public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/110799] [tsan] False positive due to -fhoist-adjacent-loads
Date: Wed, 26 Jul 2023 06:37:44 +0000	[thread overview]
Message-ID: <bug-110799-4-cGDUOnkgtY@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110799-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from rguenther at suse dot de <rguenther at suse dot de> ---
On Tue, 25 Jul 2023, amonakov at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110799
> 
> Alexander Monakov <amonakov at gcc dot gnu.org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |amonakov at gcc dot gnu.org
> 
> --- Comment #5 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
> (In reply to Richard Biener from comment #1)
> > We consider introducing load data races OK, what's the difference here? 
> > There are other passes that would do similar things but in practice the
> > loads would be considered to possibly trap so the real-world impact might be
> > limited?
> 
> What are the examples of other transforms that can introduce data races?

Off-head it would be loop invariant motion and partial-PRE, loop
if-conversion and if-combine.  All of those could speculate loads
when there's no trapping possibility but the values wouldn't be used
when not used without the transform.

> This trips Valgrind's data race detector (valgrind --tool=helgrind) too. So I
> don't think checking SANITIZE_THREAD is the correct approach.

I can see that it's difficult for those tools to avoid those false
positives but eventually valgrind might be able to see the values loaded
are not used (hopefully the register content is overwritten "soon").

  parent reply	other threads:[~2023-07-26  6:37 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25  7:03 [Bug sanitizer/110799] New: " vries at gcc dot gnu.org
2023-07-25 10:02 ` [Bug sanitizer/110799] " rguenth at gcc dot gnu.org
2023-07-25 10:08 ` vries at gcc dot gnu.org
2023-07-25 10:19 ` jakub at gcc dot gnu.org
2023-07-25 13:42 ` rguenther at suse dot de
2023-07-25 14:09 ` amonakov at gcc dot gnu.org
2023-07-25 21:48 ` vries at gcc dot gnu.org
2023-07-25 21:59 ` vries at gcc dot gnu.org
2023-07-26  6:37 ` rguenther at suse dot de [this message]
2023-07-26  6:55 ` amonakov at gcc dot gnu.org
2023-07-26  6:56 ` rguenther at suse dot de
2023-07-26  7:05 ` rguenther at suse dot de
2023-07-26  7:18 ` jakub at gcc dot gnu.org
2023-07-26  9:42 ` cvs-commit at gcc dot gnu.org
2023-07-26 10:07 ` rguenth at gcc dot gnu.org
2023-07-27 10:34 ` cvs-commit at gcc dot gnu.org
2023-07-31  8:15 ` amonakov at gcc dot gnu.org
2023-07-31  8:29 ` rguenth 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-110799-4-cGDUOnkgtY@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).