* final.c (asm_insn_count): Return zero for an empty asm body.
authorMark Shinwell <shinwell@codesourcery.com>
Wed, 2 Jul 2008 09:19:11 +0000 (09:19 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Wed, 2 Jul 2008 09:19:11 +0000 (09:19 +0000)
From-SVN: r137346

gcc/ChangeLog
gcc/final.c

index 3f1a21e..e9562f3 100644 (file)
@@ -1,3 +1,7 @@
+2008-07-02  Mark Shinwell  <shinwell@codesourcery.com>
+
+       * final.c (asm_insn_count): Return zero for an empty asm body.
+
 2008-07-02  Richard Guenther  <rguenther@suse.de>
 
        * bitmap.h (bitmap_set_bit): Return bool.
index 1f673fb..cbdb3f1 100644 (file)
@@ -1385,6 +1385,9 @@ asm_insn_count (rtx body)
   else
     template = decode_asm_operands (body, NULL, NULL, NULL, NULL, NULL);
 
+  if (!*template)
+    return 0;
+
   for (; *template; template++)
     if (IS_ASM_LOGICAL_LINE_SEPARATOR (*template, template)
        || *template == '\n')