public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/48773] New: Dataflow and REG_DEAD notes
@ 2011-04-26 15:00 mfortune at gmail dot com
  2011-04-28 11:59 ` [Bug rtl-optimization/48773] " mfortune at gmail dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: mfortune at gmail dot com @ 2011-04-26 15:00 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Dataflow and REG_DEAD notes
           Product: gcc
           Version: 4.3.5
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mfortune@gmail.com


Hello all,

I have recently been updating an out of tree target from GCC 4.2.4 to GCC 4.3.5
and have noticed that REG_DEAD notes can get out of sync at the end of multiple
passes. (i.e. be attached to instructions where the register does not die)

The first pass that appears to get REG_DEAD notes out of sync is GCSE. This
gets fixed and broken multiple times as some of the later passes solve the DF
note problem via df_analyze, some delete all notes and some get the notes out
of sync again. When the second schedule pass (sched2) runs the DF note problem
is solved at the start but then instructions can be re-ordered and notes are
once again left out of sync. In my case this causes (an admittedly old)
peephole to be applied incorrectly and bad code is generated. 

It seems to be that each pass, which may get notes out of sync, should run the
note problem before finishing.

With some experimentation I have seen that running df_analyze to solve the note
problem at the end of some passes leads to an apparent improvement in the code.
 It would therefore seem that some passes use REG_DEAD information without
first solving the REG_DEAD problem. This sounds reasonable as I would expect
each pass to end leaving notes valid.

Is the behaviour I have described here intentional? If so, could someone
explain the rationale? I can't see any changes in this area (up to trunk) and I
have seen REG_DEAD notes get out of sync with at least one in-tree target for
which I could provide a testcase if that is useful (GCC 4.5.1). This issue is
quite general though so I believe a large amount of code should trigger the
notes to get out of sync. This clearly does not lead to actual bugs in most
cases otherwise it would have already been reported.

regards,
Matthew


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-12-24 23:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-26 15:00 [Bug rtl-optimization/48773] New: Dataflow and REG_DEAD notes mfortune at gmail dot com
2011-04-28 11:59 ` [Bug rtl-optimization/48773] " mfortune at gmail dot com
2011-04-28 12:02 ` mfortune at gmail dot com
2011-04-28 12:02 ` mfortune at gmail dot com
2011-04-28 12:05 ` mfortune at gmail dot com
2011-04-28 20:54 ` ebotcazou at gcc dot gnu.org
2011-05-04 16:25 ` mfortune at gmail dot com
2011-05-04 16:42 ` ebotcazou at gcc dot gnu.org
2011-05-04 16:59 ` froydnj at codesourcery dot com
2013-12-24 23:46 ` steven at gcc dot gnu.org

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).