Re: [PATCH] proposed fix for bug # 61144

2014-07-23 Thread Florian Weimer
On 07/22/2014 07:17 PM, Alexander Monakov wrote: On Tue, 22 Jul 2014, Alexander Monakov wrote: I'd like to push this topic forward a bit. I've bootstrapped and regtested a version of the patch based on the initial proposal to check DECL_WEAK. The approach with decl_replaceable_p looks not that

Re: [PATCH] proposed fix for bug # 61144

2014-07-22 Thread Rich Felker
On Tue, Jul 22, 2014 at 09:17:12PM +0400, Alexander Monakov wrote: > On Tue, 22 Jul 2014, Alexander Monakov wrote: > > I'd like to push this topic forward a bit. I've bootstrapped and regtested > > a > > version of the patch based on the initial proposal to check DECL_WEAK. The > > approach with

Re: [PATCH] proposed fix for bug # 61144

2014-07-22 Thread Alexander Monakov
On Tue, 22 Jul 2014, Alexander Monakov wrote: > I'd like to push this topic forward a bit. I've bootstrapped and regtested a > version of the patch based on the initial proposal to check DECL_WEAK. The > approach with decl_replaceable_p looks not that easy; I'll expand in a > followup email. The

Re: [PATCH] proposed fix for bug # 61144

2014-07-22 Thread Alexander Monakov
On Mon, 16 Jun 2014, Jan Hubicka wrote: > > > /* 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_replaceab

Re: [PATCH] proposed fix for bug # 61144

2014-06-16 Thread Rich Felker
On Mon, Jun 16, 2014 at 06:05:19PM +0200, Jan Hubicka wrote: > > > This needs your decl_replaceable change to not be optimized to if (0), > > > because of the explicit const modifier. > > > > The case I care about actually has "dummy" as const (with the intent > > that it be allocated in a read-on

Re: [PATCH] proposed fix for bug # 61144

2014-06-16 Thread Jan Hubicka
> On Mon, Jun 16, 2014 at 11:06:04AM +0200, Jan Hubicka wrote: > > > > > > Are the attached files acceptable? > > > > The testcase looks OK to me, but it already should be fixed on mainline > > by patch https://gcc.gnu.org/ml/gcc-patches/2014-05/msg01315.html that > > prevents dummy to be marked

Re: [PATCH] proposed fix for bug # 61144

2014-06-16 Thread Rich Felker
On Mon, Jun 16, 2014 at 11:06:04AM +0200, Jan Hubicka wrote: > > > > Are the attached files acceptable? > > The testcase looks OK to me, but it already should be fixed on mainline > by patch https://gcc.gnu.org/ml/gcc-patches/2014-05/msg01315.html that > prevents dummy to be marked as constant.

Re: [PATCH] proposed fix for bug # 61144

2014-06-16 Thread Jan Hubicka
> > Are the attached files acceptable? The testcase looks OK to me, but it already should be fixed on mainline by patch https://gcc.gnu.org/ml/gcc-patches/2014-05/msg01315.html that prevents dummy to be marked as constant. You can however modify the testcase to have __attribute__ ((weak)) const

Re: [PATCH] proposed fix for bug # 61144

2014-06-16 Thread Jan Hubicka
> > /* 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; > >

Re: [PATCH] proposed fix for bug # 61144

2014-06-14 Thread Rich Felker
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: >

Re: [PATCH] proposed fix for bug # 61144

2014-06-09 Thread Rich Felker
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: > > >

Re: [PATCH] proposed fix for bug # 61144

2014-06-09 Thread Alexander Monakov
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 wrote: > > >>>Bug # 61144 is a reg

Re: [PATCH] proposed fix for bug # 61144

2014-06-06 Thread Rich Felker
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 wrote: > >>>Bug # 61144 is a regression in 4.9.0 that breaks building of musl libc >

Re: [PATCH] proposed fix for bug # 61144

2014-05-23 Thread Jeff Law
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

Re: [PATCH] proposed fix for bug # 61144

2014-05-21 Thread Rich Felker
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

Re: [PATCH] proposed fix for bug # 61144

2014-05-21 Thread Richard Biener
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