aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-10-10 19:47:05 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2012-10-10 19:47:05 +0200
commit2de45fb6ee035764a6c48bc87086be9fcab7aa53 (patch)
treef8c3854d4255a3e4f2ae118871fd24b14ce502ff
parentb2a8369b55c8e87d148836eb832fc047ffa6dcba (diff)
downloadgcc-2de45fb6ee035764a6c48bc87086be9fcab7aa53.zip
gcc-2de45fb6ee035764a6c48bc87086be9fcab7aa53.tar.gz
gcc-2de45fb6ee035764a6c48bc87086be9fcab7aa53.tar.bz2
re PR tree-optimization/54877 (ICE: tree check: expected ssa_name, have real_cst in copy_ssa_name_fn, at tree-ssanames.c:335)
PR tree-optimization/54877 * tree-vect-loop.c (vect_is_simple_reduction_1): For MINUS_EXPR use make_ssa_name instead of copy_ssa_name. * gcc.dg/torture/pr54877.c: New test. From-SVN: r192322
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr54877.c23
-rw-r--r--gcc/tree-vect-loop.c2
4 files changed, 35 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index dfe39b4..b2a05a9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2012-10-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/54877
+ * tree-vect-loop.c (vect_is_simple_reduction_1): For MINUS_EXPR
+ use make_ssa_name instead of copy_ssa_name.
+
2012-10-10 Richard Biener <rguenther@suse.de>
* lto-streamer-in.c (lto_input_location_bitpack): Rename to ...
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c2e2f5b..009aab8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2012-10-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/54877
+ * gcc.dg/torture/pr54877.c: New test.
+
2012-10-10 Venkataramanan Kumar <venkataramanan.kumar@amd.com>
PR testsuite/53397
diff --git a/gcc/testsuite/gcc.dg/torture/pr54877.c b/gcc/testsuite/gcc.dg/torture/pr54877.c
new file mode 100644
index 0000000..cee406e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr54877.c
@@ -0,0 +1,23 @@
+/* PR tree-optimization/54877 */
+/* { dg-do run } */
+/* { dg-options "-ffast-math" } */
+
+extern void abort (void);
+
+int
+foo (void)
+{
+ double d;
+ int i;
+ for (i = 0, d = 0; i < 64; i++)
+ d--;
+ return (int) d;
+}
+
+int
+main ()
+{
+ if (foo () != -64)
+ abort ();
+ return 0;
+}
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index 58edfcb..6b8ba3f 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -2382,7 +2382,7 @@ vect_is_simple_reduction_1 (loop_vec_info loop_info, gimple phi,
if (orig_code == MINUS_EXPR)
{
tree rhs = gimple_assign_rhs2 (def_stmt);
- tree negrhs = copy_ssa_name (rhs, NULL);
+ tree negrhs = make_ssa_name (TREE_TYPE (rhs), NULL);
gimple negate_stmt = gimple_build_assign_with_ops (NEGATE_EXPR, negrhs,
rhs, NULL);
gimple_stmt_iterator gsi = gsi_for_stmt (def_stmt);