diff options
Diffstat (limited to 'gcc/c-objc-common.c')
-rw-r--r-- | gcc/c-objc-common.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/c-objc-common.c b/gcc/c-objc-common.c index e279911..2d67b8f 100644 --- a/gcc/c-objc-common.c +++ b/gcc/c-objc-common.c @@ -133,6 +133,22 @@ inline_forbidden_p (nodep, walk_subtrees, fn) break; + case RECORD_TYPE: + case UNION_TYPE: + /* We cannot inline a function of the form + + void F (int i) { struct S { int ar[i]; } s; } + + Attempting to do so produces a catch-22 in tree-inline.c. + If walk_tree examines the TYPE_FIELDS chain of RECORD_TYPE/ + UNION_TYPE nodes, then it goes into infinite recursion on a + structure containing a pointer to its own type. If it doesn't, + then the type node for S doesn't get adjusted properly when + F is inlined, and we abort in find_function_data. */ + for (t = TYPE_FIELDS (node); t; t = TREE_CHAIN (t)) + if (variably_modified_type_p (TREE_TYPE (t))) + return node; + default: break; } |