This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tuples] more boring patches
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: dnovillo at google dot com, gcc-patches at gcc dot gnu dot org
- Date: Tue, 20 May 2008 19:27:05 -0400
- Subject: [tuples] more boring patches
I'm running out of descriptions for these fixes.
With this patch set, we walk bind and friends correctly.
We're now down to 18 gomp.exp failures.
Committing to branch.
Aldy
* omp-low.c (WALK_SUBSTMTS): New.
(check_combined_parallel): Walk sub-statements.
(diagnose_sb_1): Same.
(diagnose_sb_2): Same.
Handle switch labels and return statements correctly.
* testsuite/gcc.dg/gomp/block-7.c: Adjust for new error message.
* testsuite/gcc.dg/gomp/block-2.c: Same.
* testsuite/gcc.dg/gomp/block-4.c: Same.
* testsuite/gcc.dg/gomp/block-6.c: Same.
* testsuite/gcc.dg/gomp/block-8.c: Same.
* testsuite/gcc.dg/gomp/block-1.c: Same.
* testsuite/gcc.dg/gomp/block-3.c: Same.
* testsuite/gcc.dg/gomp/block-5.c: Same.
Index: omp-low.c
===================================================================
--- omp-low.c (revision 135674)
+++ omp-low.c (working copy)
@@ -129,6 +129,15 @@ struct omp_region *root_omp_region;
static void scan_omp (gimple_seq, omp_context *);
static tree scan_omp_1_op (tree *, int *, void *);
+#define WALK_SUBSTMTS \
+ case GIMPLE_BIND: \
+ case GIMPLE_TRY: \
+ case GIMPLE_CATCH: \
+ case GIMPLE_EH_FILTER: \
+ /* The sub-statements for these should be walked. */ \
+ *handled_ops_p = false; \
+ break;
+
/* Convenience function for calling scan_omp_1_op on tree operands. */
static inline tree
@@ -4896,14 +4905,17 @@ lower_omp_for (gimple_stmt_iterator *gsi
static tree
check_combined_parallel (gimple_stmt_iterator *gsi_p,
- bool *handled_ops_p ATTRIBUTE_UNUSED,
+ bool *handled_ops_p,
struct walk_stmt_info *wi)
{
int *info = wi->info;
gimple stmt = gsi_stmt (*gsi_p);
+ *handled_ops_p = true;
switch (gimple_code (stmt))
{
+ WALK_SUBSTMTS;
+
case GIMPLE_OMP_FOR:
case GIMPLE_OMP_SECTIONS:
*info = *info == 0 ? 1 : -1;
@@ -5254,6 +5266,8 @@ diagnose_sb_1 (gimple_stmt_iterator *gsi
switch (gimple_code (stmt))
{
+ WALK_SUBSTMTS;
+
case GIMPLE_OMP_PARALLEL:
case GIMPLE_OMP_SECTIONS:
case GIMPLE_OMP_SINGLE:
@@ -5306,6 +5320,8 @@ diagnose_sb_2 (gimple_stmt_iterator *gsi
switch (gimple_code (stmt))
{
+ WALK_SUBSTMTS;
+
case GIMPLE_OMP_PARALLEL:
case GIMPLE_OMP_SECTIONS:
case GIMPLE_OMP_SINGLE:
@@ -5344,17 +5360,16 @@ diagnose_sb_2 (gimple_stmt_iterator *gsi
unsigned int i;
for (i = 0; i < gimple_switch_num_labels (stmt); ++i)
{
- tree lab = gimple_switch_label (stmt, i);
+ tree lab = CASE_LABEL (gimple_switch_label (stmt, i));
n = splay_tree_lookup (all_labels, (splay_tree_key) lab);
- if (diagnose_sb_0 (gsi_p, context, (gimple) n->value))
+ if (n && diagnose_sb_0 (gsi_p, context, (gimple) n->value))
break;
}
}
break;
case GIMPLE_RETURN:
- if (!context)
- diagnose_sb_0 (gsi_p, context, NULL);
+ diagnose_sb_0 (gsi_p, context, NULL);
break;
default:
Index: testsuite/gcc.dg/gomp/block-7.c
===================================================================
--- testsuite/gcc.dg/gomp/block-7.c (revision 135576)
+++ testsuite/gcc.dg/gomp/block-7.c (working copy)
@@ -6,15 +6,15 @@ void foo()
for (i = 0; i < 10; ++i)
{
#pragma omp for
- for (j = ({ continue; 0; }); // { dg-error "invalid exit" }
- j < ({ continue; 10; }); // { dg-error "invalid exit" }
- j += ({ continue; 1; })) // { dg-error "invalid exit" }
+ for (j = ({ continue; 0; }); // { dg-error "invalid branch" }
+ j < ({ continue; 10; }); // { dg-error "invalid branch" }
+ j += ({ continue; 1; })) // { dg-error "invalid branch" }
continue;
#pragma omp for
- for (j = ({ break; 0; }); // { dg-error "invalid exit" }
- j < ({ break; 10; }); // { dg-error "invalid exit" }
- j += ({ break; 1; })) // { dg-error "invalid exit" }
+ for (j = ({ break; 0; }); // { dg-error "invalid branch" }
+ j < ({ break; 10; }); // { dg-error "invalid branch" }
+ j += ({ break; 1; })) // { dg-error "invalid branch" }
break; // { dg-error "break" }
}
}
Index: testsuite/gcc.dg/gomp/block-2.c
===================================================================
--- testsuite/gcc.dg/gomp/block-2.c (revision 135576)
+++ testsuite/gcc.dg/gomp/block-2.c (working copy)
@@ -11,7 +11,7 @@ void foo()
bad1:
#pragma omp for
for (i = 0; i < 10; ++i)
- goto bad1; // { dg-error "invalid exit" }
+ goto bad1; // { dg-error "invalid branch" }
goto bad2; // { dg-error "invalid entry" }
#pragma omp for
Index: testsuite/gcc.dg/gomp/block-4.c
===================================================================
--- testsuite/gcc.dg/gomp/block-4.c (revision 135576)
+++ testsuite/gcc.dg/gomp/block-4.c (working copy)
@@ -4,6 +4,6 @@ void foo()
{
#pragma omp critical
{
- return; // { dg-error "invalid exit" }
+ return; // { dg-error "invalid branch" }
}
}
Index: testsuite/gcc.dg/gomp/block-6.c
===================================================================
--- testsuite/gcc.dg/gomp/block-6.c (revision 135576)
+++ testsuite/gcc.dg/gomp/block-6.c (working copy)
@@ -4,6 +4,6 @@ void foo()
{
#pragma omp ordered
{
- return; // { dg-error "invalid exit" }
+ return; // { dg-error "invalid branch" }
}
}
Index: testsuite/gcc.dg/gomp/block-8.c
===================================================================
--- testsuite/gcc.dg/gomp/block-8.c (revision 135576)
+++ testsuite/gcc.dg/gomp/block-8.c (working copy)
@@ -7,5 +7,5 @@ int foo()
#pragma omp parallel for
for (i = 0; i < 10; ++i)
- return 0; // { dg-error "invalid exit" }
+ return 0; // { dg-error "invalid branch" }
}
Index: testsuite/gcc.dg/gomp/block-1.c
===================================================================
--- testsuite/gcc.dg/gomp/block-1.c (revision 135576)
+++ testsuite/gcc.dg/gomp/block-1.c (working copy)
@@ -4,7 +4,7 @@ void foo()
{
bad1:
#pragma omp parallel
- goto bad1; // { dg-error "invalid exit" }
+ goto bad1; // { dg-error "invalid branch" }
goto bad2; // { dg-error "invalid entry" }
#pragma omp parallel
Index: testsuite/gcc.dg/gomp/block-3.c
===================================================================
--- testsuite/gcc.dg/gomp/block-3.c (revision 135576)
+++ testsuite/gcc.dg/gomp/block-3.c (working copy)
@@ -9,7 +9,7 @@ void foo()
{
#pragma omp sections
{
- continue; // { dg-error "invalid exit" }
+ continue; // { dg-error "invalid branch" }
}
}
@@ -18,12 +18,12 @@ void foo()
#pragma omp section
{ bad1: ; }
#pragma omp section
- goto bad1; // { dg-error "invalid exit" }
+ goto bad1; // { dg-error "invalid branch" }
}
#pragma omp sections
{
- goto bad2; // { dg-error "invalid exit" }
+ goto bad2; // { dg-error "invalid branch" }
}
bad2:;
Index: testsuite/gcc.dg/gomp/block-5.c
===================================================================
--- testsuite/gcc.dg/gomp/block-5.c (revision 135576)
+++ testsuite/gcc.dg/gomp/block-5.c (working copy)
@@ -4,12 +4,12 @@ void foo()
{
#pragma omp master
{
- goto bad1; // { dg-error "invalid exit" }
+ goto bad1; // { dg-error "invalid branch" }
}
#pragma omp master
{
bad1:
- return; // { dg-error "invalid exit" }
+ return; // { dg-error "invalid branch" }
}
}