Re: [PATCH] Remove poly_int_pod
Jan-Benedict Glaw writes: > Hi Richard, > > On Thu, 2023-09-28 10:55:46 +0100, Richard Sandiford > wrote: >> poly_int was written before the switch to C++11 and so couldn't >> use explicit default constructors. This led to an awkward split >> between poly_int_pod and poly_int. poly_int simply inherited from >> poly_int_pod and added constructors, with the argumentless constructor >> having an empty body. But inheritance meant that poly_int had to >> repeat the assignment operators from poly_int_pod (again, no C++11, >> so no "using" to inherit base-class implementations). > [...] > > I haven't bisected it, but I guess your patch caused this: > > [all 2023-10-02 06:59:02] > /var/lib/laminar/run/gcc-local/75/local-toolchain-install/bin/g++ -std=c++11 > -fno-PIE -c -g -O2 -DIN_GCC-fno-exceptions -fno-rtti > -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings > -Wcast-qual -Wmissing-format-attribute -Wconditionally-supported > -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros > -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -fno-PIE -I. -I. > -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include > -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody > -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/bid > -I../libdecnumber -I../../gcc/gcc/../libbacktrace -o rtl-tests.o -MT > rtl-tests.o -MMD -MP -MF ./.deps/rtl-tests.TPo ../../gcc/gcc/rtl-tests.cc > [all 2023-10-02 06:59:04] In file included from ../../gcc/gcc/coretypes.h:480, > [all 2023-10-02 06:59:04] from ../../gcc/gcc/rtl-tests.cc:22: > [all 2023-10-02 06:59:04] ../../gcc/gcc/poly-int.h: In instantiation of > 'constexpr poly_int::poly_int(poly_int_full, const Cs& ...) [with Cs = > {int, int}; unsigned int N = 1; C = long int]': > [all 2023-10-02 06:59:04] ../../gcc/gcc/poly-int.h:439:13: required from > here > [all 2023-10-02 06:59:04] ../../gcc/gcc/rtl-tests.cc:249:25: in 'constexpr' > expansion of 'poly_int<1, long int>(1, 1)' > [all 2023-10-02 06:59:04] ../../gcc/gcc/poly-int.h:453:5: error: too many > initializers for 'long int [1]' > [all 2023-10-02 06:59:04] 453 | : coeffs { (typename > poly_coeff_traits:: > [all 2023-10-02 06:59:04] | > ^ > [all 2023-10-02 06:59:04] 454 | template init_cast::type > (cs))... } {} > [all 2023-10-02 06:59:04] | > ~~~ > [all 2023-10-02 06:59:04] make[1]: *** [Makefile:1188: rtl-tests.o] Error 1 > [all 2023-10-02 06:59:04] make[1]: Leaving directory > '/var/lib/laminar/run/gcc-local/75/toolchain-build/gcc' > [all 2023-10-02 06:59:05] make: *** [Makefile:4993: all-gcc] Error 2 > > > (Full build log at > http://toolchain.lug-owl.de/laminar/jobs/gcc-local/75 . That's in a > Docker container on amd64-linux with the host gcc being at fairly new > at basepoints/gcc-14-3827-g30e6ee07458) Yeah, this was PR111642. I pushed a fix this morning. Thanks, Richard
Re: [PATCH] Remove poly_int_pod
Hi Richard, On Thu, 2023-09-28 10:55:46 +0100, Richard Sandiford wrote: > poly_int was written before the switch to C++11 and so couldn't > use explicit default constructors. This led to an awkward split > between poly_int_pod and poly_int. poly_int simply inherited from > poly_int_pod and added constructors, with the argumentless constructor > having an empty body. But inheritance meant that poly_int had to > repeat the assignment operators from poly_int_pod (again, no C++11, > so no "using" to inherit base-class implementations). [...] I haven't bisected it, but I guess your patch caused this: [all 2023-10-02 06:59:02] /var/lib/laminar/run/gcc-local/75/local-toolchain-install/bin/g++ -std=c++11 -fno-PIE -c -g -O2 -DIN_GCC-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Wconditionally-supported -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -fno-PIE -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include -I../../gcc/gcc/../libcody -I../../gcc/gcc/../libdecnumber -I../../gcc/gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/gcc/../libbacktrace -o rtl-tests.o -MT rtl-tests.o -MMD -MP -MF ./.deps/rtl-tests.TPo ../../gcc/gcc/rtl-tests.cc [all 2023-10-02 06:59:04] In file included from ../../gcc/gcc/coretypes.h:480, [all 2023-10-02 06:59:04] from ../../gcc/gcc/rtl-tests.cc:22: [all 2023-10-02 06:59:04] ../../gcc/gcc/poly-int.h: In instantiation of 'constexpr poly_int::poly_int(poly_int_full, const Cs& ...) [with Cs = {int, int}; unsigned int N = 1; C = long int]': [all 2023-10-02 06:59:04] ../../gcc/gcc/poly-int.h:439:13: required from here [all 2023-10-02 06:59:04] ../../gcc/gcc/rtl-tests.cc:249:25: in 'constexpr' expansion of 'poly_int<1, long int>(1, 1)' [all 2023-10-02 06:59:04] ../../gcc/gcc/poly-int.h:453:5: error: too many initializers for 'long int [1]' [all 2023-10-02 06:59:04] 453 | : coeffs { (typename poly_coeff_traits:: [all 2023-10-02 06:59:04] | ^ [all 2023-10-02 06:59:04] 454 | template init_cast::type (cs))... } {} [all 2023-10-02 06:59:04] | ~~~ [all 2023-10-02 06:59:04] make[1]: *** [Makefile:1188: rtl-tests.o] Error 1 [all 2023-10-02 06:59:04] make[1]: Leaving directory '/var/lib/laminar/run/gcc-local/75/toolchain-build/gcc' [all 2023-10-02 06:59:05] make: *** [Makefile:4993: all-gcc] Error 2 (Full build log at http://toolchain.lug-owl.de/laminar/jobs/gcc-local/75 . That's in a Docker container on amd64-linux with the host gcc being at fairly new at basepoints/gcc-14-3827-g30e6ee07458) MfG, JBG -- signature.asc Description: PGP signature
Re: [PATCH] Remove poly_int_pod
On Fri, Sep 29, 2023 at 08:31:47AM +0200, Richard Biener wrote: > > IIRC the primary reason we settled on gcc-4.8.x was RHEL7/Centos7. With > > RHEL 7 approaching EOL moving the baseline forward would seem to make sense. > > > > I'd want to know if this affects folks using SuSE's enterprise distro > > before actually making the change, but I'm broadly in favor of moving > > forward it it's not going to have a major impact on users that are using > > enterprise distros. > > We're thinking of making GCC 13 the last major release to officially > build for SLE12 which > also uses GCC 4.8, so we'd be fine with doing this for GCC 14. We'd need to figure out what to do with the OS on gcc{110,112,135} on CFarm, those are all CentOS 7.9 with gcc 4.8.5. Sure, one possibility would be to install some DTS gcc if CentOS has one somewhere (though looking around, /opt/at12.0 already has there gcc 8 from IBM Advanced Toolchain 12). Jakub
Re: [PATCH] Remove poly_int_pod
On Thu, Sep 28, 2023 at 9:10 PM Jeff Law wrote: > > > > On 9/28/23 11:26, Jason Merrill wrote: > > On 9/28/23 05:55, Richard Sandiford wrote: > >> poly_int was written before the switch to C++11 and so couldn't > >> use explicit default constructors. This led to an awkward split > >> between poly_int_pod and poly_int. poly_int simply inherited from > >> poly_int_pod and added constructors, with the argumentless constructor > >> having an empty body. But inheritance meant that poly_int had to > >> repeat the assignment operators from poly_int_pod (again, no C++11, > >> so no "using" to inherit base-class implementations). > >> > >> All that goes away if we switch to using default constructors. > >> > >> The main complication is ensuring that braced initialisation still > >> gives a constexpr, so that static variables can be initialised without > >> runtime code. The two problems here are: > >> > >> (1) When initialising a poly_int with fewer than N > >> coefficients, the other coefficients need to be a zero of > >> the same precision as the explicit coefficients. This was > >> previously done in a for loop using wi::ints_for<...>::zero, > >> but C++11 constexpr constructors can't have function bodies. > >> The patch instead uses a series of delegated initialisers to > >> fill in the implicit coefficients. > > > > Perhaps it's time to update the bootstrap requirement to C++14 (i.e. GCC > > 5, from eight years ago). Not that this would affect this particular > > patch. > IIRC the primary reason we settled on gcc-4.8.x was RHEL7/Centos7. With > RHEL 7 approaching EOL moving the baseline forward would seem to make sense. > > I'd want to know if this affects folks using SuSE's enterprise distro > before actually making the change, but I'm broadly in favor of moving > forward it it's not going to have a major impact on users that are using > enterprise distros. We're thinking of making GCC 13 the last major release to officially build for SLE12 which also uses GCC 4.8, so we'd be fine with doing this for GCC 14. Richard. > > jeff
Re: [PATCH] Remove poly_int_pod
On 9/28/23 11:26, Jason Merrill wrote: On 9/28/23 05:55, Richard Sandiford wrote: poly_int was written before the switch to C++11 and so couldn't use explicit default constructors. This led to an awkward split between poly_int_pod and poly_int. poly_int simply inherited from poly_int_pod and added constructors, with the argumentless constructor having an empty body. But inheritance meant that poly_int had to repeat the assignment operators from poly_int_pod (again, no C++11, so no "using" to inherit base-class implementations). All that goes away if we switch to using default constructors. The main complication is ensuring that braced initialisation still gives a constexpr, so that static variables can be initialised without runtime code. The two problems here are: (1) When initialising a poly_int with fewer than N coefficients, the other coefficients need to be a zero of the same precision as the explicit coefficients. This was previously done in a for loop using wi::ints_for<...>::zero, but C++11 constexpr constructors can't have function bodies. The patch instead uses a series of delegated initialisers to fill in the implicit coefficients. Perhaps it's time to update the bootstrap requirement to C++14 (i.e. GCC 5, from eight years ago). Not that this would affect this particular patch. IIRC the primary reason we settled on gcc-4.8.x was RHEL7/Centos7. With RHEL 7 approaching EOL moving the baseline forward would seem to make sense. I'd want to know if this affects folks using SuSE's enterprise distro before actually making the change, but I'm broadly in favor of moving forward it it's not going to have a major impact on users that are using enterprise distros. jeff
Re: [PATCH] Remove poly_int_pod
On 9/28/23 05:55, Richard Sandiford wrote: poly_int was written before the switch to C++11 and so couldn't use explicit default constructors. This led to an awkward split between poly_int_pod and poly_int. poly_int simply inherited from poly_int_pod and added constructors, with the argumentless constructor having an empty body. But inheritance meant that poly_int had to repeat the assignment operators from poly_int_pod (again, no C++11, so no "using" to inherit base-class implementations). All that goes away if we switch to using default constructors. The main complication is ensuring that braced initialisation still gives a constexpr, so that static variables can be initialised without runtime code. The two problems here are: (1) When initialising a poly_int with fewer than N coefficients, the other coefficients need to be a zero of the same precision as the explicit coefficients. This was previously done in a for loop using wi::ints_for<...>::zero, but C++11 constexpr constructors can't have function bodies. The patch instead uses a series of delegated initialisers to fill in the implicit coefficients. Perhaps it's time to update the bootstrap requirement to C++14 (i.e. GCC 5, from eight years ago). Not that this would affect this particular patch. Jason
Re: [PATCH] Remove poly_int_pod
On Thu, Sep 28, 2023 at 10:55:46AM +0100, Richard Sandiford wrote: > Tested on aarch64-linux-gnu & x86_64-linux-gnu. Also tested with > Jakub's vec.h patch with the static_asserts uncommented; there were > no errors from poly_int-related stuff. OK to install? LGTM (mostly as the general idea, but didn't see anything wrong in the patch either), please give others a day or so to comment though. Jakub