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 c/21077] New: Missed optimization


When reworking the testsuite setup for AVR, I have stepped of the following 
missed optimization: 
 
The avr target does fail for the following test case 
(gcc.c-torture/execute/20020720-1.c) with reporting a link error: 
 
Question: After filing this bug report should I post a patch marking the test 
case as "xfail" ? 
 
 
/* Copyright (C) 2002  Free Software Foundation. 
 
   Ensure that fabs(x) < 0.0 optimization is working. 
 
   Written by Roger Sayle, 20th July 2002.  */ 
 
extern void abort (void); 
extern double fabs (double); 
extern void link_error (void); 
 
void 
foo (double x) 
{ 
  double p, q; 
 
  p = fabs (x); 
  q = 0.0; 
  if (p < q) 
    link_error (); 
} 
 
int 
main() 
{ 
  foo (1.0); 
  return 0; 
} 
 
#ifndef __OPTIMIZE__ 
void 
link_error () 
{ 
  abort (); 
} 
#endif

-- 
           Summary: Missed optimization
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bjoern dot m dot haase at web dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-linux
  GCC host triplet: i686-linux
GCC target triplet: avr-*-*


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


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