This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix -fcompare-debug differences caused by trivially_conflicts_p (PR tree-optimization/42719)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]