PR tree-optimization/36008
* fold-const.c (try_move_mult_to_index): If s == NULL, divide
the original op1, rather than delta by step.
* gcc.c-torture/execute/
20080424-1.c: New test.
From-SVN: r134634
+2008-04-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/36008
+ * fold-const.c (try_move_mult_to_index): If s == NULL, divide
+ the original op1, rather than delta by step.
+
2008-04-22 Antoniu Pop <antoniu.pop@gmail.com>
Sebastian Pop <sebastian.pop@amd.com>
else
{
/* Try if delta is a multiple of step. */
- tree tmp = div_if_zero_remainder (EXACT_DIV_EXPR, delta, step);
+ tree tmp = div_if_zero_remainder (EXACT_DIV_EXPR, op1, step);
if (! tmp)
continue;
delta = tmp;
+2008-04-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/36008
+ * gcc.c-torture/execute/20080424-1.c: New test.
+
2008-04-24 Ira Rosen <irar@il.ibm.com>
Richard Guenther <rguenther@suse.de>
--- /dev/null
+/* PR tree-optimization/36008 */
+
+extern void abort (void);
+
+int g[48][3][3];
+
+void __attribute__ ((noinline))
+bar (int x[3][3], int y[3][3])
+{
+ static int i;
+ if (x != g[i + 8] || y != g[i++])
+ abort ();
+}
+
+static inline void __attribute__ ((always_inline))
+foo (int x[][3][3])
+{
+ int i;
+ for (i = 0; i < 8; i++)
+ {
+ int k = i + 8;
+ bar (x[k], x[k - 8]);
+ }
+}
+
+int
+main ()
+{
+ foo (g);
+ return 0;
+}