OSDN Git Service

* parser.c (cp_parser_init_declarator): Pass LOOKUP_NORMAL
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-ccp.c
index 5223c27..89ef5b3 100644 (file)
@@ -205,6 +205,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "value-prof.h"
 #include "langhooks.h"
 #include "target.h"
+#include "diagnostic-core.h"
 #include "toplev.h"
 #include "dbgcnt.h"
 
@@ -1163,6 +1164,16 @@ fold_const_aggregate_ref (tree t)
       base = TREE_OPERAND (t, 0);
       switch (TREE_CODE (base))
        {
+       case MEM_REF:
+         /* ???  We could handle this case.  */
+         if (!integer_zerop (TREE_OPERAND (base, 1)))
+           return NULL_TREE;
+         base = get_base_address (base);
+         if (!base
+             || TREE_CODE (base) != VAR_DECL)
+           return NULL_TREE;
+
+         /* Fallthru.  */
        case VAR_DECL:
          if (!TREE_READONLY (base)
              || TREE_CODE (TREE_TYPE (base)) != ARRAY_TYPE