From patchwork Tue Nov 27 13:04:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Bosscher X-Patchwork-Id: 202212 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 2948D2C0084 for ; Wed, 28 Nov 2012 00:05:16 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1354626317; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: MIME-Version:Received:In-Reply-To:References:From:Date: Message-ID:Subject:To:Cc:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=tiWQB9x3VFvFg0CVwXI75fD5IHs=; b=LMD35044OxqJp1M E+QQwOt25Zmf2ieUCo4F0jSFl6EXNBrtJQalJHGWBDpFPBz3wA5zWkjZMrKaoPcM ATLbIluCNQMtZigHQETbZeluv3tT57oIFVDTrcFI0+vOocrgJg44lmad9dX9l3CH H4eyJXsvYOjxxEpJJq5F6v7hAVU0= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:MIME-Version:Received:In-Reply-To:References:From:Date:Message-ID:Subject:To:Cc:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=E0fXOG9oLxWjCfS9AFFDyz55ubIDGSK21Z59AlK/0Jlt+eXGZ4HHqzed33avGl sx49u67tCVtNu5Xob8/gAAfSn0rNDEMb7oNGY+HZlG4MxzLGQ+T/JvbdePUGP5Eh CBVJPNkbywS4jt+atA+/PQJFvOwmfOxih9fVTnrLK2viI=; Received: (qmail 24813 invoked by alias); 27 Nov 2012 13:04:55 -0000 Received: (qmail 24706 invoked by uid 22791); 27 Nov 2012 13:04:52 -0000 X-SWARE-Spam-Status: No, hits=-5.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-la0-f47.google.com (HELO mail-la0-f47.google.com) (209.85.215.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 27 Nov 2012 13:04:45 +0000 Received: by mail-la0-f47.google.com with SMTP id u2so9554899lag.20 for ; Tue, 27 Nov 2012 05:04:43 -0800 (PST) Received: by 10.152.132.3 with SMTP id oq3mr14369285lab.18.1354021482932; Tue, 27 Nov 2012 05:04:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.88.99 with HTTP; Tue, 27 Nov 2012 05:04:02 -0800 (PST) In-Reply-To: References: <20121118231540.726263BABA@mailhost.lps.ens.fr> <38690302.TaVonSBHVs@polaris> From: Steven Bosscher Date: Tue, 27 Nov 2012 14:04:02 +0100 Message-ID: Subject: Re: Fix twolf -funroll-loops -O3 miscompilation (a semi-latent web.c bug) To: Eric Botcazou Cc: gcc-patches@gcc.gnu.org, Dominique Dhumieres , bonzini@gnu.org, hubicka@ucw.cz, Richard Henderson , Jeff Law X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Tue, Nov 27, 2012 at 1:28 PM, Steven Bosscher wrote: > Dominique, could you give this a try and see if it helps? > (But as I said up-thread: I'm not sure this is a proper fix, or just > another band-aid...) And more band-aid, but this time I'm not even sure where things go wrong. In any case, we end up with a REG_EQUAL note referencing a SUBREG of a dead register. This leaked because df_remove_dead_eq_notes uses loc_mentioned_in_p not on the note but on the first operand of the note. Index: df-problems.c =================================================================== --- df-problems.c (revision 193394) +++ df-problems.c (working copy) @@ -2907,9 +2907,10 @@ df_remove_dead_eq_notes (rtx insn, bitma if (DF_REF_REGNO (use) > FIRST_PSEUDO_REGISTER && DF_REF_LOC (use) && (DF_REF_FLAGS (use) & DF_REF_IN_NOTE) - && ! bitmap_bit_p (live, DF_REF_REGNO (use)) - && loc_mentioned_in_p (DF_REF_LOC (use), XEXP (link, 0))) + && ! bitmap_bit_p (live, DF_REF_REGNO (use))) { + /* Make sure that DF_SCAN is up-to-date. */ + gcc_assert (loc_mentioned_in_p (DF_REF_LOC (use), link)); deleted = true; break; }