[Committed] [spu] Fix asm gotos

Andrew Pinski pinskia@gmail.com
Mon Sep 28 15:55:00 GMT 2009


Hi,
  The problem here is that the back-end function, get_branch_target
was not ready for a JUMP instruction to contain inline-asm.  This
causes a crash as single_set would return NULL.  This patch fixes the
problem by returning NULL for ASM_OPERANDS.

Committed after a build/test for spu-elf with no regressions and the
asmgoto* testcases working.

Thanks,
Andrew Pinski

ChangeLog:
* spu.c (get_branch_target): Return NULL for ASM_OPERANDS patterns.
-------------- next part --------------
Index: spu.c
===================================================================
--- spu.c	(revision 152237)
+++ spu.c	(working copy)
@@ -2364,6 +2364,10 @@ get_branch_target (rtx branch)
 	  || GET_CODE (PATTERN (branch)) == ADDR_DIFF_VEC)
 	return 0;
 
+     /* ASM GOTOs. */
+     if (GET_CODE (PATTERN (branch)) == ASM_OPERANDS)
+	return NULL;
+
       set = single_set (branch);
       src = SET_SRC (set);
       if (GET_CODE (SET_DEST (set)) != PC)


More information about the Gcc-patches mailing list