diff options
author | Richard Biener <rguenther@suse.de> | 2015-08-05 07:42:54 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2015-08-05 07:42:54 +0000 |
commit | f980c9a2622743e44456727a13c612b1c520c7f4 (patch) | |
tree | d4c1f0de61807eb15b8c2176060fb95184232cce /gcc | |
parent | 1e928e07b22dd721d06501fb85a31360b55d3b8b (diff) | |
download | gcc-f980c9a2622743e44456727a13c612b1c520c7f4.zip gcc-f980c9a2622743e44456727a13c612b1c520c7f4.tar.gz gcc-f980c9a2622743e44456727a13c612b1c520c7f4.tar.bz2 |
re PR c/67107 (ICE: SIGSEGV in tree_class_check with -frounding-math -funsafe-math-optimizations)
2015-08-05 Richard Biener <rguenther@suse.de>
PR middle-end/67107
* match.pd: Guard const_binop result checking against NULL_TREE
result.
* gcc.dg/pr67107.c: New testcase.
From-SVN: r226609
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/match.pd | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr67107.c | 7 |
4 files changed, 20 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9c8e176..09a89ee 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-08-05 Richard Biener <rguenther@suse.de> + + PR middle-end/67107 + * match.pd: Guard const_binop result checking against NULL_TREE + result. + 2015-08-05 Kugan Vivekanandarajah <kuganv@linaro.org> * cse.c (cse_insn): Restoring old behaviour for src_eqv diff --git a/gcc/match.pd b/gcc/match.pd index 3e9100e..2a4f7d6 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -1599,7 +1599,7 @@ along with GCC; see the file COPYING3. If not see tree tem = const_binop (op == PLUS_EXPR ? MINUS_EXPR : PLUS_EXPR, TREE_TYPE (@1), @2, @1); } - (if (!TREE_OVERFLOW (tem)) + (if (tem && !TREE_OVERFLOW (tem)) (cmp @0 { tem; })))))) /* Likewise, we can simplify a comparison of a real constant with @@ -1610,7 +1610,7 @@ along with GCC; see the file COPYING3. If not see (simplify (cmp (minus REAL_CST@0 @1) REAL_CST@2) (with { tree tem = const_binop (MINUS_EXPR, TREE_TYPE (@1), @0, @2); } - (if (!TREE_OVERFLOW (tem)) + (if (tem && !TREE_OVERFLOW (tem)) (cmp { tem; } @1))))) /* Fold comparisons against built-in math functions. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8471c04..1a5d6f9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-08-05 Richard Biener <rguenther@suse.de> + + PR middle-end/67107 + * gcc.dg/pr67107.c: New testcase. + 2015-08-04 Paolo Carlini <paolo.carlini@oracle.com> PR c++/66197 diff --git a/gcc/testsuite/gcc.dg/pr67107.c b/gcc/testsuite/gcc.dg/pr67107.c new file mode 100644 index 0000000..e2e11c0 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr67107.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-options "-frounding-math -funsafe-math-optimizations" } */ + +int test () +{ + return 5.0 < 5.0 - 0.1; +} |