* tree-data-ref.c (split_constant_offset) <case SSA_NAME>: Don't
recurse for pure or const function calls.
* gcc.dg/pr33017.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128107
138bc75d-0d04-0410-961f-
82ee72b054a4
* config/rs6000/tramp.asm: Include config.h.
Check __PIC__ or __pic__ macro instead of SHARED.
+ PR tree-optimization/33017
+ * tree-data-ref.c (split_constant_offset) <case SSA_NAME>: Don't
+ recurse for pure or const function calls.
+
2007-09-04 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* c-format.c: Include alloc-pool.h.
+2007-09-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/33017
+ * gcc.dg/pr33017.c: New test.
+
2007-09-05 Ben Elliston <bje@au.ibm.com>
* gcc.target/powerpc/ppu-intrinsics.c: Add test cases for the
--- /dev/null
+/* PR tree-optimization/33017 */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-vectorize" } */
+
+extern __SIZE_TYPE__ strlen (const char *);
+extern void abort (void);
+
+char *
+__attribute__((noinline))
+foo (const char *string)
+{
+ int len;
+ static char var[0x104];
+ int off;
+ len = strlen (string);
+ for (off = 0; off < 64; off++)
+ var[len + off + 2] = 0x57;
+ return var;
+}
+
+int
+main (void)
+{
+ char *p = foo ("abcd");
+ int i;
+ for (i = 0; i < 0x104; i++)
+ if (p[i] != ((i >= 6 && i < 70) ? 0x57 : 0))
+ abort ();
+ return 0;
+}
if (!TREE_SIDE_EFFECTS (def_stmt_rhs)
&& EXPR_P (def_stmt_rhs)
- && !REFERENCE_CLASS_P (def_stmt_rhs))
+ && !REFERENCE_CLASS_P (def_stmt_rhs)
+ && !get_call_expr_in (def_stmt_rhs))
{
split_constant_offset (def_stmt_rhs, &var0, &off0);
var0 = fold_convert (type, var0);