* cfgexpand.c (expand_debug_expr) <INDIRECT_REF>: Remove overzealous
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Dec 2009 18:27:58 +0000 (18:27 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Dec 2009 18:27:58 +0000 (18:27 +0000)
assertion and useless code.
<TARGET_MEM_REF>: Likewise.

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

gcc/ChangeLog
gcc/cfgexpand.c

index 6b36de4..779dfe8 100644 (file)
@@ -1,3 +1,9 @@
+2009-12-14  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * cfgexpand.c (expand_debug_expr) <INDIRECT_REF>: Remove overzealous
+       assertion and useless code.
+       <TARGET_MEM_REF>: Likewise.
+
 2009-12-14  Alexandre Oliva  <aoliva@redhat.com>
 
        PR debug/41473
index 4245d0f..08b211e 100644 (file)
@@ -2186,7 +2186,6 @@ expand_debug_expr (tree exp)
   int unsignedp = TYPE_UNSIGNED (TREE_TYPE (exp));
   addr_space_t as;
   enum machine_mode address_mode;
-  enum machine_mode pointer_mode;
 
   switch (TREE_CODE_CLASS (TREE_CODE (exp)))
     {
@@ -2382,17 +2381,15 @@ expand_debug_expr (tree exp)
        return NULL;
 
       if (POINTER_TYPE_P (TREE_TYPE (exp)))
-       as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp)));
+       {
+         as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp)));
+         address_mode = targetm.addr_space.address_mode (as);
+       }
       else
-       as = ADDR_SPACE_GENERIC;
-
-      address_mode = targetm.addr_space.address_mode (as);
-      pointer_mode = targetm.addr_space.pointer_mode (as);
-
-      gcc_assert (GET_MODE (op0) == address_mode
-                 || GET_MODE (op0) == pointer_mode
-                 || GET_CODE (op0) == CONST_INT
-                 || GET_CODE (op0) == CONST_DOUBLE);
+       {
+         as = ADDR_SPACE_GENERIC;
+         address_mode = Pmode;
+       }
 
       if (TREE_CODE (exp) == ALIGN_INDIRECT_REF)
        {
@@ -2412,19 +2409,11 @@ expand_debug_expr (tree exp)
        return NULL;
 
       op0 = expand_debug_expr
-       (tree_mem_ref_addr (build_pointer_type (TREE_TYPE (exp)),
-                           exp));
+           (tree_mem_ref_addr (build_pointer_type (TREE_TYPE (exp)), exp));
       if (!op0)
        return NULL;
 
       as = TYPE_ADDR_SPACE (TREE_TYPE (exp));
-      address_mode = targetm.addr_space.address_mode (as);
-      pointer_mode = targetm.addr_space.pointer_mode (as);
-
-      gcc_assert (GET_MODE (op0) == address_mode
-                 || GET_MODE (op0) == pointer_mode
-                 || GET_CODE (op0) == CONST_INT
-                 || GET_CODE (op0) == CONST_DOUBLE);
 
       op0 = gen_rtx_MEM (mode, op0);