On Thu, Apr 16, 2015 at 11:11:06PM +0200, Jakub Jelinek wrote:
> during expansion we get the a[D#2].t added as MEM_EXPR of a MEM, and because
> we can't mem_loc_descriptor that MEM (I'll post separately a trunk only
> patch that fixes that in this case, but generally not all MEMs can be
> represented in debug info), we try harder and try to use MEM_EXPR in

Here is the patch for it, bootstrapped/regtested on x86_64-linux and
i686-linux, ok for trunk?
We handle TLS SYMBOL_REFs in mem_loc_descriptor, but in the testcase it
is surrounded by (const (plus (symbol_ref) (const_int))).

2015-04-16  Jakub Jelinek  <ja...@redhat.com>

        PR debug/65771
        * dwarf2out.c (mem_loc_descriptor): For CONST, fallback to
        trying mem_loc_descriptor on XEXP (rtl, 0).

--- gcc/dwarf2out.c.jj  2015-02-26 16:37:09.000000000 +0100
+++ gcc/dwarf2out.c     2015-04-16 16:45:44.584429608 +0200
@@ -12799,7 +12799,12 @@ mem_loc_descriptor (rtx rtl, machine_mod
        }
 
       if (!const_ok_for_output (rtl))
-       break;
+       {
+         if (GET_CODE (rtl) == CONST)
+           mem_loc_result = mem_loc_descriptor (XEXP (rtl, 0), mode, mem_mode,
+                                                initialized);
+         break;
+       }
 
     symref:
       mem_loc_result = new_addr_loc_descr (rtl, dtprel_false);


        Jakub

Reply via email to