This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault
- From: "krebbel at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 10 Jan 2013 07:41:46 +0000
- Subject: [Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault
- Auto-submitted: auto-generated
- References: <bug-55719-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55719
Andreas Krebbel <krebbel at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |krebbel at gcc dot gnu.org
|gnu.org |
--- Comment #6 from Andreas Krebbel <krebbel at gcc dot gnu.org> 2013-01-10 07:41:46 UTC ---
(In reply to comment #5)
> I'm out of my depth here, but perhaps someone can give me a hint on how to
> debug this further.
>
> As alluded to earlier, this ICE only happens with sched-pressure scheduling.
>
> The actual ICE happens in find_reloads_address_part(), where we have are
> analyzing X=:
>
> (const:DI (plus:DI (symbol_ref:DI ("glob_b"))
> (const_int 3 [0x3])))
>
> prefer_reload_class() returns NO_REGS, because legitimate_reload_constant_p()
> returns false for the X above. So when we call force_const_mem() in
> find_reloads_address_part...
>
> if (CONSTANT_P (x)
> && (!targetm.legitimate_constant_p (mode, x)
> || targetm.preferred_reload_class (x, rclass) == NO_REGS))
> {
> x = force_const_mem (mode, x); <-- HERE
>
> force_const_mem() returns NULL because s390_cannot_force_const_mem() returns
> true for the SYMBOL_REF in -fPIC mode.
>
> Bottom line-- force_const_mem() returns NULL for a (const (plus SYMBOL_REF
> CONST)) with -fPIC, and then we dereference this NULL.
>
> Is the RTL correct?
>
> Any hints?
I'm already testing a patch. We have an instruction (larl) which is able to
handle pc-relative symbol references. But it only allows even addends. symref +
odd addend is handled via secondary reload. I think it is invalid that
preferred reload class returns NO_REGS here.