From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5169 invoked by alias); 9 Jan 2013 18:46:08 -0000 Received: (qmail 4075 invoked by uid 48); 9 Jan 2013 18:45:41 -0000 From: "aldyh at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/55719] [4.8 Regression] ICE: Segmentation fault Date: Wed, 09 Jan 2013 18:46: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: aldyh at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: CC 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/msg00865.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55719 Aldy Hernandez changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rsandifo at gcc dot gnu.org --- Comment #5 from Aldy Hernandez 2013-01-09 18:45:34 UTC --- 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?