This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tuples] Fix block-1.f90
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>, Diego Novillo <dnovillo at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 30 May 2008 10:41:15 -0400
- Subject: [tuples] Fix block-1.f90
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
diagnose_omp_structured_block_errors replaces diagnosed invalid stuff with
GIMPLE_NOPs, but that newly on the tuples branch relies on cfun != NULL.
I think it isn't a big deal to switch to the target cfun.
2008-05-30 Jakub Jelinek <jakub@redhat.com>
* omp-low.c (diagnose_omp_structured_block_errors): Temporarily
switch cfun to DECL_STRUCT_FUNCTION (fndecl).
* gfortran.dg/gomp/block-1.f90: Adjust dg-error.
--- gcc/omp-low.c.jj 2008-05-30 14:01:38.000000000 +0200
+++ gcc/omp-low.c 2008-05-30 16:31:16.000000000 +0200
@@ -5449,9 +5449,11 @@ diagnose_omp_structured_block_errors (tr
{
tree save_current = current_function_decl;
struct walk_stmt_info wi;
+ struct function *old_cfun = cfun;
gimple_seq body = gimple_body (fndecl);
current_function_decl = fndecl;
+ set_cfun (DECL_STRUCT_FUNCTION (fndecl));
all_labels = splay_tree_new (splay_tree_compare_pointers, 0, 0);
@@ -5465,6 +5467,7 @@ diagnose_omp_structured_block_errors (tr
splay_tree_delete (all_labels);
all_labels = NULL;
+ set_cfun (old_cfun);
current_function_decl = save_current;
}
--- gcc/testsuite/gfortran.dg/gomp/block-1.f90.jj 2008-05-27 14:33:43.000000000 +0200
+++ gcc/testsuite/gfortran.dg/gomp/block-1.f90 2008-05-30 16:37:34.000000000 +0200
@@ -2,7 +2,7 @@
!$omp parallel
!$omp critical
- goto 10 ! { dg-error "invalid exit" }
+ goto 10 ! { dg-error "invalid (exit|branch)" }
!$omp end critical
10 x = 1
!$omp end parallel
Jakub