Patchwork ICE on mainline bootstrap with powerpc64 -mcmodel={medium,large}

login
register
mail settings
Submitter Alan Modra
Date April 1, 2011, 5:41 a.m.
Message ID <20110401054144.GC19002@bubble.grove.modra.org>
Download mbox | patch
Permalink /patch/89206/
State New
Headers show

Comments

Alan Modra - April 1, 2011, 5:41 a.m.
On Thu, Mar 31, 2011 at 01:35:17PM -0500, Peter Bergner wrote:
> Alan,
> 
> Mainline seems to be broken on bootstrap when GCC is configured with
> LD=/path/to/ld/that/supports/Large-TOC.  I'm attaching a preprocessed
> source file from the build and it compiles fine with -mcmodel=small,
> but ICE's when using -mcmodel={medium,large}.  Can you please have
> a look?  Thanks.

So, dwarf2out.c:gen_subprogram_die calls mem_loc_descriptor with the
lo_sum in the following

(gdb) p debug_rtx(call_arg_locations->call_arg_loc_note)
(note 38 22 37 (expr_list:REG_DEP_TRUE (concat:DI (reg:DI 3 3)
        (lo_sum:DI (plus:DI (reg:DI 2 2)
                (high:DI (unspec:DI [
                            (const_int 0 [0])
                        ] UNSPEC_TLSLD)))
            (unspec:DI [
                    (const_int 0 [0])
                ] UNSPEC_TLSLD)))
    (nil)) NOTE_INSN_CALL_ARG_LOCATION)

which is no doubt from the rs6000 tls_ld patterns.  mem_loc_descriptor
ignores the first arg of the lo_sum (fair enough), and passes the
second arg, the unspec, to const_ok_for_output.  const_ok_for_output
says it is ok, because rs6000 does not wrap the unspec in a const..

It seems to me that mem_loc_descriptor is making unwarranted
assumptions about the contents of a lo_sum.  Easily fixed.
OK to apply mainline, assuming my bootstrap and regression test
passes?

	* dwarf2out.c (mem_loc_descriptor): Recurse on LO_SUM.
Richard Henderson - April 1, 2011, 3:12 p.m.
On 03/31/2011 10:41 PM, Alan Modra wrote:
> 	* dwarf2out.c (mem_loc_descriptor): Recurse on LO_SUM.

Ok.


r~

Patch

Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c	(revision 171817)
+++ gcc/dwarf2out.c	(working copy)
@@ -13698,9 +13698,7 @@  mem_loc_descriptor (rtx rtl, enum machin
       break;
 
     case LO_SUM:
-	 rtl = XEXP (rtl, 1);
-
-      /* ... fall through ...  */
+      return mem_loc_descriptor (XEXP (rtl, 1), mode, initialized);
 
     case LABEL_REF:
       /* Some ports can transform a symbol ref into a label ref, because