summaryrefslogtreecommitdiff
path: root/gcc/omp-low.c
diff options
context:
space:
mode:
authortschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>2014-02-12 14:46:08 +0000
committertschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>2014-02-12 14:46:08 +0000
commita4eb3f73ce45d62a9c4484a6bc3843bbc1d382ed (patch)
tree89f989ac44affc877db59bdd2965712c0ec6572a /gcc/omp-low.c
parent93415fb5d52b3fd0ea735a0b470b7bad8307389f (diff)
downloadgcc-a4eb3f73ce45d62a9c4484a6bc3843bbc1d382ed.tar.gz
Fix potential ICE (null pointer dereference) in omp-low.c:diagnose_sb_0.
gcc/ * omp-low.c (diagnose_sb_0): Make sure label_ctx is valid to dereference. gcc/testsuite/ * gcc.dg/cilk-plus/jump-openmp.c: New file. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207722 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r--gcc/omp-low.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index f99b2a62264..ff3d2e80fb8 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -10269,7 +10269,8 @@ diagnose_sb_0 (gimple_stmt_iterator *gsi_p,
if ((branch_ctx
&& gimple_code (branch_ctx) == GIMPLE_OMP_FOR
&& gimple_omp_for_kind (branch_ctx) == GF_OMP_FOR_KIND_CILKSIMD)
- || (gimple_code (label_ctx) == GIMPLE_OMP_FOR
+ || (label_ctx
+ && gimple_code (label_ctx) == GIMPLE_OMP_FOR
&& gimple_omp_for_kind (label_ctx) == GF_OMP_FOR_KIND_CILKSIMD))
cilkplus_block = true;
}