OSDN Git Service

2011-08-26 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 26 Aug 2011 11:23:37 +0000 (11:23 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 26 Aug 2011 11:23:37 +0000 (11:23 +0000)
* expr.c (string_constant): Handle &MEM_REF.

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

gcc/ChangeLog
gcc/expr.c

index 55a5a84..c8d97d8 100644 (file)
@@ -1,3 +1,7 @@
+2011-08-26  Richard Guenther  <rguenther@suse.de>
+
+       * expr.c (string_constant): Handle &MEM_REF.
+
 2011-08-26  Andrew Stubbs  <ams@codesourcery.com>
 
        * config/arm/arm.c (struct four_ints): New type.
index a6746d1..e29f3f6 100644 (file)
@@ -10168,6 +10168,17 @@ string_constant (tree arg, tree *ptr_offset)
                                    fold_convert (sizetype, lower_bound));
            }
        }
+      else if (TREE_CODE (TREE_OPERAND (arg, 0)) == MEM_REF)
+       {
+         array = TREE_OPERAND (TREE_OPERAND (arg, 0), 0);
+         offset = TREE_OPERAND (TREE_OPERAND (arg, 0), 1);
+         if (TREE_CODE (array) != ADDR_EXPR)
+           return 0;
+         array = TREE_OPERAND (array, 0);
+         if (TREE_CODE (array) != STRING_CST
+             && TREE_CODE (array) != VAR_DECL)
+           return 0;
+       }
       else
        return 0;
     }