From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30293 invoked by alias); 27 Oct 2011 06:41:13 -0000 Received: (qmail 30227 invoked by uid 22791); 27 Oct 2011 06:41:12 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,TO_NO_BRKTS_PCNT X-Spam-Check-By: sourceware.org Received: from shards.monkeyblade.net (HELO shards.monkeyblade.net) (198.137.202.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 27 Oct 2011 06:40:56 +0000 Received: from localhost (cpe-66-65-61-233.nyc.res.rr.com [66.65.61.233]) (authenticated bits=0) by shards.monkeyblade.net (8.14.4/8.14.4) with ESMTP id p9R6eT0Q005491 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 26 Oct 2011 23:40:32 -0700 Date: Thu, 27 Oct 2011 08:46:00 -0000 Message-Id: <20111027.024029.1691741697599158961.davem@davemloft.net> To: amodra@gmail.com Cc: gcc-patches@gcc.gnu.org, ebotcazou@adacore.com Subject: Re: Reload related segfaults From: David Miller In-Reply-To: <20111026.230711.1078076406757764801.davem@davemloft.net> References: <20111027025956.GQ29439@bubble.grove.modra.org> <20111026.230711.1078076406757764801.davem@davemloft.net> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg02441.txt.bz2 From: David Miller Date: Wed, 26 Oct 2011 23:07:11 -0400 (EDT) > From: Alan Modra > Date: Thu, 27 Oct 2011 13:29:56 +1030 > >> Some recent patch has exposed a reload bug. I'm seeing > > I think this might be a side effect or Eric's recent changes, > CC:'d. Eric, I'm seeing a similar segmentation fault in reload on sparc64. But it's in a slightly different place than Alan's crash. Simply compile gcc.target/ultrasp12.c with "-m64 -O2 -mcpu=ultrasparc -mvis" to see this. The crash is in find_valid_class() called from push_reload(), via this code block around line 1184 of reload.c: enum reg_class in_out_class = find_valid_class (outmode, GET_MODE (SUBREG_REG (out)), subreg_regno_offset (REGNO (SUBREG_REG (out)), GET_MODE (SUBREG_REG (out)), SUBREG_BYTE (out), GET_MODE (out)), REGNO (SUBREG_REG (out))); 'out' is: (subreg:DI (reg/v:V4QI 50 %f18 [orig:314 s2hi4_ ] [314]) 0) so subreg_regno_offset() returns -1, and find_valid_class() isn't too happy about getting "-1" for it's 'n' argument. I suspect the test that you removed in order to fix rtl-optimization/46603 would guard against this happening. And indeed, I confirmed that backing out the rtl-optimization/46603 fix makes the segmentation fault go away.