This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Avoid ICE in tree-vect-patterns.c (PR tree-optimization/70916)
- From: Richard Biener <rguenther at suse dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 3 May 2016 13:35:52 +0200 (CEST)
- Subject: Re: [PATCH] Avoid ICE in tree-vect-patterns.c (PR tree-optimization/70916)
- Authentication-results: sourceware.org; auth=none
- References: <20160503113028 dot GY26501 at tucnak dot zalov dot cz>
On Tue, 3 May 2016, Jakub Jelinek wrote:
> Hi!
>
> We ICE on the following testcase. There are multiple issues, this patch
> fixes just the ICE part; INTEGER_CST rhs1 is completely valid on COND_EXPR,
> though of course a sign of missed optimization earlier; so we don't need
> to spend too much time on it, but shouldn't ICE.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk/6.2?
Ok.
Richard.
> 2016-05-03 Jakub Jelinek <jakub@redhat.com>
>
> 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.
>
> --- gcc/tree-vect-patterns.c.jj 2016-03-23 10:51:23.000000000 +0100
> +++ gcc/tree-vect-patterns.c 2016-05-03 08:39:17.779229143 +0200
> @@ -3673,8 +3673,10 @@ vect_recog_mask_conversion_pattern (vec<
> 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);
>
> --- gcc/testsuite/gcc.c-torture/compile/pr70916.c.jj 2016-05-03 09:52:28.245508879 +0200
> +++ gcc/testsuite/gcc.c-torture/compile/pr70916.c 2016-05-03 09:52:21.000000000 +0200
> @@ -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;
> + }
> + }
> + }
> +}
>
> Jakub
>
>
--
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)