------- Additional Comments From jakub at gcc dot gnu dot org 2005-02-22 18:14 ------- The testcase is indeed invalid. K&R definition can't serve as a prototype and whether a 32-bit argument is on PPC64 sign or zero extended to 64-bit depends on whether the argument is signed or unsigned. So, either prototypes must be used, or the caller must match the type of the arguments.
if (exact_log2_wide (0x80000000) != 31) abort (); or if (exact_log2_wide ((unsigned int) -2147483648) != 31) abort (); work just fine. On many 64-bit arches this testcase will work anyway, as arguments are e.g. always sign extended to 64-bit (I believe Alpha is an example here) or zero extended to 64-bit. -- What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Keywords|wrong-code | Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20134