[Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available

2024-02-16 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87744 --- Comment #17 from GCC Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:c74131e77f1a6b7afe700d3526a8992dc9744b0c commit r14-9038-gc74131e77f1a6b7afe700d3526a8992dc9744b0c Author: Jonathan Wakely

[Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available

2024-02-16 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87744 --- Comment #16 from GCC Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:7f3d900684ad989164114f25eb46a33871c6533d commit r14-9028-g7f3d900684ad989164114f25eb46a33871c6533d Author: Jonathan Wakely

[Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available

2024-02-15 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87744 --- Comment #15 from GCC Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:c9ce332b557bb95987d038d98ea929cdfd1eae1d commit r14-8998-gc9ce332b557bb95987d038d98ea929cdfd1eae1d Author: Jonathan Wakely

[Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available

2024-02-07 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87744 --- Comment #14 from Jonathan Wakely --- (In reply to Lewis Fox from comment #12) > (In reply to Jonathan Wakely from comment #2) > > My original comment about libc++ was in reference to the LLVM bugzilla > report #27839:

[Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available

2024-02-07 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87744 --- Comment #13 from Jonathan Wakely --- (In reply to Jakub Jelinek from comment #11) > Though, if it is common enough, one could try to optimize the __ll[0] == 0 > && __xx[0] == 0 case, one can do then either 32x32->64 or 64x64->64 >

[Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available

2024-02-07 Thread lrflew.coll at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87744 --- Comment #12 from Lewis Fox --- (In reply to Jonathan Wakely from comment #2) My original comment about libc++ was in reference to the LLVM bugzilla report #27839: https://bugs.llvm.org/show_bug.cgi?id=27839 It looks like the issue you

[Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available

2024-02-06 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87744 --- Comment #11 from Jakub Jelinek --- (In reply to Jakub Jelinek from comment #10) > As discussed on IRC, probably the > if (!__builtin_mul_overflow(__l._M_lo, __x, &__lo)) > optimization isn't a good idea, because most likely the compiler will

[Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available

2024-02-06 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87744 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment

[Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available

2024-02-06 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87744 --- Comment #9 from Jonathan Wakely --- Oops yes!

[Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available

2024-02-06 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87744 --- Comment #8 from Jakub Jelinek --- if (!__l._M_hi) { __l._M_lo %= __m; return __l; } auto __n = __l._M_hi ? __builtin_clzll(__l._M_hi)

[Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available

2024-02-06 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87744 Jonathan Wakely changed: What|Removed |Added Attachment #57346|0 |1 is obsolete|

[Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available

2024-02-06 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87744 --- Comment #6 from Jonathan Wakely --- (In reply to Jakub Jelinek from comment #4) > Why not just > __l._M_hi += __builtin_uaddll_overflow(__l._M_lo, __c, > &__l._M_lo); > and similarly for subtraction? No good reason - I'll change

[Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available

2024-02-06 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87744 Jonathan Wakely changed: What|Removed |Added Attachment #57345|0 |1 is obsolete|

[Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available

2024-02-06 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87744 --- Comment #4 from Jakub Jelinek --- (In reply to Jonathan Wakely from comment #1) > Created attachment 57345 [details] > Use 64-bit integers to do 128-bit arithmetic > > This patch defines a custom type that implements the necessary 128-bit >

[Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available

2024-02-06 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87744 --- Comment #3 from Jonathan Wakely --- Based on that, I'm not sure what libc++ does is actually better than what libstdc++ does today (i.e. refuse to compile if the results would be wrong). I think the patch above would make sense though. I'm

[Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available

2024-02-06 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87744 --- Comment #2 from Jonathan Wakely --- (In reply to Lewis Fox from comment #0) > libc++'s > implementation of linear_congruential_engine (though libc++ incorrectly uses > Schrage's method). I haven't checked what libc++ actually does, but it

[Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available

2024-02-06 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87744 --- Comment #1 from Jonathan Wakely --- Created attachment 57345 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57345=edit Use 64-bit integers to do 128-bit arithmetic This patch defines a custom type that implements the necessary 128-bit

[Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available

2018-10-25 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87744 Jonathan Wakely changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|