Hi! The following patch fixes 2 -Wleading-whitespace=blanks issues in gcc/, include/, libiberty/, libcpp/, libgcc/ and libstdc++-v3/ One is the ../../gcc/c/c-typeck.cc:196:1: warning: whitespace other than spaces and tabs in leading whitespace [-Wleading-whitespace=] case (where there was a form-feed immediately followed by a comment rather than having a new-line separating it) and then tons of warning: tab after space in leading whitespace [-Wleading-whitespace=] warnings. For the latter I've used find -name \*.h -o -name \*.c -o -name \*.cc | grep -v testsuite/ | grep -v gofrontend/ | xargs grep -l '^[ ]* ' to find affected files (also left out the m2 'do not edit' files) and in an editor searched for the same regex and fixed up manually.
xz compressed patch attached, followed by -ubp diff which shows that a few changes beyond just space removal or replacement by tab were done while I was at it, but only very few. Ok for trunk if this passes bootstrap/regtest? 2024-10-25 Jakub Jelinek <ja...@redhat.com> gcc/ * cfgrtl.cc: Fix space after tab issues in leading whitespace. * tree-ssa-loop-unswitch.cc: Likewise. * explow.cc: Likewise. * ipa-inline-analysis.cc: Likewise. * bb-reorder.cc: Likewise. * tree-stdarg.cc: Likewise. * ipa-modref.cc: Likewise. * cfgloopmanip.cc: Likewise. * simplify-rtx.cc: Likewise. * hash-map.h: Likewise. * sched-ebb.cc: Likewise. * tree-cfgcleanup.cc: Likewise. * tree-vect-data-refs.cc: Likewise. * genmatch.cc: Likewise. * vec.h: Likewise. * passes.cc: Likewise. * gcov-dump.cc: Likewise. * symtab.cc: Likewise. * trans-mem.cc: Likewise. * except.cc: Likewise. * ipa-prop.cc: Likewise. * tree-vect-loop.cc: Likewise. * tree-nested.cc: Likewise. * gimple-fold.cc: Likewise. * ipa-polymorphic-call.cc: Likewise. * gimple.cc: Likewise. * ipa-pure-const.cc: Likewise. * ira-emit.cc: Likewise. * tree.cc: Likewise. * web.cc: Likewise. * fold-const.cc: Likewise. * tree-vect-patterns.cc: Likewise. * combine.cc: Likewise. * tree-vrp.cc: Likewise. * jump.cc: Likewise. * loop-iv.cc: Likewise. * config/alpha/alpha.cc: Likewise. * config/iq2000/iq2000.cc: Likewise. * config/darwin.h: Likewise. * config/pa/pa.cc: Likewise. * config/c6x/c6x.cc: Likewise. * config/rx/linux.h: Likewise. * config/rx/rx.h: Likewise. * config/ia64/ia64.cc: Likewise. * config/ia64/ia64.h: Likewise. * config/rl78/rl78.cc: Likewise. * config/rl78/rl78.h: Likewise. * config/arm/unknown-elf.h: Likewise. * config/arm/arm.cc: Likewise. * config/sh/sh.cc: Likewise. * config/sh/sh_treg_combine.cc: Likewise. * config/frv/frv-protos.h: Likewise. * config/frv/frv.cc: Likewise. * config/frv/frv.h: Likewise. * config/bfin/bfin.h: Likewise. * config/bfin/bfin.cc: Likewise. * config/i386/i386.h: Likewise. * config/i386/openbsdelf.h: Likewise. * config/i386/avx10_2bf16intrin.h: Likewise. * config/i386/xopintrin.h: Likewise. * config/i386/gfniintrin.h: Likewise. * config/i386/host-mingw32.cc: Likewise. * config/i386/x86-tune-costs.h: Likewise. * config/i386/i386-expand.cc: Likewise. * config/i386/i386.cc: Likewise. * config/i386/avx10_2convertintrin.h: Likewise. * config/i386/avx10_2-512convertintrin.h: Likewise. * config/i386/i386-builtins.cc: Likewise. * config/i386/avx10_2minmaxintrin.h: Likewise. * config/i386/i386-features.cc: Likewise. * config/mingw/winnt.cc: Likewise. * config/h8300/h8300.cc: Likewise. * config/sparc/sparc.cc: Likewise. * config/gcn/gcn.cc: Likewise. * config/nios2/nios2-opts.h: Likewise. * config/pdp11/pdp11.cc: Likewise. * config/mn10300/mn10300.h: Likewise. * config/rs6000/rs6000-builtin.cc: Likewise. * config/rs6000/ppu_intrinsics.h: Likewise. * config/rs6000/rs6000-logue.cc: Likewise. * config/rs6000/rs6000-call.cc: Likewise. * config/rs6000/rs6000.cc: Likewise. * config/mips/mips.cc: Likewise. * config/mips/mips.h: Likewise. * config/mcore/mcore.cc: Likewise. * config/mcore/mcore.h: Likewise. * config/fr30/fr30.cc: Likewise. * config/darwin.cc: Likewise. * config/vxworks.h: Likewise. * config/microblaze/microblaze.cc: Likewise. * config/m68k/m68k.h: Likewise. * config/m68k/m68k.cc: Likewise. * tree-data-ref.cc: Likewise. * expr.cc: Likewise. * tree-scalar-evolution.cc: Likewise. * ipa-devirt.cc: Likewise. * gimplify.cc: Likewise. * loop-doloop.cc: Likewise. * tree-streamer-out.cc: Likewise. * df-problems.cc: Likewise. * tree-ssa-loop-niter.cc: Likewise. * tree-ssa-loop-ivopts.cc: Likewise. * tree-ssa-threadupdate.cc: Likewise. * attribs.cc: Likewise. * tree-ssa-threadedge.cc: Likewise. * profile.cc: Likewise. * sel-sched-ir.cc: Likewise. * tree-ssa-loop-ivcanon.cc: Likewise. * ira.cc: Likewise. * tree-switch-conversion.cc: Likewise. * sancov.cc: Likewise. * ipa-fnsummary.cc: Likewise. * gcc.cc: Likewise. * tree-ssa-sccvn.cc: Likewise. * tree-streamer-in.cc: Likewise. * gcov-io.h: Likewise. * df-core.cc: Likewise. * predict.cc: Likewise. * tree-vect-generic.cc: Likewise. * asan.cc: Likewise. * incpath.cc: Likewise. * ira-color.cc: Likewise. * ipa-utils.cc: Likewise. * tree-ssa-live.h: Likewise. * gimple-lower-bitint.cc: Likewise. * tree-ssa-loop-prefetch.cc: Likewise. * ipa-visibility.cc: Likewise. * print-tree.cc: Likewise. * tree-ssa-propagate.cc: Likewise. * ddg.cc: Likewise. * tree-ssa-alias.cc: Likewise. * tree-ssa-loop.cc: Likewise. * dse.cc: Likewise. * ira-lives.cc: Likewise. * cgraph.cc: Likewise. * sel-sched-dump.cc: Likewise. * expmed.cc: Likewise. * gimple.h: Likewise. * tree-vect-stmts.cc: Likewise. * function.cc: Likewise. * genautomata.cc: Likewise. * ipa-fnsummary.h: Likewise. * ipa-inline.cc: Likewise. * loop-unroll.cc: Likewise. * convert.cc: Likewise. * genpreds.cc: Likewise. * gengtype.cc: Likewise. * sel-sched-ir.h: Likewise. * gimple-pretty-print.cc: Likewise. * dwarf2out.cc: Likewise. * tree-ssa-ccp.cc: Likewise. * lra-constraints.cc: Likewise. * sel-sched.cc: Likewise. * dwarf2cfi.cc: Likewise. * modulo-sched.cc: Likewise. * ira-costs.cc: Likewise. * reload.cc: Likewise. * ipa.cc: Likewise. * loop-invariant.cc: Likewise. * genattrtab.cc: Likewise. * ira-build.cc: Likewise. * ggc-page.cc: Likewise. * reginfo.cc: Likewise. * gensupport.cc: Likewise. * tree-inline.cc: Likewise. * coverage.cc: Likewise. * tree-ssa-math-opts.cc: Likewise. * tree-ssa-live.cc: Likewise. * alias.cc: Likewise. * loop-init.cc: Likewise. * gimple-ssa-isolate-paths.cc: Likewise. * optabs.cc: Likewise. * ubsan.cc: Likewise. * tree-pretty-print.cc: Likewise. * mode-switching.cc: Likewise. * builtins.cc: Likewise. * rtlanal.cc: Likewise. * common/config/s390/s390-common.cc: Likewise. * common/config/bfin/bfin-common.cc: Likewise. * fixed-value.cc: Likewise. * tree-chrec.cc: Likewise. * omp-low.cc: Likewise. * wide-int-print.cc: Likewise. * tree-ssa-strlen.cc: Likewise. * dominance.cc: Likewise. * tree-ssa-forwprop.cc: Likewise. * gimple-ssa-warn-restrict.cc: Likewise. * lto-streamer-in.cc: Likewise. * internal-fn.cc: Likewise. gcc/ada/ * adaint.c: Fix space after tab issues in leading whitespace. * gcc-interface/decl.cc: Likewise. * gcc-interface/utils.cc: Likewise. * raise-gcc.c: Likewise. gcc/analyzer/ * exploded-graph.h: Fix space after tab issues in leading whitespace. * supergraph.cc: Likewise. gcc/c-family/ * c-omp.cc: Fix space after tab issues in leading whitespace. * c-common.cc: Likewise. * c-format.cc: Likewise. gcc/c/ * c-parser.cc: Fix space after tab issues in leading whitespace. * c-decl.cc: Likewise. * c-tree.h: Likewise. * c-typeck.cc: Likewise. Add new-line after form-feed. gcc/cp/ * decl.cc: Fix space after tab issues in leading whitespace. * tree.cc: Likewise. * module.cc: Likewise. * name-lookup.cc: Likewise. * parser.cc: Likewise. * error.cc: Likewise. * semantics.cc: Likewise. * cp-tree.h: Likewise. * init.cc: Likewise. * class.cc: Likewise. * lambda.cc: Likewise. * typeck.cc: Likewise. * cvt.cc: Likewise. * pt.cc: Likewise. gcc/fortran/ * decl.cc: Fix space after tab issues in leading whitespace. * primary.cc: Likewise. * trans-intrinsic.cc: Likewise. * trans-expr.cc: Likewise. * resolve.cc: Likewise. * trans-array.cc: Likewise. * trans-decl.cc: Likewise. * module.cc: Likewise. * expr.cc: Likewise. * target-memory.cc: Likewise. * trans-types.cc: Likewise. * simplify.cc: Likewise. * check.cc: Likewise. * symbol.cc: Likewise. * class.cc: Likewise. * trans-openmp.cc: Likewise. * interface.cc: Likewise. * intrinsic.cc: Likewise. * arith.cc: Likewise. gcc/go/ * go-gcc.cc: Fix space after tab issues in leading whitespace. gcc/lto/ * lto-partition.cc: Fix space after tab issues in leading whitespace. * lto-symtab.cc: Likewise. include/ * libiberty.h: Fix space after tab issues in leading whitespace. libcpp/ * macro.cc: Fix space after tab issues in leading whitespace. * expr.cc: Likewise. * lex.cc: Likewise. * directives.cc: Likewise. * pch.cc: Likewise. libgcc/ * fp-bit.c: Fix space after tab issues in leading whitespace. * config/ia64/unwind-ia64.c: Likewise. * config/arm/unwind-arm.c: Likewise. * gthr.h: Likewise. libgcc/config/libbid/ * bid128_fma.c: Fix space after tab issues in leading whitespace. libiberty/ * simple-object.c: Fix space after tab issues in leading whitespace. * pex-djgpp.c: Likewise. * pex-common.c: Likewise. * ffs.c: Likewise. * simple-object-xcoff.c: Likewise. * regex.c: Likewise. * cp-demangle.c: Likewise. libstdc++-v3/ * config/locale/dragonfly/numeric_members.cc: Fix space after tab issues in leading whitespace. * config/locale/dragonfly/time_members.cc: Likewise. * include/parallel/unique_copy.h: Likewise. * include/parallel/partition.h: Likewise. * include/parallel/random_shuffle.h: Likewise. * include/parallel/losertree.h: Likewise. * include/parallel/set_operations.h: Likewise. * include/parallel/multiway_merge.h: Likewise. * include/parallel/balanced_quicksort.h: Likewise. * include/bits/streambuf_iterator.h: Likewise. * include/bits/unordered_set.h: Likewise. * include/bits/stl_vector.h: Likewise. * include/bits/uses_allocator.h: Likewise. * include/tr1/hashtable.h: Likewise. * include/ext/rc_string_base.h: Likewise. * src/c++98/mt_allocator.cc: Likewise. * src/c++11/limits.cc: Likewise. Jakub
gcc15-leading-whitespace-1.patch.xz
Description: application/xz
--- gcc/c/c-typeck.cc +++ gcc/c/c-typeck.cc @@ -194,7 +194,8 @@ remove_c_maybe_const_expr (tree expr) return expr; } -/* This is a cache to hold if two types are seen. */ + +/* This is a cache to hold if two types are seen. */ struct tagged_tu_seen_cache { const struct tagged_tu_seen_cache * next; --- gcc/config/darwin.cc +++ gcc/config/darwin.cc @@ -710,7 +710,8 @@ machopic_indirect_data_reference (rtx orig, rtx reg) if (DARWIN_PPC) { /* Create a new register for CSE opportunities. */ - rtx hi_reg = (!can_create_pseudo_p () ? reg : gen_reg_rtx (Pmode)); + rtx hi_reg = (!can_create_pseudo_p () + ? reg : gen_reg_rtx (Pmode)); emit_insn (gen_macho_high (Pmode, hi_reg, orig)); emit_insn (gen_macho_low (Pmode, reg, hi_reg, orig)); return reg; --- gcc/config/i386/i386-builtins.cc +++ gcc/config/i386/i386-builtins.cc @@ -2053,9 +2053,7 @@ make_var_decl (tree type, const char *name) { tree new_decl; - new_decl = build_decl (UNKNOWN_LOCATION, - VAR_DECL, - get_identifier(name), + new_decl = build_decl (UNKNOWN_LOCATION, VAR_DECL, get_identifier(name), type); DECL_EXTERNAL (new_decl) = 1; --- gcc/config/mingw/winnt.cc +++ gcc/config/mingw/winnt.cc @@ -808,7 +808,8 @@ mingw_pe_file_end (void) if (!startswith (name, "refptr.")) continue; name += 7; - fprintf (asm_out_file, "\t.section\t.rdata$%s, \"dr\"\n" + fprintf (asm_out_file, + "\t.section\t.rdata$%s, \"dr\"\n" "\t.globl\t%s\n" "\t.linkonce\tdiscard\n", oname, oname); fprintf (asm_out_file, "%s:\n\t.quad\t%s\n", oname, name); --- gcc/config/rs6000/rs6000.cc +++ gcc/config/rs6000/rs6000.cc @@ -20227,8 +20227,8 @@ pad_groups (FILE *dump, int sched_verbose, rtx_insn *prev_head_insn, while (insn != NULL_RTX) { - can_issue_more = - rs6000_variable_issue (dump, sched_verbose, insn, can_issue_more); + can_issue_more + = rs6000_variable_issue (dump, sched_verbose, insn, can_issue_more); group_end = (next_insn == NULL_RTX || GET_MODE (next_insn) == TImode); --- gcc/fold-const.cc +++ gcc/fold-const.cc @@ -9944,14 +9944,16 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0) if (TREE_CODE (arg0) == BIT_XOR_EXPR && (tem = fold_unary_loc (loc, BIT_NOT_EXPR, type, fold_convert_loc (loc, type, - TREE_OPERAND (arg0, 0))))) + TREE_OPERAND (arg0, + 0))))) return fold_build2_loc (loc, BIT_XOR_EXPR, type, tem, fold_convert_loc (loc, type, TREE_OPERAND (arg0, 1))); else if (TREE_CODE (arg0) == BIT_XOR_EXPR && (tem = fold_unary_loc (loc, BIT_NOT_EXPR, type, fold_convert_loc (loc, type, - TREE_OPERAND (arg0, 1))))) + TREE_OPERAND (arg0, + 1))))) return fold_build2_loc (loc, BIT_XOR_EXPR, type, fold_convert_loc (loc, type, TREE_OPERAND (arg0, 0)), tem); --- gcc/genpreds.cc +++ gcc/genpreds.cc @@ -1157,8 +1157,7 @@ write_insn_constraint_len (void) { class constraint_data *c = constraints_by_letter_table[i]; - if (!c - || c->namelen == 1) + if (!c || c->namelen == 1) continue; /* Constraints with multiple characters should have the same --- gcc/ipa-fnsummary.cc +++ gcc/ipa-fnsummary.cc @@ -1711,7 +1711,8 @@ set_cond_stmt_execution_predicate (struct ipa_func_body_info *fbi, { ipa_predicate p = add_condition (summary, params_summary, index, param_type, &aggpos, - ipa_predicate::is_not_constant, NULL_TREE); + ipa_predicate::is_not_constant, + NULL_TREE); e->aux = edge_predicate_pool.allocate (); *(ipa_predicate *) e->aux = p; } --- gcc/ipa-visibility.cc +++ gcc/ipa-visibility.cc @@ -712,8 +712,7 @@ function_and_variable_visibility (bool whole_program) } node->dissolve_same_comdat_group_list (); } - gcc_assert ((!DECL_WEAK (node->decl) - && !DECL_COMDAT (node->decl)) + gcc_assert ((!DECL_WEAK (node->decl) && !DECL_COMDAT (node->decl)) || TREE_PUBLIC (node->decl) || node->weakref || DECL_EXTERNAL (node->decl)); --- gcc/ipa.cc +++ gcc/ipa.cc @@ -146,8 +146,7 @@ process_references (symtab_node *snode, knows about potential references. */ || (VAR_P (node->decl) && (flag_wpa - || flag_incremental_link - == INCREMENTAL_LINK_LTO) + || flag_incremental_link == INCREMENTAL_LINK_LTO) && dyn_cast <varpool_node *> (node) ->ctor_useable_for_folding_p ())))) { --- gcc/lto/lto-symtab.cc +++ gcc/lto/lto-symtab.cc @@ -49,8 +49,7 @@ lto_cgraph_replace_node (struct cgraph_node *node, if (dump_file) { - fprintf (dump_file, "Replacing cgraph node %s by %s" - " for symbol %s\n", + fprintf (dump_file, "Replacing cgraph node %s by %s for symbol %s\n", node->dump_name (), prevailing_node->dump_name (), IDENTIFIER_POINTER ((*targetm.asm_out.mangle_assembler_name) --- gcc/omp-low.cc +++ gcc/omp-low.cc @@ -14400,8 +14400,7 @@ lower_omp_teams (gimple_stmt_iterator *gsi_p, omp_context *ctx) of OMP context, but with make_addressable_vars set. */ static tree -lower_omp_regimplify_p (tree *tp, int *walk_subtrees, - void *data) +lower_omp_regimplify_p (tree *tp, int *walk_subtrees, void *data) { tree t = *tp; --- gcc/tree.cc +++ gcc/tree.cc @@ -11796,8 +11796,7 @@ tree_set_block (tree t, tree b) tree create_artificial_label (location_t loc) { - tree lab = build_decl (loc, - LABEL_DECL, NULL_TREE, void_type_node); + tree lab = build_decl (loc, LABEL_DECL, NULL_TREE, void_type_node); DECL_ARTIFICIAL (lab) = 1; DECL_IGNORED_P (lab) = 1; --- libstdc++-v3/include/parallel/multiway_merge.h +++ libstdc++-v3/include/parallel/multiway_merge.h @@ -390,8 +390,7 @@ namespace __gnu_parallel { if (__seq1 <= __seq2) _GLIBCXX_PARALLEL_DECISION(0,1,2,3) - else - if (__seq2 < __seq0) + else if (__seq2 < __seq0) _GLIBCXX_PARALLEL_DECISION(2,0,1,3) else _GLIBCXX_PARALLEL_DECISION(0,2,1,3)