]> git.ipfire.org Git - thirdparty/gcc.git/commit
alias: Perform offset arithmetics in poly_offset_int rather than poly_int64 [PR118819]
authorJakub Jelinek <jakub@redhat.com>
Thu, 27 Feb 2025 07:48:18 +0000 (08:48 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 27 Feb 2025 07:48:18 +0000 (08:48 +0100)
commitb570f48c3dfb9ca3d640467cff67e569904009d4
tree380f2d53bfad63a65ffaacb8a32a196c24d575b1
parentedd9ad2a8ad5ec35b81f8436089daf653eb2834d
alias: Perform offset arithmetics in poly_offset_int rather than poly_int64 [PR118819]

This PR is about ubsan error on the c - cx1 + cy1 evaluation in the first
hunk.

The following patch hopefully fixes that by doing the additions/subtractions
in poly_offset_int rather than poly_int64 and then converting back to poly_int64.
If it doesn't fit, -1 is returned (which means it is unknown if there is a conflict
or not).

2025-02-27  Jakub Jelinek  <jakub@redhat.com>

PR middle-end/118819
* alias.cc (memrefs_conflict_p): Perform arithmetics on c, xsize and
ysize in poly_offset_int and return -1 if it is not representable in
poly_int64.
gcc/alias.cc