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.
2015-12-06  Bernd Edlinger  <bernd.edlin...@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;
 

Reply via email to