Re: [committed] Fix up duplicated duplicated words in comments

2022-11-28 Thread Andrew Pinski via Gcc-patches
On Mon, Mar 7, 2022 at 6:06 AM Jakub Jelinek via Gcc-patches
 wrote:
>
> Hi!
>
> Like in r10-7215-g700d4cb08c88aec37c13e21e63dd61fd698baabc 2 years ago,
> I've run
> grep -v 'long long\|optab optab\|template template\|double double' 
> *.{[chS],cc} */*.{[chS],cc} *.def config/*/* 2>/dev/null | grep ' 
> \([a-zA-Z]\+\) \1 '

Some small changes to this shell command for next time:
grep -vi 'long long\|optab optab\|template template\|double double'
*.{[chS],cc} */*.{[chS],cc} *.def config/*/* *.pd 2>/dev/null | grep
-i ' \([a-zA-Z]\+\) \1 '

Adding .pd and doing a case insensitive grep would have found the fix
I had committed at
https://gcc.gnu.org/pipermail/gcc-patches/2022-November/607425.html .
The case insensitive grep increases the number of false positives
though but I am not the best person for grep and the case where we had
"mode MODE" which shows up
in the comments of the function calls.

Thanks,
Andrew Pinski


> and for the cases that looked clearly wrong changed them, mostly by removing
> one of the duplicated words but in some cases with other changes.
>
> Committed to trunk as obvious.
>
> 2022-03-07  Jakub Jelinek  
>
> gcc/
> * tree-ssa-propagate.cc: Fix up duplicated word issue in a comment.
> * config/riscv/riscv.cc: Likewise.
> * config/darwin.h: Likewise.
> * config/i386/i386.cc: Likewise.
> * config/aarch64/thunderx3t110.md: Likewise.
> * config/aarch64/fractional-cost.h: Likewise.
> * config/vax/vax.cc: Likewise.
> * config/rs6000/pcrel-opt.md: Likewise.
> * config/rs6000/predicates.md: Likewise.
> * ctfc.h: Likewise.
> * tree-ssa-uninit.cc: Likewise.
> * value-relation.h: Likewise.
> * gimple-range-gori.cc: Likewise.
> * ipa-polymorphic-call.cc: Likewise.
> * pointer-query.cc: Likewise.
> * ipa-sra.cc: Likewise.
> * internal-fn.cc: Likewise.
> * varasm.cc: Likewise.
> * gimple-ssa-warn-access.cc: Likewise.
> gcc/analyzer/
> * store.cc: Fix up duplicated word issue in a comment.
> * analyzer.cc: Likewise.
> * engine.cc: Likewise.
> * sm-taint.cc: Likewise.
> gcc/c-family/
> * c-attribs.cc: Fix up duplicated word issue in a comment.
> gcc/cp/
> * cvt.cc: Fix up duplicated word issue in a comment.
> * pt.cc: Likewise.
> * module.cc: Likewise.
> * coroutines.cc: Likewise.
> gcc/fortran/
> * trans-expr.cc: Fix up duplicated word issue in a comment.
> * gfortran.h: Likewise.
> * scanner.cc: Likewise.
> gcc/jit/
> * libgccjit.h: Fix up duplicated word issue in a comment.
>
> --- gcc/tree-ssa-propagate.cc.jj2022-01-18 11:59:00.090974799 +0100
> +++ gcc/tree-ssa-propagate.cc   2022-03-07 14:33:28.033829512 +0100
> @@ -697,7 +697,7 @@ private:
>  gimple_stmt_iterator new_gsi);
>  };
>
> -/* Call post_new_stmt for each each new statement that has been added
> +/* Call post_new_stmt for each new statement that has been added
> to the current BB.  OLD_GSI is the statement iterator before the BB
> changes ocurred.  NEW_GSI is the iterator which may contain new
> statements.  */
> --- gcc/config/riscv/riscv.cc.jj2022-02-04 14:36:54.467612813 +0100
> +++ gcc/config/riscv/riscv.cc   2022-03-07 14:50:54.717372413 +0100
> @@ -4984,7 +4984,7 @@ riscv_option_override (void)
>  target_flags |= MASK_FDIV;
>
>/* Handle -mtune, use -mcpu if -mtune is not given, and use default -mtune
> - if -mtune and -mcpu both not not given.  */
> + if -mtune and -mcpu both not given.  */
>cpu = riscv_parse_tune (riscv_tune_string ? riscv_tune_string :
>   (riscv_cpu_string ? riscv_cpu_string :
>RISCV_TUNE_STRING_DEFAULT));
> --- gcc/config/darwin.h.jj  2022-01-18 11:58:59.078989257 +0100
> +++ gcc/config/darwin.h 2022-03-07 14:36:18.924463533 +0100
> @@ -340,7 +340,7 @@ extern GTY(()) int darwin_ms_struct;
>  " %:version-compare(>= 10.6 mmacosx-version-min= -no_compact_unwind) "
>
>  /* In Darwin linker specs we can put -lcrt0.o and ld will search the library
> -   path for crt0.o or -lcrtx.a and it will search for for libcrtx.a.  As for
> +   path for crt0.o or -lcrtx.a and it will search for libcrtx.a.  As for
> other ports, we can also put xxx.{o,a}%s and get the appropriate complete
> startfile absolute directory.  This latter point is important when we want
> to override ld's rule of .dylib being found ahead of .a and the user wants
> --- gcc/config/i386/i386.cc.jj  2022-03-04 09:35:58.674788325 +0100
> +++ gcc/config/i386/i386.cc 2022-03-07 14:50:08.093016106 +0100
> @@ -20334,7 +20334,7 @@ ix86_division_cost (const struct process
>
>  /* Return cost of shift in MODE.
> If CONSTANT_OP1 is true, the op1 value is known and set in OP1_VAL.
> -   AND_IN_OP1 specify in op1 is result of and and SHIFT_AND_TRUNCATE
> +   

[committed] Fix up duplicated duplicated words in comments

2022-03-07 Thread Jakub Jelinek via Gcc-patches
Hi!

Like in r10-7215-g700d4cb08c88aec37c13e21e63dd61fd698baabc 2 years ago,
I've run
grep -v 'long long\|optab optab\|template template\|double double' *.{[chS],cc} 
*/*.{[chS],cc} *.def config/*/* 2>/dev/null | grep ' \([a-zA-Z]\+\) \1 '
and for the cases that looked clearly wrong changed them, mostly by removing
one of the duplicated words but in some cases with other changes.

Committed to trunk as obvious.

2022-03-07  Jakub Jelinek  

gcc/
* tree-ssa-propagate.cc: Fix up duplicated word issue in a comment.
* config/riscv/riscv.cc: Likewise.
* config/darwin.h: Likewise.
* config/i386/i386.cc: Likewise.
* config/aarch64/thunderx3t110.md: Likewise.
* config/aarch64/fractional-cost.h: Likewise.
* config/vax/vax.cc: Likewise.
* config/rs6000/pcrel-opt.md: Likewise.
* config/rs6000/predicates.md: Likewise.
* ctfc.h: Likewise.
* tree-ssa-uninit.cc: Likewise.
* value-relation.h: Likewise.
* gimple-range-gori.cc: Likewise.
* ipa-polymorphic-call.cc: Likewise.
* pointer-query.cc: Likewise.
* ipa-sra.cc: Likewise.
* internal-fn.cc: Likewise.
* varasm.cc: Likewise.
* gimple-ssa-warn-access.cc: Likewise.
gcc/analyzer/
* store.cc: Fix up duplicated word issue in a comment.
* analyzer.cc: Likewise.
* engine.cc: Likewise.
* sm-taint.cc: Likewise.
gcc/c-family/
* c-attribs.cc: Fix up duplicated word issue in a comment.
gcc/cp/
* cvt.cc: Fix up duplicated word issue in a comment.
* pt.cc: Likewise.
* module.cc: Likewise.
* coroutines.cc: Likewise.
gcc/fortran/
* trans-expr.cc: Fix up duplicated word issue in a comment.
* gfortran.h: Likewise.
* scanner.cc: Likewise.
gcc/jit/
* libgccjit.h: Fix up duplicated word issue in a comment.

--- gcc/tree-ssa-propagate.cc.jj2022-01-18 11:59:00.090974799 +0100
+++ gcc/tree-ssa-propagate.cc   2022-03-07 14:33:28.033829512 +0100
@@ -697,7 +697,7 @@ private:
 gimple_stmt_iterator new_gsi);
 };
 
-/* Call post_new_stmt for each each new statement that has been added
+/* Call post_new_stmt for each new statement that has been added
to the current BB.  OLD_GSI is the statement iterator before the BB
changes ocurred.  NEW_GSI is the iterator which may contain new
statements.  */
--- gcc/config/riscv/riscv.cc.jj2022-02-04 14:36:54.467612813 +0100
+++ gcc/config/riscv/riscv.cc   2022-03-07 14:50:54.717372413 +0100
@@ -4984,7 +4984,7 @@ riscv_option_override (void)
 target_flags |= MASK_FDIV;
 
   /* Handle -mtune, use -mcpu if -mtune is not given, and use default -mtune
- if -mtune and -mcpu both not not given.  */
+ if -mtune and -mcpu both not given.  */
   cpu = riscv_parse_tune (riscv_tune_string ? riscv_tune_string :
  (riscv_cpu_string ? riscv_cpu_string :
   RISCV_TUNE_STRING_DEFAULT));
--- gcc/config/darwin.h.jj  2022-01-18 11:58:59.078989257 +0100
+++ gcc/config/darwin.h 2022-03-07 14:36:18.924463533 +0100
@@ -340,7 +340,7 @@ extern GTY(()) int darwin_ms_struct;
 " %:version-compare(>= 10.6 mmacosx-version-min= -no_compact_unwind) "
 
 /* In Darwin linker specs we can put -lcrt0.o and ld will search the library
-   path for crt0.o or -lcrtx.a and it will search for for libcrtx.a.  As for
+   path for crt0.o or -lcrtx.a and it will search for libcrtx.a.  As for
other ports, we can also put xxx.{o,a}%s and get the appropriate complete
startfile absolute directory.  This latter point is important when we want
to override ld's rule of .dylib being found ahead of .a and the user wants
--- gcc/config/i386/i386.cc.jj  2022-03-04 09:35:58.674788325 +0100
+++ gcc/config/i386/i386.cc 2022-03-07 14:50:08.093016106 +0100
@@ -20334,7 +20334,7 @@ ix86_division_cost (const struct process
 
 /* Return cost of shift in MODE.
If CONSTANT_OP1 is true, the op1 value is known and set in OP1_VAL.
-   AND_IN_OP1 specify in op1 is result of and and SHIFT_AND_TRUNCATE
+   AND_IN_OP1 specify in op1 is result of AND and SHIFT_AND_TRUNCATE
if op1 is a result of subreg.
 
SKIP_OP0/1 is set to true if cost of OP0/1 should be ignored.  */
--- gcc/config/aarch64/thunderx3t110.md.jj  2022-01-11 23:11:21.68935 
+0100
+++ gcc/config/aarch64/thunderx3t110.md 2022-03-07 14:47:39.710064661 +0100
@@ -138,7 +138,7 @@ (define_insn_reservation "thunderx3t110_
logic_shift_imm,logics_shift_imm"))
   "thunderx3t110_i01")
 
-; we are going for the the optimistic answer (13)
+; we are going for the optimistic answer (13)
 ; for now, the worst case is 23
 (define_insn_reservation "thunderx3t110_div" 13
   (and (eq_attr "tune" "thunderx3t110")
--- gcc/config/aarch64/fractional-cost.h.jj 2022-01-11 23:11:21.687300033 
+0100
+++ gcc/config/aarch64/fractional-cost.h2022-03-07 

[committed] Fix up duplicated duplicated words in comments

2020-03-18 Thread Jakub Jelinek via Gcc-patches
Hi!

Another set of duplicated word fixes for things I've missed last time.
These include e.g. *.cc files I forgot about, or duplicated words at the start
or end of line.

Tested on x86_64-linux, committed to trunk as obvious.

2020-03-18  Jakub Jelinek  

* asan.c (get_mem_refs_of_builtin_call): Fix up duplicated word issue
in a comment.
* config/arc/arc.c (frame_stack_add): Likewise.
* gimple-loop-versioning.cc (loop_versioning::analyze_arbitrary_term):
Likewise.
* ipa-predicate.c (predicate::remap_after_inlining): Likewise.
* tree-ssa-strlen.h (handle_printf_call): Likewise.
* tree-ssa-strlen.c (is_strlen_related_p): Likewise.
* optinfo-emit-json.cc (optrecord_json_writer::add_record): Likewise.
analyzer/
* sm-malloc.cc (malloc_state_machine::on_stmt): Fix up duplicated word
issue in a comment.
* region-model.cc (region_model::make_region_for_unexpected_tree_code,
region_model::delete_region_and_descendents): Likewise.
* engine.cc (class exploded_cluster): Likewise.
* diagnostic-manager.cc (class path_builder): Likewise.
cp/
* constraint.cc (resolve_function_concept_check, subsumes_constraints,
strictly_subsumes): Fix up duplicated word issue in a comment.
* coroutines.cc (build_init_or_final_await, captures_temporary):
Likewise.
* logic.cc (dnf_size_r, cnf_size_r): Likewise.
* pt.c (append_type_to_template_for_access_check): Likewise.
d/
* expr.cc (ExprVisitor::visit (CatAssignExp *)): Fix up duplicated
word issue in a comment.
* d-target.cc (Target::FPTypeProperties::max): Likewise.
fortran/
* class.c (generate_finalization_wrapper): Fix up duplicated word
issue in a comment.
* trans-types.c (gfc_get_nodesc_array_type): Likewise.

--- gcc/asan.c.jj   2020-01-12 11:54:36.191416758 +0100
+++ gcc/asan.c  2020-03-18 11:40:49.402322262 +0100
@@ -794,7 +794,7 @@ get_mem_refs_of_builtin_call (gcall *cal
   handle_builtin_alloca (call, iter);
   break;
 /* And now the __atomic* and __sync builtins.
-   These are handled differently from the classical memory memory
+   These are handled differently from the classical memory
access builtins above.  */
 
 case BUILT_IN_ATOMIC_LOAD_1:
--- gcc/config/arc/arc.c.jj 2020-03-14 08:14:47.063741917 +0100
+++ gcc/config/arc/arc.c2020-03-18 11:30:29.758456109 +0100
@@ -2607,7 +2607,7 @@ frame_stack_add (HOST_WIDE_INT offset)
register.
 
During compilation of a function the frame size is evaluated
-   multiple times, it is not until the reload pass is complete the the
+   multiple times, it is not until the reload pass is complete the
frame size is considered fixed (it is at this point that space for
all spills has been allocated).  However the frame_pointer_needed
variable is not set true until the register allocation pass, as a
--- gcc/cp/constraint.cc.jj 2020-03-18 08:52:00.401441356 +0100
+++ gcc/cp/constraint.cc2020-03-18 11:32:52.317354771 +0100
@@ -316,7 +316,7 @@ resolve_function_concept_overload (tree
   return cands;
 }
 
-/* Determine if the the call expression CALL is a constraint check, and
+/* Determine if the call expression CALL is a constraint check, and
return the concept declaration and arguments being checked. If CALL
does not denote a constraint check, return NULL.  */
 
@@ -2958,7 +2958,7 @@ equivalently_constrained (tree d1, tree
  Partial ordering of constraints
 ---*/
 
-/* Returns true when the the constraints in A subsume those in B.  */
+/* Returns true when the constraints in A subsume those in B.  */
 
 bool
 subsumes_constraints (tree a, tree b)
@@ -2968,7 +2968,7 @@ subsumes_constraints (tree a, tree b)
   return subsumes (a, b);
 }
 
-/* Returns true when the the constraints in CI (with arguments
+/* Returns true when the constraints in CI (with arguments
ARGS) strictly subsume the associated constraints of TMPL.  */
 
 bool
--- gcc/cp/coroutines.cc.jj 2020-03-15 22:35:30.361489995 +0100
+++ gcc/cp/coroutines.cc2020-03-18 11:36:40.804986823 +0100
@@ -2466,7 +2466,7 @@ build_init_or_final_await (location_t lo
 return error_mark_node;
 
   /* So build the co_await for this */
-  /* For initial/final suspends the call is is "a" per [expr.await] 3.2.  */
+  /* For initial/final suspends the call is "a" per [expr.await] 3.2.  */
   return build_co_await (loc, setup_call, (is_final ? FINAL_SUSPEND_POINT
: INITIAL_SUSPEND_POINT));
 }
@@ -2547,7 +2547,7 @@ static tree
 captures_temporary (tree *stmt, int *do_subtree, void *d)
 {
   /* Stop recursing if we see an await expression, the subtrees
- of that will be handled when it it processed.  */
+ of that will be handled when it is