This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/48149] New: Piecewise complex pass-through not optimized


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 ;)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]