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++/54130] New: Recognize builtins with bool return type


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

             Bug #: 54130
           Summary: Recognize builtins with bool return type
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: glisse@gcc.gnu.org


Hello,

extern "C" int isnan(double);
int f(){return isnan(3);}

is optimized to "return 0;" because isnan is recognized as a builtin. However,
if I change the program to:

extern "C" bool isnan(double);
int f(){return isnan(3);}

the optimization is not done. I haven't seen any example in gcc sources of a
builtin that may be declared with several different prototypes.


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