]> git.ipfire.org Git - thirdparty/gcc.git/commit
Avoid -Wvla-parameter for nontrivial bounds [PR97548].
authorMartin Sebor <msebor@redhat.com>
Thu, 15 Jul 2021 16:11:23 +0000 (10:11 -0600)
committerMartin Sebor <msebor@redhat.com>
Thu, 15 Jul 2021 16:22:06 +0000 (10:22 -0600)
commit98f1f9f38c45218c06200feb1939c9433a2ab6ca
tree37cd9c520dba216ab5078e1ae64e83b50ec28c88
parent07bd2703047d222ed7ff189d86350e73c5cc2c9e
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.
gcc/c-family/c-warn.c
gcc/c/c-decl.c
gcc/fold-const.c
gcc/testsuite/gcc.dg/Wvla-parameter-12.c [new file with mode: 0644]
gcc/tree-core.h