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
This commit is contained in:
Marek Polacek 2014-01-08 15:37:35 +00:00 committed by Marek Polacek
parent 2a537fa74e
commit ab04b46efc
5 changed files with 31 additions and 2 deletions

View file

@ -1,3 +1,8 @@
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

View file

@ -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);

View file

@ -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

View file

@ -0,0 +1,9 @@
/* PR middle-end/59669 */
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
#pragma omp declare simd linear(a)
void
foo (int a)
{
}

View file

@ -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)
{
}