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: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jan 2010 21:47:39 -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 #39 from rguenther at suse dot de 2010-01-22 21:47 -------
Subject: Re: [4.5 Regression] stdarg pass
produces wrong code
On Fri, 22 Jan 2010, jakub at gcc dot gnu dot org wrote:
> ------- 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.
It's a feature ;) FRE can look through struct copies now and thus
can value-number x to 1 in s.a = 1; r = s; x = r.a;
> 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.
or alpha could make the va_list struct copies volatile. Or we can
schedule tree-stdarg earlier.
Richard.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41089