diff options
author | Bin Cheng <bin.cheng@arm.com> | 2016-12-07 10:14:58 +0000 |
---|---|---|
committer | Bin Cheng <amker@gcc.gnu.org> | 2016-12-07 10:14:58 +0000 |
commit | ebf417348808be4608fd44ba3b2863b735b4324e (patch) | |
tree | 9cea72e97f3641dd7b37c8e0b7ddbb4091e51a32 /gcc/match.pd | |
parent | 81a58ffbb7d6dd26bf13a09d293e6082aceda520 (diff) | |
download | gcc-ebf417348808be4608fd44ba3b2863b735b4324e.zip gcc-ebf417348808be4608fd44ba3b2863b735b4324e.tar.gz gcc-ebf417348808be4608fd44ba3b2863b735b4324e.tar.bz2 |
re PR middle-end/78691 (ICE compiling Linux boot code)
PR tree-optimization/78691
* match.pd ((convert1 (minmax ((convert2 (x) c)))) -> minmax (x c)):
Require integral type for the outer expression.
gcc/testsuite
PR tree-optimization/78691
* gcc.target/i386/pr78691-i386.c: New test.
* gcc.target/powerpc/pr78691-ppc.c: New test.
From-SVN: r243335
Diffstat (limited to 'gcc/match.pd')
-rw-r--r-- | gcc/match.pd | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/match.pd b/gcc/match.pd index 1fe003b..feaa4a1 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -1378,7 +1378,8 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (for minmax (min max) (simplify (convert (minmax@0 (convert @1) INTEGER_CST@2)) - (if (types_match (@1, type) && int_fits_type_p (@2, type) + (if (INTEGRAL_TYPE_P (type) + && types_match (@1, type) && int_fits_type_p (@2, type) && TYPE_SIGN (TREE_TYPE (@0)) == TYPE_SIGN (type) && TYPE_PRECISION (TREE_TYPE (@0)) > TYPE_PRECISION (type)) (minmax @1 (convert @2))))) |