diff mbox

[2/2] Fix minor glitches with basic asm

Message ID HE1PR07MB090535F0B4BB8DB820122680E40A0@HE1PR07MB0905.eurprd07.prod.outlook.com
State New
Headers show

Commit Message

Bernd Edlinger Dec. 6, 2015, 8:58 a.m. UTC
Hi,

while looking at the handling of basic asm statements
I noticed two minor glitches, which I want to fix now.

Secondly there is a wrong check in shorten_branches in final.c

Here we check if GET_CODE (body) == ASM_INPUT, that is
never true, because GET_CODE (body) == SEQUENCE here.
The right object to check is PATTERN (inner_insn).


Boot-strapped and reg-tested on x86_64-pc-linux-gnu,
OK for trunk?


Thanks
Bernd.

Comments

Richard Biener Dec. 7, 2015, 8:32 a.m. UTC | #1
On Sun, 6 Dec 2015, Bernd Edlinger wrote:

> 
> Hi,
> 
> while looking at the handling of basic asm statements
> I noticed two minor glitches, which I want to fix now.
> 
> Secondly there is a wrong check in shorten_branches in final.c
> 
> Here we check if GET_CODE (body) == ASM_INPUT, that is
> never true, because GET_CODE (body) == SEQUENCE here.
> The right object to check is PATTERN (inner_insn).
> 
> 
> Boot-strapped and reg-tested on x86_64-pc-linux-gnu,
> OK for trunk?

Ok.

Richard.
diff mbox

Patch

2015-12-06  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	* final.c (shorten_branches): Fix check for basic asm.

Index: gcc/final.c
===================================================================
--- gcc/final.c	(revision 231320)
+++ gcc/final.c	(working copy)
@@ -1157,7 +1157,7 @@  shorten_branches (rtx_insn *first)
 	      int inner_uid = INSN_UID (inner_insn);
 	      int inner_length;
 
-	      if (GET_CODE (body) == ASM_INPUT
+	      if (GET_CODE (PATTERN (inner_insn)) == ASM_INPUT
 		  || asm_noperands (PATTERN (inner_insn)) >= 0)
 		inner_length = (asm_insn_count (PATTERN (inner_insn))
 				* insn_default_length (inner_insn));