This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix for PR63583
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Martin Liška <mliska at suse dot cz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, pinskia at gcc dot gnu dot org, "hubi >> Jan Hubicka" <hubicka at ucw dot cz>
- Date: Sun, 19 Oct 2014 22:43:49 +0200
- Subject: Re: [PATCH] Fix for PR63583
- Authentication-results: sourceware.org; auth=none
- References: <54442148 dot 2070108 at suse dot cz>
> Hello.
>
> I added missing gimple_asm_string comparison for a function with an asm statement.
> Bootstrap and regression tests still running, ready for trunk after it finishes?
OK.
(I remember pointing this out at review :))
Honza
>
> Thank you,
> Martin
> gcc/ChangeLog:
>
> 2014-10-19 Martin Liska <mliska@suse.cz>
>
> * ipa-icf-gimple.c (func_checker::compare_gimple_asm):
> Gimple tempate string is compared.
>
> gcc/testsuite/ChangeLog:
>
> 2014-10-19 Martin Liska <mliska@suse.cz>
>
> * gcc.dg/ipa/pr63595.c: New test.
> diff --git a/gcc/ipa-icf-gimple.c b/gcc/ipa-icf-gimple.c
> index 792a3e4..1369b74 100644
> --- a/gcc/ipa-icf-gimple.c
> +++ b/gcc/ipa-icf-gimple.c
> @@ -863,6 +863,9 @@ func_checker::compare_gimple_asm (gimple g1, gimple g2)
> if (gimple_asm_nclobbers (g1) != gimple_asm_nclobbers (g2))
> return false;
>
> + if (strcmp (gimple_asm_string (g1), gimple_asm_string (g2)) != 0)
> + return return_false_with_msg ("ASM strings are different");
> +
> for (unsigned i = 0; i < gimple_asm_ninputs (g1); i++)
> {
> tree input1 = gimple_asm_input_op (g1, i);
> diff --git a/gcc/testsuite/gcc.dg/ipa/pr63595.c b/gcc/testsuite/gcc.dg/ipa/pr63595.c
> new file mode 100644
> index 0000000..9c9f3bf
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/ipa/pr63595.c
> @@ -0,0 +1,26 @@
> +/* { dg-do compile } */
> +/* { dg-options "-O2 -fdump-ipa-icf-details" } */
> +
> +static int f(int t) __attribute__((noinline));
> +
> +static int g(int t) __attribute__((noinline));
> +static int g(int t)
> +{
> + asm("addl %0, 1": "+r"(t));
> + return t;
> +}
> +static int f(int t)
> +{
> + asm("addq %0, -1": "+r"(t));
> + return t;
> +}
> +
> +
> +int h(int t)
> +{
> + return f(t) + g(t);
> +}
> +
> +/* { dg-final { scan-ipa-dump "ASM strings are different" "icf" } } */
> +/* { dg-final { scan-ipa-dump "Equal symbols: 0" "icf" } } */
> +/* { dg-final { cleanup-ipa-dump "icf" } } */