From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15409 invoked by alias); 23 May 2014 18:26:23 -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 15398 invoked by uid 89); 23 May 2014 18:26:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 May 2014 18:26:21 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4NIQJlv001180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 23 May 2014 14:26:19 -0400 Received: from stumpy.slc.redhat.com (ovpn-113-20.phx2.redhat.com [10.3.113.20]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s4NIQIS7003136; Fri, 23 May 2014 14:26:18 -0400 Message-ID: <537F92CA.8090808@redhat.com> Date: Fri, 23 May 2014 18:26:00 -0000 From: Jeff Law User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Rich Felker , Richard Biener CC: Jan Hubicka , GCC Patches Subject: Re: [PATCH] proposed fix for bug # 61144 References: <20140521015948.GA21600@brightrain.aerifal.cx> <20140522035942.GG507@brightrain.aerifal.cx> In-Reply-To: <20140522035942.GG507@brightrain.aerifal.cx> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg02045.txt.bz2 On 05/21/14 21:59, Rich Felker wrote: > On Wed, May 21, 2014 at 11:17:53AM +0200, Richard Biener wrote: >> 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 > > How should a testcase be done? On the PR there's a testcase that shows > the problem in the generated code, but no automated check for it. > Testing this is actually a bit of a pain unless you're allowed to run > the generated program. You can run the test program. Have it exit (0) on success, abort () on failure if at all possible. Then drop the test source file into gcc/testsuite/gcc.c-torture/execute/pr61144.c At least that's the easiest way when you don't need to pass special arguments, restrict it to certain targets, etc. Jeff