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 optimization/12282] New: builtin function return value ignored


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: builtin function return value ignored
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: critical
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pbrook at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-unknown-linux-gnu
  GCC host triplet: i686-unknown-linux-gnu
GCC target triplet: i686-unknown-linux-gnu

The following testcase fails when compiled with -O on tree-ssa branch.  Removal 
of the second assignment to q also seems to be removing part of the code which 
assigns the value to r. 
 
void foo (float * p) 
{ 
  if (*p != __builtin_sqrtf(2.0)) 
    abort(); 
} 
 
int main() 
{ 
  float r; 
  double q; 
 
  r = 2.0; 
  q = 2.0; 
  r = __builtin_sqrtf (r); 
  q = __builtin_sqrtf (q); 
 
  foo (&r); 
  exit(0); 
}


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