This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/29797] Miscompiles bit test / set in OpenOffice
- From: "matz at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Nov 2006 15:51:48 -0000
- Subject: [Bug rtl-optimization/29797] Miscompiles bit test / set in OpenOffice
- References: <bug-29797-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from matz at gcc dot gnu dot org 2006-11-10 15:51 -------
At least this patch fixes the bug at hand, but I'm sceptical if by chance or
for real:
Index: ifcvt.c
===================================================================
--- ifcvt.c (revision 118648)
+++ ifcvt.c (working copy)
@@ -1942,6 +1942,8 @@ noce_try_bitop (struct noce_if_info *if_
return FALSE;
bitnum = INTVAL (XEXP (cond, 2));
mode = GET_MODE (x);
+ if (BITS_BIG_ENDIAN)
+ bitnum = GET_MODE_BITSIZE (mode) - 1 - bitnum;
if (bitnum >= HOST_BITS_PER_WIDE_INT)
return FALSE;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29797