]> git.ipfire.org Git - thirdparty/gcc.git/commit
Disallow pointer and offset types on some gimple
authorAndrew Pinski <apinski@marvell.com>
Sun, 6 Jun 2021 02:03:06 +0000 (19:03 -0700)
committerAndrew Pinski <apinski@marvell.com>
Fri, 18 Jun 2021 07:58:18 +0000 (00:58 -0700)
commit2f1686ff70b25fceb04ca2ffc0a450fb682913ef
tree3f59db825745ac968c5e93b3de50f6cc6a46301d
parent2786064d91f46cbdb35a543a883155a3982b9478
Disallow pointer and offset types on some gimple

While debugging PR 100925, I found that the gimple verifiers
don't reject NEGATE on pointer or offset type.
This patch adds the check on some unary and binary gimple which
should not have operated on pointer/offset types.

OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.

Thanks,
Andrew Pinski

gcc/ChangeLog:

* tree-cfg.c (verify_gimple_assign_unary): Reject point and offset
types on NEGATE_EXPR, ABS_EXPR, BIT_NOT_EXPR, PAREN_EXPR and CNONJ_EXPR.
(verify_gimple_assign_binary): Reject point and offset types on
MULT_EXPR, MULT_HIGHPART_EXPR, TRUNC_DIV_EXPR, CEIL_DIV_EXPR,
FLOOR_DIV_EXPR, ROUND_DIV_EXPR, TRUNC_MOD_EXPR, CEIL_MOD_EXPR,
FLOOR_MOD_EXPR, ROUND_MOD_EXPR, RDIV_EXPR, and EXACT_DIV_EXPR.
gcc/tree-cfg.c