This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/23299] [4.0 Regression] "classic" GCSE caused miscompilation
- From: "jakub at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Aug 2005 17:27:42 -0000
- Subject: [Bug rtl-optimization/23299] [4.0 Regression] "classic" GCSE caused miscompilation
- References: <20050809170136.23299.jakub@redhat.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From jakub at redhat dot com 2005-08-09 17:27 -------
The problem is in insert_insn_end_bb.
That function is called to hoist the common expression to the end of bb0.
But, bb0 ends with a call that can throw, so insert_insn_end_bb decides not
to put it after the call, but before it and load of its parameters.
And that's the problem here, because that callee's argument (this) is the
same as caller's argument (this) and CSE already removed that parameter load
(as the argument is in r3 already from the entry block). insert_insn_end_bb
keeps searching for parameter loads, until it reaches the beginning
of the bb0 and inserts it there, without checking whether it crosses any
setter of pseudos it uses.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23299