summaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-05-11 18:48:51 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-05-11 18:48:51 -0400
commit868fc7506b9b9824de70612823e7dff108001506 (patch)
tree50c4e512889fcd9f78b89d82f77dee8f86a04422 /gcc/c-common.c
parent5be1df77c9a811517d0d7af71467c6fba1267909 (diff)
downloadgcc-868fc7506b9b9824de70612823e7dff108001506.tar.gz
(convert_and_check): Don't diagnose overflow in constant expression
merely because conversion overflowed. From-SVN: r9626
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 4f5ce82410c..fc368c8a53d 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -1369,6 +1369,10 @@ convert_and_check (type, expr)
{
TREE_OVERFLOW (t) = 0;
+ /* Do not diagnose overflow in a constant expression merely
+ because a conversion overflowed. */
+ TREE_CONSTANT_OVERFLOW (t) = TREE_CONSTANT_OVERFLOW (expr);
+
/* No warning for converting 0x80000000 to int. */
if (!(TREE_UNSIGNED (type) < TREE_UNSIGNED (TREE_TYPE (expr))
&& TREE_CODE (TREE_TYPE (expr)) == INTEGER_TYPE