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: Wed, 07 Feb 2024 10:55:32 +0000	[thread overview]
Message-ID: <bug-87744-4-5taSUi8zWn@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 #14 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(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: https://bugs.llvm.org/show_bug.cgi?id=27839

Thanks, that got copied to github as
https://github.com/llvm/llvm-project/issues/28213

> It looks like the issue you discovered is LLVM bugzilla report #34206:
> https://bugs.llvm.org/show_bug.cgi?id=34206

And that is now https://github.com/llvm/llvm-project/issues/33554

> It seems like since I made that comment here, libc++ has updated to fix the
> misuse of Schrage's algorithm (though, looking at the current source code,
> it still looks wrong to me), so it does mean my initial comment is a little
> out of date.

Unsurprising when it took me more than 5 years to look into it properly ;-)

> This is a bit of an edge case that I don't think most users will encounter,
> so performance is probably less important here than accuracy.

100% agreed

> I'd personally
> prioritize minimizing branches (i.e. improving simplicity) than optimizing
> the operand sizes for performance, but that's just my opinion.

Agreed again, for although as I said in comment 13 I think the extra branch in
operator% might be worthwhile. Maybe with __builtin_expect(__l._M_hi == 0, 0))
as a branch prediction hint.

  parent reply	other threads:[~2024-02-07 10:55 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
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 [this message]
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-5taSUi8zWn@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).