diff options
author | Martin Sebor <msebor@redhat.com> | 2021-07-15 10:11:23 -0600 |
---|---|---|
committer | Martin Sebor <msebor@redhat.com> | 2021-07-15 10:22:06 -0600 |
commit | 98f1f9f38c45218c06200feb1939c9433a2ab6ca (patch) | |
tree | 37cd9c520dba216ab5078e1ae64e83b50ec28c88 /gcc/c/c-decl.c | |
parent | 07bd2703047d222ed7ff189d86350e73c5cc2c9e (diff) | |
download | gcc-98f1f9f38c45218c06200feb1939c9433a2ab6ca.zip gcc-98f1f9f38c45218c06200feb1939c9433a2ab6ca.tar.gz gcc-98f1f9f38c45218c06200feb1939c9433a2ab6ca.tar.bz2 |
Avoid -Wvla-parameter for nontrivial bounds [PR97548].
Resolves:
PR c/101289 - bogus -Wvla-paramater warning when using const for vla param
PR c/97548 - bogus -Wvla-parameter on a bound expression involving a parameter
gcc/c-family/ChangeLog:
PR c/101289
PR c/97548
* c-warn.c (warn_parm_array_mismatch): Use OEP_DECL_NAME.
gcc/c/ChangeLog:
PR c/101289
PR c/97548
* c-decl.c (get_parm_array_spec): Strip nops.
gcc/ChangeLog:
PR c/101289
PR c/97548
* fold-const.c (operand_compare::operand_equal_p): Handle OEP_DECL_NAME.
(operand_compare::verify_hash_value): Same.
* tree-core.h (OEP_DECL_NAME): New.
gcc/testsuite/ChangeLog:
* gcc.dg/Wvla-parameter-12.c: New test.
Diffstat (limited to 'gcc/c/c-decl.c')
-rw-r--r-- | gcc/c/c-decl.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index 983d65e..234ee16 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -5865,6 +5865,7 @@ get_parm_array_spec (const struct c_parm *parm, tree attrs) /* Each variable VLA bound is represented by a dollar sign. */ spec += "$"; + STRIP_NOPS (nelts); vbchain = tree_cons (NULL_TREE, nelts, vbchain); } |