From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14986 invoked by alias); 10 Jan 2013 07:42:32 -0000 Received: (qmail 13004 invoked by uid 48); 10 Jan 2013 07:41:53 -0000 From: "krebbel at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault Date: Thu, 10 Jan 2013 07:42:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Keywords: ra X-Bugzilla-Severity: normal X-Bugzilla-Who: krebbel at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: krebbel at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: Status AssignedTo Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg00908.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55719 Andreas Krebbel 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 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.