OSDN Git Service

2010-07-09 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Jul 2010 18:32:29 +0000 (18:32 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Jul 2010 18:32:29 +0000 (18:32 +0000)
PR middle-end/44890
* tree-ssa-address.c (create_mem_ref_raw): Only build a MEM_REF
if base is a pointer.
* tree-cfg.c (verify_expr): Update MEM_REF checking.

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

gcc/ChangeLog
gcc/tree-cfg.c
gcc/tree-ssa-address.c

index e7c944f..b3c9f38 100644 (file)
@@ -1,3 +1,10 @@
+2010-07-09  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/44890
+       * tree-ssa-address.c (create_mem_ref_raw): Only build a MEM_REF
+       if base is a pointer.
+       * tree-cfg.c (verify_expr): Update MEM_REF checking.
+
 2010-07-08  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
        PR target/44877
index c700793..9e38ca7 100644 (file)
@@ -2610,7 +2610,8 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
 
     case MEM_REF:
       x = TREE_OPERAND (t, 0);
-      if (!is_gimple_mem_ref_addr (x))
+      if (!POINTER_TYPE_P (TREE_TYPE (x))
+         || !is_gimple_mem_ref_addr (x))
        {
          error ("Invalid first operand of MEM_REF.");
          return x;
index cf7a81d..f49bf14 100644 (file)
@@ -352,7 +352,8 @@ create_mem_ref_raw (tree type, tree alias_ptr_type, struct mem_address *addr)
   /* If possible use a plain MEM_REF instead of a TARGET_MEM_REF.  */
   if (alias_ptr_type
       && !addr->index
-      && !addr->step)
+      && !addr->step
+      && (!addr->base || POINTER_TYPE_P (TREE_TYPE (addr->base))))
     {
       tree base, offset;
       gcc_assert (!addr->symbol ^ !addr->base);