public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/111519] [13/14 Regression] Wrong code at -O3 on x86_64-linux-gnu since r13-455-g1fe04c497d
Date: Tue, 10 Oct 2023 10:37:34 +0000	[thread overview]
Message-ID: <bug-111519-4-x9csp7UTDQ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111519-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #6)
> Created attachment 56089 [details]
> patch
> 
> This patch (against the 13 branch) fixes the bug but it might be a bit
> conservative since some entries (the _addr one for example) may not have
> a live virtual use.  Maybe getting the relevant one from up the call chain
> is better.
> 
> I'm going to throw this at testing but expect some testsuite fallout because
> of this conservativeness.

It causes

FAIL: gcc.dg/Wstringop-overflow-69.c  (test for warnings, line 60)
FAIL: gcc.dg/Wstringop-overflow-69.c  (test for warnings, line 62)

the testcase has

  *(VC4*)a2 = c4;       // { dg-warning "writing 4 bytes into a region of size
2" }
  *(VC4*)a3 = c4;       // { dg-warning "writing 4 bytes into a region of size
3" }
  *(VC8*)a4 = c8;       // { dg-warning "writing 8 bytes into a region of size
4" }
  *(VC8*)a7 = c8;       // { dg-warning "writing 8 bytes into a region of size
7" }

and the later of the two assignments from c4 and c8 fail to be diagnosed
as their load is CSEd to a definition before the earlier of the two
assignments.  Which means the fix is working, not sure if we want to beef
it up with an alias walk, that definitely would require careful looking
as to what random trees we feed into this kitchen-sink routine.

I'm inclined to XFAIL the sub-test, at least on branches, and only maybe
fix it on trunk (well, not myself actually).

  parent reply	other threads:[~2023-10-10 10:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-21 13:20 [Bug tree-optimization/111519] New: " shaohua.li at inf dot ethz.ch
2023-09-21 15:35 ` [Bug tree-optimization/111519] " pinskia at gcc dot gnu.org
2023-09-21 15:47 ` pinskia at gcc dot gnu.org
2023-09-21 16:00 ` rguenth at gcc dot gnu.org
2023-10-09 22:05 ` roger at nextmovesoftware dot com
2023-10-10  7:56 ` rguenth at gcc dot gnu.org
2023-10-10  8:21 ` jakub at gcc dot gnu.org
2023-10-10  8:26 ` rguenth at gcc dot gnu.org
2023-10-10  8:31 ` rguenth at gcc dot gnu.org
2023-10-10  8:33 ` rguenth at gcc dot gnu.org
2023-10-10 10:37 ` rguenth at gcc dot gnu.org [this message]
2023-10-11  7:09 ` cvs-commit at gcc dot gnu.org
2023-10-11  7:23 ` cvs-commit at gcc dot gnu.org
2023-10-11  7:24 ` jakub at gcc dot gnu.org
2023-11-02  9:05 ` pinskia 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-111519-4-x9csp7UTDQ@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).