fold-const: Return corresponding integral type for OFFSET_TYPE in range_check_type...
authorJakub Jelinek <jakub@redhat.com>
Tue, 22 Jun 2021 13:20:14 +0000 (15:20 +0200)
committerJakub Jelinek <jakub@redhat.com>
Tue, 22 Jun 2021 13:20:14 +0000 (15:20 +0200)
commit92d9c9e705f039f42734139c233202888d2bf01b
treef58341cdb5aa5070fd0b0e1c5c546bed9f1f3c79
parentca1f9f22854049d6f9cab5b4bfbc46edbcb5c990
fold-const: Return corresponding integral type for OFFSET_TYPE in range_check_type [PR101162]

Andrew's recent r12-1608-g2f1686ff70b25fceb04ca2ffc0a450fb682913ef change
to fail verification on various unary and binary operations with OFFSET_TYPE
revealed that e.g. switchconv happily performs multiplications and additions
in OFFSET_TYPE.

2021-06-22  Jakub Jelinek  <jakub@redhat.com>
    Andrew Pinski  <apinski@marvell.com>

PR tree-optimization/101162
* fold-const.c (range_check_type): Handle OFFSET_TYPE like pointer
types.

* g++.dg/opt/pr101162.C: New test.
gcc/fold-const.c
gcc/testsuite/g++.dg/opt/pr101162.C [new file with mode: 0644]