tree-optimization/104064 - UBSAN issue in vect dataref analysis
authorRichard Biener <rguenther@suse.de>
Tue, 18 Jan 2022 08:06:13 +0000 (09:06 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 18 Jan 2022 09:27:56 +0000 (10:27 +0100)
commit00dc7877ee02634d4837d024e36b55bef6b9d49c
treef0a89f33e9515536acaac397db675ba7fd87466f
parentff7aeceb6b3a476c3bac66a7f39a5ef4240206fc
tree-optimization/104064 - UBSAN issue in vect dataref analysis

Since we order DRs after DR_INIT we know the difference will be
positive and thus can avoid signed overflow issues by using
unsigned arithmetic to produce the known unsigned result.

2022-01-18  Richard Biener  <rguenther@suse.de>

PR tree-optimization/104064
* tree-vect-data-refs.cc (vect_analyze_data_ref_accesses): Check
DR_INIT fits in a signed HWI, represent the difference from the
first DR in unsigned.
gcc/tree-vect-data-refs.cc