Fix PR42205.
2009-12-17 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/42205
* graphite-sese-to-poly.c (translate_scalar_reduction_to_array_for_stmt):
Insert the reduction copy in the same block as the phi node.
(follow_ssa_with_commutative_ops): Handle GIMPLE_NOPs.
* testsuite/gcc.dg/graphite/pr42205-1.c: New.
* testsuite/gcc.dg/graphite/pr42205-2.c: New.
From-SVN: r155419
+2009-12-17 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR middle-end/42205
+ * graphite-sese-to-poly.c (translate_scalar_reduction_to_array_for_stmt):
+ Insert the reduction copy in the same block as the phi node.
+ (follow_ssa_with_commutative_ops): Handle GIMPLE_NOPs.
+
+ * testsuite/gcc.dg/graphite/pr42205-1.c: New.
+ * testsuite/gcc.dg/graphite/pr42205-2.c: New.
+
+2009-12-17 Sebastian Pop <sebastian.pop@amd.com>
+
+ PR middle-end/42221
+ * sese.c (expand_scalar_variables_expr): Follow the SSA links into
+ the array indexing of ADDR_EXPRs.
+
+ * testsuite/gcc.dg/graphite/pr42221.c: New.
+
2009-12-17 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/42178
2009-12-17 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/42178
stmt = SSA_NAME_DEF_STMT (arg);
stmt = SSA_NAME_DEF_STMT (arg);
+ if (gimple_code (stmt) == GIMPLE_NOP)
+ return NULL;
+
if (gimple_code (stmt) == GIMPLE_PHI)
{
if (phi_contains_arg (stmt, lhs))
if (gimple_code (stmt) == GIMPLE_PHI)
{
if (phi_contains_arg (stmt, lhs))
translate_scalar_reduction_to_array_for_stmt (tree red, gimple stmt,
gimple loop_phi)
{
translate_scalar_reduction_to_array_for_stmt (tree red, gimple stmt,
gimple loop_phi)
{
- basic_block bb = gimple_bb (stmt);
- gimple_stmt_iterator insert_gsi = gsi_after_labels (bb);
+ gimple_stmt_iterator insert_gsi = gsi_after_labels (gimple_bb (loop_phi));
tree res = gimple_phi_result (loop_phi);
gimple assign = gimple_build_assign (res, red);
gsi_insert_before (&insert_gsi, assign, GSI_SAME_STMT);
tree res = gimple_phi_result (loop_phi);
gimple assign = gimple_build_assign (res, red);
gsi_insert_before (&insert_gsi, assign, GSI_SAME_STMT);
+ insert_gsi = gsi_after_labels (gimple_bb (stmt));
assign = gimple_build_assign (red, gimple_assign_lhs (stmt));
insert_gsi = gsi_for_stmt (stmt);
gsi_insert_after (&insert_gsi, assign, GSI_SAME_STMT);
assign = gimple_build_assign (red, gimple_assign_lhs (stmt));
insert_gsi = gsi_for_stmt (stmt);
gsi_insert_after (&insert_gsi, assign, GSI_SAME_STMT);
--- /dev/null
+/* { dg-options "-O1 -ffast-math -floop-interchange" } */
+
+int adler32(int adler, char *buf, int n)
+{
+ int sum = 0;
+ do {
+ adler += buf[0];
+ sum += adler;
+ adler += buf[1];
+ sum += adler;
+ adler += buf[2];
+ sum += adler;
+ adler += buf[3];
+ sum += adler;
+ } while (--n);
+ return adler | (sum << 16);
+}
--- /dev/null
+/* { dg-options "-O1 -funsafe-math-optimizations -floop-interchange" } */
+
+double f(double x)
+{
+ double y = 0.0;
+ int i;
+ for (i = 0; i < 8; i++) {
+ y += x * i;
+ }
+ return y;
+}