diff options
author | Marek Polacek <polacek@redhat.com> | 2014-01-08 15:37:35 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2014-01-08 15:37:35 +0000 |
commit | ab04b46efc42eda6fe74b5fb4551409d29538777 (patch) | |
tree | b17ff64d436854036e7cc189919357e011c8a37a /gcc | |
parent | 2a537fa74e256265925390d687d1f5212494e19b (diff) | |
download | gcc-ab04b46efc42eda6fe74b5fb4551409d29538777.zip gcc-ab04b46efc42eda6fe74b5fb4551409d29538777.tar.gz gcc-ab04b46efc42eda6fe74b5fb4551409d29538777.tar.bz2 |
re PR middle-end/59669 (ICE: SIGSEGV with #pragma omp declare simd linear)
PR middle-end/59669
* omp-low.c (simd_clone_adjust): Don't crash if def is NULL.
testsuite/
* gcc.dg/gomp/pr59669-1.c: New test.
* gcc.dg/gomp/pr59669-2.c: New test.
From-SVN: r206431
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/omp-low.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/gomp/pr59669-1.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/gomp/pr59669-2.c | 9 |
5 files changed, 31 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5ff7cd0..5ad197c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2014-01-08 Marek Polacek <polacek@redhat.com> + PR middle-end/59669 + * omp-low.c (simd_clone_adjust): Don't crash if def is NULL. + +2014-01-08 Marek Polacek <polacek@redhat.com> + PR sanitizer/59667 * ubsan.c (ubsan_type_descriptor): Call strip_array_types on type2. diff --git a/gcc/omp-low.c b/gcc/omp-low.c index f1ec1c6..05513ee 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -11537,7 +11537,7 @@ simd_clone_adjust (struct cgraph_node *node) unsigned int alignment = node->simdclone->args[i].alignment; tree orig_arg = node->simdclone->args[i].orig_arg; tree def = ssa_default_def (cfun, orig_arg); - if (!has_zero_uses (def)) + if (def && !has_zero_uses (def)) { tree fn = builtin_decl_explicit (BUILT_IN_ASSUME_ALIGNED); gimple_seq seq = NULL; @@ -11587,7 +11587,7 @@ simd_clone_adjust (struct cgraph_node *node) tree def = ssa_default_def (cfun, orig_arg); gcc_assert (INTEGRAL_TYPE_P (TREE_TYPE (orig_arg)) || POINTER_TYPE_P (TREE_TYPE (orig_arg))); - if (!has_zero_uses (def)) + if (def && !has_zero_uses (def)) { iter1 = make_ssa_name (orig_arg, NULL); iter2 = make_ssa_name (orig_arg, NULL); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f00c845..39e7af0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-01-08 Marek Polacek <polacek@redhat.com> + + PR middle-end/59669 + * gcc.dg/gomp/pr59669-1.c: New test. + * gcc.dg/gomp/pr59669-2.c: New test. + 2014-01-08 Martin Jambor <mjambor@suse.cz> PR ipa/59610 diff --git a/gcc/testsuite/gcc.dg/gomp/pr59669-1.c b/gcc/testsuite/gcc.dg/gomp/pr59669-1.c new file mode 100644 index 0000000..c72156d --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/pr59669-1.c @@ -0,0 +1,9 @@ +/* PR middle-end/59669 */ +/* { dg-do compile } */ +/* { dg-options "-fopenmp" } */ + +#pragma omp declare simd linear(a) +void +foo (int a) +{ +} diff --git a/gcc/testsuite/gcc.dg/gomp/pr59669-2.c b/gcc/testsuite/gcc.dg/gomp/pr59669-2.c new file mode 100644 index 0000000..f6aad89 --- /dev/null +++ b/gcc/testsuite/gcc.dg/gomp/pr59669-2.c @@ -0,0 +1,9 @@ +/* PR middle-end/59669 */ +/* { dg-do compile } */ +/* { dg-options "-fopenmp" } */ + +#pragma omp declare simd uniform(a) aligned(a:32) +void +bar (int *a) +{ +} |