+2008-10-07 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree-ssa-loop-ivopts.c (may_be_nonaddressable_p) <VIEW_CONVERT_EXPR>:
+ Return true for non-addressable GIMPLE operands.
+
2008-10-07 H.J. Lu <hongjiu.lu@intel.com>
PR target/24765
+2008-10-07 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/loop_optimization4.adb: New test.
+ * gnat.dg/loop_optimization4_pkg.ad[sb]: New helper.
+
2008-10-07 Bob Wilson <bob.wilson@acm.org>
* gcc.dg/compat/struct-layout-1_generate.c (dg_options): New. Moved
--- /dev/null
+-- { dg-do run }
+-- { dg-options "-O2" }
+
+with Loop_Optimization4_Pkg; use Loop_Optimization4_Pkg;
+
+procedure Loop_Optimization4 is
+begin
+ Add ("Nothing");
+end;
--- /dev/null
+package body Loop_Optimization4_Pkg is
+
+ procedure Add (Phrase : String) is
+ begin
+ if Debug_Buffer_Len = Max_Debug_Buffer_Len then
+ return;
+ end if;
+ for I in Phrase'Range loop
+ Debug_Buffer_Len := Debug_Buffer_Len + 1;
+ Debug_Buffer (Debug_Buffer_Len) := Phrase (I);
+ if Debug_Buffer_Len = Max_Debug_Buffer_Len then
+ exit;
+ end if;
+ end loop;
+ end Add;
+
+end Loop_Optimization4_Pkg;
--- /dev/null
+package Loop_Optimization4_Pkg is
+
+ Max_Debug_Buffer_Len : Natural := 8 * 1024;
+ Debug_Buffer : String (1 .. Max_Debug_Buffer_Len);
+ Debug_Buffer_Len : Natural range 0 .. Max_Debug_Buffer_Len;
+
+ procedure Add (Phrase : String);
+
+end Loop_Optimization4_Pkg;
non-addressability may be uncovered again, causing ADDR_EXPRs
of inappropriate objects to be built. */
if (is_gimple_reg (TREE_OPERAND (expr, 0))
- || is_gimple_min_invariant (TREE_OPERAND (expr, 0)))
+ || !is_gimple_addressable (TREE_OPERAND (expr, 0)))
return true;
/* ... fall through ... */