public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/57300] [4.8/4.9 Regression] statement in expression miscompiled at -O3 in 32-bit mode
Date: Thu, 16 May 2013 11:26:00 -0000	[thread overview]
Message-ID: <bug-57300-4-4ZGUjHrmdp@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-57300-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57300

--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Steven Bosscher from comment #9)
> (In reply to Jakub Jelinek from comment #6)
> > So supposedly
> > bool
> > split_dead_or_set_p (rtx insn, const_rtx x)
> > {
> >   if (BLOCK_FOR_INSN (insn) == NULL)
> >     return false; /* If cfg is gone, be conservative.  */
> >   if (df_note == NULL)
> >     {
> >       df_note_add_problem ();
> >       df_analyze ();
> >     }
> >   return dead_or_set_p (insn, x);
> > }
> > 
> > could work.  Steven, comments?
> 
> I don't think this will work. The fact that df_note != NULL does not
> mean the notes are up-to-date.
> 
> It seems to me that after freeing the CFG, no pass should rely on the
> REG_DEAD and REG_UNUSED notes if Eric's comment in PR57281 is correct:
> That each pass is responsible for re-computing the notes if it needs
> them. But I would much rather have the passes at least discard the
> notes if the pass can't update them.  After all, it's not just this
> dead_or_set_p function that relies on these notes, but also single_set
> and a bunch of other functions.

I agree that possibly bogus IL is a smoking gun that waits for this kind
of bugs to appear.  If we do not want to pay the price of removing
notes can we at least have a flag that tells whether the NOTE problem
is up-to-date (and add verification that it indeed is - at least has
no bogus notes - when that flag is set)?  We could introduce
a new PROP_rtl_notes for that.

As for the case in question in PR57281 - it shouldn't be hard for
postreload to remove REG_DEAD notes from all uses when it propagates
equivalencies, no?

Btw, as alternative to computing the NOTE problem at the start of split
we can also remove all notes which should be cheaper.


  parent reply	other threads:[~2013-05-16 11:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-15 19:41 [Bug rtl-optimization/57300] New: " dhazeghi at yahoo dot com
2013-05-16  7:53 ` [Bug rtl-optimization/57300] [4.8/4.9 Regression] " jakub at gcc dot gnu.org
2013-05-16  8:11 ` jakub at gcc dot gnu.org
2013-05-16  8:16 ` jakub at gcc dot gnu.org
2013-05-16  8:35 ` jakub at gcc dot gnu.org
2013-05-16  8:51 ` steven at gcc dot gnu.org
2013-05-16  9:02 ` jakub at gcc dot gnu.org
2013-05-16  9:29 ` ebotcazou at gcc dot gnu.org
2013-05-16  9:43 ` jakub at gcc dot gnu.org
2013-05-16  9:50 ` steven at gcc dot gnu.org
2013-05-16 10:08 ` jakub at gcc dot gnu.org
2013-05-16 10:13 ` jakub at gcc dot gnu.org
2013-05-16 11:26 ` rguenth at gcc dot gnu.org [this message]
2013-05-16 14:48 ` ebotcazou at gcc dot gnu.org
2013-05-20  7:13 ` jakub at gcc dot gnu.org

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=bug-57300-4-4ZGUjHrmdp@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).