]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/46832 (internal compiler error: Segmentation fault)
authorRichard Guenther <rguenther@suse.de>
Tue, 7 Dec 2010 12:36:40 +0000 (12:36 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 7 Dec 2010 12:36:40 +0000 (12:36 +0000)
2010-12-07  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/46832
* tree-ssa-math-opts.c (execute_optimize_widening_mul): Check
that the call has a lhs.

* gcc.c-torture/compile/pr46832.c: New testcase.

From-SVN: r167535

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr46832.c [new file with mode: 0644]
gcc/tree-ssa-math-opts.c

index fb4a27b3ce5b99cdb3b017bcc37cc3a6b4fc0c0d..e2dda1120ff8be29bb49e91477eb477aa94bde6e 100644 (file)
@@ -1,3 +1,9 @@
+2010-12-07  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/46832
+       * tree-ssa-math-opts.c (execute_optimize_widening_mul): Check
+       that the call has a lhs.
+
 2010-12-07  Yao Qi  <yao@codesourcery.com>
 
        * Makefile.in: Add $(TARGET_H) to the regrename.o rule.
index c77146d7f60b011929146f646b517105fc45c2e8..3ff9cd8dcf067cde227afc361958c24571ffb9a5 100644 (file)
@@ -1,3 +1,8 @@
+2010-12-07  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/46832
+       * gcc.c-torture/compile/pr46832.c: New testcase.
+
 2010-12-07  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/46799
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr46832.c b/gcc/testsuite/gcc.c-torture/compile/pr46832.c
new file mode 100644 (file)
index 0000000..f500aa5
--- /dev/null
@@ -0,0 +1,4 @@
+double pow(double x, double y);
+void foo( double x ) {
+   int j = (int) ((pow(x, 2)) < 0.0 ? (pow(x, 2))-0.5 : (pow(x, 2))+0.5);
+}
index e8f90372bc1a67c0c96c8a8bfc4c3a70261b5675..ed9b7a9d5467bdc0b69bfc1eef76f7171e4e345b 100644 (file)
@@ -1707,7 +1707,8 @@ execute_optimize_widening_mul (void)
                default:;
                }
            }
-         else if (is_gimple_call (stmt))
+         else if (is_gimple_call (stmt)
+                  && gimple_call_lhs (stmt))
            {
              tree fndecl = gimple_call_fndecl (stmt);
              if (fndecl