public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Is NEGATE_EXPR gimple valid for pointer (and offset) types
@ 2021-06-05 22:54 Andrew Pinski
  2021-06-06  8:02 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Pinski @ 2021-06-05 22:54 UTC (permalink / raw)
  To: GCC Mailing List

While debugging PR 100925, I found that after my match.pd (for
A?CST0:CST1) and phiopt patch to use match-and-simplify, gcc will
produce an negate assignment gimple which has a pointer type (and
offset type).  Before we would produce "cond ? -1B : 0B" in this case
but now we produce:
  _4 = a_2(D) == 0;
  _5 = (void *) _4;
  _6 = -_5;
Which I think would be invalid gimple but the verifiers don't say it is.
Should the verifier reject this gimple and similar ones?  I am going
to do some simple testing to see what code hits it too.

Thanks,
Andrew Pinski

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

* Re: Is NEGATE_EXPR gimple valid for pointer (and offset) types
  2021-06-05 22:54 Is NEGATE_EXPR gimple valid for pointer (and offset) types Andrew Pinski
@ 2021-06-06  8:02 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2021-06-06  8:02 UTC (permalink / raw)
  To: Andrew Pinski, Andrew Pinski via Gcc, GCC Mailing List

On June 6, 2021 12:54:03 AM GMT+02:00, Andrew Pinski via Gcc <gcc@gcc.gnu.org> wrote:
>While debugging PR 100925, I found that after my match.pd (for
>A?CST0:CST1) and phiopt patch to use match-and-simplify, gcc will
>produce an negate assignment gimple which has a pointer type (and
>offset type).  Before we would produce "cond ? -1B : 0B" in this case
>but now we produce:
>  _4 = a_2(D) == 0;
>  _5 = (void *) _4;
>  _6 = -_5;
>Which I think would be invalid gimple but the verifiers don't say it
>is.
>Should the verifier reject this gimple and similar ones?  I am going
>to do some simple testing to see what code hits it too.

I think this is invalid GIMPLE. We only allow BIT_xxx on pointer types. But digging in history might reveal sth I don't remember... 

Richard. 

>Thanks,
>Andrew Pinski


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

end of thread, other threads:[~2021-06-06  8:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-05 22:54 Is NEGATE_EXPR gimple valid for pointer (and offset) types Andrew Pinski
2021-06-06  8:02 ` 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).