(convert_and_check): Don't diagnose overflow in constant expression
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 11 May 1995 22:48:51 +0000 (22:48 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 11 May 1995 22:48:51 +0000 (22:48 +0000)
merely because conversion overflowed.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9626 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/c-common.c

index 4f5ce82..fc368c8 100644 (file)
@@ -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