re PR middle-end/69915 (ICE: SIGSEGV with -O -ftracer with broken backtrace)

PR middle-end/69915
	* tree.c (build_vector_from_ctor): Fix handling of VECTOR_CST
	elements.

	* gcc.dg/pr69915.c: New test.

From-SVN: r233664
This commit is contained in:
Jakub Jelinek 2016-02-24 14:54:39 +01:00 committed by Jakub Jelinek
parent 0683fd27de
commit 89c0c1fd5c
4 changed files with 27 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2016-02-24 Jakub Jelinek <jakub@redhat.com>
PR middle-end/69915
* tree.c (build_vector_from_ctor): Fix handling of VECTOR_CST
elements.
2016-02-24 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR rtl-optimization/69886

View File

@ -1,3 +1,8 @@
2016-02-24 Jakub Jelinek <jakub@redhat.com>
PR middle-end/69915
* gcc.dg/pr69915.c: New test.
2016-02-24 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR rtl-optimization/69886

View File

@ -0,0 +1,15 @@
/* PR middle-end/69915 */
/* { dg-do compile } */
/* { dg-options "-O -ftracer" } */
typedef unsigned short V __attribute__ ((vector_size (32)));
unsigned
foo (unsigned x, unsigned c, V *p)
{
V v = *p;
if (c < 360)
v = (V) { 0 };
v *= (V) { x };
return v[1];
}

View File

@ -1749,7 +1749,7 @@ build_vector_from_ctor (tree type, vec<constructor_elt, va_gc> *v)
else
vec[pos++] = value;
}
for (; idx < TYPE_VECTOR_SUBPARTS (type); ++idx)
while (pos < TYPE_VECTOR_SUBPARTS (type))
vec[pos++] = build_zero_cst (TREE_TYPE (type));
return build_vector (type, vec);