diff mbox

[1/2] Fix minor glitches with basic asm

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

Commit Message

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

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

First there is a missing check in compare_gimple_asm in ipa-icf-gimple.c

Here we check if two asm statements are exactly identical,
there is a possibility that one is a basic asm and the other is an
extended asm with zero operands. Even if both have the same string
the string means something slightly different, if % or { } are around.

example:

asm("%"); // OK
asm("%":); // error: invalid 'asm': invalid %-code


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


Thanks
Bernd.

Comments

Richard Biener Dec. 7, 2015, 8:31 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.
> 
> First there is a missing check in compare_gimple_asm in ipa-icf-gimple.c
> 
> Here we check if two asm statements are exactly identical,
> there is a possibility that one is a basic asm and the other is an
> extended asm with zero operands. Even if both have the same string
> the string means something slightly different, if % or { } are around.
> 
> example:
> 
> asm("%"); // OK
> asm("%":); // error: invalid 'asm': invalid %-code
> 
> 
> 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>

	* ipa-icf-gimple.c (func_checker::compare_gimple_asm): Fix check for
	basic asm.

Index: gcc/ipa-icf-gimple.c
===================================================================
--- gcc/ipa-icf-gimple.c	(revision 231320)
+++ gcc/ipa-icf-gimple.c	(working copy)
@@ -981,6 +981,9 @@  func_checker::compare_gimple_asm (const gasm *g1,
   if (gimple_asm_volatile_p (g1) != gimple_asm_volatile_p (g2))
     return false;
 
+  if (gimple_asm_input_p (g1) != gimple_asm_input_p (g2))
+    return false;
+
   if (gimple_asm_ninputs (g1) != gimple_asm_ninputs (g2))
     return false;