]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/38615 (invalid promotion to static from auto)
authorSteve Ellcey <sje@cup.hp.com>
Thu, 22 Jan 2009 17:02:21 +0000 (17:02 +0000)
committerSteve Ellcey <sje@gcc.gnu.org>
Thu, 22 Jan 2009 17:02:21 +0000 (17:02 +0000)
PR middle-end/38615
* gimplify.c (gimplify_init_constructor): Fix promotion of const
variables to static.
* doc/invoke.texi (-fmerge-all-constants): Update description.

From-SVN: r143570

gcc/ChangeLog
gcc/gimplify.c

index 8b921a2142405d9f4f1233a0d2a55a8246559a3f..df876e9bb0d3a18d3f08dabacf9d54ebee82ff45 100644 (file)
@@ -1,3 +1,10 @@
+2009-01-22  Steve Ellcey  <sje@cup.hp.com>
+
+       PR middle-end/38615
+       * gimplify.c (gimplify_init_constructor): Fix promotion of const
+       variables to static.
+       * doc/invoke.texi (-fmerge-all-constants): Update description.
+
 2009-01-22  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/38931
index 5aef12875aa7731dbf49a480535dc78bdf031eef..be0c1ac00e5574c9448c4c473c6002dcf830f8a8 100644 (file)
@@ -3526,7 +3526,8 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
        if (valid_const_initializer
            && num_nonzero_elements > 1
            && TREE_READONLY (object)
-           && TREE_CODE (object) == VAR_DECL)
+           && TREE_CODE (object) == VAR_DECL
+           && (flag_merge_constants >= 2 || !TREE_ADDRESSABLE (object)))
          {
            if (notify_temp_creation)
              return GS_ERROR;