Results for 20240529 master r15-909-gd1a1f7e9f0bede (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit d1a1f7e9f0bedea55c558ab95127679bc3e9ff72 Linux 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Tue Jun 11 06:44:46 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13930
Results for 20240611 master r15-1171-g097bc0aebaed58 (GCC) testsuite on powerpc64le-unknown-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --with-long-double-format=ieee --disable-multilib --enable-plugin --enable-bootstrap gcc-branch: master git commit 097bc0aebaed58c11c738ea61da723cca950e5b1 Linux 5.14.0-284.11.1.el9_2.ppc64le #1 SMP Tue May 9 09:51:51 UTC 2023 ppc64le ppc64le GNU/Linux GNU ld version 2.35.2-43.el9 GNU assembler version 2.35.2-43.el9 GNU Make 4.3 Test run by gaius on Tue Jun 11 01:52:17 2024 Native configuration is powerpc64le-unknown-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes14036
Results for 20240529 master r15-909-gd1a1f7e9f0bede (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit d1a1f7e9f0bedea55c558ab95127679bc3e9ff72 Linux 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Mon Jun 10 15:19:24 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13930
Results for 20240607 master r15-1114-g2c9643c27ecddb (GCC) testsuite on aarch64-unknown-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --disable-multilib --enable-plugin --enable-bootstrap gcc-branch: master git commit 2c9643c27ecddb7f597d34009d89e932b4aca58e Linux 5.19.0-rc7-asahi-2-gbfe8f1b7e230 #1 SMP Sat Jul 23 17:21:00 CEST 2022 aarch64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Mon Jun 10 01:13:50 2024 Native configuration is aarch64-unknown-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes14036
Results for 20240529 master r15-909-gd1a1f7e9f0bede (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit d1a1f7e9f0bedea55c558ab95127679bc3e9ff72 Linux 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Mon Jun 10 01:47:24 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13930
Results for 20240607 master r15-1114-g2c9643c27ecddb (GCC) testsuite on aarch64-unknown-linux-gnu
$ ../configure --prefix=/home/gaius/opt --enable-bootstrap --with-build-config=bootstrap-O3 bootstrap-lto --enable-languages=c,c++,m2,lto gcc-branch: master git commit 2c9643c27ecddb7f597d34009d89e932b4aca58e Linux 5.19.0-rc7-asahi-2-gbfe8f1b7e230 #1 SMP Sat Jul 23 17:21:00 CEST 2022 aarch64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Sun Jun 9 06:22:24 2024 Native configuration is aarch64-unknown-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes14036
Results for 20240606 master r15-1118-gae91b5dd14920f (GCC) testsuite on powerpc64le-unknown-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --with-long-double-format=ieee --disable-multilib --enable-plugin --enable-bootstrap gcc-branch: master git commit ae91b5dd14920ff9671db8ff80c0d763d25f977f Linux 5.14.0-284.11.1.el9_2.ppc64le #1 SMP Tue May 9 09:51:51 UTC 2023 ppc64le ppc64le GNU/Linux GNU ld version 2.35.2-43.el9 GNU assembler version 2.35.2-43.el9 GNU Make 4.3 Test run by gaius on Sat Jun 8 20:54:54 2024 Native configuration is powerpc64le-unknown-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes14036
Re: [PATCH 06/52] m2: Replace uses of {FLOAT, {, LONG_}DOUBLE}_TYPE_SIZE
"Kewen.Lin" writes: Hi Kewen, > Nice! Looking forward to you pushing this new one (I'm withdrawing the > original > patch). all pushed now - thanks for the original patch! regards, Gaius
[gcc r15-1078] modula2: Simplify REAL/LONGREAL/SHORTREAL node creation.
https://gcc.gnu.org/g:30ce9dfcc665b6088e5898cfa766b57556ebb90e commit r15-1078-g30ce9dfcc665b6088e5898cfa766b57556ebb90e Author: Gaius Mulley Date: Thu Jun 6 19:27:56 2024 +0100 modula2: Simplify REAL/LONGREAL/SHORTREAL node creation. This patch simplifies the real type build functions by using the default float_type_node, double_type_node rather than create new nodes. It also uses the default GCC long_double_type_node or float128_type_nodes for longreal. gcc/m2/ChangeLog: * gm2-gcc/m2type.cc (build_m2_short_real_node): Rewrite to use the default float_type_node. (build_m2_real_node): Rewrite to use the default double_type_node. (build_m2_long_real_node): Rewrite to use the default long_double_type_node or float128_type_node. Co-Authored-By: Kewen.Lin Signed-off-by: Gaius Mulley Diff: --- gcc/m2/gm2-gcc/m2type.cc | 30 +++--- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/gcc/m2/gm2-gcc/m2type.cc b/gcc/m2/gm2-gcc/m2type.cc index 571923c08ef..5773a5cbd19 100644 --- a/gcc/m2/gm2-gcc/m2type.cc +++ b/gcc/m2/gm2-gcc/m2type.cc @@ -1415,45 +1415,29 @@ build_m2_char_node (void) static tree build_m2_short_real_node (void) { - tree c; - - /* Define `REAL'. */ - - c = make_node (REAL_TYPE); - TYPE_PRECISION (c) = FLOAT_TYPE_SIZE; - layout_type (c); - return c; + /* Define `SHORTREAL'. */ + ASSERT_CONDITION (TYPE_PRECISION (float_type_node) == FLOAT_TYPE_SIZE); + return float_type_node; } static tree build_m2_real_node (void) { - tree c; - /* Define `REAL'. */ - - c = make_node (REAL_TYPE); - TYPE_PRECISION (c) = DOUBLE_TYPE_SIZE; - layout_type (c); - return c; + ASSERT_CONDITION (TYPE_PRECISION (double_type_node) == DOUBLE_TYPE_SIZE); + return double_type_node; } static tree build_m2_long_real_node (void) { tree longreal; - + /* Define `LONGREAL'. */ - if (M2Options_GetIBMLongDouble ()) -{ - longreal = make_node (REAL_TYPE); - TYPE_PRECISION (longreal) = LONG_DOUBLE_TYPE_SIZE; -} - else if (M2Options_GetIEEELongDouble ()) + if (M2Options_GetIEEELongDouble ()) longreal = float128_type_node; else longreal = long_double_type_node; - layout_type (longreal); return longreal; }
Results for 20240606 master r15-1075-g43530bc40b1d04 (GCC) testsuite on powerpc64le-unknown-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --with-long-double-format=ieee --disable-multilib --enable-plugin --enable-bootstrap gcc-branch: master git commit 43530bc40b1d0465911e493e56a6631202ce85b1 Linux 5.14.0-284.11.1.el9_2.ppc64le #1 SMP Tue May 9 09:51:51 UTC 2023 ppc64le ppc64le GNU/Linux GNU ld version 2.35.2-43.el9 GNU assembler version 2.35.2-43.el9 GNU Make 4.3 Test run by gaius on Thu Jun 6 17:14:41 2024 Native configuration is powerpc64le-unknown-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes14036
Results for 20240529 master r15-909-gd1a1f7e9f0bede (GCC) testsuite on aarch64-unknown-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --disable-multilib --enable-plugin --enable-bootstrap gcc-branch: master git commit d1a1f7e9f0bedea55c558ab95127679bc3e9ff72 Linux 5.19.0-rc7-asahi-2-gbfe8f1b7e230 #1 SMP Sat Jul 23 17:21:00 CEST 2022 aarch64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Thu Jun 6 16:44:29 2024 Native configuration is aarch64-unknown-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes14036
Re: [PATCH 06/52] m2: Replace uses of {FLOAT, {, LONG_}DOUBLE}_TYPE_SIZE
"Kewen.Lin" writes: > Hi Joseph and Gaius, > > on 2024/6/4 02:02, Joseph Myers wrote: >> On Sun, 2 Jun 2024, Kewen Lin wrote: >> >>> diff --git a/gcc/m2/gm2-gcc/m2type.cc b/gcc/m2/gm2-gcc/m2type.cc >>> index 571923c08ef..d52cbdf0b99 100644 >>> --- a/gcc/m2/gm2-gcc/m2type.cc >>> +++ b/gcc/m2/gm2-gcc/m2type.cc >>> @@ -1420,7 +1420,7 @@ build_m2_short_real_node (void) >>>/* Define `REAL'. */ >>> >>>c = make_node (REAL_TYPE); >>> - TYPE_PRECISION (c) = FLOAT_TYPE_SIZE; >>> + TYPE_PRECISION (c) = TYPE_PRECISION (float_type_node); >>>layout_type (c); >>>return c; >>> } >>> @@ -1433,7 +1433,7 @@ build_m2_real_node (void) >>>/* Define `REAL'. */ >>> >>>c = make_node (REAL_TYPE); >>> - TYPE_PRECISION (c) = DOUBLE_TYPE_SIZE; >>> + TYPE_PRECISION (c) = TYPE_PRECISION (double_type_node); >>>layout_type (c); >>>return c; >>> } >>> @@ -1447,7 +1447,7 @@ build_m2_long_real_node (void) >>>if (M2Options_GetIBMLongDouble ()) >>> { >>>longreal = make_node (REAL_TYPE); >>> - TYPE_PRECISION (longreal) = LONG_DOUBLE_TYPE_SIZE; >>> + TYPE_PRECISION (longreal) = TYPE_PRECISION (long_double_type_node); >> >> This looks rather like m2 would still have the same problem the generic >> code previously had: going via precision when that might not uniquely >> determine the desired machine mode. And so making sure to use the right >> machine mode as done when setting up long_double_type_node etc. would be >> better than keeping this code copying TYPE_PRECISION and hoping to >> determine a machine mode from that. It certainly looks like this code >> wants to match float, double and long double, rather than possibly getting >> a different mode with possibly the same TYPE_PRECISION. > > Good point, sorry that I just did a replacement without checking the context. > If the above holds (Gaius can confirm or clarify), SET_TYPE_MODE would be > also applied here, that is: Hi Kewen and Joseph, yes the code is attempting to create nodes SHORTREAL, REAL, LONGREAL mapping onto the C float, double, long double nodes. > diff --git a/gcc/m2/gm2-gcc/m2type.cc b/gcc/m2/gm2-gcc/m2type.cc > index d52cbdf0b99..5ff02a18876 100644 > --- a/gcc/m2/gm2-gcc/m2type.cc > +++ b/gcc/m2/gm2-gcc/m2type.cc > @@ -1421,6 +1421,7 @@ build_m2_short_real_node (void) > >c = make_node (REAL_TYPE); >TYPE_PRECISION (c) = TYPE_PRECISION (float_type_node); > + SET_TYPE_MODE (c, TYPE_MODE (float_type_node)); >layout_type (c); >return c; > } > @@ -1434,6 +1435,7 @@ build_m2_real_node (void) > >c = make_node (REAL_TYPE); >TYPE_PRECISION (c) = TYPE_PRECISION (double_type_node); > + SET_TYPE_MODE (c, TYPE_MODE (double_type_node)); >layout_type (c); >return c; > } > > I'm not sure and curious why the above builds new nodes for short real and > real but re-use float128_type_node or long_double_type_node for some cases, > some special needs cause the former ones should have separated nodes? good point - there is no need to create new nodes. >> (I don't know if the M2Options_GetIBMLongDouble call would be needed at >> all once you use the machine mode for long double in a reliable way, or >> whether this code could be further simplified.) > > long_double_type_node should already take care of ibmlongdouble, IIUC it > would be like: > > @@ -1443,13 +1445,7 @@ build_m2_long_real_node (void) > { >tree longreal; > > - /* Define `LONGREAL'. */ > - if (M2Options_GetIBMLongDouble ()) > -{ > - longreal = make_node (REAL_TYPE); > - TYPE_PRECISION (longreal) = TYPE_PRECISION (long_double_type_node); > -} > - else if (M2Options_GetIEEELongDouble ()) > + if (M2Options_GetIEEELongDouble ()) > longreal = float128_type_node; >else > longreal = long_double_type_node; yes indeed and the above patch is fine, all bootstrapped and regression tested on ppc64le (cfarm120). I've also bootstrapped and regression tested the following patch on ppc64le and aarch64: diff --git a/gcc/m2/gm2-gcc/m2type.cc b/gcc/m2/gm2-gcc/m2type.cc index 571923c08ef..ce53130e2a9 100644 --- a/gcc/m2/gm2-gcc/m2type.cc +++ b/gcc/m2/gm2-gcc/m2type.cc @@ -1415,41 +1415,26 @@ build_m2_char_node (void) static tree build_m2_short_real_node (void) { - tree c; - - /* Define `REAL'. */ - - c = make_node (REAL_TYPE); - TYPE_PRECISION (c) = FLOAT_TYPE_SIZE; - layout_type (c); - return c; + /* Define `SHORTREAL'. */ + layout_type (float_type_node); + return float_type_node; } static tree build_m2_real_node (void) { - tree c; - /* Define `REAL'. */ - - c = make_node (REAL_TYPE); - TYPE_PRECISION (c) = DOUBLE_TYPE_SIZE; - layout_type (c); - return c; + layout_type (double_type_node); + return double_type_node; } static tree build_m2_long_real_node (void) { tree longreal; - + /* Define `LONGREAL'. */ - if (M2Options_GetIBMLongDouble ()) -{ - longreal = make_node (REAL_TYPE); - TYPE_PRECISION (longreal) =
Results for 20240529 master r15-909-gd1a1f7e9f0bede (GCC) testsuite on aarch64-unknown-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --disable-multilib --enable-plugin --enable-bootstrap gcc-branch: master git commit d1a1f7e9f0bedea55c558ab95127679bc3e9ff72 Linux 5.19.0-rc7-asahi-2-gbfe8f1b7e230 #1 SMP Sat Jul 23 17:21:00 CEST 2022 aarch64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Wed Jun 5 14:43:43 2024 Native configuration is aarch64-unknown-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes14036
Results for 20240605 master r15-1034-g58ecd2eb507ab2 (GCC) testsuite on powerpc64le-unknown-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --with-long-double-format=ieee --disable-multilib --enable-plugin --enable-bootstrap gcc-branch: master git commit 58ecd2eb507ab216861408cf10ec05efc4e8344e Linux 5.14.0-284.11.1.el9_2.ppc64le #1 SMP Tue May 9 09:51:51 UTC 2023 ppc64le ppc64le GNU/Linux GNU ld version 2.35.2-43.el9 GNU assembler version 2.35.2-43.el9 GNU Make 4.3 Test run by gaius on Wed Jun 5 13:38:26 2024 Native configuration is powerpc64le-unknown-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes14036
Results for 20240605 master r15-1034-g58ecd2eb507ab2 (GCC) testsuite on powerpc64le-unknown-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --with-long-double-format=ieee --disable-multilib --enable-plugin --enable-bootstrap gcc-branch: master git commit 58ecd2eb507ab216861408cf10ec05efc4e8344e Linux 5.14.0-284.11.1.el9_2.ppc64le #1 SMP Tue May 9 09:51:51 UTC 2023 ppc64le ppc64le GNU/Linux GNU ld version 2.35.2-43.el9 GNU assembler version 2.35.2-43.el9 GNU Make 4.3 Test run by gaius on Wed Jun 5 12:28:54 2024 Native configuration is powerpc64le-unknown-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes14036
Re: [PATCH 06/52] m2: Replace uses of {FLOAT, {, LONG_}DOUBLE}_TYPE_SIZE
Kewen Lin writes: > Joseph pointed out "floating types should have their mode, > not a poorly defined precision value" in the discussion[1], > as he and Richi suggested, the existing macros > {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE will be replaced with a > hook mode_for_floating_type. To be prepared for that, this > patch is to replace use of {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE > in m2 with TYPE_PRECISION of {float,{,long_}double}_type_node. > > [1] https://gcc.gnu.org/pipermail/gcc-patches/2024-May/651209.html > > gcc/m2/ChangeLog: > > * gm2-gcc/m2type.cc (build_m2_short_real_node): Use TYPE_PRECISION of > float_type_node to replace FLOAT_TYPE_SIZE. > (build_m2_real_node): Use TYPE_PRECISION of double_type_node to > replace DOUBLE_TYPE_SIZE. > (build_m2_long_real_node): Use TYPE_PRECISION of > long_double_type_node to replace LONG_DOUBLE_TYPE_SIZE. > --- > gcc/m2/gm2-gcc/m2type.cc | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/gcc/m2/gm2-gcc/m2type.cc b/gcc/m2/gm2-gcc/m2type.cc > index 571923c08ef..d52cbdf0b99 100644 > --- a/gcc/m2/gm2-gcc/m2type.cc > +++ b/gcc/m2/gm2-gcc/m2type.cc > @@ -1420,7 +1420,7 @@ build_m2_short_real_node (void) >/* Define `REAL'. */ > >c = make_node (REAL_TYPE); > - TYPE_PRECISION (c) = FLOAT_TYPE_SIZE; > + TYPE_PRECISION (c) = TYPE_PRECISION (float_type_node); >layout_type (c); >return c; > } > @@ -1433,7 +1433,7 @@ build_m2_real_node (void) >/* Define `REAL'. */ > >c = make_node (REAL_TYPE); > - TYPE_PRECISION (c) = DOUBLE_TYPE_SIZE; > + TYPE_PRECISION (c) = TYPE_PRECISION (double_type_node); >layout_type (c); >return c; > } > @@ -1447,7 +1447,7 @@ build_m2_long_real_node (void) >if (M2Options_GetIBMLongDouble ()) > { >longreal = make_node (REAL_TYPE); > - TYPE_PRECISION (longreal) = LONG_DOUBLE_TYPE_SIZE; > + TYPE_PRECISION (longreal) = TYPE_PRECISION (long_double_type_node); > } >else if (M2Options_GetIEEELongDouble ()) > longreal = float128_type_node; all look good to me thanks, regards, Gaius
Results for 20240529 master r15-909-gd1a1f7e9f0bede (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit d1a1f7e9f0bedea55c558ab95127679bc3e9ff72 Linux 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Wed May 29 18:33:59 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13930
[gcc r15-909] PR modula2/115276 bugfix libgm2 wraptime.InitTM returns NIL
https://gcc.gnu.org/g:d1a1f7e9f0bedea55c558ab95127679bc3e9ff72 commit r15-909-gd1a1f7e9f0bedea55c558ab95127679bc3e9ff72 Author: Gaius Mulley Date: Wed May 29 17:26:59 2024 +0100 PR modula2/115276 bugfix libgm2 wraptime.InitTM returns NIL This patch fixes libgm2/libm2iso/wraptime.cc:InitTM so that it does not always return NULL. The incorrect autoconf macro was used (inside InitTM) and the function short circuited to return NULL. The fix is to use HAVE_SYS_TIME_H and use AC_HEADER_TIME in libgm2/configure.ac. libgm2/ChangeLog: PR modula2/115276 * config.h.in: Regenerate. * configure: Regenerate. * configure.ac: Use AC_HEADER_TIME. * libm2iso/wraptime.cc (InitTM): Check HAVE_SYS_TIME_H before using struct tm to obtain the size. gcc/testsuite/ChangeLog: PR modula2/115276 * gm2/isolib/run/pass/testinittm.mod: New test. Signed-off-by: Gaius Mulley Diff: --- gcc/testsuite/gm2/isolib/run/pass/testinittm.mod | 17 +++ libgm2/config.h.in | 3 ++ libgm2/configure | 39 ++-- libgm2/configure.ac | 1 + libgm2/libm2iso/wraptime.cc | 2 +- 5 files changed, 59 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/gm2/isolib/run/pass/testinittm.mod b/gcc/testsuite/gm2/isolib/run/pass/testinittm.mod new file mode 100644 index 000..dfe041140f1 --- /dev/null +++ b/gcc/testsuite/gm2/isolib/run/pass/testinittm.mod @@ -0,0 +1,17 @@ +MODULE testinittm ; + +FROM wraptime IMPORT InitTM, tm ; +FROM libc IMPORT printf, exit ; + +VAR + m: tm ; +BEGIN + m := InitTM () ; + IF m = NIL + THEN + printf ("InitTM failed\n"); + exit (1) + ELSE + printf ("InitTM passed\n") + END +END testinittm. diff --git a/libgm2/config.h.in b/libgm2/config.h.in index 7426cb26cf8..321ef3b807f 100644 --- a/libgm2/config.h.in +++ b/libgm2/config.h.in @@ -335,6 +335,9 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE diff --git a/libgm2/configure b/libgm2/configure index 13861f0ff93..c36fd7d4cac 100755 --- a/libgm2/configure +++ b/libgm2/configure @@ -6837,6 +6837,41 @@ $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if ${ac_cv_header_time+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_time=yes +else + ac_cv_header_time=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h + +fi + ac_fn_c_check_header_mongrel "$LINENO" "math.h" "ac_cv_header_math_h" "$ac_includes_default" if test "x$ac_cv_header_math_h" = xyes; then : @@ -14544,7 +14579,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 14547 "configure" +#line 14582 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14650,7 +14685,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 14653 "configure" +#line 14688 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/libgm2/configure.ac b/libgm2/configure.ac index 9563831ddc5..1e6b82305ff 100644 --- a/libgm2/configure.ac +++ b/libgm2/configure.ac @@ -88,6 +88,7 @@ AC_ARG_WITH(cross-host, # Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT +AC_HEADER_TIME AC_CHECK_HEADER([math.h], [AC_DEFINE([HAVE_MATH_H], [1], [have math.h])]) diff --git a/libgm2/libm2iso/wraptime.cc b/libgm2/libm2iso/wraptime.cc index 158086b75cc..4bbd5f9701d 100644 --- a/libgm2/libm2iso/wraptime.cc +++ b/libgm2/libm2iso/wraptime.cc @@ -113,7 +113,7 @@ EXPORT(KillTimezone) (struct timezone *tv) /* InitTM - returns a newly created opaque type. */ -#if defined(HAVE_STRUCT_TM) && defined(HAVE_MALLOC_H) +#if defined(HAVE_SYS_TIME_H) && defined(HAVE_MALLOC_H) extern "C" struct tm * EXPORT(InitTM) (void) {
Results for 20240522 master r15-815-g5b9b3bae33cae7 (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit 5b9b3bae33cae7fca2e3c3e3028be6b8bee9b698 Linux 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Wed May 29 17:11:41 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13930
[gcc r15-852] modula2: simplify xref usage in documentation, remove external ref to gm2.
https://gcc.gnu.org/g:a209f219b862def8fed166b31984b8c6c3bb74a0 commit r15-852-ga209f219b862def8fed166b31984b8c6c3bb74a0 Author: Gaius Mulley Date: Mon May 27 18:06:59 2024 +0100 modula2: simplify xref usage in documentation, remove external ref to gm2. This patch simplifies all the xref usage for gm2 nodes in the modula-2 documentation. gcc/ChangeLog: * doc/gm2.texi: Replace all occurrences of xref {foo, , , gm2} with xref {foo}. Signed-off-by: Gaius Mulley Diff: --- gcc/doc/gm2.texi | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/gcc/doc/gm2.texi b/gcc/doc/gm2.texi index d553131e1bd..8661fcb8728 100644 --- a/gcc/doc/gm2.texi +++ b/gcc/doc/gm2.texi @@ -291,7 +291,7 @@ This manual only documents the options specific to @command{gm2}. This section describes how to compile and link a simple hello world program. It provides a few examples of using the different options -mentioned in @pxref{Compiler options, , ,m2}. Assuming that you have +mentioned in @pxref{Compiler options}. Assuming that you have a file called @file{hello.mod} in your current directory which contains: @@ -442,7 +442,7 @@ turn on ISO standard features. Currently this enables the ISO @code{SYSTEM} module and alters the default library search path so that the ISO libraries are searched before the PIM libraries. It also effects the behavior of @code{DIV} and @code{MOD} operators. -@xref{Dialect, , ,m2}. +@xref{Dialect}. @item -flibs= modifies the default library search path. The libraries supplied are: @@ -558,30 +558,30 @@ turn on PIM standard features. Currently this enables the PIM @code{SYSTEM} module and determines which identifiers are pervasive (declared in the base module). If no other @samp{-fpim[234]} switch is used then division and modulus operators behave as defined in PIM4. -@xref{Dialect, , ,m2}. +@xref{Dialect}. @item -fpim2 turn on PIM-2 standard features. Currently this removes @code{SIZE} from being a pervasive identifier (declared in the base module). It places @code{SIZE} in the @code{SYSTEM} module. It also effects the behavior of @code{DIV} and @code{MOD} operators. -@xref{Dialect, , ,m2}. +@xref{Dialect}. @item -fpim3 turn on PIM-3 standard features. Currently this only effects the behavior of @code{DIV} and @code{MOD} operators. -@xref{Dialect, , ,m2}. +@xref{Dialect}. @item -fpim4 turn on PIM-4 standard features. Currently this only effects the behavior of @code{DIV} and @code{MOD} operators. -@xref{Dialect, , ,m2}. +@xref{Dialect}. @item -fpositive-mod-floor-div forces the @code{DIV} and @code{MOD} operators to behave as defined by PIM4. All modulus results are positive and the results from the division are rounded to the floor. -@xref{Dialect, , ,m2}. +@xref{Dialect}. @item -fpthread link against the pthread library. By default this option is on. It @@ -876,8 +876,8 @@ LONGCOMPLEX complex long double Note that GNU Modula-2 also supports fixed sized data types which are exported from the @code{SYSTEM} module. -@xref{The PIM system module, , ,m2}. -@xref{The ISO system module, , ,m2}. +@xref{The PIM system module}. +@xref{The ISO system module}. @node Standard procedures, High procedure function, Elementary data types, Using @section Permanently accessible base procedures. @@ -1628,7 +1628,7 @@ This section introduces the GNU Modula-2 language extensions. The GNU Modula-2 compiler allows abstract data types to be any type, not just restricted to a pointer type providing the @samp{-fextended-opaque} option is supplied -@xref{Compiler options, , ,m2}. +@xref{Compiler options}. Declarations can be made in any order, whether they are types, constants, procedures, nested modules or variables. @@ -1829,8 +1829,8 @@ program module. GNU Modula-2 also provides additional fixed sized data types which are all exported from the @code{SYSTEM} module. -@xref{The PIM system module, , ,m2}. -@xref{The ISO system module, , ,m2}. +@xref{The PIM system module}. +@xref{The ISO system module}. @node Type compatibility, Unbounded by reference, Extensions, Using @section Type compatibility @@ -2205,7 +2205,7 @@ $ python3 testnum.py 1234 x 2 = 2468 @end example -@xref{Producing a Python module, , ,m2} for another example which +@xref{Producing a Python module} for another example which uses the @code{UNQUALIFIED} keyword to reduce the module name clutter from the viewport of Python3.
[gcc r15-819] modula2: fix xref fourth parameter in documentation, change from gm2 to m2
https://gcc.gnu.org/g:5833e5b8ef40367764325f4f3c80cfa129fbe1da commit r15-819-g5833e5b8ef40367764325f4f3c80cfa129fbe1da Author: Gaius Mulley Date: Fri May 24 13:42:58 2024 +0100 modula2: fix xref fourth parameter in documentation, change from gm2 to m2 This patch corrects the gm2.texi xref for the modula-2 documentation. gcc/ChangeLog: * doc/gm2.texi: Replace all occurrences of xref {, , , gm2} with xref {, , , m2}. Signed-off-by: Gaius Mulley Diff: --- gcc/doc/gm2.texi | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/gcc/doc/gm2.texi b/gcc/doc/gm2.texi index b38d6a15de0..7e580400fb9 100644 --- a/gcc/doc/gm2.texi +++ b/gcc/doc/gm2.texi @@ -291,7 +291,7 @@ This manual only documents the options specific to @command{gm2}. This section describes how to compile and link a simple hello world program. It provides a few examples of using the different options -mentioned in @pxref{Compiler options, , ,gm2}. Assuming that you have +mentioned in @pxref{Compiler options, , ,m2}. Assuming that you have a file called @file{hello.mod} in your current directory which contains: @@ -442,7 +442,7 @@ turn on ISO standard features. Currently this enables the ISO @code{SYSTEM} module and alters the default library search path so that the ISO libraries are searched before the PIM libraries. It also effects the behavior of @code{DIV} and @code{MOD} operators. -@xref{Dialect, , ,gm2}. +@xref{Dialect, , ,m2}. @item -flibs= modifies the default library search path. The libraries supplied are: @@ -558,30 +558,30 @@ turn on PIM standard features. Currently this enables the PIM @code{SYSTEM} module and determines which identifiers are pervasive (declared in the base module). If no other @samp{-fpim[234]} switch is used then division and modulus operators behave as defined in PIM4. -@xref{Dialect, , ,gm2}. +@xref{Dialect, , ,m2}. @item -fpim2 turn on PIM-2 standard features. Currently this removes @code{SIZE} from being a pervasive identifier (declared in the base module). It places @code{SIZE} in the @code{SYSTEM} module. It also effects the behavior of @code{DIV} and @code{MOD} operators. -@xref{Dialect, , ,gm2}. +@xref{Dialect, , ,m2}. @item -fpim3 turn on PIM-3 standard features. Currently this only effects the behavior of @code{DIV} and @code{MOD} operators. -@xref{Dialect, , ,gm2}. +@xref{Dialect, , ,m2}. @item -fpim4 turn on PIM-4 standard features. Currently this only effects the behavior of @code{DIV} and @code{MOD} operators. -@xref{Dialect, , ,gm2}. +@xref{Dialect, , ,m2}. @item -fpositive-mod-floor-div forces the @code{DIV} and @code{MOD} operators to behave as defined by PIM4. All modulus results are positive and the results from the division are rounded to the floor. -@xref{Dialect, , ,gm2}. +@xref{Dialect, , ,m2}. @item -fpthread link against the pthread library. By default this option is on. It @@ -876,8 +876,8 @@ LONGCOMPLEX complex long double Note that GNU Modula-2 also supports fixed sized data types which are exported from the @code{SYSTEM} module. -@xref{The PIM system module, , ,gm2}. -@xref{The ISO system module, , ,gm2}. +@xref{The PIM system module, , ,m2}. +@xref{The ISO system module, , ,m2}. @node Standard procedures, High procedure function, Elementary data types, Using @section Permanently accessible base procedures. @@ -1628,7 +1628,7 @@ This section introduces the GNU Modula-2 language extensions. The GNU Modula-2 compiler allows abstract data types to be any type, not just restricted to a pointer type providing the @samp{-fextended-opaque} option is supplied -@xref{Compiler options, , ,gm2}. +@xref{Compiler options, , ,m2}. Declarations can be made in any order, whether they are types, constants, procedures, nested modules or variables. @@ -1829,8 +1829,8 @@ program module. GNU Modula-2 also provides additional fixed sized data types which are all exported from the @code{SYSTEM} module. -@xref{The PIM system module, , ,gm2}. -@xref{The ISO system module, , ,gm2}. +@xref{The PIM system module, , ,m2}. +@xref{The ISO system module, , ,m2}. @node Type compatibility, Unbounded by reference, Extensions, Using @section Type compatibility @@ -2205,7 +2205,7 @@ $ python3 testnum.py 1234 x 2 = 2468 @end example -@xref{Producing a Python module, , ,gm2} for another example which +@xref{Producing a Python module, , ,m2} for another example which uses the @code{UNQUALIFIED} keyword to reduce the module name clutter from the viewport of Python3.
Results for 20240521 master r15-700-gd642b66a298ece (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit d642b66a298ece7394e786a6a2d14a4f0b561d9a Linux 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Tue May 21 15:51:00 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13912
[gcc r15-756] modula2: use groups in the type resolver of the bootstrap tool mc
https://gcc.gnu.org/g:20e6f36771df7e3a8857628dd367eecfe77ba4fc commit r15-756-g20e6f36771df7e3a8857628dd367eecfe77ba4fc Author: Gaius Mulley Date: Tue May 21 15:46:46 2024 +0100 modula2: use groups in the type resolver of the bootstrap tool mc This patch introduces groups to maintain the lists used when resolving types in the bootstrap tool mc. The groups and type resolver are very similar to that used in cc1gm2. Specifically the resolver uses the group to detect any change to any element in any list within a group. This is much cleaner and safer than the previous list length comparisons. gcc/m2/ChangeLog: * Make-lang.in (MC_EXTENDED_OPAQUE): New definition. * mc-boot/GDynamicStrings.cc: Rebuild. * mc-boot/GDynamicStrings.h: Rebuild. * mc-boot/Galists.cc: Rebuild. * mc-boot/Galists.h: Rebuild. * mc-boot/Gdecl.cc: Rebuild. * mc/alists.def (equalList): New procedure. * mc/alists.mod (equalList): New procedure implementation. * mc/decl.mod (group): New type. (freeGroup): New variable. (globalGroup): Ditto. (todoQ): Remove declaration and prefix all occurances with globalGroup^. (partialQ): Ditto. (doneQ): Ditto. (newGroup): New procedure. (initGroup): Ditto. (killGroup): Ditto. (dupGroup): Ditto. (equalGroup): Ditto. (topologicallyOut): Rewrite. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/Make-lang.in | 5 +- gcc/m2/mc-boot/GDynamicStrings.cc | 74 - gcc/m2/mc-boot/GDynamicStrings.h | 17 +- gcc/m2/mc-boot/Galists.cc | 43 + gcc/m2/mc-boot/Galists.h | 6 + gcc/m2/mc-boot/Gdecl.cc | 319 +++--- gcc/m2/mc/alists.def | 7 + gcc/m2/mc/alists.mod | 28 gcc/m2/mc/decl.mod| 218 ++ 9 files changed, 552 insertions(+), 165 deletions(-) diff --git a/gcc/m2/Make-lang.in b/gcc/m2/Make-lang.in index da4226123df..83d592f35d8 100644 --- a/gcc/m2/Make-lang.in +++ b/gcc/m2/Make-lang.in @@ -505,6 +505,7 @@ MC_ARGS= --olang=c++ \ $(MC_COPYRIGHT) \ --gcc-config-system +MC_EXTENDED_OPAQUE=--extended-opaque MCDEPS=m2/boot-bin/mc$(exeext) MC=m2/boot-bin/mc$(exeext) $(MC_ARGS) @@ -1539,7 +1540,7 @@ m2/gm2-libs-boot/SysStorage.o: $(srcdir)/m2/gm2-libs/SysStorage.mod $(MCDEPS) $( m2/gm2-compiler-boot/M2GCCDeclare.o: $(srcdir)/m2/gm2-compiler/M2GCCDeclare.mod $(MCDEPS) $(BUILD-BOOT-H) -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) - $(MC) --extended-opaque -o=m2/gm2-compiler-boot/M2GCCDeclare.c $< + $(MC) $(MC_EXTENDED_OPAQUE) -o=m2/gm2-compiler-boot/M2GCCDeclare.c $< $(COMPILER) $(CM2DEP) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) \ -I. -I$(srcdir)/../include -I$(srcdir) \ -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot \ @@ -1548,7 +1549,7 @@ m2/gm2-compiler-boot/M2GCCDeclare.o: $(srcdir)/m2/gm2-compiler/M2GCCDeclare.mod m2/gm2-compiler-boot/M2Error.o: $(srcdir)/m2/gm2-compiler/M2Error.mod $(MCDEPS) $(BUILD-BOOT-H) -test -d $(@D)/$(DEPDIR) || $(mkinstalldirs) $(@D)/$(DEPDIR) - $(MC) --extended-opaque -o=m2/gm2-compiler-boot/M2Error.c $< + $(MC) $(MC_EXTENDED_OPAQUE) -o=m2/gm2-compiler-boot/M2Error.c $< $(COMPILER) $(CM2DEP) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(GM2GCC) \ -I. -I$(srcdir)/../include -I$(srcdir) \ -I. -Im2/gm2-libs-boot -Im2/gm2-compiler-boot \ diff --git a/gcc/m2/mc-boot/GDynamicStrings.cc b/gcc/m2/mc-boot/GDynamicStrings.cc index 7f61778af64..a1cb88c03b7 100644 --- a/gcc/m2/mc-boot/GDynamicStrings.cc +++ b/gcc/m2/mc-boot/GDynamicStrings.cc @@ -255,12 +255,25 @@ extern "C" int DynamicStrings_Index (DynamicStrings_String s, char ch, unsigned /* RIndex - returns the indice of the last occurance of, ch, -in String, s. The search starts at position, o. --1 is returned if, ch, is not found. +in String, s. The search starts at position, o. +-1 is returned if, ch, is not found. The search +is performed left to right. */ extern "C" int DynamicStrings_RIndex (DynamicStrings_String s, char ch, unsigned int o); +/* + ReverseIndex - returns the indice of the last occurance of ch + in String s. The search starts at position o + and searches from right to left. The start position + may be indexed negatively from the right (-1 is the + last index). + The return value if ch is found will always be positive. + -1 is returned if ch is not found. +*/ + +extern "C" int DynamicStrings_ReverseIndex
[gcc r15-754] modula2: Pass --destdir for dir index during install of m2.info.
https://gcc.gnu.org/g:232a86f9640cde6908d0875b8df52c36030c5b5e commit r15-754-g232a86f9640cde6908d0875b8df52c36030c5b5e Author: Sam James Date: Tue May 21 12:31:47 2024 +0100 modula2: Pass --destdir for dir index during install of m2.info. This patch adds DESTDIR to the infodir when installing m2.info. gcc/m2/ChangeLog * Make-lang.in (m2.install-info): Pass --destdir for dir index. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/Make-lang.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/m2/Make-lang.in b/gcc/m2/Make-lang.in index 0abd8ce1455..da4226123df 100644 --- a/gcc/m2/Make-lang.in +++ b/gcc/m2/Make-lang.in @@ -425,7 +425,7 @@ m2.install-info: installdirs else true; fi -if [ -f gm2$(exeext) ] && [ -f $(DESTDIR)$(infodir)/m2.info ]; then \ if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - install-info --dir-file=$(infodir)/dir $(DESTDIR)$(infodir)/m2.info; \ + install-info --dir-file=$(DESTDIR)$(infodir)/dir $(DESTDIR)$(infodir)/m2.info; \ else true; fi; \ else true; fi
Results for 20240521 master r15-700-gd642b66a298ece (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --with-build-config=bootstrap-lto-lean --disable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit d642b66a298ece7394e786a6a2d14a4f0b561d9a Linux 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Tue May 21 04:30:52 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13912
Results for 20240515 master r15-497-g32ff344d57d56f (GCC) testsuite on aarch64-unknown-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --disable-multilib --enable-plugin --enable-bootstrap gcc-branch: master git commit 32ff344d57d56fddb66c4976b5651345d40b7157 Linux 5.19.0-rc7-asahi-2-gbfe8f1b7e230 #1 SMP Sat Jul 23 17:21:00 CEST 2022 aarch64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Tue May 21 02:01:31 2024 Native configuration is aarch64-unknown-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13928
Results for 20240521 master r15-701-gb666d86b41c85a (GCC) testsuite on powerpc64le-unknown-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --with-long-double-format=ieee --disable-multilib --enable-plugin --enable-bootstrap gcc-branch: master git commit b666d86b41c85a1756bf43951661a03f670a6852 Linux 5.14.0-284.11.1.el9_2.ppc64le #1 SMP Tue May 9 09:51:51 UTC 2023 ppc64le ppc64le GNU/Linux GNU ld version 2.35.2-43.el9 GNU assembler version 2.35.2-43.el9 GNU Make 4.3 Test run by gaius on Tue May 21 01:35:01 2024 Native configuration is powerpc64le-unknown-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes14018
Results for 20240521 master r15-700-gd642b66a298ece (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --disable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit d642b66a298ece7394e786a6a2d14a4f0b561d9a Linux 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Tue May 21 02:09:45 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13912
[gcc r15-700] PR modula2/115164 initial test code highlighting the problem
https://gcc.gnu.org/g:d642b66a298ece7394e786a6a2d14a4f0b561d9a commit r15-700-gd642b66a298ece7394e786a6a2d14a4f0b561d9a Author: Gaius Mulley Date: Tue May 21 01:11:48 2024 +0100 PR modula2/115164 initial test code highlighting the problem This patch includes some trivial testcode which highlights PR 115164. Expect future test code to perform runtime checks for a series of trailing zeros. gcc/testsuite/ChangeLog: PR modula2/115164 * gm2/isolib/run/pass/testlowread.mod: New test. * gm2/isolib/run/pass/testwritereal.mod: New test. Signed-off-by: Gaius Mulley Diff: --- gcc/testsuite/gm2/isolib/run/pass/testlowread.mod | 9 + gcc/testsuite/gm2/isolib/run/pass/testwritereal.mod | 9 + 2 files changed, 18 insertions(+) diff --git a/gcc/testsuite/gm2/isolib/run/pass/testlowread.mod b/gcc/testsuite/gm2/isolib/run/pass/testlowread.mod new file mode 100644 index ..fefbcb0b3720 --- /dev/null +++ b/gcc/testsuite/gm2/isolib/run/pass/testlowread.mod @@ -0,0 +1,9 @@ +MODULE testlowread ; + +FROM LowReal IMPORT places ; +FROM STextIO IMPORT WriteString, WriteLn ; +FROM SWholeIO IMPORT WriteCard ; + +BEGIN + WriteString ('value of places = ') ; WriteCard (places, 0) ; WriteLn +END testlowread. diff --git a/gcc/testsuite/gm2/isolib/run/pass/testwritereal.mod b/gcc/testsuite/gm2/isolib/run/pass/testwritereal.mod new file mode 100644 index ..025d684175c5 --- /dev/null +++ b/gcc/testsuite/gm2/isolib/run/pass/testwritereal.mod @@ -0,0 +1,9 @@ +MODULE testwritereal ; + +FROM STextIO IMPORT WriteString, WriteLn ; +FROM SRealIO IMPORT WriteFloat ; +FROM RealMath IMPORT pi ; + +BEGIN + WriteString ('value of pi = ') ; WriteFloat (pi, 0, 0) ; WriteLn +END testwritereal.
Re: [PATCH] modula2: Fully respect DESTDIR in texi rule
Sam James writes: > This was originally reported in Gentoo at https://bugs.gentoo.org/930014. > > 2024-05-20 Sam James > gcc/m2/ > * Make-lang.in (m2.install-info): Pass --destdir for dir index. > --- > gcc/m2/Make-lang.in | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gcc/m2/Make-lang.in b/gcc/m2/Make-lang.in > index 0abd8ce14555..da4226123dff 100644 > --- a/gcc/m2/Make-lang.in > +++ b/gcc/m2/Make-lang.in > @@ -425,7 +425,7 @@ m2.install-info: installdirs > else true; fi > -if [ -f gm2$(exeext) ] && [ -f $(DESTDIR)$(infodir)/m2.info ]; then \ > if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ > - install-info --dir-file=$(infodir)/dir > $(DESTDIR)$(infodir)/m2.info; \ > + install-info --dir-file=$(DESTDIR)$(infodir)/dir > $(DESTDIR)$(infodir)/m2.info; \ > else true; fi; \ > else true; fi thanks for the patch and url above - looks good to me, regards, Gaius
Results for 20240515 master r15-516-g680af0e1e90d4b (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit 680af0e1e90d4b80260d173636dfe15654fd470d Linux 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Wed May 15 18:12:36 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13876
[gcc r15-516] PR modula2/115057 TextIO.ReadRestLine raises an exception when buffer is exceeded
https://gcc.gnu.org/g:680af0e1e90d4b80260d173636dfe15654fd470d commit r15-516-g680af0e1e90d4b80260d173636dfe15654fd470d Author: Gaius Mulley Date: Wed May 15 16:58:21 2024 +0100 PR modula2/115057 TextIO.ReadRestLine raises an exception when buffer is exceeded TextIO.ReadRestLine will raise an "attempting to read beyond end of file" exception if the buffer is exceeded. This bug is caused by the TextIO.ReadRestLine calling IOChan.Skip without a preceeding IOChan.Look. The Look procedure will update the status result whereas Skip always sets read result to allRight. gcc/m2/ChangeLog: PR modula2/115057 * gm2-libs-iso/TextIO.mod (ReadRestLine): Use ReadChar to skip unwanted characters as this calls IOChan.Look and updates the cid result status. A Skip without a Look does not update the status. Skip always sets read result to allRight. * gm2-libs-iso/TextUtil.def (SkipSpaces): Improve comments. (CharAvailable): Improve comments. * gm2-libs-iso/TextUtil.mod (SkipSpaces): Improve comments. (CharAvailable): Improve comments. gcc/testsuite/ChangeLog: PR modula2/115057 * gm2/isolib/run/pass/testrestline.mod: New test. * gm2/isolib/run/pass/testrestline2.mod: New test. * gm2/isolib/run/pass/testrestline3.mod: New test. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/gm2-libs-iso/TextIO.mod | 13 - gcc/m2/gm2-libs-iso/TextUtil.def| 6 +- gcc/m2/gm2-libs-iso/TextUtil.mod| 6 +- gcc/testsuite/gm2/isolib/run/pass/testrestline.mod | 20 gcc/testsuite/gm2/isolib/run/pass/testrestline2.mod | 17 + gcc/testsuite/gm2/isolib/run/pass/testrestline3.mod | 16 6 files changed, 71 insertions(+), 7 deletions(-) diff --git a/gcc/m2/gm2-libs-iso/TextIO.mod b/gcc/m2/gm2-libs-iso/TextIO.mod index 78d67187b799..5204467b1921 100644 --- a/gcc/m2/gm2-libs-iso/TextIO.mod +++ b/gcc/m2/gm2-libs-iso/TextIO.mod @@ -114,13 +114,19 @@ PROCEDURE ReadRestLine (cid: IOChan.ChanId; VAR s: ARRAY OF CHAR); *) VAR i, h: CARDINAL ; + ignore : CHAR ; finished: BOOLEAN ; BEGIN h := HIGH(s) ; i := 0 ; finished := FALSE ; - WHILE (i<=h) AND CharAvailable (cid) AND (NOT finished) DO - ReadChar (cid, s[i]) ; + WHILE CharAvailable (cid) AND (NOT finished) DO + IF i <= h + THEN + ReadChar (cid, s[i]) + ELSE + ReadChar (cid, ignore) + END ; IF EofOrEoln (cid) THEN finished := TRUE @@ -128,9 +134,6 @@ BEGIN INC (i) END END ; - WHILE CharAvailable (cid) DO - IOChan.Skip (cid) - END ; SetNul (cid, i, s, TRUE) END ReadRestLine ; diff --git a/gcc/m2/gm2-libs-iso/TextUtil.def b/gcc/m2/gm2-libs-iso/TextUtil.def index ead045617233..7e6b3ed07dce 100644 --- a/gcc/m2/gm2-libs-iso/TextUtil.def +++ b/gcc/m2/gm2-libs-iso/TextUtil.def @@ -45,11 +45,15 @@ IMPORT IOChan ; PROCEDURE SkipSpaces (cid: IOChan.ChanId) ; -(* The following procedures do not read past line marks. *) +(* CharAvailable returns TRUE if IOChan.ReadResult is notKnown or + allRight. *) PROCEDURE CharAvailable (cid: IOChan.ChanId) : BOOLEAN ; +(* EofOrEoln returns TRUE if IOChan.ReadResult is endOfLine or + endOfInput. *) + PROCEDURE EofOrEoln (cid: IOChan.ChanId) : BOOLEAN ; diff --git a/gcc/m2/gm2-libs-iso/TextUtil.mod b/gcc/m2/gm2-libs-iso/TextUtil.mod index 44dbd1c69f8b..ad5786ca2fb2 100644 --- a/gcc/m2/gm2-libs-iso/TextUtil.mod +++ b/gcc/m2/gm2-libs-iso/TextUtil.mod @@ -23,7 +23,8 @@ BEGIN END SkipSpaces ; -(* The following procedures do not read past line marks. *) +(* CharAvailable returns TRUE if IOChan.ReadResult is notKnown or + allRight. *) PROCEDURE CharAvailable (cid: IOChan.ChanId) : BOOLEAN ; BEGIN @@ -32,6 +33,9 @@ BEGIN END CharAvailable ; +(* EofOrEoln returns TRUE if IOChan.ReadResult is endOfLine or + endOfInput. *) + PROCEDURE EofOrEoln (cid: IOChan.ChanId) : BOOLEAN ; BEGIN RETURN( (IOChan.ReadResult (cid) = IOConsts.endOfLine) OR diff --git a/gcc/testsuite/gm2/isolib/run/pass/testrestline.mod b/gcc/testsuite/gm2/isolib/run/pass/testrestline.mod new file mode 100644 index ..7702e88bdd95 --- /dev/null +++ b/gcc/testsuite/gm2/isolib/run/pass/testrestline.mod @@ -0,0 +1,20 @@ +MODULE testrestline ; + +IMPORT SeqFile, TextIO ; + +VAR + chan: SeqFile.ChanId ; + line: ARRAY [0..5] OF CHAR ; + results : SeqFile.OpenResults ; +BEGIN + SeqFile.OpenWrite (chan, "test.input", SeqFile.write, results) ; + TextIO.WriteString (chan, "a line of text exceeding 6 chars") ; + TextIO.WriteLn (chan) ; + TextIO.WriteString (chan, "a second lineline of text exceeding 6 chars") ;
Results for 20240515 master r15-514-g5609d77e683944 (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit 5609d77e683944439fae38323ecabc44a1eb4671 Linux 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Wed May 15 16:26:41 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13876
[gcc r15-349] PR modula2/115003 exporting a symbol to outer scope with a name clash causes ICE
https://gcc.gnu.org/g:bc5afdf14ccf8375f7fb3de2be1121aaf550f8aa commit r15-349-gbc5afdf14ccf8375f7fb3de2be1121aaf550f8aa Author: Gaius Mulley Date: Thu May 9 19:35:20 2024 +0100 PR modula2/115003 exporting a symbol to outer scope with a name clash causes ICE An ICE will occur if an unknown symbol is exported and causes a name clash. The error mechanism attempts to find the scope of an unknown symbol. This patch adds a missing case clause to GetScope and returns NulSym if the scope is an unknown symbol. gcc/m2/ChangeLog: PR modula2/115003 * gm2-compiler/SymbolTable.mod (GetScope): Add UndefinedSym case clause and return NulSym. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/gm2-compiler/SymbolTable.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/m2/gm2-compiler/SymbolTable.mod b/gcc/m2/gm2-compiler/SymbolTable.mod index f5890ec684fe..f206a47dff78 100644 --- a/gcc/m2/gm2-compiler/SymbolTable.mod +++ b/gcc/m2/gm2-compiler/SymbolTable.mod @@ -12449,6 +12449,7 @@ BEGIN ConstLitSym: RETURN( ConstLit.Scope ) | ConstStringSym : RETURN( ConstString.Scope ) | ConstVarSym: RETURN( ConstVar.Scope ) | + UndefinedSym : RETURN( NulSym ) | PartialUnboundedSym: InternalError ('should not be requesting the scope of a PartialUnbounded symbol') ELSE
[gcc r14-10179] [PR modula2/113768][PR modula2/114133] bugfix constants must be cast prior to vararg call
https://gcc.gnu.org/g:07dab3f6b56c711dcd737d856cf01a597a2e1626 commit r14-10179-g07dab3f6b56c711dcd737d856cf01a597a2e1626 Author: Gaius Mulley Date: Tue May 7 19:51:08 2024 +0100 [PR modula2/113768][PR modula2/114133] bugfix constants must be cast prior to vararg call This bug fix corrects the test codes below by converting the constant literals to the type required by C. In the testcases below the values, 1 etc were converted into the INTEGER type before being passed to a C vararg function. By default in modula2 constant literal ordinals are represented as the ZTYPE (the largest GCC integer type node). gcc/testsuite/ChangeLog: PR modula2/113768 PR modula2/114133 * gm2/extensions/run/pass/callingc10.mod: Convert constant literal numbers into INTEGER. * gm2/extensions/run/pass/callingc11.mod: Ditto. * gm2/extensions/run/pass/vararg2.mod: Ditto. * gm2/iso/run/pass/packed.mod: Emit a printf as a runtime diagnostic. Signed-off-by: Gaius Mulley Diff: --- gcc/testsuite/gm2/extensions/run/pass/callingc10.mod | 6 +++--- gcc/testsuite/gm2/extensions/run/pass/callingc11.mod | 6 +++--- gcc/testsuite/gm2/extensions/run/pass/vararg2.mod| 6 +++--- gcc/testsuite/gm2/iso/run/pass/packed.mod| 2 ++ 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/gcc/testsuite/gm2/extensions/run/pass/callingc10.mod b/gcc/testsuite/gm2/extensions/run/pass/callingc10.mod index 3a2d3e210dcc..0c26fedf8453 100644 --- a/gcc/testsuite/gm2/extensions/run/pass/callingc10.mod +++ b/gcc/testsuite/gm2/extensions/run/pass/callingc10.mod @@ -4,13 +4,13 @@ FROM cvararg IMPORT funcptr ; FROM SYSTEM IMPORT ADR ; BEGIN - IF funcptr (1, "hello", 5) = 1 + IF funcptr (INTEGER (1), "hello", INTEGER (5)) = INTEGER (1) THEN END ; - IF funcptr (1, "hello" + " ", 6) = 1 + IF funcptr (INTEGER (1), "hello" + " ", INTEGER (6)) = INTEGER (1) THEN END ; - IF funcptr (1, "hello" + " " + "world", 11) = 1 + IF funcptr (INTEGER (1), "hello" + " " + "world", INTEGER (11)) = INTEGER (1) THEN END END callingc10. diff --git a/gcc/testsuite/gm2/extensions/run/pass/callingc11.mod b/gcc/testsuite/gm2/extensions/run/pass/callingc11.mod index 9b8cb82d645f..d71026ee35df 100644 --- a/gcc/testsuite/gm2/extensions/run/pass/callingc11.mod +++ b/gcc/testsuite/gm2/extensions/run/pass/callingc11.mod @@ -5,13 +5,13 @@ FROM SYSTEM IMPORT ADR ; FROM strconst IMPORT WORLD ; BEGIN - IF funcptr (1, "hello", 5) = 1 + IF funcptr (INTEGER (1), "hello", INTEGER (5)) = INTEGER (1) THEN END ; - IF funcptr (1, "hello" + " ", 6) = 1 + IF funcptr (INTEGER (1), "hello" + " ", INTEGER (6)) = INTEGER (1) THEN END ; - IF funcptr (1, "hello" + " " + WORLD, 11) = 1 + IF funcptr (INTEGER (1), "hello" + " " + WORLD, INTEGER (11)) = INTEGER (1) THEN END END callingc11. diff --git a/gcc/testsuite/gm2/extensions/run/pass/vararg2.mod b/gcc/testsuite/gm2/extensions/run/pass/vararg2.mod index e26ed096fb84..05f7074a459d 100644 --- a/gcc/testsuite/gm2/extensions/run/pass/vararg2.mod +++ b/gcc/testsuite/gm2/extensions/run/pass/vararg2.mod @@ -21,13 +21,13 @@ FROM cvararg IMPORT funcptr ; FROM SYSTEM IMPORT ADR ; BEGIN - IF funcptr(1, ADR("hello world"), 11)=1 + IF funcptr(INTEGER (1), ADR("hello world"), INTEGER (11))=INTEGER (1) THEN END ; - IF funcptr(1, ADR("hello"), 5)=1 + IF funcptr(INTEGER (1), ADR("hello"), INTEGER (5))=INTEGER (1) THEN END ; - IF funcptr(1, ADR("/etc/passwd"), 11)=1 + IF funcptr(INTEGER (1), ADR("/etc/passwd"), INTEGER (11))=INTEGER (1) THEN END END vararg2. diff --git a/gcc/testsuite/gm2/iso/run/pass/packed.mod b/gcc/testsuite/gm2/iso/run/pass/packed.mod index 401a6998f71a..3dad71e60a13 100644 --- a/gcc/testsuite/gm2/iso/run/pass/packed.mod +++ b/gcc/testsuite/gm2/iso/run/pass/packed.mod @@ -38,7 +38,9 @@ PROCEDURE test ; VAR v: CARDINAL ; BEGIN + printf ("testing to see BITSET{0} = CARDINAL (1)..."); Assert(CAST(CARDINAL, BITSET{0}) = VAL(CARDINAL, 1), __FILE__, __LINE__) ; + printf ("yes\n"); v := MAX(CARDINAL)-1 ; WHILE v>0 DO Assert(CAST(CARDINAL, SHIFT(CAST(BITSET, v), -1)) = v DIV 2, __FILE__, __LINE__) ;
[gcc r15-300] PR modula2/114133 bugfix constants must be cast prior to vararg call
https://gcc.gnu.org/g:76e591200f54226290ddb49b8ac6231a694bf882 commit r15-300-g76e591200f54226290ddb49b8ac6231a694bf882 Author: Gaius Mulley Date: Tue May 7 19:24:08 2024 +0100 PR modula2/114133 bugfix constants must be cast prior to vararg call This bug fix corrects the test codes below by converting the constant literals to the type required by C. In the testcases below the values, 1 etc were converted into the INTEGER type before being passed to a C vararg function. By default in modula2 constant literal ordinals are represented as the ZTYPE (the largest GCC integer type node). gcc/testsuite/ChangeLog: PR modula2/114133 * gm2/extensions/run/pass/callingc10.mod: Convert constant literal numbers into INTEGER. * gm2/extensions/run/pass/callingc11.mod: Ditto. * gm2/extensions/run/pass/vararg2.mod: Ditto. * gm2/iso/run/pass/packed.mod: Emit a printf as a runtime diagnostic. Signed-off-by: Gaius Mulley Diff: --- gcc/testsuite/gm2/extensions/run/pass/callingc10.mod | 6 +++--- gcc/testsuite/gm2/extensions/run/pass/callingc11.mod | 6 +++--- gcc/testsuite/gm2/extensions/run/pass/vararg2.mod| 6 +++--- gcc/testsuite/gm2/iso/run/pass/packed.mod| 2 ++ 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/gcc/testsuite/gm2/extensions/run/pass/callingc10.mod b/gcc/testsuite/gm2/extensions/run/pass/callingc10.mod index 3a2d3e210dcc..0c26fedf8453 100644 --- a/gcc/testsuite/gm2/extensions/run/pass/callingc10.mod +++ b/gcc/testsuite/gm2/extensions/run/pass/callingc10.mod @@ -4,13 +4,13 @@ FROM cvararg IMPORT funcptr ; FROM SYSTEM IMPORT ADR ; BEGIN - IF funcptr (1, "hello", 5) = 1 + IF funcptr (INTEGER (1), "hello", INTEGER (5)) = INTEGER (1) THEN END ; - IF funcptr (1, "hello" + " ", 6) = 1 + IF funcptr (INTEGER (1), "hello" + " ", INTEGER (6)) = INTEGER (1) THEN END ; - IF funcptr (1, "hello" + " " + "world", 11) = 1 + IF funcptr (INTEGER (1), "hello" + " " + "world", INTEGER (11)) = INTEGER (1) THEN END END callingc10. diff --git a/gcc/testsuite/gm2/extensions/run/pass/callingc11.mod b/gcc/testsuite/gm2/extensions/run/pass/callingc11.mod index 9b8cb82d645f..d71026ee35df 100644 --- a/gcc/testsuite/gm2/extensions/run/pass/callingc11.mod +++ b/gcc/testsuite/gm2/extensions/run/pass/callingc11.mod @@ -5,13 +5,13 @@ FROM SYSTEM IMPORT ADR ; FROM strconst IMPORT WORLD ; BEGIN - IF funcptr (1, "hello", 5) = 1 + IF funcptr (INTEGER (1), "hello", INTEGER (5)) = INTEGER (1) THEN END ; - IF funcptr (1, "hello" + " ", 6) = 1 + IF funcptr (INTEGER (1), "hello" + " ", INTEGER (6)) = INTEGER (1) THEN END ; - IF funcptr (1, "hello" + " " + WORLD, 11) = 1 + IF funcptr (INTEGER (1), "hello" + " " + WORLD, INTEGER (11)) = INTEGER (1) THEN END END callingc11. diff --git a/gcc/testsuite/gm2/extensions/run/pass/vararg2.mod b/gcc/testsuite/gm2/extensions/run/pass/vararg2.mod index e26ed096fb84..05f7074a459d 100644 --- a/gcc/testsuite/gm2/extensions/run/pass/vararg2.mod +++ b/gcc/testsuite/gm2/extensions/run/pass/vararg2.mod @@ -21,13 +21,13 @@ FROM cvararg IMPORT funcptr ; FROM SYSTEM IMPORT ADR ; BEGIN - IF funcptr(1, ADR("hello world"), 11)=1 + IF funcptr(INTEGER (1), ADR("hello world"), INTEGER (11))=INTEGER (1) THEN END ; - IF funcptr(1, ADR("hello"), 5)=1 + IF funcptr(INTEGER (1), ADR("hello"), INTEGER (5))=INTEGER (1) THEN END ; - IF funcptr(1, ADR("/etc/passwd"), 11)=1 + IF funcptr(INTEGER (1), ADR("/etc/passwd"), INTEGER (11))=INTEGER (1) THEN END END vararg2. diff --git a/gcc/testsuite/gm2/iso/run/pass/packed.mod b/gcc/testsuite/gm2/iso/run/pass/packed.mod index 401a6998f71a..3dad71e60a13 100644 --- a/gcc/testsuite/gm2/iso/run/pass/packed.mod +++ b/gcc/testsuite/gm2/iso/run/pass/packed.mod @@ -38,7 +38,9 @@ PROCEDURE test ; VAR v: CARDINAL ; BEGIN + printf ("testing to see BITSET{0} = CARDINAL (1)..."); Assert(CAST(CARDINAL, BITSET{0}) = VAL(CARDINAL, 1), __FILE__, __LINE__) ; + printf ("yes\n"); v := MAX(CARDINAL)-1 ; WHILE v>0 DO Assert(CAST(CARDINAL, SHIFT(CAST(BITSET, v), -1)) = v DIV 2, __FILE__, __LINE__) ;
[gcc r14-10166] [PATCH] PR modula2/114929 for loop fails to iterate down to zero
https://gcc.gnu.org/g:d811080341adf9d805e3f79a8fd9be2e13bd9848 commit r14-10166-gd811080341adf9d805e3f79a8fd9be2e13bd9848 Author: Gaius Mulley Date: Fri May 3 22:58:11 2024 +0100 [PATCH] PR modula2/114929 for loop fails to iterate down to zero There is a bug in the for loop control code which is exposed when an unsigned type is used in the iterator variable. See gm2/pim/run/pass/testforloopzero[234].mod. The bug is in the calculation of the last iterator value. The bug fix is to avoid using negative expressions when calculating the last iterator value with a negative step value. This patch detects if e1, e2, step value are all constant, in which case the ztype is used internally and there is no overflow. If the last iterator value is held in a variable then it uses a different method to calculate the last iterator depending upon the sign of the step value. gcc/m2/ChangeLog: PR modula2/114929 * gm2-compiler/M2Quads.mod (ForLoopLastIteratorVariable): New procedure. (ForLoopLastIteratorConstant): Ditto. (ForLoopLastIterator): Ditto. (BuildForToByDo): Remove LastIterator calculation and call ForLoopLastIterator instead. (FinalValue): Replace with ... (LastIterator): ... this. gcc/testsuite/ChangeLog: PR modula2/114929 * gm2/pim/run/pass/testforloopzero.mod: New test. * gm2/pim/run/pass/testforloopzero2.mod: New test. * gm2/pim/run/pass/testforloopzero3.mod: New test. * gm2/pim/run/pass/testforloopzero4.mod: New test. (cherry picked from commit a561dc0f6c7085e102fe9e9b6abd7f2138512576) Signed-off-by: Gaius Mulley Diff: --- gcc/m2/gm2-compiler/M2Quads.mod| 191 + gcc/testsuite/gm2/pim/run/pass/testforloopzero.mod | 33 .../gm2/pim/run/pass/testforloopzero2.mod | 35 .../gm2/pim/run/pass/testforloopzero3.mod | 32 .../gm2/pim/run/pass/testforloopzero4.mod | 32 5 files changed, 289 insertions(+), 34 deletions(-) diff --git a/gcc/m2/gm2-compiler/M2Quads.mod b/gcc/m2/gm2-compiler/M2Quads.mod index 8a9a23013b2..3f414e186b2 100644 --- a/gcc/m2/gm2-compiler/M2Quads.mod +++ b/gcc/m2/gm2-compiler/M2Quads.mod @@ -4583,6 +4583,144 @@ BEGIN END BuildForLoopToRangeCheck ; +(* + ForLoopLastIteratorVariable - assigns the last value of the index variable to + symbol LastIterator. + The For Loop is regarded: + + For ident := e1 To e2 By BySym Do + + End +*) + +PROCEDURE ForLoopLastIteratorVariable (LastIterator, e1, e2, BySym, ByType: CARDINAL ; + e1tok, e2tok, bytok: CARDINAL) ; +VAR + PBType, + PositiveBy, + ElseQuad, + t, f : CARDINAL ; +BEGIN + Assert (IsVar (LastIterator)) ; + (* If By > 0 then. *) + (* q+1 if >= by0 q+3. *) + (* q+2 GotoOp q+else. *) + PushTFtok (BySym, ByType, bytok) ; (* BuildRelOp 1st parameter *) + PushT (GreaterEqualTok) ; (* 2nd parameter *) + (* 3rd parameter *) + PushZero (bytok, ByType) ; + BuildRelOp (e2tok) ; (* Choose final expression position. *) + PopBool (t, f) ; + BackPatch (t, NextQuad) ; + + (* LastIterator := ((e2-e1) DIV By) * By + e1. *) + PushTF (LastIterator, GetSType (LastIterator)) ; + PushTFtok (e2, GetSType (e2), e2tok) ; + PushT (MinusTok) ; + PushTFtok (e1, GetSType (e1), e1tok) ; + doBuildBinaryOp (TRUE, FALSE) ; + PushT (DivideTok) ; + PushTFtok (BySym, ByType, bytok) ; + doBuildBinaryOp (FALSE, FALSE) ; + PushT (TimesTok) ; + PushTFtok (BySym, ByType, bytok) ; + doBuildBinaryOp (FALSE, FALSE) ; + PushT (ArithPlusTok) ; + PushTFtok (e1, GetSType (e1), e1tok) ; + doBuildBinaryOp (FALSE, FALSE) ; + BuildForLoopToRangeCheck ; + BuildAssignmentWithoutBounds (e1tok, FALSE, FALSE) ; + GenQuad (GotoOp, NulSym, NulSym, 0) ; + ElseQuad := NextQuad-1 ; + + (* Else. *) + + BackPatch (f, NextQuad) ; + + PushTtok (MinusTok, bytok) ; + PushTFtok (BySym, ByType, bytok) ; + BuildUnaryOp ; + PopTF (PositiveBy, PBType) ; (* PositiveBy := - BySym. *) + + (* LastIterator := e1 - ((e1-e2) DIV PositiveBy) * PositiveBy. *) + PushTF (LastIterator, GetSType (LastIterator)) ; + PushTFtok (e1, GetSType (e1), e1tok) ; + PushT (MinusTok) ; + PushTFtok (e1, GetSType (e1), e1tok) ; + PushT (MinusTok) ; + PushTFtok (e2, GetSType (e2), e2tok) ; + doBuildBinaryOp (TRUE, FALSE) ; + PushT (DivideTok) ; + PushTFtok (PositiveBy, ByType, bytok) ; + doBuildBinaryOp (FALSE, FALSE) ; + PushT (TimesTok) ; + PushTFtok (PositiveBy, ByType, bytok) ; + doBuildBi
Results for 20240503 releases/gcc-14 r14-10164-gdb447ec808e997 (GCC) testsuite on aarch64-unknown-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --disable-multilib --enable-plugin --enable-bootstrap gcc-branch: releases/gcc-14 git commit db447ec808e997bd13a849d9b3076792afb888cb Linux 5.19.0-rc7-asahi-2-gbfe8f1b7e230 #1 SMP Sat Jul 23 17:21:00 CEST 2022 aarch64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Fri May 3 21:51:00 2024 Native configuration is aarch64-unknown-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13928
Results for 20240503 releases/gcc-14 r14-10164-gdb447ec808e997 (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: releases/gcc-14 git commit db447ec808e997bd13a849d9b3076792afb888cb Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Fri May 3 22:16:15 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13822
[gcc r15-137] PR modula2/114929 extra for loop iteration count regression tests
https://gcc.gnu.org/g:c943d7b5c40f447b12431df9ad27a47dad95026d commit r15-137-gc943d7b5c40f447b12431df9ad27a47dad95026d Author: Gaius Mulley Date: Fri May 3 20:48:01 2024 +0100 PR modula2/114929 extra for loop iteration count regression tests This patch introduces three more for loop tests checking the iteration count using the CHAR and enumeration data types. gcc/testsuite/ChangeLog: PR modula2/114929 * gm2/pim/run/pass/testforloopchar.mod: New test. * gm2/pim/run/pass/testforloopchar2.mod: New test. * gm2/pim/run/pass/testforloopenum.mod: New test. Signed-off-by: Gaius Mulley Diff: --- gcc/testsuite/gm2/pim/run/pass/testforloopchar.mod | 27 +++ .../gm2/pim/run/pass/testforloopchar2.mod | 27 +++ gcc/testsuite/gm2/pim/run/pass/testforloopenum.mod | 30 ++ 3 files changed, 84 insertions(+) diff --git a/gcc/testsuite/gm2/pim/run/pass/testforloopchar.mod b/gcc/testsuite/gm2/pim/run/pass/testforloopchar.mod new file mode 100644 index 000..be26ecb7149 --- /dev/null +++ b/gcc/testsuite/gm2/pim/run/pass/testforloopchar.mod @@ -0,0 +1,27 @@ +MODULE testforloopchar ; + +FROM libc IMPORT printf, exit ; + +PROCEDURE test ; +VAR + ch : CHAR ; + count: CARDINAL ; +BEGIN + count := 0 ; + FOR ch := 'a' TO 'z' DO + INC (count) ; + printf ("ch = %c, count = %d\n", ch, count) + END ; + IF count = 26 + THEN + printf ("passed\n") + ELSE + printf ("failed\n") ; + exit (1) + END +END test ; + + +BEGIN + test +END testforloopchar. diff --git a/gcc/testsuite/gm2/pim/run/pass/testforloopchar2.mod b/gcc/testsuite/gm2/pim/run/pass/testforloopchar2.mod new file mode 100644 index 000..05478b2d5f2 --- /dev/null +++ b/gcc/testsuite/gm2/pim/run/pass/testforloopchar2.mod @@ -0,0 +1,27 @@ +MODULE testforloopchar2 ; + +FROM libc IMPORT printf, exit ; + +PROCEDURE test ; +VAR + ch : CHAR ; + count: CARDINAL ; +BEGIN + count := 0 ; + FOR ch := 'a' TO 'z' BY CHR (2) DO + INC (count) ; + printf ("ch = %c, count = %d\n", ch, count) + END ; + IF count = 13 + THEN + printf ("passed\n") + ELSE + printf ("failed\n") ; + exit (1) + END +END test ; + + +BEGIN + test +END testforloopchar2. diff --git a/gcc/testsuite/gm2/pim/run/pass/testforloopenum.mod b/gcc/testsuite/gm2/pim/run/pass/testforloopenum.mod new file mode 100644 index 000..3855cae0012 --- /dev/null +++ b/gcc/testsuite/gm2/pim/run/pass/testforloopenum.mod @@ -0,0 +1,30 @@ +MODULE testforloopenum ; + +FROM libc IMPORT printf, exit ; + +TYPE + colour = (red, green, blue, yellow) ; + +PROCEDURE test ; +VAR + c: colour ; + count: CARDINAL ; +BEGIN + count := 0 ; + FOR c := red TO blue BY colour (2) DO + INC (count) ; + printf ("c = %d, count = %d\n", c, count) + END ; + IF count = 2 + THEN + printf ("passed\n") + ELSE + printf ("failed\n") ; + exit (1) + END +END test ; + + +BEGIN + test +END testforloopenum.
Results for 20240503 master r15-122-ga561dc0f6c7085 (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit a561dc0f6c7085e102fe9e9b6abd7f2138512576 Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Fri May 3 14:56:37 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13822
Results for 20240503 master r15-122-ga561dc0f6c7085 (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit a561dc0f6c7085e102fe9e9b6abd7f2138512576 Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Fri May 3 13:29:55 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13822
[gcc r15-122] PR modula2/114929 for loop fails to iterate down to zero when using a cardinal type
https://gcc.gnu.org/g:a561dc0f6c7085e102fe9e9b6abd7f2138512576 commit r15-122-ga561dc0f6c7085e102fe9e9b6abd7f2138512576 Author: Gaius Mulley Date: Fri May 3 01:22:10 2024 +0100 PR modula2/114929 for loop fails to iterate down to zero when using a cardinal type There is a bug in the for loop control code which is exposed when an unsigned type is used in the iterator variable. See gm2/pim/run/pass/testforloopzero[234].mod. The bug is in the calculation of the last iterator value. The bug fix is to avoid using negative expressions when calculating the last iterator value with a negative step value. This patch detects if e1, e2, step value are all constant, in which case the ztype is used internally and there is no overflow. If the last iterator value is held in a variable then it uses a different method to calculate the last iterator depending upon the sign of the step value. gcc/m2/ChangeLog: PR modula2/114929 * gm2-compiler/M2LangDump.mod (GenQualidentSymString): Add missing return result into identstr. * gm2-compiler/M2Quads.mod (ForLoopLastIteratorVariable): New procedure. (ForLoopLastIteratorConstant): Ditto. (ForLoopLastIterator): Ditto. (BuildForToByDo): Remove LastIterator calculation and call ForLoopLastIterator instead. (FinalValue): Replace with ... (LastIterator): ... this. gcc/testsuite/ChangeLog: PR modula2/114929 * gm2/pim/run/pass/testforloopzero.mod: New test. * gm2/pim/run/pass/testforloopzero2.mod: New test. * gm2/pim/run/pass/testforloopzero3.mod: New test. * gm2/pim/run/pass/testforloopzero4.mod: New test. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/gm2-compiler/M2LangDump.mod | 2 +- gcc/m2/gm2-compiler/M2Quads.mod| 191 + gcc/testsuite/gm2/pim/run/pass/testforloopzero.mod | 33 .../gm2/pim/run/pass/testforloopzero2.mod | 35 .../gm2/pim/run/pass/testforloopzero3.mod | 32 .../gm2/pim/run/pass/testforloopzero4.mod | 32 6 files changed, 290 insertions(+), 35 deletions(-) diff --git a/gcc/m2/gm2-compiler/M2LangDump.mod b/gcc/m2/gm2-compiler/M2LangDump.mod index e65f5b040a5..2ce77a03d14 100644 --- a/gcc/m2/gm2-compiler/M2LangDump.mod +++ b/gcc/m2/gm2-compiler/M2LangDump.mod @@ -260,7 +260,7 @@ BEGIN WHILE GetScope (sym) # NulSym DO sym := GetScope (sym) ; identstr := InitStringCharStar (KeyToCharStar (GetSymName (sym))) ; - ConCatChar (identstr, '.') ; + identstr := ConCatChar (identstr, '.') ; qualidentstr := ConCat (identstr, Mark (qualidentstr)) END ; RETURN qualidentstr diff --git a/gcc/m2/gm2-compiler/M2Quads.mod b/gcc/m2/gm2-compiler/M2Quads.mod index 8a9a23013b2..3f414e186b2 100644 --- a/gcc/m2/gm2-compiler/M2Quads.mod +++ b/gcc/m2/gm2-compiler/M2Quads.mod @@ -4583,6 +4583,144 @@ BEGIN END BuildForLoopToRangeCheck ; +(* + ForLoopLastIteratorVariable - assigns the last value of the index variable to + symbol LastIterator. + The For Loop is regarded: + + For ident := e1 To e2 By BySym Do + + End +*) + +PROCEDURE ForLoopLastIteratorVariable (LastIterator, e1, e2, BySym, ByType: CARDINAL ; + e1tok, e2tok, bytok: CARDINAL) ; +VAR + PBType, + PositiveBy, + ElseQuad, + t, f : CARDINAL ; +BEGIN + Assert (IsVar (LastIterator)) ; + (* If By > 0 then. *) + (* q+1 if >= by0 q+3. *) + (* q+2 GotoOp q+else. *) + PushTFtok (BySym, ByType, bytok) ; (* BuildRelOp 1st parameter *) + PushT (GreaterEqualTok) ; (* 2nd parameter *) + (* 3rd parameter *) + PushZero (bytok, ByType) ; + BuildRelOp (e2tok) ; (* Choose final expression position. *) + PopBool (t, f) ; + BackPatch (t, NextQuad) ; + + (* LastIterator := ((e2-e1) DIV By) * By + e1. *) + PushTF (LastIterator, GetSType (LastIterator)) ; + PushTFtok (e2, GetSType (e2), e2tok) ; + PushT (MinusTok) ; + PushTFtok (e1, GetSType (e1), e1tok) ; + doBuildBinaryOp (TRUE, FALSE) ; + PushT (DivideTok) ; + PushTFtok (BySym, ByType, bytok) ; + doBuildBinaryOp (FALSE, FALSE) ; + PushT (TimesTok) ; + PushTFtok (BySym, ByType, bytok) ; + doBuildBinaryOp (FALSE, FALSE) ; + PushT (ArithPlusTok) ; + PushTFtok (e1, GetSType (e1), e1tok) ; + doBuildBinaryOp (FALSE, FALSE) ; + BuildForLoopToRangeCheck ; + BuildAssignmentWithoutBounds (e1tok, FALSE, FALSE) ; + GenQuad (GotoOp, NulSym, NulSym, 0) ; + ElseQuad := NextQuad-1 ; + + (* Else. *) + + BackPatch (f, Ne
Results for 20240502 master r15-113-g67e66c973ce31e (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit 67e66c973ce31e375caa9611b2db290fbfc1904d Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Fri May 3 01:01:36 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13768
Results for 20240502 master r15-110-g43dc4302b41815 (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit 43dc4302b4181535d24e83759514b774ae4dbfcc Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Thu May 2 15:14:34 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13696
Re: [PATCH] libgm2: re-generate with autoreconf
Simon Marchi writes: > > I don't have access to the gcc repo, so could you please push the patch > on my behalf? all done - many thanks for the patch! regards, Gaius
[gcc r15-113] modula2: Regenerate libgm2 Makefile.ins using correct include order
https://gcc.gnu.org/g:67e66c973ce31e375caa9611b2db290fbfc1904d commit r15-113-g67e66c973ce31e375caa9611b2db290fbfc1904d Author: Gaius Mulley Date: Thu May 2 14:38:51 2024 +0100 modula2: Regenerate libgm2 Makefile.ins using correct include order Regenerated libgm2/Makefile.in (and subdir Makefile.in) using aclocal -I .. -I ../config (or autoreconf). libgm2/ChangeLog: * Makefile.in: Regenerate. * libm2cor/Makefile.in: Ditto. * libm2iso/Makefile.in: Ditto. * libm2log/Makefile.in: Ditto. * libm2min/Makefile.in: Ditto. * libm2pim/Makefile.in: Ditto. * aclocal.m4: Ditto. Signed-off-by: Gaius Mulley Diff: --- libgm2/Makefile.in | 10 +- libgm2/aclocal.m4 | 10 +- libgm2/libm2cor/Makefile.in | 10 +- libgm2/libm2iso/Makefile.in | 10 +- libgm2/libm2log/Makefile.in | 10 +- libgm2/libm2min/Makefile.in | 10 +- libgm2/libm2pim/Makefile.in | 10 +- 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/libgm2/Makefile.in b/libgm2/Makefile.in index f259df7842c..9cd79824a53 100644 --- a/libgm2/Makefile.in +++ b/libgm2/Makefile.in @@ -90,15 +90,15 @@ host_triplet = @host@ target_triplet = @target@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ - $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ - $(top_srcdir)/../config/acx.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/lead-dot.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/override.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/../config/gc++filt.m4 \ $(top_srcdir)/../config/tls.m4 $(top_srcdir)/../config/gthr.m4 \ $(top_srcdir)/../config/cet.m4 $(top_srcdir)/configure.ac diff --git a/libgm2/aclocal.m4 b/libgm2/aclocal.m4 index bee67b05dee..19cfb0d1eb2 100644 --- a/libgm2/aclocal.m4 +++ b/libgm2/aclocal.m4 @@ -1187,15 +1187,15 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR -m4_include([../libtool.m4]) -m4_include([../ltoptions.m4]) -m4_include([../ltsugar.m4]) -m4_include([../ltversion.m4]) -m4_include([../lt~obsolete.m4]) m4_include([../config/acx.m4]) m4_include([../config/depstand.m4]) m4_include([../config/lead-dot.m4]) m4_include([../config/multi.m4]) m4_include([../config/no-executables.m4]) m4_include([../config/override.m4]) +m4_include([../libtool.m4]) +m4_include([../ltoptions.m4]) +m4_include([../ltsugar.m4]) +m4_include([../ltversion.m4]) +m4_include([../lt~obsolete.m4]) m4_include([acinclude.m4]) diff --git a/libgm2/libm2cor/Makefile.in b/libgm2/libm2cor/Makefile.in index 63299388dd8..f9952cff71a 100644 --- a/libgm2/libm2cor/Makefile.in +++ b/libgm2/libm2cor/Makefile.in @@ -108,15 +108,15 @@ target_triplet = @target@ @BUILD_CORLIB_TRUE@@ENABLE_DARWIN_AT_RPATH_TRUE@am__append_1 = -nodefaultrpaths -Wl,-rpath,@loader_path/ subdir = libm2cor ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \ - $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ - $(top_srcdir)/../config/acx.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/lead-dot.m4 \ $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/override.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/../config/override.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/../config/gc++filt.m4 \ $(top_srcdir)/../config/tls.m4 $(top_srcdir)/../config/gthr.m4 \ $(top_srcdir)/../config/cet.m4 $(top_srcdir)/configure.ac diff --git a/libgm2/libm2iso/Makefile.in b/libgm2/libm2iso/Makefile.in index 964c6da8527..370837f15b8 100644 --- a/libgm2/libm2iso/Makefile.in +++ b/libgm2/libm2iso/Makefile.in @@ -108,15 +108,15 @@ target_triplet = @target@ @BUILD_ISOLIB_TRUE@@ENABLE_DARWIN_AT_RPATH_TRUE@am__append_1 = -nodefaultrpaths -Wl,-rpath,@loader_path/ subdir = libm2iso ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/../ltoptions.m4
[gcc r15-110] PR modula2/113836 gm2 does not dump gimple or quadruples to a file
https://gcc.gnu.org/g:43dc4302b4181535d24e83759514b774ae4dbfcc commit r15-110-g43dc4302b4181535d24e83759514b774ae4dbfcc Author: Gaius Mulley Date: Thu May 2 13:16:07 2024 +0100 PR modula2/113836 gm2 does not dump gimple or quadruples to a file This patch completes the implementation of dumping the intermediate forms to file. It implements the filtering on symbol rules. Filtering can be performed through the full text name (given to the GCC tree) or qualified modula-2 symbol or filename:qualident. gcc/ChangeLog: PR modula2/113836 * doc/gm2.texi (Compiler options): Add -fm2-debug-trace=, -fm2-dump, -fm2-dump-decl=, -fm2-dump-gimple=, -fm2-dump-quad= and -fm2-dump-filter=. gcc/m2/ChangeLog: PR modula2/113836 * gm2-compiler/M2AsmUtil.def: Remove export qualified and unused import. * gm2-compiler/M2LangDump.mod (AddRuleTextDump): New procedure. (AddRuleScopeQualidentDump): Add warning check against unmatched rule. (GenQualidentSymString): New procedure function. (IdentQualidentMatch): New procedure function. (IsRuleFilenameMatch): New procedure function. (CheckRuleMatch): New procedure function. (AddRuleFilenameDump): New procedure function. * gm2-gcc/m2misc.cc (m2misc_warning_m2_dump_filter): New function. * gm2-gcc/m2misc.def (warning_m2_dump_filter): New procedure. * gm2-gcc/m2misc.h (m2misc_warning_m2_dump_filter): New prototype. * gm2-gcc/m2pp.cc (VERBOSE_TYPE_DESC): New define. (m2pp_identifier): Define out verbose type info. (m2pp_constructor): Define out verbose type info. (m2pp_assignment): Define out verbose type info. * gm2-lang.cc (ENABLE_M2DUMP_ALL): Remove. * lang.opt (fm2-dump): Add. (fm2-dump-decl=): Add. (fm2-dump-gimple=): Add. (fm2-dump-quad=): Add. (fm2-dump-filter=): Add. Signed-off-by: Gaius Mulley Diff: --- gcc/doc/gm2.texi | 39 -- gcc/m2/gm2-compiler/M2AsmUtil.def | 2 - gcc/m2/gm2-compiler/M2LangDump.mod | 150 +++-- gcc/m2/gm2-gcc/m2misc.cc | 10 +++ gcc/m2/gm2-gcc/m2misc.def | 3 +- gcc/m2/gm2-gcc/m2misc.h| 1 + gcc/m2/gm2-gcc/m2pp.cc | 21 +- gcc/m2/gm2-lang.cc | 4 - gcc/m2/lang.opt| 20 + 9 files changed, 225 insertions(+), 25 deletions(-) diff --git a/gcc/doc/gm2.texi b/gcc/doc/gm2.texi index 19b864573c1..b38d6a15de0 100644 --- a/gcc/doc/gm2.texi +++ b/gcc/doc/gm2.texi @@ -466,10 +466,39 @@ this option forces the use of the static version. @c Modula-2 Joined @c set all location values to a specific value (internal switch) -@c fm2-debug-trace= -@c Modula-2 Joined -@c turn on trace debugging using a comma separated list: -@c line,token,quad,all. +@item -fm2-debug-trace= +turn on trace debugging using a comma separated list: +@samp{line,token,quad,all}. This is an internal command line option. + +@item -fm2-dump= +enable dumping of modula-2 internal representation of data structures +using a comma separated list. The list can contain: +@samp{quad,gimple,decl,all}. + +@item -fm2-dump-decl=@file{filestem} +dump the modula-2 representation of a symbol to the @file{filestem} +specified. This option only takes effect if the +@samp{-fm2-dump-filter} is specified. + +@item -fm2-dump-gimple=@file{filestem} +dump modula-2 gimple representation to the @file{filestem} specified. + +@item -fm2-dump-quad=@file{filestem} +dump quadruple representation to the @file{filestem} specified. + +@item -fm2-dump-filter=@samp{rules} +filter the language dumps @samp{-fdump-lang-decl}, +@samp{-fdump-lang-gimple} and@samp{-fdump-lang-quad} +on @samp{rules}. @samp{rules} must be a comma +separated list which can take three forms: the full decl textual name +of a procedure, @samp{[libname.]module.ident} or +@samp{[filename:]module.ident}. This is an internal command line +option. Currently it only filters on procedure names and regexp +matching is not implemented. Three examples of its use following +the previous forms could be: +@code{-fm2-dump-filter=_M2_hello_init}, +@code{-fm2-dump-filter=m2pim.StrIO.WriteString} and +@code{-fm2-dump-filter=StrLib.mod:StrIO.WriteString}. @item -fm2-g improve the debugging experience for new programmers at the expense @@ -487,7 +516,7 @@ specify the module mangled prefix name for all modules in the following include paths. @item -fm2-pathnameI -for internal use only: used by the driver to copy the user facing -I +for internal use only: used by the driver to copy the user facing @samp{-I} option. @item -fm2-plugin diff --git a/gcc/m2/gm2-compiler/M2AsmUtil.def b/gcc/m2/gm2-compiler
Results for 20240430 master r15-70-g0b2735e0797fee (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit 0b2735e0797fee9b4ec5cd74f22afe0483f888dd Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Thu May 2 12:14:57 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13696
Results for 20240430 master r15-70-g0b2735e0797fee (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit 0b2735e0797fee9b4ec5cd74f22afe0483f888dd Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Thu May 2 11:19:44 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13696
Results for 20240430 master r15-70-g0b2735e0797fee (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit 0b2735e0797fee9b4ec5cd74f22afe0483f888dd Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Wed May 1 23:10:41 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13696
Results for 20240430 master r15-70-g0b2735e0797fee (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit 0b2735e0797fee9b4ec5cd74f22afe0483f888dd Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Tue Apr 30 17:19:33 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13696
Re: [PATCH] testsuite: gm2: Remove timeout overrides [PR114886]
Rainer Orth writes: > Hi Gaius, > >> yes this looks good to me please apply. Thanks for the rationale > > done for trunk. I guess it's ok to apply to the gcc-14 branch after the > release and some soak time? many thanks - and yes certainly also to gcc-14 (after an appropriate amount of delay), regards, Gaius
[pushed] wwwdocs: modula2 update for changes.html, index.html, readings.html and frontends.html
Pushed the commit c74a573fa888f3970b6b38d57020f0160e49e58a frontends.html: Mention modula-2 was merged during gcc-13. gcc-14/changes.html: New section heading for modula-2 and populate. index.html: Add modula-2 to the list of languages supported by GCC. readings.html (Modula 2 information): New section containing PIM2, PIM4 and ISO standard links. regards, Gaius diff --git a/htdocs/frontends.html b/htdocs/frontends.html index d47b56b6..2dec80c9 100644 --- a/htdocs/frontends.html +++ b/htdocs/frontends.html @@ -43,8 +43,8 @@ has a back end that generates assembler directly, using the GCC back end. http://www.nongnu.org/gm2/;>GNU Modula-2 implements the ISO/IEC 10514-1, PIM2, PIM3 and PIM4 dialects of the language. The compiler is operational with GCC 10, GCC 11, and GCC 12 (on -GNU/Linux x86 systems). The front end is now in the GCC development -trunk (GCC 13). It is mostly written in Modula-2 and includes a +GNU/Linux x86 systems). The front end was merged into the GCC tree +during GCC 13. It is mostly written in Modula-2 and includes a bootstrap tool which translates Modula-2 into C/C++. Modula-3 (for links see +Modula-2 + + The automatic dependency generation options: -M, +-MD, -MF, +-MMD, -MP, -MQ and +-MT have been implemented in the compiler. + + The -Wcase-enum +and -Wuninit-variable-checking= options have +been implemented to provide compile time warnings against +missing case clauses and uninitialized variables respectively. + + + libgccjit diff --git a/htdocs/index.html b/htdocs/index.html index 7eac5eab..d80ef5d7 100644 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -19,7 +19,7 @@ C, C++, Objective-C, Fortran, -Ada, Go, and D, as well as libraries for these languages (libstdc++,...). +Ada, Go, D and Modula-2 as well as libraries for these languages (libstdc++,...). GCC was originally written as the compiler for the http://www.gnu.org/gnu/thegnuproject.html;>GNU operating system. The GNU system was developed to be 100% free software, free in the sense diff --git a/htdocs/readings.html b/htdocs/readings.html index ee77d969..0f6032c2 100644 --- a/htdocs/readings.html +++ b/htdocs/readings.html @@ -559,6 +559,18 @@ names. +Modula 2 information + + + https://www.research-collection.ethz.ch/handle/20.500.11850/68683;>Programming + in Modula-2 (Edition 2) + https://freepages.modula2.org/report4/modula-2.html;>Programming + in Modula-2 (Edition 4) + http://sc22wg13.twi.tudelft.nl;>ISO Modula-2 standards + (base language, OO and generic language extensions) + + + Modula 3 information
gcc-wwwdocs branch master updated. c74a573fa888f3970b6b38d57020f0160e49e58a
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "gcc-wwwdocs". The branch, master has been updated via c74a573fa888f3970b6b38d57020f0160e49e58a (commit) from 0c1bfb5e6891b972c5706ba1724ae0f9f6b3fe85 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log - commit c74a573fa888f3970b6b38d57020f0160e49e58a Author: Gaius Mulley Date: Tue Apr 30 14:26:15 2024 +0100 frontends.html: Mention modula-2 was merged during gcc-13. gcc-14/changes.html: New section heading for modula-2 and populate. index.html: Add modula-2 to the list of languages supported by GCC. readings.html (Modula 2 information): New section containing PIM2, PIM4 and ISO standard links. Signed-off-by: Gaius Mulley diff --git a/htdocs/frontends.html b/htdocs/frontends.html index d47b56b6..2dec80c9 100644 --- a/htdocs/frontends.html +++ b/htdocs/frontends.html @@ -43,8 +43,8 @@ has a back end that generates assembler directly, using the GCC back end. http://www.nongnu.org/gm2/;>GNU Modula-2 implements the ISO/IEC 10514-1, PIM2, PIM3 and PIM4 dialects of the language. The compiler is operational with GCC 10, GCC 11, and GCC 12 (on -GNU/Linux x86 systems). The front end is now in the GCC development -trunk (GCC 13). It is mostly written in Modula-2 and includes a +GNU/Linux x86 systems). The front end was merged into the GCC tree +during GCC 13. It is mostly written in Modula-2 and includes a bootstrap tool which translates Modula-2 into C/C++. Modula-3 (for links see +Modula-2 + + The automatic dependency generation options: -M, +-MD, -MF, +-MMD, -MP, -MQ and +-MT have been implemented in the compiler. + + The -Wcase-enum +and -Wuninit-variable-checking= options have +been implemented to provide compile time warnings against +missing case clauses and uninitialized variables respectively. + + + libgccjit diff --git a/htdocs/index.html b/htdocs/index.html index 7eac5eab..d80ef5d7 100644 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -19,7 +19,7 @@ C, C++, Objective-C, Fortran, -Ada, Go, and D, as well as libraries for these languages (libstdc++,...). +Ada, Go, D and Modula-2 as well as libraries for these languages (libstdc++,...). GCC was originally written as the compiler for the http://www.gnu.org/gnu/thegnuproject.html;>GNU operating system. The GNU system was developed to be 100% free software, free in the sense diff --git a/htdocs/readings.html b/htdocs/readings.html index ee77d969..0f6032c2 100644 --- a/htdocs/readings.html +++ b/htdocs/readings.html @@ -559,6 +559,18 @@ names. +Modula 2 information + + + https://www.research-collection.ethz.ch/handle/20.500.11850/68683;>Programming + in Modula-2 (Edition 2) + https://freepages.modula2.org/report4/modula-2.html;>Programming + in Modula-2 (Edition 4) + http://sc22wg13.twi.tudelft.nl;>ISO Modula-2 standards + (base language, OO and generic language extensions) + + + Modula 3 information --- Summary of changes: htdocs/frontends.html | 4 ++-- htdocs/gcc-14/changes.html | 14 ++ htdocs/index.html | 2 +- htdocs/readings.html | 12 4 files changed, 29 insertions(+), 3 deletions(-) hooks/post-receive -- gcc-wwwdocs
Re: [PATCH] libgm2: re-generate with autoreconf
Christophe Lyon writes: > On Tue, 30 Apr 2024 at 04:01, Simon Marchi wrote: >> >> I get a diff when running "autoreconf" in this directory. I think that >> the current state is erroneous: it appears to have been generated using >> >> aclocal -I ../config -I .. >> >> even though configure.ac and Makefile.am list the include flag in the >> reverse order: >> >>aclocal -I .. -I ../config >> >> Running "autoreconf" uses the latter order, so I think that's the >> "right" output. >> >> No functional difference expected. > > Thanks, this matches what I noticed. > I'm not a maintainer, so I cannot approve, but a minor remark: in GCC > we still need a ChangeLog entry in the commit message. > > Christophe many thanks for spotting this bug, lgtm, regards, Gaius
Re: [PATCH] testsuite: gm2: Remove timeout overrides [PR114886]
Rainer Orth writes: > A large number of gm2 tests are timing out even on current Solaris/SPARC > systems. As detailed in the PR, the problem is that the gm2 testsuite > artificially lowers many timeouts way below the DejaGnu default of 300 > seconds, often as short as 10 seconds. The problem lies both in the > values (they may be appropriate for some targets, but too low for > others, especially under high load) and the fact that it uses absolute > values, overriding e.g. settings from a build-wide site.exp. > > Therefore this patch removes all those overrides, restoring the > defaults. > > Tested on sparc-sun-solaris2.11 (where all the previous timeouts are > gone) and i386-pc-solaris2.11. > > Ok for trunk and the gcc-14 branch once GCC 14.1.0 has been released? yes this looks good to me please apply. Thanks for the rationale described in the PR. As suggested, locally changing site.exp is more appropriate should the need arise. The dg-timeout code was added to speed up testing/development of (a deadlocking) RTco.cc (which has since been fixed) regards, Gaius
Results for 20240425 master r14-10124-gd0e1e1291b1037 (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit d0e1e1291b10372d71ad3d6cb66b333ea91097e7 Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Thu Apr 25 19:33:45 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13696
[gcc r14-10124] PR modula2/114836 Avoid concatenation of error strings to aid error locale translation
https://gcc.gnu.org/g:d0e1e1291b10372d71ad3d6cb66b333ea91097e7 commit r14-10124-gd0e1e1291b10372d71ad3d6cb66b333ea91097e7 Author: Gaius Mulley Date: Thu Apr 25 18:31:55 2024 +0100 PR modula2/114836 Avoid concatenation of error strings to aid error locale translation This patch avoids a concatenation of error strings making locale translation of the error message easier. gcc/m2/ChangeLog: PR modula2/114836 * gm2-compiler/M2Range.mod (FoldTypeAssign): Avoid error string concatenation. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/gm2-compiler/M2Range.mod | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/gcc/m2/gm2-compiler/M2Range.mod b/gcc/m2/gm2-compiler/M2Range.mod index 7686620a247..a8e572eff50 100644 --- a/gcc/m2/gm2-compiler/M2Range.mod +++ b/gcc/m2/gm2-compiler/M2Range.mod @@ -1706,20 +1706,17 @@ BEGIN THEN (* Expression type compatibility rules for pass by reference parameters. *) compatible := ParameterTypeCompatible (tokenNo, - '{%4EN} parameter failure due to expression incompatibility ' + - 'between actual parameter {%3ad} and the {%4N} formal {%2ad} parameter in procedure {%1ad}', + '{%4EN} parameter failure due to expression incompatibility between actual parameter {%3ad} and the {%4N} formal {%2ad} parameter in procedure {%1ad}', procedure, formal, actual, paramNo, TRUE) ELSIF GetPIM () THEN (* Assignment type compatibility rules for pass by value PIM parameters. *) compatible := ParameterTypeCompatible (tokenNo, - '{%4EN} parameter failure due to assignment incompatibility ' + - 'between actual parameter {%3ad} and the {%4N} formal {%2ad} parameter in procedure {%1ad}', + '{%4EN} parameter failure due to assignment incompatibility between actual parameter {%3ad} and the {%4N} formal {%2ad} parameter in procedure {%1ad}', procedure, formal, actual, paramNo, FALSE) ELSE compatible := ParameterTypeCompatible (tokenNo, - '{%4EN} parameter failure due to parameter incompatibility ' + - 'between actual parameter {%3ad} and the {%4N} formal {%2ad} parameter in procedure {%1ad}', + '{%4EN} parameter failure due to parameter incompatibility between actual parameter {%3ad} and the {%4N} formal {%2ad} parameter in procedure {%1ad}', procedure, formal, actual, paramNo, FALSE) END ; IF compatible
Results for 20240425 master r14-10121-g070dd5c883ec2c (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit 070dd5c883ec2c0be542f448bd82d0f7f0ead390 Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Thu Apr 25 16:52:09 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13696
[gcc r14-10121] modula2: issue the parameter incompatibility error message based on dialect
https://gcc.gnu.org/g:070dd5c883ec2c0be542f448bd82d0f7f0ead390 commit r14-10121-g070dd5c883ec2c0be542f448bd82d0f7f0ead390 Author: Gaius Mulley Date: Thu Apr 25 15:19:30 2024 +0100 modula2: issue the parameter incompatibility error message based on dialect This tiny patch improves the parameter incompatibility error message by having a different message for the dialect chosen mentioning the specific violation. PIM uses assignment rules for pass by value and expression rules for pass by reference. ISO uses expression type checking for pass by value and pass by reference. gcc/m2/ChangeLog: * gm2-compiler/M2FileName.def (CalculateFileName): Remove quoted string in comment. * gm2-compiler/M2Range.mod (FoldTypeParam): Generate dialect specific parameter incompatibility error message. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/gm2-compiler/M2FileName.def | 2 +- gcc/m2/gm2-compiler/M2Range.mod| 32 +++- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/gcc/m2/gm2-compiler/M2FileName.def b/gcc/m2/gm2-compiler/M2FileName.def index 02413593003..01acb9b48d5 100644 --- a/gcc/m2/gm2-compiler/M2FileName.def +++ b/gcc/m2/gm2-compiler/M2FileName.def @@ -39,7 +39,7 @@ EXPORT QUALIFIED CalculateFileName, CalculateStemName, ExtractExtension ; given a module and an extension. This file name length will be operating system specific. String, Extension, is concatenated onto - Module and thus it is safe to `Mark' the extension + Module and thus it is safe to Mark the extension for garbage collection. *) diff --git a/gcc/m2/gm2-compiler/M2Range.mod b/gcc/m2/gm2-compiler/M2Range.mod index 4b8e5fadfe7..7686620a247 100644 --- a/gcc/m2/gm2-compiler/M2Range.mod +++ b/gcc/m2/gm2-compiler/M2Range.mod @@ -56,7 +56,7 @@ FROM M2Debug IMPORT Assert ; FROM Indexing IMPORT Index, InitIndex, InBounds, PutIndice, GetIndice ; FROM Storage IMPORT ALLOCATE ; FROM M2ALU IMPORT PushIntegerTree, PushInt, ConvertToInt, Equ, Gre, Less, GreEqu ; -FROM M2Options IMPORT VariantValueChecking, CaseEnumChecking ; +FROM M2Options IMPORT VariantValueChecking, CaseEnumChecking, GetPIM ; FROM M2Error IMPORT Error, InternalError, ErrorFormat0, ErrorFormat1, ErrorFormat2, FlushErrors, GetAnnounceScope ; @@ -1693,14 +1693,36 @@ END FoldTypeAssign ; (* - FoldTypeParam - + FoldTypeParam - performs a parameter check between actual and formal. + The quad is removed if the check succeeds. *) PROCEDURE FoldTypeParam (q: CARDINAL; tokenNo: CARDINAL; formal, actual, procedure: CARDINAL; paramNo: CARDINAL) ; +VAR + compatible: BOOLEAN ; BEGIN - IF ParameterTypeCompatible (tokenNo, - '{%4EN} parameter type failure between actual parameter type {%3ad} and the formal type {%2ad}', - procedure, formal, actual, paramNo, IsVarParam (procedure, paramNo)) + compatible := FALSE ; + IF IsVarParam (procedure, paramNo) + THEN + (* Expression type compatibility rules for pass by reference parameters. *) + compatible := ParameterTypeCompatible (tokenNo, + '{%4EN} parameter failure due to expression incompatibility ' + + 'between actual parameter {%3ad} and the {%4N} formal {%2ad} parameter in procedure {%1ad}', + procedure, formal, actual, paramNo, TRUE) + ELSIF GetPIM () + THEN + (* Assignment type compatibility rules for pass by value PIM parameters. *) + compatible := ParameterTypeCompatible (tokenNo, + '{%4EN} parameter failure due to assignment incompatibility ' + + 'between actual parameter {%3ad} and the {%4N} formal {%2ad} parameter in procedure {%1ad}', + procedure, formal, actual, paramNo, FALSE) + ELSE + compatible := ParameterTypeCompatible (tokenNo, + '{%4EN} parameter failure due to parameter incompatibility ' + + 'between actual parameter {%3ad} and the {%4N} formal {%2ad} parameter in procedure {%1ad}', + procedure, formal, actual, paramNo, FALSE) + END ; + IF compatible THEN SubQuad(q) END
Results for 20240425 master r14-10119-g1d238c84025aae (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit 1d238c84025aaef1641e4000bd2a8f4328b474dd Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Thu Apr 25 15:09:25 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13696
Re: [committed] Further spelling fixes in translatable strings
Jakub Jelinek writes: > On Tue, Apr 23, 2024 at 11:32:08AM +0100, Jonathan Wakely wrote: >> On Mon, 22 Apr 2024 at 22:30, Jakub Jelinek wrote: >> Yup: >> https://gcc.gnu.org/codingconventions.html#Spelling >> >> That spelling is explicitly mentioned at the link above, so they >> should be "ize" really. > > Ok. I've committed that patch plus the following as obvious too. > > I see various similar cases in m2 and rust FEs where they don't make it into > gcc/po/gcc.pot, guess those would be nice to get fixed too, end best even > find out > how to make those messages translatable. > Talking about e.g. > m2/gm2-compiler/M2Quads.mod:'%a unrecognised builtin > constant', Id) | > m2/gm2-compiler/M2Quads.mod: InternalError ('unrecognised value') many thanks for spotting these errors - I'll look into getting the messages translatable, regards, Gaius
Results for 20240422 master r14-10080-gb909daa5b67317 (GCC) testsuite on aarch64-unknown-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --disable-multilib --enable-plugin --enable-bootstrap gcc-branch: master git commit b909daa5b67317e46543a7b2ed76e82298645cf6 Linux 5.19.0-rc7-asahi-2-gbfe8f1b7e230 #1 SMP Sat Jul 23 17:21:00 CEST 2022 aarch64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Mon Apr 22 21:15:38 2024 Native configuration is aarch64-unknown-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13802
Results for 20240422 master r14-10080-gb909daa5b67317 (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit b909daa5b67317e46543a7b2ed76e82298645cf6 Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Mon Apr 22 21:26:28 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13696
[gcc r14-10080] PR modula2/114811 string set incl ICE bugfix
https://gcc.gnu.org/g:b909daa5b67317e46543a7b2ed76e82298645cf6 commit r14-10080-gb909daa5b67317e46543a7b2ed76e82298645cf6 Author: Gaius Mulley Date: Mon Apr 22 20:34:11 2024 +0100 PR modula2/114811 string set incl ICE bugfix This patch corrects gm2-torture.exp to recognize an ICE in the fail case as a negative result. The patch also fixes FoldBinarySet so that the types are only checked once the operands have been resolved. Without this patch gcc/testsuite/gm2/iso/fail/badexpression2.mod would cause an ICE. gcc/m2/ChangeLog: PR modula2/114811 * gm2-compiler/M2GenGCC.mod (FoldBinarySet): Add condition checking to ensure op2 and op3 are fully resolved before type checking is performed. gcc/testsuite/ChangeLog: PR modula2/114811 * lib/gm2-torture.exp: Correct regexp checking for internal compiler error strings in compiler output. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/gm2-compiler/M2GenGCC.mod | 43 +-- gcc/testsuite/lib/gm2-torture.exp | 7 --- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/gcc/m2/gm2-compiler/M2GenGCC.mod b/gcc/m2/gm2-compiler/M2GenGCC.mod index da52c924974..26ed399b24c 100644 --- a/gcc/m2/gm2-compiler/M2GenGCC.mod +++ b/gcc/m2/gm2-compiler/M2GenGCC.mod @@ -5000,29 +5000,32 @@ BEGIN TryDeclareConstant(tokenno, op3) ; location := TokenToLocation(tokenno) ; - IF CheckBinaryExpressionTypes (quad, p) + IF GccKnowsAbout(op2) AND GccKnowsAbout(op3) THEN - IF IsConst(op2) AND IsConstSet(op2) AND - IsConst(op3) AND IsConstSet(op3) AND - IsConst(op1) + IF CheckBinaryExpressionTypes (quad, p) THEN - IF IsValueSolved(op2) AND IsValueSolved(op3) + IF IsConst(op2) AND IsConstSet(op2) AND +IsConst(op3) AND IsConstSet(op3) AND +IsConst(op1) THEN -Assert(MixTypes(FindType(op3), FindType(op2), tokenno)#NulSym) ; -PutConst(op1, MixTypes(FindType(op3), FindType(op2), tokenno)) ; -PushValue(op2) ; -PushValue(op3) ; -op(tokenno) ; -PopValue(op1) ; -PushValue(op1) ; -PutConstSet(op1) ; -AddModGcc(op1, - DeclareKnownConstant(location, - Mod2Gcc(GetType(op3)), - PopSetTree(tokenno))) ; -p(op1) ; -NoChange := FALSE ; -SubQuad(quad) +IF IsValueSolved(op2) AND IsValueSolved(op3) +THEN + Assert(MixTypes(FindType(op3), FindType(op2), tokenno)#NulSym) ; + PutConst(op1, MixTypes(FindType(op3), FindType(op2), tokenno)) ; + PushValue(op2) ; + PushValue(op3) ; + op(tokenno) ; + PopValue(op1) ; + PushValue(op1) ; + PutConstSet(op1) ; + AddModGcc(op1, + DeclareKnownConstant(location, + Mod2Gcc(GetType(op3)), + PopSetTree(tokenno))) ; + p(op1) ; + NoChange := FALSE ; + SubQuad(quad) +END END END END diff --git a/gcc/testsuite/lib/gm2-torture.exp b/gcc/testsuite/lib/gm2-torture.exp index 090929954ca..c29b0b4d1a0 100644 --- a/gcc/testsuite/lib/gm2-torture.exp +++ b/gcc/testsuite/lib/gm2-torture.exp @@ -138,7 +138,7 @@ proc gm2-torture-compile { src option } { proc gm2_check_compile_fail {testcase option objname gcc_output} { global tool; -set fatal_signal "*cc: Internal compiler error: program*got fatal signal" +set fatal_signal "*nternal compiler error: program*got fatal signal" if [string match "$fatal_signal 6" $gcc_output] then { ${tool}_fail $testcase "Got Signal 6, $option" @@ -170,8 +170,9 @@ proc gm2_check_compile_fail {testcase option objname gcc_output} { regsub -all -- "\[\r\n\]*" $gcc_output "" gcc_output # check for any internal error -if { [string match "internal error" $gcc_output] || -[string match "internal compiler error" $gcc_output] } then { +if { [string match "*internal error*" $gcc_output] || +[string match "*internal compiler error*" $gcc_output] } then { + puts stderr "ICE: " ${tool}_fail $testcase $option return 0 }
Results for 20240422 master r14-10077-gb0469e35dbcc9a (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit b0469e35dbcc9a93a2cb50e3c0445edc3db174be Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Mon Apr 22 20:28:43 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13696
Results for 20240422 master r14-10077-gb0469e35dbcc9a (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit b0469e35dbcc9a93a2cb50e3c0445edc3db174be Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Mon Apr 22 19:11:17 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13696
[gcc r14-10077] PR modula2/114807 badpointer3.mod causes an ICE
https://gcc.gnu.org/g:b0469e35dbcc9a93a2cb50e3c0445edc3db174be commit r14-10077-gb0469e35dbcc9a93a2cb50e3c0445edc3db174be Author: Gaius Mulley Date: Mon Apr 22 18:19:32 2024 +0100 PR modula2/114807 badpointer3.mod causes an ICE This patch fixes an ICE caused when a constant string is built and attempted to be passed into a procedure with an opaque type. gcc/m2/ChangeLog: PR modula2/114807 * gm2-compiler/M2Check.mod (checkUnbounded): Remove unused local variables. (constCheckMeta): Include check for IsReallyPointer in the failure case. * gm2-compiler/M2Quads.mod (MoveWithMode): Remove CopyConstString. * gm2-compiler/SymbolTable.def (IsHiddenReallyPointer): Export. * gm2-compiler/SymbolTable.mod (SkipHiddenType): Remove. (IsReallyPointer): Include IsHiddenReallyPointer test. gcc/testsuite/ChangeLog: PR modula2/114807 * gm2/pim/fail/badproctype.mod: Change MYSHORTREAL to SHORTREAL. * gm2/pim/fail/badprocbool.mod: New test. * gm2/pim/fail/badproccard.mod: New test. * gm2/pim/fail/badprocint.mod: New test. * gm2/pim/fail/badprocint2.mod: New test. * gm2/pim/pass/goodproccard2.mod: New test. * gm2/pim/pass/goodprocint.mod: New test. * gm2/pim/pass/goodprocint3.mod: New test. * gm2/pim/run/pass/genconststr.mod: New test. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/gm2-compiler/M2Check.mod| 9 gcc/m2/gm2-compiler/M2Quads.mod| 3 +-- gcc/m2/gm2-compiler/SymbolTable.def| 8 +++ gcc/m2/gm2-compiler/SymbolTable.mod| 29 -- gcc/testsuite/gm2/pim/fail/badprocbool.mod | 13 gcc/testsuite/gm2/pim/fail/badproccard.mod | 13 gcc/testsuite/gm2/pim/fail/badprocint.mod | 17 +++ gcc/testsuite/gm2/pim/fail/badprocint2.mod | 14 + gcc/testsuite/gm2/pim/fail/badproctype.mod | 9 +++- gcc/testsuite/gm2/pim/pass/goodproccard2.mod | 16 ++ gcc/testsuite/gm2/pim/pass/goodprocint.mod | 13 gcc/testsuite/gm2/pim/pass/goodprocint3.mod| 14 + gcc/testsuite/gm2/pim/run/pass/genconststr.mod | 23 13 files changed, 143 insertions(+), 38 deletions(-) diff --git a/gcc/m2/gm2-compiler/M2Check.mod b/gcc/m2/gm2-compiler/M2Check.mod index a4451938b88..1750fe07ecf 100644 --- a/gcc/m2/gm2-compiler/M2Check.mod +++ b/gcc/m2/gm2-compiler/M2Check.mod @@ -47,7 +47,8 @@ FROM SymbolTable IMPORT NulSym, IsRecord, IsSet, GetDType, GetSType, IsType, IsReallyPointer, IsPointer, IsParameter, ModeOfAddr, GetMode, GetType, IsUnbounded, IsComposite, IsConstructor, IsParameter, IsConstString, IsConstLitInternal, IsConstLit, -GetStringLength, GetProcedureProcType ; +GetStringLength, GetProcedureProcType, IsHiddenType, +IsHiddenReallyPointer ; FROM M2GCCDeclare IMPORT GetTypeMin, GetTypeMax ; FROM M2System IMPORT Address ; @@ -264,9 +265,6 @@ END checkSubrange ; *) PROCEDURE checkUnbounded (result: status; tinfo: tInfo; unbounded, right: CARDINAL) : status ; -VAR - lLow, rLow, - lHigh, rHigh: CARDINAL ; BEGIN (* Firstly check to see if we have resolved this as false. *) IF isFalse (result) @@ -683,7 +681,8 @@ BEGIN THEN RETURN result ELSIF IsSet (typeRight) OR IsEnumeration (typeRight) OR - IsProcedure (typeRight) OR IsRecord (typeRight) + IsProcedure (typeRight) OR IsRecord (typeRight) OR + IsReallyPointer (typeRight) THEN RETURN false ELSIF IsArray (typeRight) diff --git a/gcc/m2/gm2-compiler/M2Quads.mod b/gcc/m2/gm2-compiler/M2Quads.mod index 68b91201702..8a9a23013b2 100644 --- a/gcc/m2/gm2-compiler/M2Quads.mod +++ b/gcc/m2/gm2-compiler/M2Quads.mod @@ -73,7 +73,7 @@ FROM SymbolTable IMPORT ModeOfAddr, GetMode, PutMode, GetSymName, IsUnknown, GetModuleQuads, GetProcedureQuads, GetModuleCtors, MakeProcedure, -CopyConstString, PutConstStringKnown, +PutConstStringKnown, PutModuleStartQuad, PutModuleEndQuad, PutModuleFinallyStartQuad, PutModuleFinallyEndQuad, PutProcedureStartQuad, PutProcedureEndQuad, @@ -3454,7 +3454,6 @@ BEGIN THEN GenQuadOtok (tokno, BecomesOp, Des, NulSym, Exp, TRUE, destok, UnknownTokenNo, exptok) ; - CopyConstString (tokno, Des, Exp) ELSE IF GetMode(Des)=RightValue THEN diff --git
Results for 20240420 master r14-10053-gf9a48fe7032d98 (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit f9a48fe7032d9894e88d0d121ba6f75b08ea5dcb Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Mon Apr 22 17:32:23 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13678
Results for 20240420 master r14-10053-gf9a48fe7032d98 (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit f9a48fe7032d9894e88d0d121ba6f75b08ea5dcb Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Mon Apr 22 00:56:43 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13678
Results for 20240420 master r14-10053-gf9a48fe7032d98 (GCC) testsuite on aarch64-unknown-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --disable-multilib --enable-plugin --enable-bootstrap gcc-branch: master git commit f9a48fe7032d9894e88d0d121ba6f75b08ea5dcb Linux 5.19.0-rc7-asahi-2-gbfe8f1b7e230 #1 SMP Sat Jul 23 17:21:00 CEST 2022 aarch64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Sat Apr 20 15:00:32 2024 Native configuration is aarch64-unknown-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13742
[gcc r14-10053] PR modula2/112893 full type checking between proctype and procedure not implemented
https://gcc.gnu.org/g:f9a48fe7032d9894e88d0d121ba6f75b08ea5dcb commit r14-10053-gf9a48fe7032d9894e88d0d121ba6f75b08ea5dcb Author: Gaius Mulley Date: Sat Apr 20 14:35:18 2024 +0100 PR modula2/112893 full type checking between proctype and procedure not implemented This patch implements full type checking between proctype and procedures. The change implements an associated proc type built for each procedure. M2Check.mod will request GetProcedureProcType if it encounters a procedure. Before this patch a procedure was associated with the type ADDRESS in the type checking module M2Check. The gm2/pim/pass/proccard.mod have been corrected now this assumption has been removed. gcc/m2/ChangeLog: PR modula2/112893 * gm2-compiler/M2Check.mod (GetProcedureProcType): Import. (getType): Return value using GetProcedureProcType if sym is a procedure. * gm2-compiler/M2Range.mod (FoldTypeExpr): Remove quad if expression is type compatible. * gm2-compiler/SymbolTable.def (GetProcedureProcType): New procedure function. * gm2-compiler/SymbolTable.mod (Procedure): Add ProcedureType. (MakeProcedure): Initialize ProcedureType. (PutParam): Call AddProcedureProcTypeParam. (PutVarParam): Call AddProcedureProcTypeParam. (AddProcedureProcTypeParam): New procedure. (GetProcedureProcType): New procedure function. gcc/testsuite/ChangeLog: PR modula2/112893 * gm2/pim/pass/another.mod: Correct bug exposed by type checker. Swap ProcA and ProcB assignments. * gm2/pim/pass/proccard.mod: Use VAL to convert procedure into a cardinal. * gm2/iso/const/fail/castproctype.mod: New test. * gm2/pim/fail/badproctype.mod: New test. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/gm2-compiler/M2Check.mod | 4 +- gcc/m2/gm2-compiler/M2Range.mod | 3 +- gcc/m2/gm2-compiler/SymbolTable.def | 7 +++ gcc/m2/gm2-compiler/SymbolTable.mod | 76 --- gcc/testsuite/gm2/iso/const/fail/castproctype.mod | 19 ++ gcc/testsuite/gm2/pim/fail/badproctype.mod| 37 +++ gcc/testsuite/gm2/pim/pass/another.mod| 8 +-- gcc/testsuite/gm2/pim/pass/proccard.mod | 3 +- 8 files changed, 141 insertions(+), 16 deletions(-) diff --git a/gcc/m2/gm2-compiler/M2Check.mod b/gcc/m2/gm2-compiler/M2Check.mod index 20d463d207b..a4451938b88 100644 --- a/gcc/m2/gm2-compiler/M2Check.mod +++ b/gcc/m2/gm2-compiler/M2Check.mod @@ -47,7 +47,7 @@ FROM SymbolTable IMPORT NulSym, IsRecord, IsSet, GetDType, GetSType, IsType, IsReallyPointer, IsPointer, IsParameter, ModeOfAddr, GetMode, GetType, IsUnbounded, IsComposite, IsConstructor, IsParameter, IsConstString, IsConstLitInternal, IsConstLit, -GetStringLength ; +GetStringLength, GetProcedureProcType ; FROM M2GCCDeclare IMPORT GetTypeMin, GetTypeMax ; FROM M2System IMPORT Address ; @@ -1397,7 +1397,7 @@ PROCEDURE getType (sym: CARDINAL) : CARDINAL ; BEGIN IF (sym # NulSym) AND IsProcedure (sym) THEN - RETURN Address + RETURN GetProcedureProcType (sym) ELSIF IsTyped (sym) THEN RETURN GetDType (sym) diff --git a/gcc/m2/gm2-compiler/M2Range.mod b/gcc/m2/gm2-compiler/M2Range.mod index 50c2a48fe7f..4b8e5fadfe7 100644 --- a/gcc/m2/gm2-compiler/M2Range.mod +++ b/gcc/m2/gm2-compiler/M2Range.mod @@ -1719,7 +1719,8 @@ BEGIN 'expression of type {%1Etad} is incompatible with type {%2tad}', left, right, strict, isin) THEN - SubQuad(q) ; + SubQuad(q) + ELSE setReported (r) END END diff --git a/gcc/m2/gm2-compiler/SymbolTable.def b/gcc/m2/gm2-compiler/SymbolTable.def index ec48631e43f..d7f0f8d943c 100644 --- a/gcc/m2/gm2-compiler/SymbolTable.def +++ b/gcc/m2/gm2-compiler/SymbolTable.def @@ -1394,6 +1394,13 @@ PROCEDURE PutProcedureNoReturn (Sym: CARDINAL; value: BOOLEAN) ; PROCEDURE IsProcedureNoReturn (Sym: CARDINAL) : BOOLEAN ; +(* + GetProcedureProcType - returns the proctype matching procedure sym. +*) + +PROCEDURE GetProcedureProcType (sym: CARDINAL) : CARDINAL ; + + (* PutModuleStartQuad - Places QuadNumber into the Module symbol, Sym. QuadNumber is the start quad of Module, diff --git a/gcc/m2/gm2-compiler/SymbolTable.mod b/gcc/m2/gm2-compiler/SymbolTable.mod index 13ee1fb6fe3..7543bb52749 100644 --- a/gcc/m2/gm2-compiler/SymbolTable.mod +++ b/gcc/m2/gm2-compiler/SymbolTable.mod @@ -407,6 +407,7 @@ TYPE SavePriority : BOOLEAN ;(* Does procedure need to save
Results for 20240417 master r14-10005-gbf2b5231312e1c (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit bf2b5231312e1cea45732cb8df6ffa2b2c9115b6 Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Sat Apr 20 00:04:13 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13642
Results for 20240417 master r14-10005-gbf2b5231312e1c (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --disable-multilib --disable-plugin --disable-bootstrap gcc-branch: master git commit bf2b5231312e1cea45732cb8df6ffa2b2c9115b6 Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Fri Apr 19 14:12:40 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix FAIL: gm2/iso/const/fail/castproctype2.mod, -O FAIL: gm2/iso/const/fail/castproctype2.mod, -O -g FAIL: gm2/iso/const/fail/castproctype2.mod, -O3 -fomit-frame-pointer FAIL: gm2/iso/const/fail/castproctype2.mod, -O3 -fomit-frame-pointer -finline-functions FAIL: gm2/iso/const/fail/castproctype2.mod, -Os FAIL: gm2/iso/const/fail/castproctype2.mod, -g === gm2 Summary === # of expected passes13630 # of unexpected failures6
[gcc r14-9998] PR modula2/114745: const cast causes ICE
https://gcc.gnu.org/g:eadd05d5601063bd0c7ef6c3606b4eeb856d57d7 commit r14-9998-geadd05d5601063bd0c7ef6c3606b4eeb856d57d7 Author: Gaius Mulley Date: Tue Apr 16 23:08:43 2024 +0100 PR modula2/114745: const cast causes ICE This patch allows SYSTEM.CAST to be used during a const expression and prevents an ICE. gcc/m2/ChangeLog: PR modula2/114745 * gm2-compiler/M2Code.mod (DumpLangDecl): Replace with ... (GetDumpDecl): ... this. (DumpLangGimple): Replace with ... (GetDumpGimple): ... this. * gm2-compiler/M2GenGCC.mod: * gm2-compiler/M2LangDump.mod (GetDumpLangQuadFilename): Replace with ... (GetDumpQuadFilename): ... this. (GetDumpLangDeclFilename): Replace with ... (GetDumpDeclFilename): ... this. (GetDumpLangGimpleFilename): Replace with ... (GetDumpGimpleFilename): ... this. * gm2-compiler/M2Options.def (GetDumpLangDeclFilename): New procedure function. (GetDumpDeclFilename): Ditto. (SetDumpLangDeclFilename): New procedure. (SetDumpDeclFilename): Ditto. (GetDumpLangQuadFilename): New procedure function. (GetDumpQuadFilename): Ditto (SetDumpLangQuadFilename): New procedure. (SetDumpQuadFilename): Ditto. (GetDumpLangGimpleFilename): New procedure function. (GetDumpGimpleFilename): Ditto. (SetDumpLangGimpleFilename): New procedure. (SetDumpGimpleFilename): Ditto. (GetDumpLangGimple): New procedure function. (SetM2Dump): New procedure. (GetDumpGimple): New procedure function. (GetDumpQuad): Ditto. (GetDumpDecl): Ditto. * gm2-compiler/M2Options.mod (DumpLangDeclFilename): Remove. (DumpLangQuadFilename): Ditto. (DumpLangGimpleFilename): Ditto. (DumpDeclFilename): New variable. (DumpQuadFilename): Ditto. (DumpGimpleFilename): Ditto. (DebugTraceTree): New variable. (SetQuadDebugging): Rewrite. (GetDumpLangDeclFilename): Replace with ... (GetDumpDeclFilename): ... this. (SetDumpLangQuadFilename): Replace with ... (SetDumpQuadFilename): ... this. (GetDumpLangGimpleFilename): Replace with ... (GetDumpGimpleFilename): ... this. (SetDumpLangGimpleFilename): Replace with ... (SetDumpGimpleFilename): ... this. (GetDumpLangGimple): Remove. (MatchDump): New procedure function. (SetM2Dump): New procedure. (GetDumpGimple): New procedure function. (GetDumpQuad): Ditto. (GetDumpDecl): Ditto. (GetDumpLangGimple): Ditto. * gm2-compiler/M2Quads.mod (BreakAtQuad): Assigned to 140. (BuildTypeCoercion): Add ConstExpr parameter. Check for const parameter in a const expression. Create a constant temporary if in a const expression. (BuildCastFunction): Pass ConstExpr to BuildTypeCoercion. (BuildFunctionCall): Pass ConstExpr to BuildTypeCoercion. * gm2-compiler/PCSymBuild.mod (buildConstFunction): Test for Cast and call InitConvert. (ErrorConstFunction): Add CAST to the error message. * gm2-compiler/SymbolTable.mod (GetConstStringContent): Remove unused procedure. * gm2-gcc/m2decl.cc (m2decl_DeclareKnownConstant): Copy value and change type of value. * gm2-gcc/m2options.h (M2Options_GetDumpLangDeclFilename): Remove. (M2Options_SetDumpLangDeclFilename): Ditto. (M2Options_GetDumpLangQuadFilename): Ditto. (M2Options_SetDumpLangQuadFilename): Ditto. (M2Options_GetDumpLangGimpleFilename): Ditto. (M2Options_SetDumpLangGimpleFilename): Ditto. (M2Options_GetDumpLangGimple): Ditto. (M2Options_GetDumpDeclFilename): New function. (M2Options_SetDumpDeclFilename): Ditto. (M2Options_GetDumpQuadFilename): Ditto. (M2Options_SetDumpQuadFilename): Ditto. (M2Options_GetDumpGimpleFilename): Ditto. (M2Options_SetDumpGimpleFilename): Ditto. (M2Options_SetM2Dump): Ditto. (M2Options_GetDumpGimple): Ditto. * gm2-gcc/m2pp.cc (GM2): New define. (m2pp_type_lowlevel): Remove linefeed. (m2pp_identifier): Add type description for const. (m2pp_assignment): Display lhs/rhs types. (m2pp_dump_gimple): Replace GetDumpLangGimple with GetDumpGimple. * gm2-lang.cc (ENABLE_QUAD_DUMP_ALL): Remove. (ENABLE_M2DUMP_ALL): New define. (gm2_langhook_handle_option): Remove commented options
Results for 20240416 master r14-9993-gf949481a1f7ab9 (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit f949481a1f7ab973608a4ffcc0e342ab5a74e8e4 Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Tue Apr 16 18:56:25 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13624
[pushed] modula2: add modula-2 language section to languages supported by GCC
Pushed to trunk as r14-9915-g0dc39dee836761f1bc993d760f4ed5f3d127897a This patch introduces a small modula-2 language section to the Language Standards Supported by GCC node. gcc/ChangeLog: * doc/standards.texi (Language Standards Supported by GCC): Add Modula-2 language section. (my last email omitted the patch, now included here) diff --git a/gcc/doc/standards.texi b/gcc/doc/standards.texi index 06444ee15f7..68bd750a063 100644 --- a/gcc/doc/standards.texi +++ b/gcc/doc/standards.texi @@ -332,6 +332,17 @@ GCC supports the D 2.0 programming language. The D language itself is currently defined by its reference implementation and supporting language specification, described at @uref{https://dlang.org/spec/spec.html}. +@section Modula-2 language + +GCC supports the Modula-2 language and is compliant with the PIM2, +PIM3, PIM4 and ISO dialects. Also implemented are a complete set of +free ISO libraries. It also contains a collection of PIM libraries +and some Logitech compatible libraries. + +For more information on Modula-2 see +@uref{https://gcc.gnu.org/readings.html}. The online manual is +available at @uref{https://gcc.gnu.org/onlinedocs/gm2/index.html}. + @section References for Other Languages @xref{Top, GNAT Reference Manual, About This Guide, gnat_rm,
[pushed] modula2: add modula-2 language section to languages supported by GCC
Pushed to trunk as r14-9915-g0dc39dee836761f1bc993d760f4ed5f3d127897a This patch introduces a small modula-2 language section to the Language Standards Supported by GCC node. gcc/ChangeLog: * doc/standards.texi (Language Standards Supported by GCC): Add Modula-2 language section.
[gcc r14-9915] modula2: add modula-2 language section to languages supported by GCC
https://gcc.gnu.org/g:0dc39dee836761f1bc993d760f4ed5f3d127897a commit r14-9915-g0dc39dee836761f1bc993d760f4ed5f3d127897a Author: Gaius Mulley Date: Thu Apr 11 15:04:49 2024 +0100 modula2: add modula-2 language section to languages supported by GCC This patch introduces a small modula-2 language section to the Language Standards Supported by GCC node. gcc/ChangeLog: * doc/standards.texi (Language Standards Supported by GCC): Add Modula-2 language section. Signed-off-by: Gaius Mulley Diff: --- gcc/doc/standards.texi | 11 +++ 1 file changed, 11 insertions(+) diff --git a/gcc/doc/standards.texi b/gcc/doc/standards.texi index 06444ee15f7..586835b28f3 100644 --- a/gcc/doc/standards.texi +++ b/gcc/doc/standards.texi @@ -332,6 +332,17 @@ GCC supports the D 2.0 programming language. The D language itself is currently defined by its reference implementation and supporting language specification, described at @uref{https://dlang.org/spec/spec.html}. +@section Modula-2 language + +GCC supports the Modula-2 language and is compliant with the PIM2, +PIM3, PIM4 and ISO dialects. Also implemented are a complete set of +free ISO libraries. It also contains a collection of PIM libraries +and some Logitech compatible libraries. + +For more information on Modula-2 see +@uref{https://gcc.gnu.org/readings.html}. The online manual is +available at @uref{https://gcc.gnu.org/onlinedocs/gm2/index.html}. + @section References for Other Languages @xref{Top, GNAT Reference Manual, About This Guide, gnat_rm,
[PATCH][wwwdocs] modula2 update for changes.html, index.html, readings.html and frontends.html
Hello, Here are a proposed set of patches to highlight the changes in the modula-2 frontend for GCC 14.1. The patches also contain updates for: * readings.html: Add Modula-2 language standards. * index.html: Modula-2 listed in the languages supported by GCC. * frontends.html: Update now Modula-2 is in the tree. * changes.html: Highlight user facing changes. feel free to adjust or rewrite in anyway, regards, Gaius diff --git a/htdocs/frontends.html b/htdocs/frontends.html index d47b56b6..2dec80c9 100644 --- a/htdocs/frontends.html +++ b/htdocs/frontends.html @@ -43,8 +43,8 @@ has a back end that generates assembler directly, using the GCC back end. http://www.nongnu.org/gm2/;>GNU Modula-2 implements the ISO/IEC 10514-1, PIM2, PIM3 and PIM4 dialects of the language. The compiler is operational with GCC 10, GCC 11, and GCC 12 (on -GNU/Linux x86 systems). The front end is now in the GCC development -trunk (GCC 13). It is mostly written in Modula-2 and includes a +GNU/Linux x86 systems). The front end was merged into the GCC tree +during GCC 13. It is mostly written in Modula-2 and includes a bootstrap tool which translates Modula-2 into C/C++. Modula-3 (for links see +Modula-2 + + The automatic dependency generation options: -M, +-MD, -MF, +-MMD, -MP, -MQ and +-MT have been implemented in the compiler. + + The -Wcase-enum +and -Wuninit-variable-checking= options have +been implemented to provide compile time warnings against +missing case clauses and uninitialized variables respectively. + + + libgccjit diff --git a/htdocs/index.html b/htdocs/index.html index 909cae75..125fc4ce 100644 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -19,7 +19,7 @@ C, C++, Objective-C, Fortran, -Ada, Go, and D, as well as libraries for these languages (libstdc++,...). +Ada, Go, D and Modula-2 as well as libraries for these languages (libstdc++,...). GCC was originally written as the compiler for the http://www.gnu.org/gnu/thegnuproject.html;>GNU operating system. The GNU system was developed to be 100% free software, free in the sense diff --git a/htdocs/readings.html b/htdocs/readings.html index ee77d969..e78c4769 100644 --- a/htdocs/readings.html +++ b/htdocs/readings.html @@ -559,6 +559,18 @@ names. +Modula 2 information + + + https://www.research-collection.ethz.ch/handle/20.500.11850/68683;>Programming + in Modula-2 (Edition 2) + https://freepages.modula2.org/report4/modula-2.html;>Programming + in Modula-2 (Edition 4) + http://sc22wg13.twi.tudelft.nl;>ISO Modula-2 standards + (base language, OO and generic language extensions) + + + Modula 3 information
[gcc r14-9868] modula2: remove description of fdebug-trace-quad, fdebug-trace-api and add fm2-debug-trace=
https://gcc.gnu.org/g:897a241ddde53eae912c612a1623c84ff4dfe339 commit r14-9868-g897a241ddde53eae912c612a1623c84ff4dfe339 Author: Gaius Mulley Date: Tue Apr 9 11:21:02 2024 +0100 modula2: remove description of fdebug-trace-quad, fdebug-trace-api and add fm2-debug-trace= This documentation fix removes the descriptions of -fdebug-trace-quad and -fdebug-trace-api. It adds a description of -fm2-debug-trace= together with the trace alternatives: line,token,quad,all. gcc/ChangeLog: * doc/gm2.texi (Compiler options): Remove -fdebug-trace-quad. Remove -fdebug-trace-api. Add -fm2-debug-trace=. Signed-off-by: Gaius Mulley Diff: --- gcc/doc/gm2.texi | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/gcc/doc/gm2.texi b/gcc/doc/gm2.texi index 9f6d4140e42..19b864573c1 100644 --- a/gcc/doc/gm2.texi +++ b/gcc/doc/gm2.texi @@ -398,14 +398,6 @@ it allows users to single step code into an intrinsic function. @c Modula-2 @c turn on internal debugging of the compiler (internal switch) -@c fdebug-trace-quad -@c Modula-2 -@c turn on quadruple tracing (internal switch) - -@c fdebug-trace-api -@c Modula-2 -@c turn on the Modula-2 api tracing (internal switch) - @c fdebug-function-line-numbers @c Modula-2 @c turn on the Modula-2 function line number generation (internal switch) @@ -474,6 +466,11 @@ this option forces the use of the static version. @c Modula-2 Joined @c set all location values to a specific value (internal switch) +@c fm2-debug-trace= +@c Modula-2 Joined +@c turn on trace debugging using a comma separated list: +@c line,token,quad,all. + @item -fm2-g improve the debugging experience for new programmers at the expense of generating @code{nop} instructions if necessary to ensure single
[gcc r14-9867] modula2: tidyup makeSystem
https://gcc.gnu.org/g:46120d7d12318f98cbeeef1bae886222ecc92d52 commit r14-9867-g46120d7d12318f98cbeeef1bae886222ecc92d52 Author: Gaius Mulley Date: Tue Apr 9 11:02:17 2024 +0100 modula2: tidyup makeSystem This patch provides a tidyup for gcc/m2/tools-src/makeSystem. It only runs the compiler once and will echo a debug command line should it fail. gcc/m2/ChangeLog: * tools-src/makeSystem: Invoke ${COMPILER} once and adjust the echo string to expand the shell variables with -wrapper gdb, --args. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/tools-src/makeSystem | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/gcc/m2/tools-src/makeSystem b/gcc/m2/tools-src/makeSystem index 824aeb76676..393713eb873 100644 --- a/gcc/m2/tools-src/makeSystem +++ b/gcc/m2/tools-src/makeSystem @@ -101,8 +101,10 @@ displayEnd () { MINIMAL="-fno-scaffold-main -fno-scaffold-dynamic -fno-scaffold-static -fno-m2-plugin" rm -f ${OUTPUTFILE} -if ${COMPILER} ${DIALECT} ${LIBRARY} ${MINIMAL} \ - -S -fdump-system-exports ${SYSTEMMOD} -o /dev/null 2>&1 > /dev/null ; then +${COMPILER} ${DIALECT} ${LIBRARY} ${MINIMAL} \ + -S -fdump-system-exports ${SYSTEMMOD} -o /dev/null 2>&1 > /dev/null +res=$? +if [ ${res} -eq 0 ] ; then types=`${COMPILER} ${DIALECT} ${LIBRARY} ${MINIMAL} -fno-m2-plugin -S -fdump-system-exports ${SYSTEMMOD} -o /dev/null | cut -f5 -d' '` touch ${OUTPUTFILE} displayStart @@ -111,7 +113,9 @@ if ${COMPILER} ${DIALECT} ${LIBRARY} ${MINIMAL} \ displayBuiltinTypes displayEnd else -${COMPILER} ${DIALECT} ${LIBRARY} ${MINIMAL} \ - -S -fdump-system-exports ${SYSTEMMOD} -o /dev/null -exit $? +echo "the command below failed:" +echo "${COMPILER} ${DIALECT} ${LIBRARY} ${MINIMAL} -S -fdump-system-exports ${SYSTEMMOD}" +echo "to debug the command use" +echo "${COMPILER} ${DIALECT} ${LIBRARY} ${MINIMAL} -S -fdump-system-exports ${SYSTEMMOD} -wrapper gdb,--args" +exit $res fi
Results for 20240408 master r14-9866-g8657d76d583f0f (GCC) testsuite on powerpc64le-unknown-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --with-long-double-format=ieee --disable-multilib --enable-plugin --enable-bootstrap gcc-branch: master git commit 8657d76d583f0f87000e9003ba75922f2bbe4455 Linux 5.14.0-284.11.1.el9_2.ppc64le #1 SMP Tue May 9 09:51:51 UTC 2023 ppc64le ppc64le GNU/Linux GNU ld version 2.35.2-42.el9_3.1 GNU assembler version 2.35.2-42.el9_3.1 GNU Make 4.3 Test run by gaius on Tue Apr 9 10:00:33 2024 Native configuration is powerpc64le-unknown-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13712
Results for 20240409 master r14-9849-g600bf396799a02 (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit 600bf396799a022e65938de572ad1a79a951b95a Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Tue Apr 9 10:56:23 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13606
[gcc r14-9849] PR modula2/114648 cc1gm2 by default does not handle C pre-processor file and line directives
https://gcc.gnu.org/g:600bf396799a022e65938de572ad1a79a951b95a commit r14-9849-g600bf396799a022e65938de572ad1a79a951b95a Author: Gaius Mulley Date: Tue Apr 9 02:35:11 2024 +0100 PR modula2/114648 cc1gm2 by default does not handle C pre-processor file and line directives This patch fixes the default behavior of cc1gm2 to the description in the documentation. By default cc1gm2 will allow C preprocessor directives (they can be turned off via -fno-cpp). gcc/m2/ChangeLog: PR modula2/114648 * gm2-compiler/M2Options.mod (LineDirectives): Initially set to true. gcc/testsuite/ChangeLog: PR modula2/114648 * gm2/cpp/default/pass/AdvParse.def: New test. * gm2/cpp/default/pass/AdvParse.mod: New test. * gm2/cpp/default/pass/cpp-default-pass.exp: New test. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/gm2-compiler/M2Options.mod | 2 +- gcc/testsuite/gm2/cpp/default/pass/AdvParse.def| 5 +++ gcc/testsuite/gm2/cpp/default/pass/AdvParse.mod| 8 + .../gm2/cpp/default/pass/cpp-default-pass.exp | 36 ++ 4 files changed, 50 insertions(+), 1 deletion(-) diff --git a/gcc/m2/gm2-compiler/M2Options.mod b/gcc/m2/gm2-compiler/M2Options.mod index 09d62cbc732..d04cded17f0 100644 --- a/gcc/m2/gm2-compiler/M2Options.mod +++ b/gcc/m2/gm2-compiler/M2Options.mod @@ -1944,7 +1944,7 @@ BEGIN ReturnChecking:= FALSE ; CaseElseChecking := FALSE ; CPreProcessor := FALSE ; - LineDirectives:= FALSE ; + LineDirectives:= TRUE ; ExtendedOpaque:= FALSE ; UnboundedByReference := FALSE ; VerboseUnbounded := FALSE ; diff --git a/gcc/testsuite/gm2/cpp/default/pass/AdvParse.def b/gcc/testsuite/gm2/cpp/default/pass/AdvParse.def new file mode 100644 index 000..391a803116f --- /dev/null +++ b/gcc/testsuite/gm2/cpp/default/pass/AdvParse.def @@ -0,0 +1,5 @@ +DEFINITION MODULE AdvParse ; + +PROCEDURE foo ; + +END AdvParse. diff --git a/gcc/testsuite/gm2/cpp/default/pass/AdvParse.mod b/gcc/testsuite/gm2/cpp/default/pass/AdvParse.mod new file mode 100644 index 000..ed3727c63c6 --- /dev/null +++ b/gcc/testsuite/gm2/cpp/default/pass/AdvParse.mod @@ -0,0 +1,8 @@ +# 2 "AdvParse.bnf" +IMPLEMENTATION MODULE AdvParse ; + +PROCEDURE foo ; +BEGIN +END foo ; + +END AdvParse. \ No newline at end of file diff --git a/gcc/testsuite/gm2/cpp/default/pass/cpp-default-pass.exp b/gcc/testsuite/gm2/cpp/default/pass/cpp-default-pass.exp new file mode 100644 index 000..0b373cfd655 --- /dev/null +++ b/gcc/testsuite/gm2/cpp/default/pass/cpp-default-pass.exp @@ -0,0 +1,36 @@ +# Copyright (C) 2024 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# <http://www.gnu.org/licenses/>. + +# This file was written by Gaius Mulley (gaiusm...@gmail.com) +# for GNU Modula-2. + +if $tracelevel then { +strace $tracelevel +} + +# load support procs +load_lib gm2-torture.exp + +gm2_init_pim "${srcdir}/gm2/cpp/default/pass/" + +foreach testcase [lsort [glob -nocomplain $srcdir/$subdir/*.mod]] { +# If we're only testing specific files and this isn't one of them, skip it. +if ![runtest_file_p $runtests $testcase] then { + continue +} + +gm2-torture $testcase +}
Results for 20240408 master r14-9833-g278cad85077509 (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit 278cad85077509b73b1faf32d36f3889c2a5524b Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Tue Apr 9 02:26:46 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13606
Results for 20240406 master r14-9823-g4e3c8257304c55 (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit 4e3c8257304c55f2ebfb24bd6de3236bda0f054e Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Sun Apr 7 00:37:57 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13600
[gcc r14-9823] PR modula2/114617 gm2 unable to resolve const expressions using relop ICE
https://gcc.gnu.org/g:4e3c8257304c55f2ebfb24bd6de3236bda0f054e commit r14-9823-g4e3c8257304c55f2ebfb24bd6de3236bda0f054e Author: Gaius Mulley Date: Sat Apr 6 23:45:35 2024 +0100 PR modula2/114617 gm2 unable to resolve const expressions using relop ICE This patch allows cc1gm2 to resolve constant expressions which use relative operators. Previous to the patch the result of a relop was stored in a temporary variable set by an if then else quadruple sequence. This patch marks a const expression in the quadruples and then reduces this sequence of quadruples into a single assignment to an internal constant. gcc/m2/ChangeLog: PR modula2/114617 * gm2-compiler/M2GenGCC.mod (CodeStatememt): Add quad trace. (ResolveConstantExpressions): Add parameter p to FoldIfLess, FoldIfGre, FoldIfLessEqu, FoldIfGreEqu, FoldIfEqu, FoldIfNotEqu, FoldIfIn and FoldIfNotIn. (CodeInline): Add constExpr variable and pass it to GetQuadOtok. (CodeReturnValue): Ditto. (CodeParam): Ditto. (FoldStringLength): Ditto. (FoldStringConvertM2nul): Ditto. (FoldStringConvertCnul): Ditto. (DeclaredOperandsBecomes): Ditto. (TypeCheckBecomes): Ditto. (PerformFoldBecomes): Ditto. (CodeBecomes): Ditto. (CheckElementSetTypes): Ditto. (CodeBinarySet): Ditto. (PerformCodeIfLess): Ditto. (PerformCodeIfGre): Ditto. (PerformCodeIfLessEqu): Ditto. (PerformCodeIfGreEqu): Ditto. (PerformCodeIfEqu): Ditto. (PerformCodeIfNotEqu): Ditto. (IsValidExpressionRelOp): Ditto. (PerformCodeIfIn): Ditto. (PerformCodeIfNotIn): Ditto. (CodeXIndr): Ditto. (QuadCondition): New procedure function. (IsBooleanRelOpPattern): Ditto. (FoldBooleanRelopPattern): Ditto. (FoldIfGre): Check for boolean relop constant expression and add parameter p. (FoldIfLessEqu): Ditto. (FoldIfIn): Ditto. (FoldIfEqu): Ditto. (FoldIfNotIn): Ditto. (FoldIfGreEqu): New procedure. (FoldIfNotEqu): Ditto. * gm2-compiler/M2Optimize.mod (ReduceBranch): Add constExpr variable and pass it to GetQuadOtok. * gm2-compiler/M2Quads.def (IsBecomes): New procedure function. (IsDummy): Ditto. (IsQuadConstExpr): Ditto. (SetQuadConstExpr): Ditto. (GetQuadDest): New procedure. (GetQuadOp1): New procedure. (GetQuadOp2): New procedure. (GetQuadOp3): New procedure. (GetQuadOtok): New procedure. (GetQuadOTypetok): New procedure. (PutQuadOtok): New procedure. (IsInConstParameters): New procedure function. * gm2-compiler/M2Quads.mod (IsBecomes): New procedure function. (IsDummy): Ditto. (IsQuadConstExpr): Ditto. (SetQuadConstExpr): Ditto. (GetQuadDest): New procedure. (GetQuadOp1): New procedure. (GetQuadOp2): New procedure. (GetQuadOp3): New procedure. (GetQuadOtok): New procedure. (GetQuadOTypetok): New procedure. (PutQuadOtok): New procedure. (IsInConstParameters): New procedure function. (ConstStack): Remove to ... (ConstExprStack): ... this. (ConstParamStack): New variable and initialize. (QuadFrame): New field ConstExpr. (GetQuadOtok): Add parameter constExpr and assign. (PutQuadOtok): Add constExpr parameter and assign. (PutQuadOType): Ditto. (GetQuadOTypetok): Ditto. (EraseQuad): Assign ConstExpr to FALSE. (FoldSubrange): Set ConstExpr to FALSE in BecomesOp. (PushInConstParameters): New procedure. (PopInConstParameters): New procedure. (IsInConstParameters): New procedure function. * gm2-compiler/M2SymInit.mod (IssueConditional): Add constExpr boolean variable. (CheckReadBeforeInitQuad): Ditto. (trashParam): Ditto. * gm2-compiler/P3Build.bnf (ConstExpression): Call PushInConstExpression and PopInConstExpression. (ConstSetOrQualidentOrFunction): Call PushInConstParameters and PopInConstParameters. * gm2-compiler/PCBuild.bnf (ConstExpression): Call PushInConstExpression and PopInConstExpression. * gm2-compiler/PHBuild.bnf: Ditto * gm2-gcc/m2expr.cc (m2expr_BuildCondIfExpression): New function. * gm2-gcc/m2expr.def (BuildCondIfExpression): New prototype. * gm2-gcc/m2expr.h
Results for 20240406 master r14-9822-g93adf88cc6744a (GCC) testsuite on aarch64-unknown-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --disable-multilib --enable-plugin --enable-bootstrap gcc-branch: master git commit 93adf88cc6744aa2c732b765e1e3b96e66cb3300 Linux 5.19.0-rc7-asahi-2-gbfe8f1b7e230 #1 SMP Sat Jul 23 17:21:00 CEST 2022 aarch64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Sat Apr 6 22:54:06 2024 Native configuration is aarch64-unknown-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13706
Results for 20240402 master r14-9764-g1bafa6a3fdbb53 (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit 1bafa6a3fdbb53651ffa5d854c2341c487bf3269 Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Sat Apr 6 11:57:07 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13600
Results for 20240402 master r14-9764-g1bafa6a3fdbb53 (GCC) testsuite on aarch64-unknown-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --disable-multilib --enable-plugin --enable-bootstrap gcc-branch: master git commit 1bafa6a3fdbb53651ffa5d854c2341c487bf3269 Linux 5.19.0-rc7-asahi-2-gbfe8f1b7e230 #1 SMP Sat Jul 23 17:21:00 CEST 2022 aarch64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Sat Apr 6 10:05:33 2024 Native configuration is aarch64-unknown-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13706
Results for 20240402 master r14-9764-g1bafa6a3fdbb53 (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --disable-plugin --enable-bootstrap gcc-branch: master git commit 1bafa6a3fdbb53651ffa5d854c2341c487bf3269 Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Sat Apr 6 02:12:08 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13600
Re: [PATCH] modula2: Add m2.install-dvi in gcc/m2/Make-lang.in
Christophe Lyon writes: > m2 has a m2.dvi build rule, but lacks the m2.install-dvi one. > > 2024-04-04 Christophe Lyon > > gcc/m2/ > * Make-lang.in (m2.install-dvi): New rule. > --- > gcc/m2/Make-lang.in | 12 > 1 file changed, 12 insertions(+) > > diff --git a/gcc/m2/Make-lang.in b/gcc/m2/Make-lang.in > index e56240b4c44..0abd8ce1455 100644 > --- a/gcc/m2/Make-lang.in > +++ b/gcc/m2/Make-lang.in > @@ -162,6 +162,18 @@ m2.dvi: doc/m2.dvi > doc/m2.dvi: $(TEXISRC) $(objdir)/m2/images/gnu.eps > $(TEXI2DVI) -c -I $(objdir)/m2 -I $(srcdir)/doc/include -o $@ > $(srcdir)/doc/gm2.texi > > +M2_DVIFILES = doc/m2.dvi > + > +m2.install-dvi: $(M2_DVIFILES) > + @$(NORMAL_INSTALL) > + test -z "$(dvidir)/gcc" || $(mkinstalldirs) "$(DESTDIR)$(dvidir)/gcc" > + @list='$(M2_DVIFILES)'; for p in $$list; do \ > + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ > + f=$(dvi__strip_dir) \ > + echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(dvidir)/gcc/$$f'"; \ > + $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(dvidir)/gcc/$$f"; \ > + done > + > doc/m2.ps: doc/m2.dvi > dvips -o $@ $< many thanks - lgtm, regards, Gaius
Results for 20240402 master r14-9764-g1bafa6a3fdbb53 (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --enable-plugin --enable-bootstrap gcc-branch: master git commit 1bafa6a3fdbb53651ffa5d854c2341c487bf3269 Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Wed Apr 3 11:38:16 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13688
[gcc r14-9764] PR modula2/114565 progress trace would be useful to isolate ICE for users
https://gcc.gnu.org/g:1bafa6a3fdbb53651ffa5d854c2341c487bf3269 commit r14-9764-g1bafa6a3fdbb53651ffa5d854c2341c487bf3269 Author: Gaius Mulley Date: Tue Apr 2 23:47:42 2024 +0100 PR modula2/114565 progress trace would be useful to isolate ICE for users This patch introduces the internal option -fm2-debug-trace= which can be given a comma separated list of filter terms. Currently it allows: all,line,token,quad. The patch allows users to trace the progress of cc1gm2 so that source which causes an ICE can be reduced. Once PR113836 is complete it is expected that the trace information will be written to file. gcc/m2/ChangeLog: PR modula2/114565 * gm2-compiler/M2GenGCC.mod (CodeStatement): Test GetDebugTraceQuad before calling DisplayQuad. * gm2-compiler/M2LexBuf.mod (NumberIO): Import CardToStr. (GetToken): Test GetDebugTraceToken before writing the token number or token line. * gm2-compiler/M2Options.def (SetDebugTraceQuad): Rename to (SetM2DebugTraceFilter): ...this. (SetDebugTraceAPI): Remove. (GetDebugTraceQuad): New procedure function. (GetDebugTraceTree): Ditto. (GetDebugTraceToken): Ditto. (GetDebugTraceLine): Ditto. (GetDebugFunctionLineNumbers): Ditto. * gm2-compiler/M2Options.mod (DebugFunctionLineNumbers): New boolean variable. (DebugTraceQuad): Ditto. (DebugTraceTree): Ditto. (DebugTraceLine): Ditto. (DebugTraceToken): Ditto. (errors1): New procedure. (SetDebugTraceQuad): Remove. (SetM2DebugTraceFilter): New procedure implemented. (SetM2DebugTrace): Ditto. (GetDebugTraceQuad): Ditto. (GetDebugTraceToken ): Ditto. (GetDebugTraceLine): Ditto. (SetDebugTraceLine): Remove. * gm2-compiler/M2Quads.mod (GenQuadOTrash): Test GetDebugTraceQuad and call DisplayQuad. (GenQuadOTypetok): Ditto. * gm2-compiler/SymbolTable.mod: Replace DebugFunctionLineNumbers with GetDebugFunctionLineNumbers. * gm2-gcc/init.cc (_M2_M2LangDump_init): Add prototype. (init_PerCompilationInit): Add call. * gm2-gcc/m2misc.cc (m2misc_cerror): New function. (m2misc_error): Ditto. * gm2-gcc/m2misc.def (error): New procedure. (cerror): Ditto. * gm2-gcc/m2misc.h (m2misc_cerror): New prototype. (m2misc_error): Ditto. * gm2-gcc/m2options.h (M2Options_SetDebugTraceQuad): New prototype. (M2Options_SetDebugTraceAPI): Remove. (M2Options_GetDebugTraceToken): New prototype. (M2Options_GetDebugTraceLine): Ditto. (M2Options_SetDebugFunctionLineNumbers): Ditto. (M2Options_GetDebugFunctionLineNumbers): Ditto. (M2Options_SetM2DebugTraceFilter): Ditto. * gm2-lang.cc (gm2_langhook_init_options): Remove OPT_fdebug_trace_quad case. Remove OPT_fdebug_trace_api case. Add OPT_fm2_debug_trace_ case. * lang.opt (fm2-debug-trace): New option. (fdebug-trace-api): Remove. (fdebug-trace-quad): Remove. * m2.flex (m2flex_M2Error): Check s for NULL. (skipnewline): New function. (consumeLine): Call traceline. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/gm2-compiler/M2GenGCC.mod| 5 +- gcc/m2/gm2-compiler/M2LexBuf.mod| 24 +- gcc/m2/gm2-compiler/M2Options.def | 54 + gcc/m2/gm2-compiler/M2Options.mod | 154 +++- gcc/m2/gm2-compiler/M2Quads.mod | 18 - gcc/m2/gm2-compiler/SymbolTable.mod | 6 +- gcc/m2/gm2-gcc/init.cc | 2 + gcc/m2/gm2-gcc/m2misc.cc| 16 gcc/m2/gm2-gcc/m2misc.def | 4 + gcc/m2/gm2-gcc/m2misc.h | 2 + gcc/m2/gm2-gcc/m2options.h | 7 +- gcc/m2/gm2-lang.cc | 9 +-- gcc/m2/lang.opt | 14 ++-- gcc/m2/m2.flex | 35 +++- 14 files changed, 285 insertions(+), 65 deletions(-) diff --git a/gcc/m2/gm2-compiler/M2GenGCC.mod b/gcc/m2/gm2-compiler/M2GenGCC.mod index 7e27373a6ac..60f58cc2d1b 100644 --- a/gcc/m2/gm2-compiler/M2GenGCC.mod +++ b/gcc/m2/gm2-compiler/M2GenGCC.mod @@ -96,8 +96,7 @@ FROM M2MetaError IMPORT MetaErrorT0, MetaErrorT1, MetaErrorT2, MetaErrorT3, FROM M2Options IMPORT UnboundedByReference, PedanticCast, VerboseUnbounded, Iso, Pim, DebugBuiltins, WholeProgram, StrictTypeChecking, AutoInit, cflag, ScaffoldMain, - ScaffoldDynamic, ScaffoldStatic, - DebugTraceQuad, DebugTraceAPI
Results for 20240329 master r14-9755-gd5aa2ca06aa7a6 (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --enable-plugin --enable-bootstrap gcc-branch: master git commit d5aa2ca06aa7a6a2f826c4da19204b6db1402995 Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Tue Apr 2 18:24:17 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13688
Results for 20240401 master r14-9739-g4bd2f59af4a78c (GCC) testsuite on x86_64-pc-linux-gnu
$ ../configure --prefix=/home/gaius/opt --libexecdir=/home/gaius/opt/lib --enable-host-shared --enable-threads=posix --enable-clocale=gnu --enable-checking --enable-long-longx --enable-languages=m2 --enable-multilib --enable-plugin --enable-bootstrap gcc-branch: master git commit 4bd2f59af4a78cdc80039cffa51c1d9ad91081a3 Linux 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 unknown GNU/Linux GNU ld (GNU Binutils for Debian) 2.40 GNU assembler (GNU Binutils for Debian) 2.40 GNU Make 4.3 Test run by gaius on Tue Apr 2 17:06:51 2024 Native configuration is x86_64-pc-linux-gnu === gm2 tests === Schedule of variations: unix === gm2 Summary === # of expected passes13688
[gcc r14-9739] PR modula2/114548 gm2 fails to identify variable in a const expression
https://gcc.gnu.org/g:4bd2f59af4a78cdc80039cffa51c1d9ad91081a3 commit r14-9739-g4bd2f59af4a78cdc80039cffa51c1d9ad91081a3 Author: Gaius Mulley Date: Mon Apr 1 19:18:36 2024 +0100 PR modula2/114548 gm2 fails to identify variable in a const expression This patch introduces stricter checking within standard procedure functions which detect whether paramaters are variable when used in a const expression. gcc/m2/ChangeLog: PR modula2/114548 * gm2-compiler/M2Quads.mod (ConvertToAddress): Pass procedure, false parameters to BuildConvertFunction. (PushOne): Pass procedure, true parameters to BuildConvertFunction. Remove usused parameter internal. (BuildPseudoBy): Remove parameter to PushOne. (BuildIncProcedure): Ditto. (BuildDecProcedure): Ditto. (BuildFunctionCall): Add ConstExpr parameter to BuildPseudoFunctionCall. (BuildConstFunctionCall): Add procedure and true to BuildConvertFunction. (BuildPseudoFunctionCall): Add ConstExpr parameter. Pass ProcSym and ConstExpr to BuildLengthFunction, BuildConvertFunction, BuildOddFunction, BuildAbsFunction, BuildCapFunction, BuildValFunction, BuildChrFunction, BuildOrdFunction, BuildIntFunction, BuildTruncFunction, BuildFloatFunction, BuildAddAdrFunction, BuildSubAdrFunction, BuildDifAdrFunction, BuildCastFunction, BuildReFunction, BuildImFunction and BuildCmplxFunction. (BuildAddAdrFunction): Add ProcSym, ConstExpr parameters and check for constant parameters. (BuildSubAdrFunction): Ditto. (BuildDifAdrFunction): Ditto. (ConstExprError): Ditto. (BuildLengthFunction): Ditto. (BuildOddFunction): Ditto. (BuildAbsFunction): Ditto. (BuildCapFunction): Ditto. (BuildChrFunction): Ditto. (BuildOrdFunction): Ditto. (BuildIntFunction): Ditto. (BuildValFunction): Ditto. (BuildCastFunction): Ditto. (BuildConvertFunction): Ditto. (BuildTruncFunction): Ditto. (BuildFloatFunction): Ditto. (BuildReFunction): Ditto. (BuildImFunction): Ditto. (BuildCmplxFunction): Ditto. gcc/testsuite/ChangeLog: PR modula2/114548 * gm2/iso/const/fail/expression.mod: New test. * gm2/iso/const/fail/iso-const-fail.exp: New test. * gm2/iso/const/fail/testabs.mod: New test. * gm2/iso/const/fail/testaddadr.mod: New test. * gm2/iso/const/fail/testcap.mod: New test. * gm2/iso/const/fail/testcap2.mod: New test. * gm2/iso/const/fail/testchr.mod: New test. * gm2/iso/const/fail/testchr2.mod: New test. * gm2/iso/const/fail/testcmplx.mod: New test. * gm2/iso/const/fail/testfloat.mod: New test. * gm2/iso/const/fail/testim.mod: New test. * gm2/iso/const/fail/testint.mod: New test. * gm2/iso/const/fail/testlength.mod: New test. * gm2/iso/const/fail/testodd.mod: New test. * gm2/iso/const/fail/testord.mod: New test. * gm2/iso/const/fail/testre.mod: New test. * gm2/iso/const/fail/testtrunc.mod: New test. * gm2/iso/const/fail/testval.mod: New test. * gm2/iso/const/pass/constbool.mod: New test. * gm2/iso/const/pass/constbool2.mod: New test. * gm2/iso/const/pass/constbool3.mod: New test. Signed-off-by: Gaius Mulley Diff: --- gcc/m2/gm2-compiler/M2Quads.mod| 454 ++--- gcc/testsuite/gm2/iso/const/fail/expression.mod| 10 + .../gm2/iso/const/fail/iso-const-fail.exp | 36 ++ gcc/testsuite/gm2/iso/const/fail/testabs.mod | 10 + gcc/testsuite/gm2/iso/const/fail/testaddadr.mod| 12 + gcc/testsuite/gm2/iso/const/fail/testcap.mod | 10 + gcc/testsuite/gm2/iso/const/fail/testcap2.mod | 10 + gcc/testsuite/gm2/iso/const/fail/testchr.mod | 10 + gcc/testsuite/gm2/iso/const/fail/testchr2.mod | 10 + gcc/testsuite/gm2/iso/const/fail/testcmplx.mod | 10 + gcc/testsuite/gm2/iso/const/fail/testfloat.mod | 10 + gcc/testsuite/gm2/iso/const/fail/testim.mod| 10 + gcc/testsuite/gm2/iso/const/fail/testint.mod | 10 + gcc/testsuite/gm2/iso/const/fail/testlength.mod| 11 + gcc/testsuite/gm2/iso/const/fail/testodd.mod | 10 + gcc/testsuite/gm2/iso/const/fail/testord.mod | 10 + gcc/testsuite/gm2/iso/const/fail/testre.mod| 10 + gcc/testsuite/gm2/iso/const/fail/testtrunc.mod | 10 + gcc/testsuite/gm2/iso/const/fail/testval.mod | 10 + gcc/testsuite/gm2/iso/const/pass/constbool.mod | 14
Re: [PATCH 2/2] modula2: Fix m2.install-info in gcc/m2/Make-lang.in
Christophe Lyon writes: > Fix a few typos: the generated filename is m2.info (not gm2.info, and > gm2$(exeext) is a file not a directory (so test -d would always fail). > > 2024-03-29 Christophe Lyon > > gcc/m2/ > * Make-lang.in (m2.install-info): Fix rule. > --- > gcc/m2/Make-lang.in | 14 +++--- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/gcc/m2/Make-lang.in b/gcc/m2/Make-lang.in > index 2d8a47a1b1f..e56240b4c44 100644 > --- a/gcc/m2/Make-lang.in > +++ b/gcc/m2/Make-lang.in > @@ -400,20 +400,20 @@ m2.install-common: installdirs > done > > m2.install-info: installdirs > - if [ -d gm2$(exeext) ] ; then \ > - if [ -f $(objdir)/doc/gm2.info ]; then \ > - rm -f $(DESTDIR)$(infodir)/gm2.info*; \ > - for f in $(objdir)/doc/gm2.info*; do \ > + if [ -f gm2$(exeext) ] ; then \ > + if [ -f $(objdir)/doc/m2.info ]; then \ > + rm -f $(DESTDIR)$(infodir)/m2.info*; \ > + for f in $(objdir)/doc/m2.info*; do \ > realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \ >rm -f $(DESTDIR)$(infodir)/`basename $$realfile`; \ > $(INSTALL_DATA) $$f $(DESTDIR)$(infodir)/`basename $$realfile`; \ > done; \ > - chmod a-x $(DESTDIR)$(infodir)/gm2.info*; \ > + chmod a-x $(DESTDIR)$(infodir)/m2.info*; \ > else true; fi; \ > else true; fi > - -if [ -f gm2$(exeext) ] && [ -f $(DESTDIR)$(infodir)/gm2.info ]; then \ > + -if [ -f gm2$(exeext) ] && [ -f $(DESTDIR)$(infodir)/m2.info ]; then \ > if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ > - install-info --dir-file=$(infodir)/dir > $(DESTDIR)$(infodir)/gm2.info; \ > + install-info --dir-file=$(infodir)/dir > $(DESTDIR)$(infodir)/m2.info; \ > else true; fi; \ > else true; fi lgtm, many thanks for spotting these bugs, regards, Gaius