From: Martin Liska Date: Fri, 7 Oct 2022 08:10:30 +0000 (+0200) Subject: remove dead variables X-Git-Tag: basepoints/gcc-14~4056 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd0e35188f2a40a428314ad10e10ab5b0926f935;p=thirdparty%2Fgcc.git remove dead variables Remove unused variables that are modified but not used. gcc/ChangeLog: * auto-profile.cc (get_inline_stack): Remove unused variable. gcc/objc/ChangeLog: * objc-gnu-runtime-abi-01.cc (generate_static_references): Remove unused variable. --- diff --git a/gcc/auto-profile.cc b/gcc/auto-profile.cc index 6533722817f6..ca48404eaf1c 100644 --- a/gcc/auto-profile.cc +++ b/gcc/auto-profile.cc @@ -388,7 +388,6 @@ get_inline_stack (location_t locus, inline_stack *stack) tree block = LOCATION_BLOCK (locus); if (block && TREE_CODE (block) == BLOCK) { - int level = 0; for (block = BLOCK_SUPERCONTEXT (block); block && (TREE_CODE (block) == BLOCK); block = BLOCK_SUPERCONTEXT (block)) @@ -401,7 +400,6 @@ get_inline_stack (location_t locus, inline_stack *stack) stack->safe_push ( std::make_pair (decl, get_combined_location (locus, decl))); locus = tmp_locus; - level++; } } stack->safe_push ( diff --git a/gcc/objc/objc-gnu-runtime-abi-01.cc b/gcc/objc/objc-gnu-runtime-abi-01.cc index 94133146d8fe..e76c486927e2 100644 --- a/gcc/objc/objc-gnu-runtime-abi-01.cc +++ b/gcc/objc/objc-gnu-runtime-abi-01.cc @@ -1852,7 +1852,7 @@ generate_static_references (void) tree class_name, klass, decl; tree cl_chain, in_chain, type = build_array_type (build_pointer_type (void_type_node), NULL_TREE); - int num_inst, num_class; + int num_class; char buf[BUFSIZE]; vec *decls = NULL; @@ -1861,8 +1861,8 @@ generate_static_references (void) { vec *v = NULL; - for (num_inst = 0, in_chain = TREE_PURPOSE (cl_chain); - in_chain; num_inst++, in_chain = TREE_CHAIN (in_chain)); + for (in_chain = TREE_PURPOSE (cl_chain); + in_chain; in_chain = TREE_CHAIN (in_chain)); snprintf (buf, BUFSIZE, "_OBJC_STATIC_INSTANCES_%d", num_class); decl = start_var_decl (type, buf);