aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2013-09-30 22:17:07 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2013-09-30 22:17:07 +0200
commitd2a365a843021a55899050ed48e914998a7d2205 (patch)
tree628a4d491509664a0bae3f7f5b778c1f71eab28c
parentf66d089128669ca6f4bbd8f661fb064012bdd595 (diff)
downloadgcc-d2a365a843021a55899050ed48e914998a7d2205.zip
gcc-d2a365a843021a55899050ed48e914998a7d2205.tar.gz
gcc-d2a365a843021a55899050ed48e914998a7d2205.tar.bz2
re PR middle-end/58564 (possible wrong code bug at -O0)
PR middle-end/58564 * fold-const.c (tree_unary_nonnegative_warnv_p): Use INTEGRAL_TYPE_P (t) instead of TREE_CODE (t) == INTEGER_TYPE. From-SVN: r203044
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/fold-const.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 29c8d6b..d125ced 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,6 +1,10 @@
2013-09-30 Jakub Jelinek <jakub@redhat.com>
PR middle-end/58564
+ * fold-const.c (tree_unary_nonnegative_warnv_p): Use
+ INTEGRAL_TYPE_P (t) instead of TREE_CODE (t) == INTEGER_TYPE.
+
+ PR middle-end/58564
* fold-const.c (fold_ternary_loc): For A < 0 : <sign bit of A> : 0
optimization, punt if sign_bit_p looked through any zero extension.
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index f68fd8b..fc29291 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -15448,7 +15448,7 @@ tree_unary_nonnegative_warnv_p (enum tree_code code, tree type, tree op0,
if (TREE_CODE (inner_type) == REAL_TYPE)
return tree_expr_nonnegative_warnv_p (op0,
strict_overflow_p);
- if (TREE_CODE (inner_type) == INTEGER_TYPE)
+ if (INTEGRAL_TYPE_P (inner_type))
{
if (TYPE_UNSIGNED (inner_type))
return true;
@@ -15456,12 +15456,12 @@ tree_unary_nonnegative_warnv_p (enum tree_code code, tree type, tree op0,
strict_overflow_p);
}
}
- else if (TREE_CODE (outer_type) == INTEGER_TYPE)
+ else if (INTEGRAL_TYPE_P (outer_type))
{
if (TREE_CODE (inner_type) == REAL_TYPE)
return tree_expr_nonnegative_warnv_p (op0,
strict_overflow_p);
- if (TREE_CODE (inner_type) == INTEGER_TYPE)
+ if (INTEGRAL_TYPE_P (inner_type))
return TYPE_PRECISION (inner_type) < TYPE_PRECISION (outer_type)
&& TYPE_UNSIGNED (inner_type);
}