summaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-11-20 07:33:19 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-11-20 07:33:19 +0000
commit3e00ba47b932a13b57061b2d2c95c768ab811d1b (patch)
treebb2b932e36924ca3737f2da2a580c0a839e4b93a /gcc/builtins.c
parent54bf2539c55b886ea60d407a7ef2f56f0a19e861 (diff)
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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index f94151bd84d..50909af91f9 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);