tree-optimization/93508 - make VN translate through _chk and valueize length
authorRichard Biener <rguenther@suse.de>
Thu, 27 Feb 2020 12:46:34 +0000 (13:46 +0100)
committerRichard Biener <rguenther@suse.de>
Thu, 27 Feb 2020 12:47:50 +0000 (13:47 +0100)
commite431546ff9f1367538ed1307a1c98fa32fec7a8a
treeae39a5ce6b1bfd253c4f637ff1d309e0f5df0654
parente840185b31e40466e1575507200e1600e2343454
tree-optimization/93508 - make VN translate through _chk and valueize length

Value-numbering failed to handle __builtin_{memcpy,memset,...}_chk
variants when removing abstraction and also failed to use the
value-numbering lattice when requiring the length argument of the
call to be constant.

2020-02-27  Richard Biener  <rguenther@suse.de>

PR tree-optimization/93508
* tree-ssa-sccvn.c (vn_reference_lookup_3): Handle _CHK like
non-_CHK variants.  Valueize their length arguments.

* gcc.dg/tree-ssa/ssa-fre-85.c: New testcase.
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-87.c [new file with mode: 0644]
gcc/tree-ssa-sccvn.c