This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/41089] [4.5 Regression] stdarg pass produces wrong code
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jan 2010 19:17:02 -0000
- Subject: [Bug tree-optimization/41089] [4.5 Regression] stdarg pass produces wrong code
- References: <bug-41089-1649@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #38 from jakub at gcc dot gnu dot org 2010-01-22 19:17 -------
In 4.4 the apY = apX; assignment isn't optimized out, because the code after it
reads from the apY's fields (apY is the struct from the inline, apX in the
caller). But in 4.5 FRE replaces them by whatever is written into apX fields.
It surprises me FRE does this, I'd expect that the struct needs to be SRAed
first before such optimizations can do anything with it.
That said, other options would be prevent FRE from doing that kind of things
with RECORD_TYPE __builtin_va_list objects in the first fre pass, or for DCE1
to
somehow signalize to the stdarg pass if it removes an va_list = va_list
assignment that it should just signalize that va_list escapes.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41089