]> git.ipfire.org Git - thirdparty/gcc.git/commit
Check for casts becoming UNDEFINED.
authorAndrew MacLeod <amacleod@redhat.com>
Thu, 15 May 2025 15:06:05 +0000 (11:06 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Thu, 15 May 2025 16:59:35 +0000 (12:59 -0400)
commit4291071a6aa3b50800ad5fc70b5fb83cb9398237
tree977d2b1367c799c0a948947983cbf8fc66272b7a
parent022d8e25e49021b378a4e6c24c2f0c380a066690
Check for casts becoming UNDEFINED.

In various situations a cast that is ultimately unreahcable may produce
an UNDEFINED result, and we can't check the bounds in this case.

PR tree-optimization/120277
gcc/
* range-op-ptr.cc (operator_cast::fold_range): Check if the cast
if UNDEFINED before setting bounds.

gcc/testsuite/
* gcc.dg/pr120277.c: New.
gcc/range-op-ptr.cc
gcc/testsuite/gcc.dg/pr120277.c [new file with mode: 0644]