This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [000/nnn] poly_int: representation of runtime offsets and sizes
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Eric Botcazou <ebotcazou at adacore dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Richard Sandiford <richard dot sandiford at linaro dot org>
- Date: Wed, 25 Oct 2017 12:27:48 +0200
- Subject: Re: [000/nnn] poly_int: representation of runtime offsets and sizes
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jakub at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DAF748210A
- References: <871sltvm7r.fsf@linaro.org> <4728974.295PUQgt1k@polaris> <87o9owq35v.fsf@linaro.org> <10524871.8B8OuvVQlb@polaris> <87fua8pz6v.fsf@linaro.org> <CAFiYyc1oX9fGQwQ5y1fDKrt2XPS13wGrMsQxd1cr2Kgbt-i43g@mail.gmail.com> <87bmkwpv8j.fsf@linaro.org> <CAFiYyc2LCP6Zj2pgkF+a7=ZVJ+KWYPqQ=g8RSmPWVrg6BXHh5Q@mail.gmail.com> <877evkptkr.fsf@linaro.org> <CAFiYyc1=ExQoNR4DH4Og2avozW=i9jt2pvZiQzTppS4vui3LRg@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Oct 25, 2017 at 12:19:37PM +0200, Richard Biener wrote:
> Hum. But then we still warn for must_eq_p (x, 1), no?
>
> So why does
>
> int f (unsigned int x)
> {
> return x != 0;
> }
>
> not warn? Probably because of promotion of the arg.
Because then one comparison operand is positive constant smaller
than the signed maximum.
We warn when both comparison operands are variable and one is signed and the
other is unsigned.
Jakub