Hi!
I've added the comment above the new function. I've also removed an old
sentence from a commit message. See the range-diff below. Hopefully
this can get merged before the freeze.
The comment doesn't document two of the function parameters, but I don't
know what they really are, so please amend that if you want. I can't do
much more than this.
This has passed regression testing:
alx@devuan:~/src/gnu/gcc/fwd_incomp$ git log --oneline
gnu/master..fwd_incomp4
ed1686b2ccf5 (HEAD -> fwd_incomp, tag: fwd_incomp4) gcc/: Factor out
helper function
a1b516ee750d gcc/: Reduce scope of local variable (refactor)
0ab2b64884ab Fix typos in comment
040e6772d8fd gcc/: Rename warn_parm_array_mismatch() =>
warn_parms_array_mismatch()
alx@devuan:~/src/gnu/gcc/fwd_incomp$ git reset gnu/master --hard
HEAD is now at ad8de026441c AVR: PR122505 - Fix bloated mulpsi3 in the
wake of hacking around PR118012.
alx@devuan:~/src/gnu/gcc/fwd_incomp$ mkdir ../fwd_incomp4
alx@devuan:~/src/gnu/gcc/fwd_incomp$ cd ../fwd_incomp4/
alx@devuan:~/src/gnu/gcc/fwd_incomp4$ set -o pipefail
alx@devuan:~/src/gnu/gcc/fwd_incomp4$ ../fwd_incomp/configure
--disable-multilib --prefix=/opt/local/gnu/gcc/fwd_incomp4 |& ts -s | tail -n1;
echo $?
00:00:01 config.status: creating Makefile
0
alx@devuan:~/src/gnu/gcc/fwd_incomp4$ make -j24 bootstrap |& ts -s |
tail -n1; echo $?
00:22:46 make[1]: Leaving directory '/srv/alx/src/gnu/gcc/fwd_incomp4'
0
alx@devuan:~/src/gnu/gcc/fwd_incomp4$ make -j24 check |& ts -s | tail
-n1; echo $?
00:38:17 make[1]: Leaving directory '/srv/alx/src/gnu/gcc/fwd_incomp4'
0
alx@devuan:~/src/gnu/gcc/fwd_incomp4$ cd ../fwd_incomp
alx@devuan:~/src/gnu/gcc/fwd_incomp$ git merge --ff-only fwd_incomp4
Updating ad8de026441c..ed1686b2ccf5
Fast-forward
gcc/c-family/c-common.h | 2 +-
gcc/c-family/c-warn.cc | 592
+++++++++++++++++++++++++++++---------------------------
gcc/c/c-decl.cc | 2 +-
gcc/c/c-parser.cc | 2 +-
4 files changed, 306 insertions(+), 292 deletions(-)
alx@devuan:~/src/gnu/gcc/fwd_incomp$ cd ..
alx@devuan:~/src/gnu/gcc$ mv fwd_incomp4/ fwd_incomp4_b4
alx@devuan:~/src/gnu/gcc$ mkdir fwd_incomp4
alx@devuan:~/src/gnu/gcc$ cd fwd_incomp4
alx@devuan:~/src/gnu/gcc/fwd_incomp4$ ../fwd_incomp/configure
--disable-multilib --prefix=/opt/local/gnu/gcc/fwd_incomp4 |& ts -s | tail -n1;
echo $?
00:00:01 config.status: creating Makefile
0
alx@devuan:~/src/gnu/gcc/fwd_incomp4$ make -j24 bootstrap |& ts -s |
tail -n1; echo $?
00:23:04 make[1]: Leaving directory '/srv/alx/src/gnu/gcc/fwd_incomp4'
0
alx@devuan:~/src/gnu/gcc/fwd_incomp4$ make -j24 check |& ts -s | tail
-n1; echo $?
00:36:05 make[1]: Leaving directory '/srv/alx/src/gnu/gcc/fwd_incomp4'
0
alx@devuan:~/src/gnu/gcc/fwd_incomp4$ find -type f | grep '\.sum$' |
while read f; do diff -u ../fwd_incomp4_b4/$f $f; done;
--- ../fwd_incomp4_b4/./x86_64-pc-linux-gnu/libitm/testsuite/libitm.sum
2025-11-02 14:32:15.289683845 +0100
+++ ./x86_64-pc-linux-gnu/libitm/testsuite/libitm.sum 2025-11-02
16:03:09.267365714 +0100
@@ -1,4 +1,4 @@
-Test run by alx on Sun Nov 2 14:32:12 2025
+Test run by alx on Sun Nov 2 16:03:06 2025
Native configuration is x86_64-pc-linux-gnu
=== libitm tests ===
---
../fwd_incomp4_b4/./x86_64-pc-linux-gnu/libatomic/testsuite/libatomic.sum
2025-11-02 14:32:14.086734205 +0100
+++ ./x86_64-pc-linux-gnu/libatomic/testsuite/libatomic.sum
2025-11-02 16:03:08.241460262 +0100
@@ -1,4 +1,4 @@
-Test run by alx on Sun Nov 2 14:32:12 2025
+Test run by alx on Sun Nov 2 16:03:06 2025
Native configuration is x86_64-pc-linux-gnu
=== libatomic tests ===
---
../fwd_incomp4_b4/./x86_64-pc-linux-gnu/libgomp/testsuite/libgomp.sum
2025-11-02 14:34:27.147488704 +0100
+++ ./x86_64-pc-linux-gnu/libgomp/testsuite/libgomp.sum 2025-11-02
16:05:45.431773814 +0100
@@ -1,4 +1,4 @@
-Test run by alx on Sun Nov 2 14:32:12 2025
+Test run by alx on Sun Nov 2 16:03:06 2025
Native configuration is x86_64-pc-linux-gnu
=== libgomp tests ===
@@ -7169,7 +7169,7 @@
PASS: libgomp.fortran/target-memcpy-rect-async-2.f90 -O (test for
excess errors)
PASS: libgomp.fortran/target-memcpy-rect-async-2.f90 -O execution
test
PASS: libgomp.fortran/target-nowait-array-section.f90 -O (test for
excess errors)
-FAIL: libgomp.fortran/target-nowait-array-section.f90 -O execution
test
+PASS: libgomp.fortran/target-nowait-array-section.f90 -O execution
test
PASS: libgomp.fortran/target-present-1.f90 -O (test for excess
errors)
PASS: libgomp.fortran/target-present-1.f90 -O execution test
PASS: libgomp.fortran/target-present-1.f90 -O output pattern test
@@ -18283,7 +18283,6 @@
=== libgomp Summary ===
-# of expected passes 17254
-# of unexpected failures 1
+# of expected passes 17255
# of expected failures 284
# of unsupported tests 726
---
../fwd_incomp4_b4/./x86_64-pc-linux-gnu/libstdc++-v3/testsuite/libstdc++.sum
2025-11-02 15:10:28.865803940 +0100
+++ ./x86_64-pc-linux-gnu/libstdc++-v3/testsuite/libstdc++.sum
2025-11-02 16:39:11.286190514 +0100
@@ -1,4 +1,4 @@
-Test run by alx on Sun Nov 2 14:32:14 2025
+Test run by alx on Sun Nov 2 16:03:07 2025
Native configuration is x86_64-pc-linux-gnu
=== libstdc++ tests ===
--- ../fwd_incomp4_b4/./gcc/testsuite/objc/objc.sum 2025-11-02
14:33:22.920939264 +0100
+++ ./gcc/testsuite/objc/objc.sum 2025-11-02 16:03:42.022763255
+0100
@@ -1,4 +1,4 @@
-Test run by alx on Sun Nov 2 14:32:13 2025
+Test run by alx on Sun Nov 2 16:03:07 2025
Native configuration is x86_64-pc-linux-gnu
=== objc tests ===
--- ../fwd_incomp4_b4/./gcc/testsuite/g++/g++.sum 2025-11-02
14:49:00.377617425 +0100
+++ ./gcc/testsuite/g++/g++.sum 2025-11-02 16:17:19.122148654 +0100
@@ -1,4 +1,4 @@
-Test run by alx on Sun Nov 2 14:32:13 2025
+Test run by alx on Sun Nov 2 16:03:07 2025
Native configuration is x86_64-pc-linux-gnu
=== g++ tests ===
--- ../fwd_incomp4_b4/./gcc/testsuite/gcc/gcc.sum 2025-11-02
15:05:54.323157582 +0100
+++ ./gcc/testsuite/gcc/gcc.sum 2025-11-02 16:20:39.787434794 +0100
@@ -1,4 +1,4 @@
-Test run by alx on Sun Nov 2 14:32:13 2025
+Test run by alx on Sun Nov 2 16:03:07 2025
Native configuration is x86_64-pc-linux-gnu
=== gcc tests ===
--- ../fwd_incomp4_b4/./gcc/testsuite/gfortran/gfortran.sum
2025-11-02 14:52:18.107423819 +0100
+++ ./gcc/testsuite/gfortran/gfortran.sum 2025-11-02
16:15:40.344084025 +0100
@@ -1,4 +1,4 @@
-Test run by alx on Sun Nov 2 14:32:13 2025
+Test run by alx on Sun Nov 2 16:03:07 2025
Native configuration is x86_64-pc-linux-gnu
=== gfortran tests ===
BTW, any idea why that fortran test now passes? Is that random? That's
weird...
Have a lovely night!
Alex
Alejandro Colomar (4):
gcc/: Rename warn_parm_array_mismatch() => warn_parms_array_mismatch()
Fix typos in comment
gcc/: Reduce scope of local variable (refactor)
gcc/: Factor out helper function
gcc/c-family/c-common.h | 2 +-
gcc/c-family/c-warn.cc | 592 ++++++++++++++++++++--------------------
gcc/c/c-decl.cc | 2 +-
gcc/c/c-parser.cc | 2 +-
4 files changed, 306 insertions(+), 292 deletions(-)
Range-diff against v3:
1: 8ba6937b57d5 = 1: 040e6772d8fd gcc/: Rename warn_parm_array_mismatch() =>
warn_parms_array_mismatch()
2: d69384585c41 = 2: 0ab2b64884ab Fix typos in comment
3: 94ad4167bed7 = 3: a1b516ee750d gcc/: Reduce scope of local variable
(refactor)
4: 2e5ba090b71a ! 4: ed1686b2ccf5 gcc/: Factor out helper function
@@ Metadata
## Commit message ##
gcc/: Factor out helper function
- Not sure about moving the definition of ptr_spec.
-
No functional change intended.
gcc/c-family/ChangeLog:
@@ gcc/c-family/c-warn.cc: expr_to_str (pretty_printer &pp, tree expr,
const char *
return pp_formatted_text (&pp);
}
++/* Helper for warn_parms_array_mismatch. Compare the mappings of
++ two function parameters and diagnose mismatches. ORIGLOC is the
++ location of the first function declaration. CURP and NEWP are the
++ parameters in the first and second function declarators,
++ respectively. PARMPOS is the position of the parameters within the
++ list of parameter declarations. BUILTIN is true if the function is
++ a builtin. */
++
+static void
+warn_parm_array_mismatch (location_t origloc, rdwr_map *cur_idx,
+ rdwr_map *new_idx, tree curp, tree newp,
base-commit: 65acf3665ea92abed79e05e3e09e5bda4ab96317
--
2.51.0