public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Rainer Orth <ro@cebitec.uni-bielefeld.de>
Cc: Andrew Stubbs <ams@codesourcery.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 1/3] omp-simd-clone: Allow fixed-lane vectors
Date: Wed, 31 Aug 2022 10:29:07 +0200	[thread overview]
Message-ID: <Yw8b0yuyurFgczft@tucnak> (raw)
In-Reply-To: <yddmtbl659i.fsf@CeBiTec.Uni-Bielefeld.DE>

On Tue, Aug 30, 2022 at 06:54:49PM +0200, Rainer Orth wrote:
> > --- a/gcc/omp-simd-clone.cc
> > +++ b/gcc/omp-simd-clone.cc
> > @@ -504,7 +504,10 @@ simd_clone_adjust_return_type (struct cgraph_node *node)
> >      veclen = node->simdclone->vecsize_int;
> >    else
> >      veclen = node->simdclone->vecsize_float;
> > -  veclen = exact_div (veclen, GET_MODE_BITSIZE (SCALAR_TYPE_MODE (t)));
> > +  if (known_eq (veclen, 0))
> > +    veclen = node->simdclone->simdlen;
> > +  else
> > +    veclen = exact_div (veclen, GET_MODE_BITSIZE (SCALAR_TYPE_MODE (t)));
> >    if (multiple_p (veclen, node->simdclone->simdlen))
> >      veclen = node->simdclone->simdlen;
> >    if (POINTER_TYPE_P (t))
> 
> this broke bootstrap on (at least) i386-pc-solaris2.11 and
> sparc-sun-solaris2.11:
> 
> In file included from /vol/gcc/src/hg/master/local/gcc/coretypes.h:475,
>                  from /vol/gcc/src/hg/master/local/gcc/omp-simd-clone.cc:23:
> /vol/gcc/src/hg/master/local/gcc/poly-int.h: In instantiation of 'typename if_nonpoly<Cb, bool>::type maybe_ne(const poly_int_pod<N, C>&, const Cb&) [with unsigned int N = 1; Ca = long long unsigned int; Cb = int; typename if_nonpoly<Cb, bool>::type = bool]':
> /vol/gcc/src/hg/master/local/gcc/omp-simd-clone.cc:507:7:   required from here
> /vol/gcc/src/hg/master/local/gcc/poly-int.h:1295:22: error: comparison of integer expressions of different signedness: 'const long long unsigned int' and 'const int' [-Werror=sign-compare]
>  1295 |   return a.coeffs[0] != b;
>       |          ~~~~~~~~~~~~^~~~
> 
> Changing the three instances of 0 to 0U seems to fix this.

It broke bootstrap for me on x86_64-linux and i686-linux too.

I've bootstrapped/regtested the following patch on both overnight
and committed to unbreak bootstrap for others.

2022-08-31  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
	    Jakub Jelinek  <jakub@redhat.com>

	* omp-simd-clone.cc (simd_clone_adjust_return_type,
	simd_clone_adjust_argument_types): Use known_eq (veclen, 0U)
	instead of known_eq (veclen, 0) to avoid -Wsign-compare warnings.

--- gcc/omp-simd-clone.cc.jj	2022-08-30 23:10:02.054456930 +0200
+++ gcc/omp-simd-clone.cc	2022-08-30 23:51:03.601664615 +0200
@@ -504,7 +504,7 @@ simd_clone_adjust_return_type (struct cg
     veclen = node->simdclone->vecsize_int;
   else
     veclen = node->simdclone->vecsize_float;
-  if (known_eq (veclen, 0))
+  if (known_eq (veclen, 0U))
     veclen = node->simdclone->simdlen;
   else
     veclen = exact_div (veclen, GET_MODE_BITSIZE (SCALAR_TYPE_MODE (t)));
@@ -621,7 +621,7 @@ simd_clone_adjust_argument_types (struct
 	    veclen = sc->vecsize_int;
 	  else
 	    veclen = sc->vecsize_float;
-	  if (known_eq (veclen, 0))
+	  if (known_eq (veclen, 0U))
 	    veclen = sc->simdlen;
 	  else
 	    veclen
@@ -676,7 +676,7 @@ simd_clone_adjust_argument_types (struct
 	veclen = sc->vecsize_int;
       else
 	veclen = sc->vecsize_float;
-      if (known_eq (veclen, 0))
+      if (known_eq (veclen, 0U))
 	veclen = sc->simdlen;
       else
 	veclen = exact_div (veclen,


	Jakub


  parent reply	other threads:[~2022-08-31  8:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-09 13:23 [PATCH 0/3] OpenMP SIMD routines Andrew Stubbs
2022-08-09 13:23 ` [PATCH 1/3] omp-simd-clone: Allow fixed-lane vectors Andrew Stubbs
2022-08-26 11:04   ` Jakub Jelinek
2022-08-30 14:52     ` Andrew Stubbs
2022-08-30 16:54       ` Rainer Orth
2022-08-31  7:11         ` Martin Liška
2022-08-31  8:29         ` Jakub Jelinek [this message]
2022-08-31  8:35           ` Andrew Stubbs
2022-08-09 13:23 ` [PATCH 2/3] amdgcn: OpenMP SIMD routine support Andrew Stubbs
2022-08-30 14:53   ` Andrew Stubbs
2022-08-09 13:23 ` [PATCH 3/3] vect: inbranch SIMD clones Andrew Stubbs
2022-09-09 14:31   ` Jakub Jelinek
2022-09-14  8:09     ` Richard Biener
2022-09-14  8:34       ` Jakub Jelinek
2022-11-30 15:17     ` Andrew Stubbs
2022-11-30 15:37       ` Jakub Jelinek
2022-12-01 13:35         ` Andrew Stubbs
2022-12-01 14:16           ` Jakub Jelinek
2023-01-06 12:20             ` Andrew Stubbs
2023-02-10  9:11               ` Jakub Jelinek
2023-02-23 10:02                 ` Andrew Stubbs

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=Yw8b0yuyurFgczft@tucnak \
    --to=jakub@redhat.com \
    --cc=ams@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ro@cebitec.uni-bielefeld.de \
    /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).