This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: gcc 3.0.4 thumb floating pt bug
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Ted Merrill <ted at arraycomm dot com>
- Cc: Richard dot Earnshaw at arm dot com, gcc-bugs at gcc dot gnu dot org, rearnsha at arm dot com
- Date: Wed, 27 Feb 2002 10:59:23 +0000
- Subject: Re: gcc 3.0.4 thumb floating pt bug
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
Ted,
This is a generic bug in the combiner pass.
Can you please try this patch.
R.
2002-02-27 Richard Earnshaw <rearnsha@arm.com>
* combine.c (simplify_comparision): If simplifying a logical-shift
right and compare with constant to eliminate the shift, make the
comparison unsigned.
Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.267
diff -p -r1.267 combine.c
*** combine.c 2002/02/20 23:15:00 1.267
--- combine.c 2002/02/27 10:55:40
*************** simplify_comparison (code, pop0, pop1)
*** 10885,10890 ****
--- 10885,10895 ----
|| (floor_log2 (const_op) + INTVAL (XEXP (op0, 1))
< mode_width)))
{
+ /* If the shift was logical, then we must make the condition
+ unsigned. */
+ if (GET_CODE (op0) == LSHIFTRT)
+ code = unsigned_condition (code);
+
const_op <<= INTVAL (XEXP (op0, 1));
op1 = GEN_INT (const_op);
op0 = XEXP (op0, 0);