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 middle-end/26134] New: fold *(float*)(&complex_float_var) into REALPART_EXPR<complex_float_var>


I was looking at some code which is mentioned to be in SPEC 2006 (I forgot
where I found the mentioning)
but anyways it has the following in it:

typedef _Complex float COMPLEX_FLOAT;
float real_part(COMPLEX_FLOAT a)
{
  return *(float*)(&a);
}

This should be converted to:

float real_part(COMPLEX_FLOAT a)
{
  return __real__ a;
}

So that the tree optimizers can work on it easier.


-- 
           Summary: fold *(float*)(&complex_float_var) into
                    REALPART_EXPR<complex_float_var>
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, TREE
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26134


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