From: Jakub Jelinek Date: Tue, 3 May 2016 11:38:38 +0000 (+0200) Subject: re PR tree-optimization/70916 (gcc ICE at -O3 on valid code on x86_64-linux-gnu in... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dea60b590ccf8968b5b651eddfc25ddf3226c8a1;p=gcc.git re PR tree-optimization/70916 (gcc ICE at -O3 on valid code on x86_64-linux-gnu in "tree_operand_check") PR tree-optimization/70916 * tree-vect-patterns.c (vect_recog_mask_conversion_pattern): Give up if COND_EXPR rhs1 is neither SSA_NAME nor COMPARISON_CLASS_P. * gcc.c-torture/compile/pr70916.c: New test. From-SVN: r235814 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7122b6c2ba9..83760681c0d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2016-05-03 Jakub Jelinek + PR tree-optimization/70916 + * tree-vect-patterns.c (vect_recog_mask_conversion_pattern): Give up + if COND_EXPR rhs1 is neither SSA_NAME nor COMPARISON_CLASS_P. + PR target/49244 * tree-ssa-ccp.c: Include stor-layout.h and optabs-query.h. (optimize_atomic_bit_test_and): New function. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b29f76334fe..0941f39afa5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2016-05-03 Jakub Jelinek + PR tree-optimization/70916 + * gcc.c-torture/compile/pr70916.c: New test. + PR target/49244 * gcc.target/i386/pr49244-1.c: New test. * gcc.target/i386/pr49244-2.c: New test. diff --git a/gcc/testsuite/gcc.c-torture/compile/pr70916.c b/gcc/testsuite/gcc.c-torture/compile/pr70916.c new file mode 100644 index 00000000000..c3ea69fba9b --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr70916.c @@ -0,0 +1,28 @@ +/* PR tree-optimization/70916 */ + +int a, b, c, d, i, k; +int static *e = &b, *j; +int **f; +int static ***g = &f; +int *h; +void +fn1 () +{ + for (;;) + { + int l[1] = { }; + int m = (__UINTPTR_TYPE__) l; + for (; d; d--) + { + int ****n; + int *****o = &n; + i = a & 7 ? : a; + *e = (((*o = &g) != (int ****) g) < h[c], 0) || k; + if (*e) + { + **n = &j; + *e = (__UINTPTR_TYPE__) h; + } + } + } +} diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index 27080d28a1d..d08b4547756 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -3673,8 +3673,10 @@ vect_recog_mask_conversion_pattern (vec *stmts, tree *type_in, if (!rhs1_type) return NULL; } - else + else if (COMPARISON_CLASS_P (rhs1)) rhs1_type = TREE_TYPE (TREE_OPERAND (rhs1, 0)); + else + return NULL; vectype2 = get_mask_type_for_scalar_type (rhs1_type);