public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Richard Sandiford <richard.sandiford@arm.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] vect: Fix ICE in vectorizable_comparison PR93292
Date: Fri, 17 Jan 2020 07:56:00 -0000	[thread overview]
Message-ID: <nycvar.YFH.7.76.2001170803140.5566@zhemvz.fhfr.qr> (raw)
In-Reply-To: <20200116234851.GL10088@tucnak>

[-- Attachment #1: Type: text/plain, Size: 1946 bytes --]

On Fri, 17 Jan 2020, Jakub Jelinek wrote:

> Hi!
> 
> The following testcase ICEs on powerpc64le-linux.  The problem is that
> get_vectype_for_scalar_type returns NULL, and while most places in
> tree-vect-stmts.c handle that case, this spot doesn't and punts only
> if it is non-NULL, but with different number of elts than expected.
> 
> Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
> trunk?

OK.

Richard.

> 2020-01-16  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR tree-optimization/93292
> 	* tree-vect-stmts.c (vectorizable_comparison): Punt also if
> 	get_vectype_for_scalar_type returns NULL.
> 
> 	* g++.dg/opt/pr93292.C: New test.
> 
> --- gcc/tree-vect-stmts.c.jj	2020-01-12 11:54:38.522381590 +0100
> +++ gcc/tree-vect-stmts.c	2020-01-16 19:42:30.608888882 +0100
> @@ -10492,7 +10492,7 @@ vectorizable_comparison (stmt_vec_info s
>      {
>        vectype = get_vectype_for_scalar_type (vinfo, TREE_TYPE (rhs1),
>  					     slp_node);
> -      if (maybe_ne (TYPE_VECTOR_SUBPARTS (vectype), nunits))
> +      if (!vectype || maybe_ne (TYPE_VECTOR_SUBPARTS (vectype), nunits))
>  	return false;
>      }
>    else if (maybe_ne (nunits, TYPE_VECTOR_SUBPARTS (vectype)))
> --- gcc/testsuite/g++.dg/opt/pr93292.C.jj	2020-01-16 19:48:51.110144613 +0100
> +++ gcc/testsuite/g++.dg/opt/pr93292.C	2020-01-16 19:47:57.351956177 +0100
> @@ -0,0 +1,18 @@
> +// PR tree-optimization/93292
> +// { dg-do compile }
> +// { dg-options "-O3 -w" }
> +
> +struct A {
> +  static int foo (float x) { static int b; b = x ? x + 0.5 : 0; return b; }
> +};
> +
> +void
> +bar (int *d, float e)
> +{
> +  float g;
> +  for (int h = 0; h < 64; h++)
> +    {
> +      d[h] += A::foo (g < 0 ? : g > 5 ? : g);
> +      A::foo (e);
> +    }
> +}
> 
> 	Jakub
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)

      reply	other threads:[~2020-01-17  7:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-17  1:02 Jakub Jelinek
2020-01-17  7:56 ` Richard Biener [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nycvar.YFH.7.76.2001170803140.5566@zhemvz.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=richard.sandiford@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).