public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: Rich Felker <dalias@libc.org>
Cc: Richard Biener <richard.guenther@gmail.com>,
	Jan Hubicka <hubicka@ucw.cz>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] proposed fix for bug # 61144
Date: Mon, 16 Jun 2014 08:56:00 -0000	[thread overview]
Message-ID: <20140616085601.GA14894@kam.mff.cuni.cz> (raw)
In-Reply-To: <20140522035942.GG507@brightrain.aerifal.cx>

> >   /* 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?
> 
> Indeed, this may be a better place to do it as long as
> decl_replaceable_p reliably returns true for weak aliases. If so, the
> following might work:
> 
>    if ((!DECL_INITIAL (real_decl) && DECL_EXTERNAL (decl))
>        || decl_replaceable_p (decl)))
>      return error_mark_node;
> 
> On the other hand, I might just separate it out into two separate if
> statements since they should probably have their own comments.

Yep, this looks like correct change.  I used to have FIXME on this but
it seems it went away during some cleanups - the original condition was
comming from expmed's folding and indeed it looked unsafe to me.

This change is OK with the testcase (if it passes testing)

Honza
> 
> I would appreciate help from anyone familiar with GCC internals on
> getting this right.
> 
> Rich

  parent reply	other threads:[~2014-06-16  8:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-21  1:59 Rich Felker
2014-05-21  9:17 ` Richard Biener
2014-05-22  3:59   ` Rich Felker
2014-05-23 18:26     ` Jeff Law
2014-06-06 17:14       ` Rich Felker
2014-06-09 11:41         ` Alexander Monakov
2014-06-09 18:46           ` Rich Felker
2014-06-16  9:06             ` Jan Hubicka
2014-06-16 13:38               ` Rich Felker
2014-06-16 16:05                 ` Jan Hubicka
2014-06-16 16:35                   ` Rich Felker
2014-06-14 21:24           ` Rich Felker
2014-06-16  8:56     ` Jan Hubicka [this message]
2014-07-22 17:18       ` Alexander Monakov
2014-07-22 17:23         ` Alexander Monakov
2014-07-22 17:30           ` Rich Felker
2014-07-23  9:06           ` Florian Weimer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140616085601.GA14894@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=dalias@libc.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).