]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/114551 - loop splitting and undefined overflow
authorRichard Biener <rguenther@suse.de>
Wed, 3 Apr 2024 12:53:30 +0000 (14:53 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 4 Apr 2024 07:00:06 +0000 (09:00 +0200)
commite152177b362143465e2b9d721ea632cae3f13445
tree961dfefa1e24808b7ce3a1b81a4cdcc28dfb91f9
parentfe385c219994f6d5c1ffe00bcaf5a62c3d18caaf
tree-optimization/114551 - loop splitting and undefined overflow

When loop splitting hoists a guard computation it needs to make sure
that can be safely evaluated at this place when it was previously
only conditionally evaluated.  The following fixes this for the
case of undefined overflow.

PR tree-optimization/114551
* tree-ssa-loop-split.cc (split_loop): If the guard is
only conditionally evaluated rewrite computations with
possibly undefined overflow to unsigned arithmetic.

* gcc.dg/torture/pr114551.c: New testcase.
gcc/testsuite/gcc.dg/torture/pr114551.c [new file with mode: 0644]
gcc/tree-ssa-loop-split.cc