This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tuples] walk_gimple_stmt: handle WCE
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: dnovillo at google dot com, gcc-patches at gcc dot gnu dot org
- Date: Mon, 17 Mar 2008 16:55:40 -0400
- Subject: [tuples] walk_gimple_stmt: handle WCE
The following patch handles walking of GIMPLE_WITH_CLEANUP_EXPRs. It
looks like a minor oversight when we added WCE tuples.
I also collapsed the common OMP code in walk_gimple_stmt.
Diego, we can also collapse GIMPLE_OMP_FOR, but I'm not sure whether
it is semantically safe to walk the PRE_BODY before the OMP_BODY. Can I
walk the PRE_BODY, and fall through for the GIMPLE_OMP_FOR code?
* gimple.c (walk_gimple_stmt): Collapse common code.
Add case for GIMPLE_WITH_CLEANUP_EXPR.
Index: gimple.c
===================================================================
--- gimple.c (revision 133138)
+++ gimple.c (working copy)
@@ -1492,16 +1492,13 @@ walk_gimple_stmt (gimple_stmt_iterator *
break;
case GIMPLE_OMP_CRITICAL:
- ret = walk_gimple_seq (gimple_omp_body (stmt), callback_stmt, callback_op,
- wi);
- if (ret)
- return ret;
- break;
-
case GIMPLE_OMP_CONTINUE:
case GIMPLE_OMP_MASTER:
case GIMPLE_OMP_ORDERED:
case GIMPLE_OMP_SECTION:
+ case GIMPLE_OMP_PARALLEL:
+ case GIMPLE_OMP_SECTIONS:
+ case GIMPLE_OMP_SINGLE:
ret = walk_gimple_seq (gimple_omp_body (stmt), callback_stmt, callback_op,
wi);
if (ret)
@@ -1519,23 +1516,9 @@ walk_gimple_stmt (gimple_stmt_iterator *
return ret;
break;
- case GIMPLE_OMP_PARALLEL:
- ret = walk_gimple_seq (gimple_omp_body (stmt), callback_stmt, callback_op,
- wi);
- if (ret)
- return ret;
- break;
-
- case GIMPLE_OMP_SECTIONS:
- ret = walk_gimple_seq (gimple_omp_body (stmt), callback_stmt, callback_op,
- wi);
- if (ret)
- return ret;
- break;
-
- case GIMPLE_OMP_SINGLE:
- ret = walk_gimple_seq (gimple_omp_body (stmt), callback_stmt, callback_op,
- wi);
+ case GIMPLE_WITH_CLEANUP_EXPR:
+ ret = walk_gimple_seq (gimple_wce_cleanup (stmt), callback_stmt,
+ callback_op, wi);
if (ret)
return ret;
break;