diff options
author | Richard Guenther <rguenther@suse.de> | 2010-12-07 12:36:40 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-12-07 12:36:40 +0000 |
commit | 85a47bed9340d25f861b9e2a186a4d443660cc26 (patch) | |
tree | 9e45039f7fcbc38277ff97fbcc1203f1e66e05c7 /gcc | |
parent | 5f286f4a1aeb494e84f4134dce04e451b9580d19 (diff) | |
download | gcc-85a47bed9340d25f861b9e2a186a4d443660cc26.zip gcc-85a47bed9340d25f861b9e2a186a4d443660cc26.tar.gz gcc-85a47bed9340d25f861b9e2a186a4d443660cc26.tar.bz2 |
re PR tree-optimization/46832 (internal compiler error: Segmentation fault)
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr46832.c | 4 | ||||
-rw-r--r-- | gcc/tree-ssa-math-opts.c | 3 |
4 files changed, 17 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fb4a27b..e2dda11 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c77146d..3ff9cd8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..f500aa5 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr46832.c @@ -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); +} diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c index e8f9037..ed9b7a9 100644 --- a/gcc/tree-ssa-math-opts.c +++ b/gcc/tree-ssa-math-opts.c @@ -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 |