re PR c/5675 (const variables wrongly considered part of constant expressions (gcc...
authorIan Lance Taylor <ian@airs.com>
Mon, 17 Jan 2005 18:54:18 +0000 (18:54 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Mon, 17 Jan 2005 18:54:18 +0000 (18:54 +0000)
PR c/5675
* c-typeck.c (build_c_cast): Revert patch of 2003-02-16: don't
fold constant variables into initial values.

From-SVN: r93769

gcc/ChangeLog
gcc/c-typeck.c

index fa24164f01934ca4b80e3b3c3628a11742a9a026..40a06bb61f303be81073d00ab82a49be9c2a983b 100644 (file)
@@ -1,3 +1,9 @@
+2005-01-17  Ian Lance Taylor  <ian@airs.com>
+
+       PR c/5675
+       * c-typeck.c (build_c_cast): Revert patch of 2003-02-16: don't
+       fold constant variables into initial values.
+
 2005-01-17  Kazu Hirata  <kazu@cs.umass.edu>
 
        * tree-cfg.c (tree_can_merge_blocks_p): Reorder two checks.
index e173c6a2d2388b34cc6cfb21db86b26d934f5226..0d7c019cdbb1fedb562a50f0c065a351c65acf55 100644 (file)
@@ -3202,9 +3202,6 @@ build_c_cast (tree type, tree expr)
        pedwarn ("ISO C forbids conversion of object pointer to function pointer type");
 
       ovalue = value;
-      /* Replace a nonvolatile const static variable with its value.  */
-      if (optimize && TREE_CODE (value) == VAR_DECL)
-       value = decl_constant_value (value);
       value = convert (type, value);
 
       /* Ignore any integer overflow caused by the cast.  */