public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/87744] Some valid instantiations of linear_congruential_engine produce compiler errors when __int128 isn't available
Date: Tue, 06 Feb 2024 21:21:55 +0000	[thread overview]
Message-ID: <bug-87744-4-Gb9q4Llxxy@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-87744-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87744

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(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 gives consistent results
for -m32 and -m64. However, apart from the first one, its results don't match
what libstdc++'s.

Libstdc++ and Boost give the same results:

864691128455147579
20120904253298372
499698276788149646
1283859513473858339
2211358525164835637
1565794316594927048
433037752037085551
3876224293909804757
842334705173512733
614226679431558764
3068544072891686009
780734117187050918
1963664848033545542
3791874062716605653
366668634810437006
1377239172204792920
1808622055437870614
464217244571328665
2604268511046649463
2831603438105397950
3223716036697852745
784694016100218461
1453099037541982349
2259076772827085306
2590915097279144408
3831773502251465123
320081643915990134
2376324005742734684
2037587339862127157
893313058057432898
118956510249458009
973816490706440657
2982490375421836301
1236945357523402079
3905294429470053119
2304284986302062495
2454379621599061616
1553811809817066890
2904663527490058979
2904663527490058979
2904663527490058979
2904663527490058979
2904663527490058979
2904663527490058979
2904663527490058979
etc.

Libc++ gets stuck  oscillating between two values right away:

864691128455147579
1965622972376959002
4035225266123976763
1965622972376959002
4035225266123976763
1965622972376959002
4035225266123976763
1965622972376959002
4035225266123976763
1965622972376959002
4035225266123976763
1965622972376959002
4035225266123976763
1965622972376959002

  parent reply	other threads:[~2024-02-06 21:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-87744-4@http.gcc.gnu.org/bugzilla/>
2024-02-06 21:09 ` redi at gcc dot gnu.org
2024-02-06 21:21 ` redi at gcc dot gnu.org [this message]
2024-02-06 21:28 ` redi at gcc dot gnu.org
2024-02-06 21:32 ` jakub at gcc dot gnu.org
2024-02-06 21:46 ` redi at gcc dot gnu.org
2024-02-06 21:48 ` redi at gcc dot gnu.org
2024-02-06 21:51 ` redi at gcc dot gnu.org
2024-02-06 21:51 ` jakub at gcc dot gnu.org
2024-02-06 22:04 ` redi at gcc dot gnu.org
2024-02-06 22:12 ` jakub at gcc dot gnu.org
2024-02-06 22:14 ` jakub at gcc dot gnu.org
2024-02-07 10:14 ` lrflew.coll at gmail dot com
2024-02-07 10:38 ` redi at gcc dot gnu.org
2024-02-07 10:55 ` redi at gcc dot gnu.org
2024-02-15 11:44 ` cvs-commit at gcc dot gnu.org
2024-02-16 10:52 ` cvs-commit at gcc dot gnu.org
2024-02-16 19:12 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-87744-4-Gb9q4Llxxy@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).