re PR rtl-optimization/50191 (Strange debug insn produced for TOC compiling 416.games...
authorJakub Jelinek <jakub@redhat.com>
Wed, 7 Sep 2011 07:32:46 +0000 (09:32 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 7 Sep 2011 07:32:46 +0000 (09:32 +0200)
PR debug/50191
* dwarf2out.c (mem_loc_descriptor) <case MEM>: Try
avoid_constant_pool_reference first instead of last.

From-SVN: r178625

gcc/ChangeLog
gcc/dwarf2out.c

index 3abfc4f..5812c4b 100644 (file)
@@ -1,3 +1,9 @@
+2011-09-07  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/50191
+       * dwarf2out.c (mem_loc_descriptor) <case MEM>: Try
+       avoid_constant_pool_reference first instead of last.
+
 2011-09-06  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
        * doc/configfiles.texi (Configuration Files): Update documentation
index a38bcf8..c11f666 100644 (file)
@@ -11695,12 +11695,22 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
       break;
 
     case MEM:
+      {
+       rtx new_rtl = avoid_constant_pool_reference (rtl);
+       if (new_rtl != rtl)
+         {
+           mem_loc_result = mem_loc_descriptor (new_rtl, mode, mem_mode,
+                                                initialized);
+           if (mem_loc_result != NULL)
+             return mem_loc_result;
+         }
+      }
       mem_loc_result = mem_loc_descriptor (XEXP (rtl, 0),
                                           get_address_mode (rtl), mode,
                                           VAR_INIT_STATUS_INITIALIZED);
       if (mem_loc_result == NULL)
        mem_loc_result = tls_mem_loc_descriptor (rtl);
-      if (mem_loc_result != 0)
+      if (mem_loc_result != NULL)
        {
          if (GET_MODE_SIZE (mode) > DWARF2_ADDR_SIZE
              || GET_MODE_CLASS (mode) != MODE_INT)
@@ -11728,12 +11738,6 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
                           new_loc_descr (DW_OP_deref_size,
                                          GET_MODE_SIZE (mode), 0));
        }
-      else
-       {
-         rtx new_rtl = avoid_constant_pool_reference (rtl);
-         if (new_rtl != rtl)
-           return mem_loc_descriptor (new_rtl, mode, mem_mode, initialized);
-       }
       break;
 
     case LO_SUM: