re PR lto/44184 ("asm goto" does not work with LTO)
authorSteven Bosscher <steven@gcc.gnu.org>
Tue, 18 May 2010 13:51:50 +0000 (13:51 +0000)
committerSteven Bosscher <steven@gcc.gnu.org>
Tue, 18 May 2010 13:51:50 +0000 (13:51 +0000)
gcc/
PR lto/44184
* lto-streamer-out.c (output_gimple_stmt): Output number of labels
in a GIMPLE_ASM.
* lto-streamer-in.c (input_gimple_stmt): Read number of labels
in a GIMPLE_ASM.

testsuite/
PR lto/44184
* gcc.dg/lto/20100518_0.c: New test.

From-SVN: r159531

gcc/ChangeLog
gcc/lto-streamer-in.c
gcc/lto-streamer-out.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/lto/20100518_0.c [new file with mode: 0644]

index 064e8f1aae0eaded7055672da7341742fcebdbb0..cc7419b8ab0fa931849cdb52b0e2ac203de7b0ca 100644 (file)
@@ -1,3 +1,11 @@
+2010-05-18  Steven Bosscher  <steven@gcc.gnu.org>
+
+       PR lto/44184
+       * lto-streamer-out.c (output_gimple_stmt): Output number of labels
+       in a GIMPLE_ASM.
+       * lto-streamer-in.c (input_gimple_stmt): Read number of labels
+       in a GIMPLE_ASM.
+
 2010-05-18  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/41371
index 5c6658a9f992c10ebb2db558108e2cc762261806..123a7a7aebffddaaa9b61a88f8a788dd30982e4b 100644 (file)
@@ -1044,6 +1044,7 @@ input_gimple_stmt (struct lto_input_block *ib, struct data_in *data_in,
        stmt->gimple_asm.ni = lto_input_uleb128 (ib);
        stmt->gimple_asm.no = lto_input_uleb128 (ib);
        stmt->gimple_asm.nc = lto_input_uleb128 (ib);
+       stmt->gimple_asm.nl = lto_input_uleb128 (ib);
        str = input_string_cst (data_in, ib);
        stmt->gimple_asm.string = TREE_STRING_POINTER (str);
       }
index b90c9daa1eeea2e5f4d5d5c92579beff3e380ffa..4d59832004642a5cb85b54100e3bec167874ebd4 100644 (file)
@@ -1702,6 +1702,7 @@ output_gimple_stmt (struct output_block *ob, gimple stmt)
       lto_output_uleb128_stream (ob->main_stream, gimple_asm_ninputs (stmt));
       lto_output_uleb128_stream (ob->main_stream, gimple_asm_noutputs (stmt));
       lto_output_uleb128_stream (ob->main_stream, gimple_asm_nclobbers (stmt));
+      lto_output_uleb128_stream (ob->main_stream, gimple_asm_nlabels (stmt));
       output_string (ob, ob->main_stream, gimple_asm_string (stmt));
       /* Fallthru  */
 
index 1711a4986aa1b3c810f0caa0cd5d81930eb71f01..609f84b13957b916be20690bbb18ee60fbf2634f 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-18  Steven Bosscher  <steven@gcc.gnu.org>
+
+       PR lto/44184
+       * gcc.dg/lto/20100518_0.c: New test.
+
 2010-05-18  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/specs/lto3.ads: Add missing dg-options.
diff --git a/gcc/testsuite/gcc.dg/lto/20100518_0.c b/gcc/testsuite/gcc.dg/lto/20100518_0.c
new file mode 100644 (file)
index 0000000..5aea2d6
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-lto-do assemble } */
+/* Forgot to steam in/out the number of labels for asm goto.  PR44184.  */
+
+extern int printf (__const char *__restrict __format, ...);
+
+int x = 1;
+int main ()
+{
+    asm goto ("decl %0; jnz %l[a]" :: "m"(x) : "memory" : a);
+    printf ("Hello world\n");
+a:
+    return 0;
+}