Patchwork Enable frontend-passes.c optimizations even in omp regions etc.

login
register
mail settings
Submitter Jakub Jelinek
Date Sept. 8, 2010, 5:17 p.m.
Message ID <20100908171700.GN1269@tyan-ft48-01.lab.bos.redhat.com>
Download mbox | patch
Permalink /patch/64183/
State New
Headers show

Comments

Jakub Jelinek - Sept. 8, 2010, 5:17 p.m.
Hi!

optimize_code_node doesn't dive into OpenMP etc. regions.
The following patch fixes it by walking ->block in the default case.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2010-09-08  Jakub Jelinek  <jakub@redhat.com>

	* frontend-passes.c (optimize_code_node): Walk block chain by default.


	Jakub
Tobias Burnus - Sept. 8, 2010, 5:48 p.m.
On 09/08/2010 07:17 PM, Jakub Jelinek wrote:
> optimize_code_node doesn't dive into OpenMP etc. regions.
> The following patch fixes it by walking ->block in the default case.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2010-09-08  Jakub Jelinek<jakub@redhat.com>
>
> 	* frontend-passes.c (optimize_code_node): Walk block chain by default.

OK. Thanks for the patch!

Tobias

> --- gcc/fortran/frontend-passes.c.jj	2010-09-06 08:41:42.000000000 +0200
> +++ gcc/fortran/frontend-passes.c	2010-09-07 22:06:52.000000000 +0200
> @@ -225,8 +225,12 @@ optimize_code_node (gfc_code *c)
>       case EXEC_OMP_TASK:
>       case EXEC_OMP_TASKWAIT:
>       case EXEC_OMP_WORKSHARE:
> +    case EXEC_OMP_END_NOWAIT:
> +    case EXEC_OMP_END_SINGLE:
>       case EXEC_DEALLOCATE:
> -
> +    case EXEC_DT_END:
> +      for (d = c->block; d; d = d->block)
> +	optimize_code (d->next);
>         break;
>
>       default:
>
> 	Jakub
>

Patch

--- gcc/fortran/frontend-passes.c.jj	2010-09-06 08:41:42.000000000 +0200
+++ gcc/fortran/frontend-passes.c	2010-09-07 22:06:52.000000000 +0200
@@ -225,8 +225,12 @@  optimize_code_node (gfc_code *c)
     case EXEC_OMP_TASK:
     case EXEC_OMP_TASKWAIT:
     case EXEC_OMP_WORKSHARE:
+    case EXEC_OMP_END_NOWAIT:
+    case EXEC_OMP_END_SINGLE:
     case EXEC_DEALLOCATE:
-      
+    case EXEC_DT_END:
+      for (d = c->block; d; d = d->block)
+	optimize_code (d->next);
       break;
 
     default: