]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/attr-fnspec.h
tree-optimization/109609 - correctly interpret arg size in fnspec
authorRichard Biener <rguenther@suse.de>
Tue, 25 Apr 2023 12:56:44 +0000 (14:56 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 25 Apr 2023 14:53:06 +0000 (16:53 +0200)
commite8d00353017f895d03a9eabae3506fd126ce1a2d
tree7d3780af9e37ee55cfbc7adf07d90c8513d0cc3c
parent1c101fcfaac8f609d618f83b124bd50aea012132
tree-optimization/109609 - correctly interpret arg size in fnspec

By majority vote and a hint from the API name which is
arg_max_access_size_given_by_arg_p this interprets a memory access
size specified as given as other argument such as for strncpy
in the testcase which has "1cO313" as specifying the _maximum_
size read/written rather than the exact size.  There are two
uses interpreting it that way already and one differing.  The
following adjusts the differing and clarifies the documentation.

PR tree-optimization/109609
* attr-fnspec.h (arg_max_access_size_given_by_arg_p):
Clarify semantics.
* tree-ssa-alias.cc (check_fnspec): Correctly interpret
the size given by arg_max_access_size_given_by_arg_p as
maximum, not exact, size.

* gcc.dg/torture/pr109609.c: New testcase.
gcc/attr-fnspec.h
gcc/testsuite/gcc.dg/torture/pr109609.c [new file with mode: 0644]
gcc/tree-ssa-alias.cc