From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5065 invoked by alias); 12 Sep 2011 08:41:54 -0000 Received: (qmail 5052 invoked by uid 22791); 12 Sep 2011 08:41:51 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_BD,TW_DB X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 12 Sep 2011 08:41:37 +0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug bootstrap/50010] [4.7 regression] bootstrap comparison failure without CFI directives Date: Mon, 12 Sep 2011 08:43:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: bootstrap X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.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: 2011-09/txt/msg00808.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50010 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED AssignedTo|unassigned at gcc dot |jakub at gcc dot gnu.org |gnu.org | --- Comment #14 from Jakub Jelinek 2011-09-12 08:40:48 UTC --- Created attachment 25246 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25246 gcc47-pr50010.patch Small testcase: static const unsigned int v[] = { 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, [255] = 0x384fbdbd }; unsigned int foo (const unsigned char *x, int y, unsigned int z) { unsigned int r = z; while (y--) { r = (r << 8) ^ v[((r >> 24) ^ *x) & 255]; x++; } return r; } -g -dA -O2 -mtune=i586 -m32 -fpic -fno-dwarf2-cfi-asm vs. -g0 -dA -O2 -mtune=i586 -m32 -fpic -fno-dwarf2-cfi-asm or just -g -dA -O2 -mtune=i586 -m32 -fpic -fno-dwarf2-cfi-asm vs. -g -dA -O2 -mtune=i586 -m32 -fpic -fno-dwarf2-cfi-asm -fno-var-tracking-assignments The problem is that when add_cfis_to_fde is creating NOTE_INSN_CFI_LABEL notes, it doesn't ignore NOTE_INSN_VAR_LOCATION and NOTE_INSN_CALL_ARG_LOCATION in between the NOTE_INSN_CFI notes, so with -fvar-tracking-assignments we generate one extra label because the NOTE_INSN_CFI notes aren't consecutive, there is one NOTE_INSN_VAR_LOCATION in between. And, apparently gas for some reason doesn't optimize away completely DW_CFA_advance_loc* if it advances by 0 (guess something to fix). Here is an untested fix. It would be enough to skip over just the NOTE_INSN_VAR_LOCATION and NOTE_INSN_CALL_ARG_LOCATION notes, but if gas doesn't optimize zero length advances, I'd say we should skip over all non-real insns.