From: jakub Date: Thu, 14 Jun 2018 19:07:45 +0000 (+0000) Subject: PR middle-end/86122 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ec67667945e01c89a1c02a6e91dac8da65005155;p=thirdparty%2Fgcc.git 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@261606 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 65284fb6fbcb..8e360fb0e8d4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2018-06-14 Jakub Jelinek + PR middle-end/86122 + * match.pd ((A +- CST1) +- CST2): Punt if last resort + unsigned_type_for returns NULL. + PR target/85945 * lower-subreg.c (find_decomposable_subregs): Don't decompose float subregs of multi-word pseudos unless the float mode has word size. diff --git a/gcc/match.pd b/gcc/match.pd index 14386da070b0..f70a88c362ef 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) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 92bc519e5583..9c15279f09bc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2018-06-14 Jakub Jelinek + PR middle-end/86122 + * gcc.c-torture/compile/pr86122.c: New test. + P0624R2 - Default constructible and assignable stateless lambdas * g++.dg/cpp2a/lambda1.C: New test. * g++.dg/cpp0x/lambda/lambda-ice2.C: Adjust expected diagnostics diff --git a/gcc/testsuite/gcc.c-torture/compile/pr86122.c b/gcc/testsuite/gcc.c-torture/compile/pr86122.c new file mode 100644 index 000000000000..0a4fd144ae6e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr86122.c @@ -0,0 +1,17 @@ +/* PR middle-end/86122 */ + +_Complex int +foo (_Complex int x) +{ + x += __INT_MAX__; + x += 1; + return x; +} + +_Complex int +bar (_Complex int x) +{ + x += 1; + x += __INT_MAX__; + return x; +}