public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* COND_EXPR (?:) and its first operand in gimple
@ 2024-04-09 21:02 Andrew Pinski (QUIC)
  2024-04-10  5:37 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Pinski (QUIC) @ 2024-04-09 21:02 UTC (permalink / raw)
  To: gcc, Richard Biener

While looking into PR 114666, I noticed that we don't verify COND_EXPR's first operand. In most of my recent patches to match.pd, I was assuming that it would be a boolean (or a type which would contain
[0,1]) but this PR shows we could end up with an 1-bit signed integer in there.
We could fix most of the match patterns which assume we would get a boolean like type or we could fix the patterns which would create this.
Both are not hard to do but it would be useful for GCC 15 at least to add a verifier if we decide the type should not be a signed 1bit integer.

Thoughts?

Thanks,
Andrew

PS sorry about the duplicated emails, I had a typo in the email address.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: COND_EXPR (?:) and its first operand in gimple
  2024-04-09 21:02 COND_EXPR (?:) and its first operand in gimple Andrew Pinski (QUIC)
@ 2024-04-10  5:37 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2024-04-10  5:37 UTC (permalink / raw)
  To: Andrew Pinski (QUIC); +Cc: gcc

On Tue, Apr 9, 2024 at 11:02 PM Andrew Pinski (QUIC)
<quic_apinski@quicinc.com> wrote:
>
> While looking into PR 114666, I noticed that we don't verify COND_EXPR's first operand. In most of my recent patches to match.pd, I was assuming that it would be a boolean (or a type which would contain
> [0,1]) but this PR shows we could end up with an 1-bit signed integer in there.

Yeah, I guess we never had verification for is_gimple_val operands in
there.  I think we want
a boolean there, anything that's valid as a scalar result of a
tcc_comparison.  Note that
there we do allow a signed 1-bit result ...

> We could fix most of the match patterns which assume we would get a boolean like type or we could fix the patterns which would create this.
> Both are not hard to do but it would be useful for GCC 15 at least to add a verifier if we decide the type should not be a signed 1bit integer.
>
> Thoughts?
>
> Thanks,
> Andrew
>
> PS sorry about the duplicated emails, I had a typo in the email address.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-10  5:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-09 21:02 COND_EXPR (?:) and its first operand in gimple Andrew Pinski (QUIC)
2024-04-10  5:37 ` Richard Biener

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).