This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] proposed fix for bug # 61144
- From: Rich Felker <dalias at libc dot org>
- To: Alexander Monakov <amonakov at ispras dot ru>
- Cc: Jeff Law <law at redhat dot com>, Richard Biener <richard dot guenther at gmail dot com>, Jan Hubicka <hubicka at ucw dot cz>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 14 Jun 2014 17:24:13 -0400
- Subject: Re: [PATCH] proposed fix for bug # 61144
- Authentication-results: sourceware.org; auth=none
- References: <20140521015948 dot GA21600 at brightrain dot aerifal dot cx> <CAFiYyc0qj1Yc+VDchBYqsocT4aoyL01CMEB2LmzV3-=TcnHmBg at mail dot gmail dot com> <20140522035942 dot GG507 at brightrain dot aerifal dot cx> <537F92CA dot 8090808 at redhat dot com> <20140606171424 dot GC179 at brightrain dot aerifal dot cx> <alpine dot LNX dot 2 dot 00 dot 1406091533270 dot 2730 at monopod dot intra dot ispras dot ru>
Ping. Do you have any feedback on my tests? What is the next step?
Rich
On Mon, Jun 09, 2014 at 03:40:44PM +0400, Alexander Monakov wrote:
>
>
> On Fri, 6 Jun 2014, Rich Felker wrote:
>
> > On Fri, May 23, 2014 at 12:26:18PM -0600, Jeff Law wrote:
> > > 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 <dalias@libc.org> 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
> >
> > The test needs to be two translation units linked together: one with
> > a weak definition of the object as 0, and the other with a strong
> > definition. The test should show the weak value being used rather than
> > the strong one. But I'm not sure how this should be integrated with
> > the build process.
>
> Please have a look at gcc/testsuite/gcc.dg/special/wkali-2{,a,b}.c. This is a
> three-TU test for weak aliases, so you should be able to very easily adjust it
> for this bug.
>
> Thanks.
> Alexander