diff options
author | Marek Polacek <polacek@redhat.com> | 2016-03-03 11:42:19 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2016-03-03 11:42:19 +0000 |
commit | a2a743a13a0a32b6ac147762707d95aacd1f605a (patch) | |
tree | 8f8e2b63a9c28ac7c078a4effbd15ae7abc5604d /gcc/match.pd | |
parent | fd2298e3e1bede85e165d8c8a7b7282e9f402ff0 (diff) | |
download | gcc-a2a743a13a0a32b6ac147762707d95aacd1f605a.zip gcc-a2a743a13a0a32b6ac147762707d95aacd1f605a.tar.gz gcc-a2a743a13a0a32b6ac147762707d95aacd1f605a.tar.bz2 |
re PR middle-end/70050 (ICE: tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type, have vector_type in generic_simplify_162, at generic-match.c:6175)
PR middle-end/70050
* match.pd (X % -Y): Add INTEGRAL_TYPE_P check.
* gcc.dg/pr70050.c: New test.
From-SVN: r233937
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 5903782..112deb3 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -293,7 +293,8 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) /* X % -Y is the same as X % Y. */ (simplify (trunc_mod @0 (convert? (negate @1))) - (if (!TYPE_UNSIGNED (type) + (if (INTEGRAL_TYPE_P (type) + && !TYPE_UNSIGNED (type) && !TYPE_OVERFLOW_TRAPS (type) && tree_nop_conversion_p (type, TREE_TYPE (@1)) /* Avoid this transformation if X might be INT_MIN or |