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, PR44503] Fixes "control flow in the middle of basic block" with -fprefetch-loop-arrays


> Hi,
> 
> Attached is the patch to fix bug 44503: "control flow in the middle of basic block" with -fprefetch-loop-arrays.
> 
> The problem is that a non-local label (for setjmp) exists in the function. When we insert a _builtin_prefetch
> call, this prefetch is considered potentially changing the control flow. We think this is, in general, a loop 
> construction problem. When the current function has non local labels, there are no natural loops in the 
> function. 

I would rather say it is CFG problem - for known builtins, like
__bultiln_prefetch we certainly don't need to produce nonlocal goto edges.

In fact this might be perhaps bundled in my "leaf" attribute patch I proposed
some time ago.

Honza
> 
> The patch passed bootstrapping and gcc regression tests on amd-linux64 systems.
> 
> Is it ok for the trunk?
> 
> Thanks,
> 
> Changpeng
Content-Description: 0003-Do-not-form-natural-loops-when-non-local-labels-exis.patch
> From 91dd3df467e121426131cf477a77eb07d6062438 Mon Sep 17 00:00:00 2001
> From: Changpeng Fang <chfang@houghton.(none)>
> Date: Mon, 14 Jun 2010 16:46:06 -0700
> Subject: [PATCH 3/3] Do not form natural loops when non-local labels exist in the current function
> 
> 	*cfgloop.c (flow_loops_find): When the current function has non local
> 	labels, there are no natural loops in the function.
> ---
>  gcc/cfgloop.c |   12 ++++++++++++
>  1 files changed, 12 insertions(+), 0 deletions(-)
> 
> diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
> index 858e75b..d2ba445 100644
> --- a/gcc/cfgloop.c
> +++ b/gcc/cfgloop.c
> @@ -394,6 +394,18 @@ flow_loops_find (struct loops *loops)
>        return 1;
>      }
>  
> + /* When the current function has non local labels, there are no
> +     natural loops in the function.  */
> +  if (cfun->has_nonlocal_label)
> +    {
> +      init_loops_structure (loops, 1);
> +
> +      FOR_EACH_BB (bb)
> +	bb->loop_father = loops->tree_root;
> +
> +      return 1;
> +    }
> +
>    dfs_order = NULL;
>    rc_order = NULL;
>  
> -- 
> 1.6.3.3
> 


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