* cfgexpand.c (expand_debug_expr) <TARGET_MEM_REF>:
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Oct 2014 12:33:43 +0000 (12:33 +0000)
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 8 Oct 2014 12:33:43 +0000 (12:33 +0000)
        Get address space from operand 0 (BASE).

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

gcc/ChangeLog
gcc/cfgexpand.c

index e198b2b..f577bf0 100644 (file)
@@ -1,3 +1,9 @@
+2014-10-08  Joern Rennecke  <joern.rennecke@embecosm.com>
+           Richard Biener  <rguenther@suse.de>
+
+       * cfgexpand.c (expand_debug_expr) <TARGET_MEM_REF>:
+       Get address space from operand 0 (BASE).
+
 2014-10-07  Iain Sandoe  <iain@codesourcery.com>
 
        PR target/61387
index f95981b..5cb96df 100644 (file)
@@ -3983,11 +3983,7 @@ expand_debug_expr (tree exp)
       if (!op0)
        return NULL;
 
-      if (POINTER_TYPE_P (TREE_TYPE (exp)))
-       as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp)));
-      else
-       as = ADDR_SPACE_GENERIC;
-
+      as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (exp, 0))));
       op0 = convert_debug_memory_address (targetm.addr_space.address_mode (as),
                                          op0, as);
       if (op0 == NULL_RTX)