This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] More TYPE_OVERFLOW_* fallout (PR middle-end/64292)
- From: Marek Polacek <polacek at redhat dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Richard Biener <rguenther at suse dot de>
- Date: Mon, 15 Dec 2014 12:33:53 +0100
- Subject: [PATCH] More TYPE_OVERFLOW_* fallout (PR middle-end/64292)
- Authentication-results: sourceware.org; auth=none
m68k revealed another missing check before TYPE_OVERFLOW_WRAPS.
I think we should use INTEGRAL_TYPE_P, and not ANY_INTEGRAL_TYPE_P
because the switch handles VECTOR_CST and COMPLEX_CST.
Bootstrapped/regtested on x86_64-linux and ppc64-linux, ok for trunk?
2014-12-15 Marek Polacek <polacek@redhat.com>
PR middle-end/64292
* fold-const.c (negate_expr_p): Add INTEGRAL_TYPE_P check.
diff --git gcc/fold-const.c gcc/fold-const.c
index d71fa94..07da71a 100644
--- gcc/fold-const.c
+++ gcc/fold-const.c
@@ -400,7 +400,7 @@ negate_expr_p (tree t)
switch (TREE_CODE (t))
{
case INTEGER_CST:
- if (TYPE_OVERFLOW_WRAPS (type))
+ if (INTEGRAL_TYPE_P (type) && TYPE_OVERFLOW_WRAPS (type))
return true;
/* Check that -CST will not overflow type. */
Marek