aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-decl.c
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2021-05-13 10:38:09 -0600
committerMartin Sebor <msebor@redhat.com>2021-05-13 10:38:09 -0600
commit957c437363f139313b2c0b2c93ca985df1d98ad2 (patch)
treeaae17b6fb8de1eefd1af1532e7d13029d46b9e5f /gcc/c/c-decl.c
parentd80aeff0bf2f455e9099def756f612bfbcd2cb0d (diff)
downloadgcc-957c437363f139313b2c0b2c93ca985df1d98ad2.zip
gcc-957c437363f139313b2c0b2c93ca985df1d98ad2.tar.gz
gcc-957c437363f139313b2c0b2c93ca985df1d98ad2.tar.bz2
PR c/100550 - ICE: in fold_convert_loc with function call VLA argument
gcc/c/ChangeLog: PR c/100550 * c-decl.c (get_parm_array_spec): Avoid erroneous VLA bounds. gcc/testsuite/ChangeLog: PR c/100550 * gcc.dg/Wvla-parameter-9.c: New test.
Diffstat (limited to 'gcc/c/c-decl.c')
-rw-r--r--gcc/c/c-decl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index 3ea4708..53b2b5b 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -5856,6 +5856,9 @@ get_parm_array_spec (const struct c_parm *parm, tree attrs)
spec += buf;
break;
}
+ else if (!INTEGRAL_TYPE_P (TREE_TYPE (nelts)))
+ /* Avoid invalid NELTS. */
+ return attrs;
/* Each variable VLA bound is represented by a dollar sign. */
spec += "$";