This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Thumb-2 conditional execution fix


The patch below fixes a bug in the ARM Thumb-2 conditional execution code that 
resulted in missing IT instructions. The condexec_count variable holds the 
umber of conditionally executions instructions that are about to be output. 
This is used by thumb2_final_prescan_insn to figure out
This should not include USE and CLOBBER insns as final_scan_insn bails out 
early for these and never calls thumb2_final_prescan_insn.

Discovered when building glibc in Thumb mode. Current glibc doesn't support 
Thumb mode out the box, but future versions should.

Tested on arm-none-linux-gnueabi.
Applied to trunk.

I have not been able to come up with a useful testcase (It's very sensitive to 
unrelated changes). Earlier versions don't support Thumb-2.

Paul

2007-02-21  Paul Brook  <paul@codesourcery.com>

	* config/arm/arm.c (thumb2_final_prescan_insn): Don't incrememnt
	condexec_count when skipping USE and CLOBBER.
Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c	(revision 163241)
+++ gcc/config/arm/arm.c	(working copy)
@@ -12318,10 +12370,7 @@ thumb2_final_prescan_insn (rtx insn)
       /* USE and CLOBBER aren't really insns, so just skip them.  */
       if (GET_CODE (body) == USE
 	  || GET_CODE (body) == CLOBBER)
-	{
-	  arm_condexec_count++;
-	  continue;
-	}
+	continue;
 
       /* ??? Recognise conditional jumps, and combine them with IT blocks.  */
       if (GET_CODE (body) != COND_EXEC)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]