This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix -fcompare-debug differences caused by trivially_conflicts_p (PR tree-optimization/42719)
- From: Richard Guenther <rguenther at suse dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Michael Matz <matz at suse dot de>, Alexandre Oliva <aoliva at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 19 Jan 2010 11:04:18 +0100 (CET)
- Subject: Re: [PATCH] Fix -fcompare-debug differences caused by trivially_conflicts_p (PR tree-optimization/42719)
- References: <20100119075619.GC7223@tyan-ft48-01.lab.bos.redhat.com>
On Tue, 19 Jan 2010, Jakub Jelinek wrote:
> Hi!
>
> The following testcase failed with -fcompare-debug, as trivially_conflicts_p
> returned different result between -g0 and -g and thus in the latter case
> a copy of an SSA_NAME had to be inserted.
>
> Given comments in the PR that this is just heuristics, I've
> bootstrapped/regtested this patch on x86_64-linux and i686-linux.
>
> Ok for trunk?
Ok.
Thanks,
Richard.
> 2010-01-19 Jakub Jelinek <jakub@redhat.com>
>
> PR tree-optimization/42719
> * tree-outof-ssa.c (trivially_conflicts_p): Don't consider debug
> stmt uses.
>
> * gcc.dg/pr42719.c: New test.
>
> --- gcc/tree-outof-ssa.c.jj 2010-01-14 23:34:53.000000000 +0100
> +++ gcc/tree-outof-ssa.c 2010-01-18 14:39:20.000000000 +0100
> @@ -956,6 +956,8 @@ trivially_conflicts_p (basic_block bb, t
> FOR_EACH_IMM_USE_FAST (use, imm_iter, result)
> {
> gimple use_stmt = USE_STMT (use);
> + if (is_gimple_debug (use_stmt))
> + continue;
> /* Now, if there's a use of RESULT that lies outside this basic block,
> then there surely is a conflict with ARG. */
> if (gimple_bb (use_stmt) != bb)
> --- gcc/testsuite/gcc.dg/pr42719.c.jj 2010-01-18 14:41:35.000000000 +0100
> +++ gcc/testsuite/gcc.dg/pr42719.c 2010-01-18 14:41:22.000000000 +0100
> @@ -0,0 +1,14 @@
> +/* PR tree-optimization/42719 */
> +/* { dg-do compile } */
> +/* { dg-options "-O2 -ftracer -fcompare-debug" } */
> +
> +int *v;
> +
> +void
> +foo (int a)
> +{
> + int i, j;
> + for (j = i = a; i != -1; j = i, i = v[i])
> + ;
> + v[j] = v[a];
> +}
>
> Jakub
>
>
--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex