Do not fold ADDR_EXPR conditions leading to builtin_unreachable early.
commitf828503eeb79ad1f1ada6db7deccc5abcc2f3ca3
authorAndrew MacLeod <amacleod@redhat.com>
Fri, 21 Apr 2023 19:03:43 +0000 (21 15:03 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Fri, 21 Apr 2023 20:34:05 +0000 (21 16:34 -0400)
tree5bf85bc2b76f66361323926c92125ab2800f7310
parent03cebd304955a6b9c5607e09312d77f1307cc98e
Do not fold ADDR_EXPR conditions leading to builtin_unreachable early.

Ranges can not represent &var globally yet, so we cannot fold these
expressions early or we lose the __builtin_unreachable information.

PR tree-optimization/109546
gcc/
* tree-vrp.cc (remove_unreachable::remove_and_update_globals): Do
not fold conditions with ADDR_EXPR early.

gcc/testsuite/
* gcc.dg/pr109546.c: New.
gcc/testsuite/gcc.dg/pr109546.c [new file with mode: 0644]
gcc/tree-vrp.cc