From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12862 invoked by alias); 3 Jul 2011 20:10:35 -0000 Received: (qmail 12852 invoked by uid 22791); 3 Jul 2011 20:10:33 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_GM 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; Sun, 03 Jul 2011 20:10:19 +0000 From: "ernews at gmx dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/49618] When building uClibc with GCC 4.6.1 old_atexit is miscompiled X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: ernews at gmx dot de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.2 X-Bugzilla-Changed-Fields: CC 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 Date: Sun, 03 Jul 2011 20:10:00 -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 X-SW-Source: 2011-07/txt/msg00154.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49618 Eugene Rudoy changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ernews at gmx dot de --- Comment #7 from Eugene Rudoy 2011-07-03 20:09:42 UTC --- (In reply to comment #4) > With the Patch from [1] I could boot a firmware-image on my router. It seems the "if-conversion"-opt is not the actual reason. It does solve the issue, but it's not the reason. Explanation: "if-conversion" is enabled by default at -O1. The code is however not miss-compiled when compiled using -O1 (-Os causes it to be miss-compiled). I found out that disabling gcse and cse-follow-jumps (i.e. passing -fno-gcse -fno-cse-follow-jumps [1]) also solves the issue. As the optimization level (-O2/-Os) these both are by default enabled on correspond to the -Os flag we use I consider them to be the actual reason for the miss-compiling. [1] http://freetz.org/attachment/ticket/1310/gcc-4.6.x-disable-opt-flags.patch