diff options
author | Jakub Jelinek <jakub@redhat.com> | 2018-06-14 21:07:45 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-06-14 21:07:45 +0200 |
commit | 48fcd201c4490f7c2b99f3d76b7bf7070b22733e (patch) | |
tree | a31ffd58d8ac318589bb25de0447a63c417a5326 /gcc/match.pd | |
parent | bc04d1ff62db94aea033829249c8b09f4b7abff1 (diff) | |
download | gcc-48fcd201c4490f7c2b99f3d76b7bf7070b22733e.zip gcc-48fcd201c4490f7c2b99f3d76b7bf7070b22733e.tar.gz gcc-48fcd201c4490f7c2b99f3d76b7bf7070b22733e.tar.bz2 |
re PR middle-end/86122 (ICE in useless_type_conversion_p, at gimple-expr.c:87)
PR middle-end/86122
* match.pd ((A +- CST1) +- CST2): Punt if last resort
unsigned_type_for returns NULL.
* gcc.c-torture/compile/pr86122.c: New test.
From-SVN: r261606
Diffstat (limited to 'gcc/match.pd')
-rw-r--r-- | gcc/match.pd | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/match.pd b/gcc/match.pd index 14386da..f70a88c 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -1771,10 +1771,11 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (neg_inner_op @0 { wide_int_to_tree (type, wi::to_wide (cst)); }) /* Last resort, use some unsigned type. */ (with { tree utype = unsigned_type_for (type); } - (view_convert (inner_op - (view_convert:utype @0) - (view_convert:utype - { drop_tree_overflow (cst); }))))))))))))) + (if (utype) + (view_convert (inner_op + (view_convert:utype @0) + (view_convert:utype + { drop_tree_overflow (cst); })))))))))))))) /* (CST1 - A) +- CST2 -> CST3 - A */ (for outer_op (plus minus) |