]> gcc.gnu.org Git - gcc.git/commit
tree-optimization/106892 - avoid invalid pointer association in predcom
authorRichard Biener <rguenther@suse.de>
Fri, 9 Sep 2022 10:06:38 +0000 (12:06 +0200)
committerRichard Biener <rguenther@suse.de>
Mon, 17 Oct 2022 12:43:37 +0000 (14:43 +0200)
commitd4bcab0b622cf8f2b6aadd982155c7e2d37d5887
treeffd2616a774bfd786f48abacf99d324a7cf2c85a
parent9124675d2771aaf573bfbbe237ab28030bf3115d
tree-optimization/106892 - avoid invalid pointer association in predcom

When predictive commoning builds a reference for iteration N it
prematurely associates a constant offset into the MEM_REF offset
operand which can be invalid if the base pointer then points
outside of an object which alias-analysis does not consider valid.

PR tree-optimization/106892
* tree-predcom.c (ref_at_iteration): Do not associate the
constant part of the offset into the MEM_REF offset
operand, across a non-zero offset.

* gcc.dg/torture/pr106892.c: New testcase.

(cherry picked from commit a8b0b13da7379feb31950a9d2ad74b98a29c547f)
gcc/testsuite/gcc.dg/torture/pr106892.c [new file with mode: 0644]
gcc/tree-predcom.c
This page took 0.065182 seconds and 5 git commands to generate.