Is NEGATE_EXPR gimple valid for pointer (and offset) types
Richard Biener
richard.guenther@gmail.com
Sun Jun 6 08:02:50 GMT 2021
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
More information about the Gcc
mailing list