This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/48149] New: Piecewise complex pass-through not optimized
- 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: Wed, 16 Mar 2011 14:14:58 +0000
- Subject: [Bug tree-optimization/48149] New: Piecewise complex pass-through not optimized
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48149
Summary: Piecewise complex pass-through not optimized
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: tree-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: rguenth@gcc.gnu.org
Neither
_Complex float
foo (_Complex float x)
{
float r = __real x;
float i = __imag x;
_Complex float z;
__real z = r;
__imag z = i;
return z;
}
nor
_Complex float
foo (_Complex float x)
{
float r = __real x;
float i = __imag x;
_Complex float z = x;
__real z = r;
__imag z = i;
return z;
}
are optimized to just return x. In the former case we have uninitialized
uses of z in the IL while in the latter case not.
_Complex float
foo (_Complex float x)
{
float r = __real x;
float i = __imag x;
return r + 1.0iF * i;
}
with -ffast-math is also not optimized. Nor is
_Complex float
foo (_Complex float x)
{
return __real x + 1.0iF * __imag x;
}
but I have a patch for that ;)