diff options
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); } |