This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Problems with conditional execution and thumb code generation
- To: gcc-patches at gcc dot gnu dot org
- Subject: Re: Problems with conditional execution and thumb code generation
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Fri, 18 Aug 2000 18:16:47 +0100
- Cc: gcc-bugs at gcc dot gnu dot org
- Cc: rearnsha at arm dot com
- Organization: ARM Ltd.
- Reply-To: rearnsha at arm dot com
[ This time I've added gcc-patches ]
> On Fri, Aug 18, 2000 at 04:43:45PM +0100, Richard Earnshaw wrote:
> > (eq (subreg:SI (reg/v:DI 34) 0)
> > (const_int 0 [0x0]))
> >
> > which of course then triggers an assertion failure because we have a
> > subreg not a reg.
> >
> > Doesn't the above code need to handle subregs?
>
> Yes it does. I guess we hadn't seen this sort of thing before
> due to the kinds of comparisons used on the machines using this
> code at the moment.
>
Looking at it, all we need the reg for is to mark it as live. So I think
the following is all that is needed:
* flow.c (init_propagate_block_info): Handle SUBREG in a jump
condition expression.
Index: flow.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/flow.c,v
retrieving revision 1.325
diff -u -p -r1.325 flow.c
--- flow.c 2000/08/15 17:31:29 1.325
+++ flow.c 2000/08/18 17:13:04
@@ -3725,9 +3725,15 @@ init_propagate_block_info (bb, live, loc
if (bitmap_operation (diff, bb_true->global_live_at_start,
bb_false->global_live_at_start, BITMAP_XOR))
{
- if (GET_CODE (XEXP (cond_true, 0)) != REG)
+ rtx reg = XEXP (cond_true, 0);
+
+ if (GET_CODE (reg) == SUBREG)
+ reg = SUBREG_REG (reg);
+
+ if (GET_CODE (reg) != REG)
abort ();
- SET_REGNO_REG_SET (pbi->reg_cond_reg, REGNO (XEXP (cond_true, 0)));
+
+ SET_REGNO_REG_SET (pbi->reg_cond_reg, REGNO (reg));
/* For each such register, mark it conditionally dead. */
EXECUTE_IF_SET_IN_REG_SET