This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/20134] [4.0 Regression] combine messes up subreg/zero_extend/compare/lshift
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Feb 2005 18:14:44 -0000
- Subject: [Bug rtl-optimization/20134] [4.0 Regression] combine messes up subreg/zero_extend/compare/lshift
- References: <20050222001243.20134.janis@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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