Commit 461d6eb3 by Eric Botcazou Committed by Eric Botcazou

trans.c (gnat_to_gnu): Use POINTER_PLUS_EXPR in pointer arithmetics.

	* trans.c (gnat_to_gnu) <N_Free_Statement>: Use POINTER_PLUS_EXPR
	in pointer arithmetics.
	* utils2.c (build_allocator): Likewise.

From-SVN: r131692
parent 6cc199f4
2008-01-21 Eric Botcazou <ebotcazou@adacore.com>
* trans.c (gnat_to_gnu) <N_Free_Statement>: Use POINTER_PLUS_EXPR
in pointer arithmetics.
* utils2.c (build_allocator): Likewise.
2008-01-17 Eric Botcazou <ebotcazou@adacore.com> 2008-01-17 Eric Botcazou <ebotcazou@adacore.com>
* utils.c (build_function_stub): Properly build the call expression. * utils.c (build_function_stub): Properly build the call expression.
...@@ -4672,10 +4672,9 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -4672,10 +4672,9 @@ gnat_to_gnu (Node_Id gnat_node)
= (void *)GNU_PTR - (void *)sizeof (void *)) */ = (void *)GNU_PTR - (void *)sizeof (void *)) */
gnu_ptr gnu_ptr
= build_binary_op = build_binary_op
(MINUS_EXPR, ptr_void_type_node, (POINTER_PLUS_EXPR, ptr_void_type_node,
convert (ptr_void_type_node, gnu_ptr), convert (ptr_void_type_node, gnu_ptr),
convert (ptr_void_type_node, size_int (-POINTER_SIZE/BITS_PER_UNIT));
TYPE_SIZE_UNIT (ptr_void_type_node)));
/* GNU_PTR (void *) = *(void **)GNU_PTR */ /* GNU_PTR (void *) = *(void **)GNU_PTR */
gnu_ptr gnu_ptr
......
...@@ -2066,10 +2066,9 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc, ...@@ -2066,10 +2066,9 @@ build_allocator (tree type, tree init, tree result_type, Entity_Id gnat_proc,
front. */ front. */
{ {
tree ptr_addr tree ptr_addr
= build_binary_op (MINUS_EXPR, ptr_void_type_node, = build_binary_op (POINTER_PLUS_EXPR, ptr_void_type_node,
convert (ptr_void_type_node, result), convert (ptr_void_type_node, result),
convert (ptr_void_type_node, size_int (-POINTER_SIZE/BITS_PER_UNIT));
TYPE_SIZE_UNIT (ptr_void_type_node)));
tree ptr_ref tree ptr_ref
= convert (build_pointer_type (ptr_void_type_node), ptr_addr); = convert (build_pointer_type (ptr_void_type_node), ptr_addr);
......
2008-01-21 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/specs/alignment1.ads: New test.
2008-01-21 Richard Guenther <rguenther@suse.de> 2008-01-21 Richard Guenther <rguenther@suse.de>
PR c++/34850 PR c++/34850
-- { dg-do compile }
package Alignment1 is
S : Natural := 20;
pragma Volatile (S);
type Block is array (1 .. S) of Integer;
for Block'Alignment use 128;
B : Block;
end;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment