From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21715 invoked by alias); 9 Dec 2014 21:27:43 -0000 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 Received: (qmail 21650 invoked by uid 48); 9 Dec 2014 21:27:37 -0000 From: "sandra at codesourcery dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/64231] [5 Regression] SIGSEGV building glibc on aarch64-linux-gnu from r217852 Date: Tue, 09 Dec 2014 21:27:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sandra at codesourcery dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-12/txt/msg00975.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64231 --- Comment #7 from Sandra Loosemore --- Hmmmm. I'm not sure why there's trouble in reproducing the failure, but looking at this some more, it seems like we have a problem with this code fragment from force_const_mem in varasm.c: /* If we're not allowed to drop X into the constant pool, don't. */ if (targetm.cannot_force_const_mem (mode, x)) return NULL_RTX; and the code at the call site in plus_constant in explow.c: tem = force_const_mem (GET_MODE (x), tem); if (memory_address_p (GET_MODE (tem), XEXP (tem, 0))) return tem; which is clearly not expecting force_const_mem to return null. Guarding the reference in the conditional like if (tem && memory_address_p (GET_MODE (tem), XEXP (tem, 0))) ... fixes the SEGV, but a quick look shows that there are a lot of other uses of force_const_mem that expect it to return a non-null value, with no checking. So, probably this has nothing to do with the specific change in r217852, but has been a lurking bug for a long time, and it needs more than a band-aid on this one particular call site.