This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/51528] [4.6 Regression] SRA should not create BOOLEAN_TYPE replacements
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 06 Feb 2012 14:13:48 +0000
- Subject: [Bug tree-optimization/51528] [4.6 Regression] SRA should not create BOOLEAN_TYPE replacements
- Auto-submitted: auto-generated
- References: <bug-51528-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51528
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Depends on| |52115
--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-06 14:13:48 UTC ---
On ppc the main SRA pass does nothing to foo () because of differences in
how the return value is returned. Still the IL at expansion time looks
great:
foo ()
{
<bb 2>:
<retval>.b = 1;
use_bool (<retval>);
<retval>.i = 65534;
return <retval>;
}
compared to x86_64 where we have the uglier
foo ()
{
union U u;
union U D.1733;
<bb 2>:
u.b = 1;
use_bool (u);
u = VIEW_CONVERT_EXPR<union U>(65534);
D.1733 = u;
u ={v} {CLOBBER};
return D.1733;
Compared to -fno-tree-sra on PPC we have
foo ()
{
union U u;
<bb 2>:
<retval>.b = 1;
use_bool (<retval>);
u.i = 65534;
<retval> = u;
u ={v} {CLOBBER};
return <retval>;
so SRA managed to remove the aggregate temporary and its copy.
So, I don't see what's wrong on PPC (with SRA, that is). This must be
a target bug if at all (note I'm only inspecting dumps and did not
reproduce the execute fail).