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 rtl-optimization/23369] [4.0.x regression] Generates wrong code for funcptr comparison


------- Additional Comments From tausq at debian dot org  2005-08-13 03:08 -------
The line of code in question is:

     51           if (old == SIG_IGN || old == SIG_DFL || old == SIG_ERR)

after preprocessing, this becomes

          if (old == ((__sighandler_t) 1) || old == ((__sighandler_t) 0) || old
== ((__sighandler_t) -1))

It appears gcc optimized out the the old == 0 case, and it does the right thing
for the old == 1 case. For the old == -1 case, it seems to subtract 2 from old,
and converts -1 to -4. 

Weird.

This also happens with -O1. Dave says it looks like the initial rtl generation
is wrong, so maybe this is not an optimization bug.

-- 


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


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