This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] PR lto/44184
- From: Richard Guenther <rguenther at suse dot de>
- To: Steven Bosscher <stevenb dot gcc at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Diego Novillo <dnovillo at google dot com>
- Date: Tue, 18 May 2010 11:56:36 +0200 (CEST)
- Subject: Re: [patch] PR lto/44184
- References: <AANLkTilB5Q59S7KciJDyvMiRo0C0eAczmAHF9fw3zrcj@mail.gmail.com>
On Tue, 18 May 2010, Steven Bosscher wrote:
> Hi,
>
> We forgot to stream in/out the GIMPLE_ASM labels for the new asm goto construct.
> Will commit as obvious later today, unless I hear objections.
The patch is ok for trunk and the branch.
Thanks,
Richard.
> Ciao!
> Steven
>
>
> 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.
>
> Index: lto-streamer-out.c
> ===================================================================
> --- lto-streamer-out.c (revision 159526)
> +++ lto-streamer-out.c (working copy)
> @@ -1702,6 +1702,7 @@ output_gimple_stmt (struct output_block *ob, gimpl
> 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: lto-streamer-in.c
> ===================================================================
> --- lto-streamer-in.c (revision 159526)
> +++ lto-streamer-in.c (working copy)
> @@ -1044,6 +1044,7 @@ input_gimple_stmt (struct lto_input_block *ib, str
> 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: testsuite/gcc.dg/lto/20100518_0.c
> ===================================================================
> --- testsuite/gcc.dg/lto/20100518_0.c (revision 0)
> +++ testsuite/gcc.dg/lto/20100518_0.c (revision 0)
> @@ -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;
> +}
>
>
--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex