From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4041 invoked by alias); 21 May 2014 09:17:58 -0000 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 Received: (qmail 4029 invoked by uid 89); 21 May 2014 09:17:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-we0-f178.google.com Received: from mail-we0-f178.google.com (HELO mail-we0-f178.google.com) (74.125.82.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 21 May 2014 09:17:56 +0000 Received: by mail-we0-f178.google.com with SMTP id u56so1751952wes.9 for ; Wed, 21 May 2014 02:17:53 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.194.57.225 with SMTP id l1mr42913477wjq.25.1400663873563; Wed, 21 May 2014 02:17:53 -0700 (PDT) Received: by 10.194.119.193 with HTTP; Wed, 21 May 2014 02:17:53 -0700 (PDT) In-Reply-To: <20140521015948.GA21600@brightrain.aerifal.cx> References: <20140521015948.GA21600@brightrain.aerifal.cx> Date: Wed, 21 May 2014 09:17:00 -0000 Message-ID: Subject: Re: [PATCH] proposed fix for bug # 61144 From: Richard Biener To: Rich Felker , Jan Hubicka Cc: GCC Patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg01724.txt.bz2 On Wed, May 21, 2014 at 3:59 AM, Rich Felker wrote: > Bug # 61144 is a regression in 4.9.0 that breaks building of musl libc > due to aggressive and semantically-incorrect constant folding of weak > aliases. The attached patch seems to fix the issue. A weak alias > should never be a candidate for constant folding because it may always > be replaced by a strong definition from another translation unit. > > For details see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61144 > > I do not have a copyright assignment on file but this patch should be > sufficiently trivial not to require it. Please add a testcase. Also I wonder why it isn't better to generalize /* Variables declared 'const' without an initializer have zero as the initializer if they may not be overridden at link or run time. */ if (!DECL_INITIAL (real_decl) && (DECL_EXTERNAL (decl) || decl_replaceable_p (decl))) return error_mark_node; Honza? Thanks, Richard. > Rich