* expr.c (expand_expr): Don't look through constant arrays if
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Nov 2003 08:37:15 +0000 (08:37 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Nov 2003 08:37:15 +0000 (08:37 +0000)
        they don't bind locally.

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

gcc/ChangeLog
gcc/expr.c

index b089988..866cdc7 100644 (file)
@@ -1,3 +1,8 @@
+2003-11-18  Richard Henderson  <rth@redhat.com>
+
+       * expr.c (expand_expr): Don't look through constant arrays if
+       they don't bind locally.
+
 2003-11-17  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
        * expr.c (convert_move): Use GET_MODE_PRECISION instead of bitsize
index 2d4953f..320284c 100644 (file)
@@ -6955,7 +6955,8 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode,
                 && modifier != EXPAND_MEMORY
                 && TREE_READONLY (array) && ! TREE_SIDE_EFFECTS (array)
                 && TREE_CODE (array) == VAR_DECL && DECL_INITIAL (array)
-                && TREE_CODE (DECL_INITIAL (array)) != ERROR_MARK)
+                && TREE_CODE (DECL_INITIAL (array)) != ERROR_MARK
+                && targetm.binds_local_p (array))
          {
            if (TREE_CODE (index) == INTEGER_CST)
              {