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

Message ID
State New
Headers show

Commit Message

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)))

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

	* dwarf2out.c (mem_loc_descriptor): Recurse on LO_SUM.


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




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
     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