diff options
author | Jan Hubicka <jh@suse.cz> | 2020-11-12 14:56:40 +0100 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2020-11-12 14:56:40 +0100 |
commit | 071a31a53388229213f323ecdc680ff8aeda456c (patch) | |
tree | 2827d05e893bf315f87c40de4368e7969438723a /gcc/tree-ssa-alias.c | |
parent | b71ff8c15f5a7d6b1cc1524b4d27843f0d88dbda (diff) | |
download | gcc-071a31a53388229213f323ecdc680ff8aeda456c.zip gcc-071a31a53388229213f323ecdc680ff8aeda456c.tar.gz gcc-071a31a53388229213f323ecdc680ff8aeda456c.tar.bz2 |
Add support for copy specifiers in fnspec
* attr-fnspec.h: Update topleve comment.
(attr_fnspec::arg_direct_p): Accept 1...9.
(attr_fnspec::arg_maybe_written_p): Reject 1...9.
(attr_fnspec::arg_copied_to_arg_p): New member function.
* builtins.c (builtin_fnspec): Update fnspec of block copy.
* tree-ssa-alias.c (attr_fnspec::verify): Update.
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index e64011d..b1e8e5b 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -3797,6 +3797,8 @@ attr_fnspec::verify () default: err = true; } + if (err) + internal_error ("invalid fn spec attribute \"%s\"", str); /* Now check all parameters. */ for (unsigned int i = 0; arg_specified_p (i); i++) @@ -3813,21 +3815,28 @@ attr_fnspec::verify () case 'w': case 'W': case '.': + if ((str[idx + 1] >= '1' && str[idx + 1] <= '9') + || str[idx + 1] == 't') + { + if (str[idx] != 'r' && str[idx] != 'R' + && str[idx] != 'w' && str[idx] != 'W' + && str[idx] != 'o' && str[idx] != 'O') + err = true; + if (str[idx] != 't' + /* Size specified is scalar, so it should be described + by ". " if specified at all. */ + && (arg_specified_p (str[idx + 1] - '1') + && str[arg_idx (str[idx + 1] - '1')] != '.')) + err = true; + } + else if (str[idx + 1] != ' ') + err = true; break; default: - err = true; + if (str[idx] < '1' || str[idx] > '9') + err = true; } - if ((str[idx + 1] >= '1' && str[idx + 1] <= '9') - || str[idx + 1] == 't') - { - if (str[idx] != 'r' && str[idx] != 'R' - && str[idx] != 'w' && str[idx] != 'W' - && str[idx] != 'o' && str[idx] != 'O') - err = true; - } - else if (str[idx + 1] != ' ') - err = true; + if (err) + internal_error ("invalid fn spec attribute \"%s\" arg %i", str, i); } - if (err) - internal_error ("invalid fn spec attribute \"%s\"", str); } |