diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-09-09 16:47:06 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-09-09 16:47:06 +0000 |
commit | 1a9a443670598aaa49e2709fb6fb40a3e580c752 (patch) | |
tree | 7ff9b4837f50abdab01e59f816bf07c92e9a20fd /gcc | |
parent | 31ebfd4982740ff959c6d561b0b97e3569d91ad3 (diff) | |
download | gcc-1a9a443670598aaa49e2709fb6fb40a3e580c752.tar.gz |
* gimple.h (CASE_GIMPLE_OMP): New.
(is_gimple_omp): Use it.
* tree-cfg.c (is_ctrl_altering_stmt): Likewise.
(verify_gimple_debug): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151565 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/gimple.h | 37 | ||||
-rw-r--r-- | gcc/tree-cfg.c | 54 |
3 files changed, 59 insertions, 39 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1035493108c..22c92646399 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2009-09-09 Richard Henderson <rth@redhat.com> + + * gimple.h (CASE_GIMPLE_OMP): New. + (is_gimple_omp): Use it. + * tree-cfg.c (is_ctrl_altering_stmt): Likewise. + (verify_gimple_debug): Likewise. + 2009-09-09 Richard Guenther <rguenther@suse.de> PR tree-optimization/41101 diff --git a/gcc/gimple.h b/gcc/gimple.h index 97d2c3789ac..6dce0b78357 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -4190,23 +4190,32 @@ gimple_return_set_retval (gimple gs, tree retval) /* Returns true when the gimple statment STMT is any of the OpenMP types. */ +#define CASE_GIMPLE_OMP \ + case GIMPLE_OMP_PARALLEL: \ + case GIMPLE_OMP_TASK: \ + case GIMPLE_OMP_FOR: \ + case GIMPLE_OMP_SECTIONS: \ + case GIMPLE_OMP_SECTIONS_SWITCH: \ + case GIMPLE_OMP_SINGLE: \ + case GIMPLE_OMP_SECTION: \ + case GIMPLE_OMP_MASTER: \ + case GIMPLE_OMP_ORDERED: \ + case GIMPLE_OMP_CRITICAL: \ + case GIMPLE_OMP_RETURN: \ + case GIMPLE_OMP_ATOMIC_LOAD: \ + case GIMPLE_OMP_ATOMIC_STORE: \ + case GIMPLE_OMP_CONTINUE + static inline bool is_gimple_omp (const_gimple stmt) { - return (gimple_code (stmt) == GIMPLE_OMP_PARALLEL - || gimple_code (stmt) == GIMPLE_OMP_TASK - || gimple_code (stmt) == GIMPLE_OMP_FOR - || gimple_code (stmt) == GIMPLE_OMP_SECTIONS - || gimple_code (stmt) == GIMPLE_OMP_SECTIONS_SWITCH - || gimple_code (stmt) == GIMPLE_OMP_SINGLE - || gimple_code (stmt) == GIMPLE_OMP_SECTION - || gimple_code (stmt) == GIMPLE_OMP_MASTER - || gimple_code (stmt) == GIMPLE_OMP_ORDERED - || gimple_code (stmt) == GIMPLE_OMP_CRITICAL - || gimple_code (stmt) == GIMPLE_OMP_RETURN - || gimple_code (stmt) == GIMPLE_OMP_ATOMIC_LOAD - || gimple_code (stmt) == GIMPLE_OMP_ATOMIC_STORE - || gimple_code (stmt) == GIMPLE_OMP_CONTINUE); + switch (gimple_code (stmt)) + { + CASE_GIMPLE_OMP: + return true; + default: + return false; + } } diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 3996f081733..524422f1ec4 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -2748,24 +2748,30 @@ is_ctrl_altering_stmt (gimple t) { gcc_assert (t); - if (is_gimple_call (t)) + switch (gimple_code (t)) { - int flags = gimple_call_flags (t); + case GIMPLE_CALL: + { + int flags = gimple_call_flags (t); - /* A non-pure/const call alters flow control if the current - function has nonlocal labels. */ - if (!(flags & (ECF_CONST | ECF_PURE)) - && cfun->has_nonlocal_label) - return true; + /* A non-pure/const call alters flow control if the current + function has nonlocal labels. */ + if (!(flags & (ECF_CONST | ECF_PURE)) && cfun->has_nonlocal_label) + return true; - /* A call also alters control flow if it does not return. */ - if (gimple_call_flags (t) & ECF_NORETURN) - return true; - } + /* A call also alters control flow if it does not return. */ + if (gimple_call_flags (t) & ECF_NORETURN) + return true; + } + break; - /* OpenMP directives alter control flow. */ - if (is_gimple_omp (t)) - return true; + CASE_GIMPLE_OMP: + /* OpenMP directives alter control flow. */ + return true; + + default: + break; + } /* If a statement can throw, it alters control flow. */ return stmt_can_throw_internal (t); @@ -4196,17 +4202,6 @@ verify_gimple_debug (gimple stmt ATTRIBUTE_UNUSED) static bool verify_types_in_gimple_stmt (gimple stmt) { - if (is_gimple_omp (stmt)) - { - /* OpenMP directives are validated by the FE and never operated - on by the optimizers. Furthermore, GIMPLE_OMP_FOR may contain - non-gimple expressions when the main index variable has had - its address taken. This does not affect the loop itself - because the header of an GIMPLE_OMP_FOR is merely used to determine - how to setup the parallel iteration. */ - return false; - } - switch (gimple_code (stmt)) { case GIMPLE_ASSIGN: @@ -4244,6 +4239,15 @@ verify_types_in_gimple_stmt (gimple stmt) case GIMPLE_PREDICT: return false; + CASE_GIMPLE_OMP: + /* OpenMP directives are validated by the FE and never operated + on by the optimizers. Furthermore, GIMPLE_OMP_FOR may contain + non-gimple expressions when the main index variable has had + its address taken. This does not affect the loop itself + because the header of an GIMPLE_OMP_FOR is merely used to determine + how to setup the parallel iteration. */ + return false; + case GIMPLE_DEBUG: return verify_gimple_debug (stmt); |