From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18915 invoked by alias); 30 Jan 2012 22:34:56 -0000 Received: (qmail 18741 invoked by uid 22791); 30 Jan 2012 22:34:55 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 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, 30 Jan 2012 22:34:41 +0000 From: "gccbug at jamasaru dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/52056] Code optimization sensitive to trivial changes Date: Mon, 30 Jan 2012 23:17:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: gccbug at jamasaru dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: 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: 2012-01/txt/msg03597.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52056 --- Comment #1 from gccbug at jamasaru dot com 2012-01-30 22:34:37 UTC --- While not relevant to gcc itself, it is interesting that clang also has trouble with consistently identifying this optimization, but in an opposite way to GCC. For clang, the unsigned shift code is faster (11.9 seconds) compared to clang's signed shift (13.3 seconds.) GCC's speeds are 24.3 and 11.3 seconds respectively. clang does not have any sensitivity to the static variable declaration.