diff options
author | Richard Biener <rguenther@suse.de> | 2019-11-20 07:33:19 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2019-11-20 07:33:19 +0000 |
commit | 3e00ba47b932a13b57061b2d2c95c768ab811d1b (patch) | |
tree | bb2b932e36924ca3737f2da2a580c0a839e4b93a /gcc/builtins.c | |
parent | 54bf2539c55b886ea60d407a7ef2f56f0a19e861 (diff) | |
download | gcc-3e00ba47b932a13b57061b2d2c95c768ab811d1b.zip gcc-3e00ba47b932a13b57061b2d2c95c768ab811d1b.tar.gz gcc-3e00ba47b932a13b57061b2d2c95c768ab811d1b.tar.bz2 |
re PR c/92088 (aggregates with VLAs and nested functions are broken)
2019-11-20 Richard Biener <rguenther@suse.de>
PR c/92088
c/
* c-decl.c (grokdeclarator): Prevent inlining of nested
function with VLA arguments.
* builtins.c (compute_objsize): Deal with VLAs.
* gcc.dg/torture/pr92088-1.c: New testcase.
* gcc.dg/torture/pr92088-2.c: Likewise.
From-SVN: r278477
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c index f94151b..50909af 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -3707,7 +3707,8 @@ compute_objsize (tree dest, int ostype, tree *pdecl /* = NULL */) if (DECL_P (ref)) { *pdecl = ref; - return DECL_SIZE_UNIT (ref); + if (tree size = DECL_SIZE_UNIT (ref)) + return TREE_CODE (size) == INTEGER_CST ? size : NULL_TREE; } tree type = TREE_TYPE (dest); |