public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marc Glisse <marc.glisse@inria.fr>
To: Richard Biener <richard.guenther@gmail.com>
Cc: Jason Merrill <jason@redhat.com>,
	    gcc-patches List <gcc-patches@gcc.gnu.org>,
	    Ramana Radhakrishnan <ramana.gcc@googlemail.com>
Subject: Re: RFA: PATCH to match.pd for c++/68385
Date: Sat, 21 Nov 2015 19:19:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.20.1511211950570.6250@laptop-mg.saclay.inria.fr> (raw)
In-Reply-To: <F68952C0-4EAA-4D5E-900F-F51E5291858F@gmail.com>

On Sat, 21 Nov 2015, Richard Biener wrote:

> On November 20, 2015 8:58:15 PM GMT+01:00, Jason Merrill <jason@redhat.com> wrote:
>> In this bug, we hit the (A & sign-bit) != 0 -> A < 0 transformation.
>> Because of delayed folding, the operands aren't fully folded yet, so we
>>
>> have NOP_EXPRs around INTEGER_CSTs, and so calling wi::only_sign_bit_p
>> ICEs.  We've been seeing several similar bugs, where code calls
>> integer_zerop and therefore assumes that they have an INTEGER_CST, but
>> in fact integer_zerop does STRIP_NOPS.
>>
>> This patch changes the pattern to only match if the operand is actually
>>
>> an INTEGER_CST.  Alternatively we could call tree_strip_nop_conversions
>>
>> on the operand, but I would expect that to have issues when the
>> conversion changes the signedness of the type.
>>
>> OK if testing passes?
>
> What happens if we remove the nops stripping from integer_zerop?

I had the same reaction.

> Do other integer predicates strip nops?

Yes, they do.

I believe I added one or two of those, and the reason I added STRIP_NOPS 
is because they started as a copy-paste of integer_zerop...

-- 
Marc Glisse

  reply	other threads:[~2015-11-21 18:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20 19:58 Jason Merrill
2015-11-20 20:38 ` Jason Merrill
2015-11-21  6:31 ` Richard Biener
2015-11-21 19:19   ` Marc Glisse [this message]
2015-11-23 10:17     ` Richard Biener
2015-11-23 19:07   ` Jason Merrill
2015-11-24  9:40     ` Richard Biener

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=alpine.DEB.2.20.1511211950570.6250@laptop-mg.saclay.inria.fr \
    --to=marc.glisse@inria.fr \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=ramana.gcc@googlemail.com \
    --cc=richard.guenther@gmail.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).