(constant_expression_warning): Check INTEGER_CST for TREE_CONSTANT_OVERFLOW.
authorRichard Stallman <rms@gnu.org>
Sat, 5 Sep 1992 02:01:30 +0000 (02:01 +0000)
committerRichard Stallman <rms@gnu.org>
Sat, 5 Sep 1992 02:01:30 +0000 (02:01 +0000)
From-SVN: r2052

gcc/c-typeck.c

index 6f71cb6996c090d77b3dbef4c308c993952d6d98..6a0247aa0c5a8a59d1628d1a834c867092f813c0 100644 (file)
@@ -786,14 +786,13 @@ c_alignof (type)
   return size_int (TYPE_ALIGN (type) / BITS_PER_UNIT);
 }
 
-/* Print a warning if a constant expression had overflow in folding.
-   This doesn't really work--it is waiting for changes in fold.  */
+/* Print a warning if a constant expression had overflow in folding.  */
 
 void
 constant_expression_warning (value)
      tree value;
 {
-  if (TREE_CODE (value) == NON_LVALUE_EXPR && TREE_CONSTANT_OVERFLOW (value))
+  if (TREE_CODE (value) == INTEGER_CST && TREE_CONSTANT_OVERFLOW (value))
     pedwarn ("overflow in constant expression");
 }
 \f
@@ -801,6 +800,7 @@ constant_expression_warning (value)
    alignment of EXPR, measured in bytes.  For VAR_DECL's and
    FIELD_DECL's return DECL_ALIGN (which can be set from an
    "aligned" __attribute__ specification).  */
+
 tree
 c_alignof_expr (expr)
      tree expr;