public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/40209]  New: ICE in iv opts caused by stale REG_UNUSED note
@ 2009-05-20 18:47 nvachhar at google dot com
  2009-07-24  4:01 ` [Bug rtl-optimization/40209] ICE in iv_analyze_def " ian at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: nvachhar at google dot com @ 2009-05-20 18:47 UTC (permalink / raw)
  To: gcc-bugs

An ICE occurs in iv_analyze_def because the register referred to by a def is
not the same register referred to by the set in an rtx.  The rtx in question
actually has multiple set's, but single_set only returns one of them because of
a stale REG_UNUSED note.

The stale REG_UNUSED note is created in gcse.  At the beginning of gcse, the
REG_UNUSED note is added (and is correct).  At the end of gcse, if expensive
optimizations are on, it will make a call to cse_main which will merge two defs
with the same expression.  This makes the REG_UNUSED note stale, however it is
not removed from the operation.  Later in iv_analyze_def, the call to
single_set trips over this stale REG_UNUSED note.  I have verified that the
problem is resolved if df_analyze (with the notes problem added) corrects the
stale note and avoids the problem.  However discussions with Ian suggest that
this might not be the correct approach to fixing the problem, so I'm filing
this bug.

I've attached a test case which will cause the ICE if compiled with the
following command line:

gcc -c -O2 -fprofile-use test.c

Note that no .gcda file is necessary.


-- 
           Summary: ICE in iv opts caused by stale REG_UNUSED note
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: nvachhar at google dot com
  GCC host triplet: i686-unknown-linux
GCC target triplet: x86_64-unknown-linux


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


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

end of thread, other threads:[~2023-12-06 18:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-40209-4@http.gcc.gnu.org/bugzilla/>
2023-12-06 18:32 ` [Bug rtl-optimization/40209] ICE in iv_analyze_def caused by stale REG_UNUSED note pinskia at gcc dot gnu.org
2023-12-06 18:33 ` pinskia at gcc dot gnu.org
2023-12-06 18:34 ` [Bug rtl-optimization/40209] stale REG_UNUSED note vs single_set pinskia at gcc dot gnu.org
2009-05-20 18:47 [Bug rtl-optimization/40209] New: ICE in iv opts caused by stale REG_UNUSED note nvachhar at google dot com
2009-07-24  4:01 ` [Bug rtl-optimization/40209] ICE in iv_analyze_def " ian at gcc dot gnu dot org
2009-07-24  6:25 ` ubizjak at gmail dot com
2009-07-24  6:27 ` steven at gcc dot gnu dot org
2009-07-24 15:39 ` nvachhar at google dot com
2009-07-24 17:05 ` steven at gcc dot gnu dot org
2009-07-24 17:47 ` nvachhar at google dot com

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