summaryrefslogtreecommitdiff
path: root/gcc/objc
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-20 16:41:48 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-20 16:41:48 +0000
commitf5d156fd00f390d9b1b9686e261c45ba9ee24102 (patch)
treee2e44d98a3c2439eda0265c0bce9ef5990fc410d /gcc/objc
parent3472707ff105a1428957d98eb77b6dae29b74097 (diff)
downloadgcc-f5d156fd00f390d9b1b9686e261c45ba9ee24102.tar.gz
PR c/12913
* c-tree.h (struct c_label_list): Update comment. (struct c_label_context): Rename to struct c_label_context_se. (label_context_stack): Rename to label_context_stack_se. (C_DECL_UNJUMPABLE_VM, C_DECL_UNDEFINABLE_VM, struct c_label_context_vm, label_context_stack_vm, c_begin_vm_scope, c_end_vm_scope): New. (C_DECL_DECLARED_BUILTIN, C_DECL_USED): Use FUNCTION_DECL_CHECK. * c-decl.c (pop_scope): Call c_end_vm_scope. (pushdecl): Call c_begin_vm_scope for variably modified declarations. (define_label): Check for jumping into scope of identifier with variably modified type. Push label on stack for those defined at current context of identifiers with variably modified type. (start_function): Create stack level for context of identifiers with variably modified type. (finish_function): Pop stack level for context of identifiers with variably modified type. * c-typeck.c (label_context_stack): Rename to label_context_stack_se. (label_context_stack_vm, c_begin_vm_scope, c_end_vm_scope): New. (c_finish_goto_label): Check for jumping into scope of identifier with variably modified type. Push label on stack for those jumped to from current context of identifiers with variably modified type. (struct c_switch): Add blocked_vm. (c_start_case): Initialize blocked_vm. (do_case): Check blocked_vm. (c_finish_case): Add comment. (c_begin_stmt_expr, c_finish_stmt_expr): Update for renamed variable label_context_stack. objc: * objc-act.c (objc_start_function): Create stack level for context of identifiers with variably modified type. testsuite: * gcc.dg/c99-vla-jump-1.c, gcc.dg/c99-vla-jump-2.c, gcc.dg/c99-vla-jump-3.c, gcc.dg/c99-vla-jump-4.c, gcc.dg/c99-vla-jump-5.c: New tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98464 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/objc')
-rw-r--r--gcc/objc/ChangeLog6
-rw-r--r--gcc/objc/objc-act.c19
2 files changed, 19 insertions, 6 deletions
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index 8d7a904e50a..01c8a2bb190 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,9 @@
+2005-04-20 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR c/12913
+ * objc-act.c (objc_start_function): Create stack level for context
+ of identifiers with variably modified type.
+
2005-03-30 Joseph S. Myers <joseph@codesourcery.com>
PR c/772
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 986fb9f24ba..62d5c84f9d8 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -7666,12 +7666,19 @@ objc_start_function (tree name, tree type, tree attrs,
cplus_decl_attributes (&fndecl, attrs, 0);
start_preparsed_function (fndecl, attrs, /*flags=*/SF_DEFAULT);
#else
- struct c_label_context *nstack;
- nstack = XOBNEW (&parser_obstack, struct c_label_context);
- nstack->labels_def = NULL;
- nstack->labels_used = NULL;
- nstack->next = label_context_stack;
- label_context_stack = nstack;
+ struct c_label_context_se *nstack_se;
+ struct c_label_context_vm *nstack_vm;
+ nstack_se = XOBNEW (&parser_obstack, struct c_label_context_se);
+ nstack_se->labels_def = NULL;
+ nstack_se->labels_used = NULL;
+ nstack_se->next = label_context_stack_se;
+ label_context_stack_se = nstack_se;
+ nstack_vm = XOBNEW (&parser_obstack, struct c_label_context_vm);
+ nstack_vm->labels_def = NULL;
+ nstack_vm->labels_used = NULL;
+ nstack_vm->scope = 0;
+ nstack_vm->next = label_context_stack_vm;
+ label_context_stack_vm = nstack_vm;
decl_attributes (&fndecl, attrs, 0);
announce_function (fndecl);
DECL_INITIAL (fndecl) = error_mark_node;