public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/111734] [14 Regression] wrong code with '-O3 -fno-inline-functions-called-once -fno-inline-small-functions -fno-omit-frame-pointer -fno-toplevel-reorder -fno-tree-fre'
Date: Tue, 10 Oct 2023 02:38:13 +0000	[thread overview]
Message-ID: <bug-111734-4-NAinIxIAFY@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111734-4@http.gcc.gnu.org/bugzilla/>

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
            Summary|wrong code with '-O3        |[14 Regression] wrong code
                   |-fno-inline-functions-calle |with '-O3
                   |d-once                      |-fno-inline-functions-calle
                   |-fno-inline-small-functions |d-once
                   |-fno-omit-frame-pointer     |-fno-inline-small-functions
                   |-fno-toplevel-reorder       |-fno-omit-frame-pointer
                   |-fno-tree-fre'              |-fno-toplevel-reorder
                   |                            |-fno-tree-fre'
   Last reconfirmed|                            |2023-10-10
          Component|c                           |tree-optimization
   Target Milestone|---                         |14.0
             Status|UNCONFIRMED                 |NEW

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
PRE does:

Processing block 0: BB2
Value numbering stmt = *m_1(D) = &e;
RHS &e simplified to &e
No store match
Value numbering store *m_1(D) to &e
Setting value number of .MEM_3 to .MEM_

...

Starting insert iteration 1
Deleted redundant store *m_1(D) = &e;
Removing dead stmt *m_1(D) = &e;


Better reduced testcase:
```
struct a {};
struct {
  unsigned b;
  unsigned short c;
} d, f = {9, 1};
int e;
static void g(unsigned, __SIZE_TYPE__, int **m);
static void h() {
  int *i = &e;
  g(0, (__SIZE_TYPE__)i, &i);
  if (*i)
    f = d;
}
void g(unsigned a, __SIZE_TYPE__ b, int **m) {
  *m = &e;
}
int main() {
  h();
  if (f.c != 1)
    __builtin_abort();
}
```

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

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-09 10:02 [Bug c/111734] New: " 19373742 at buaa dot edu.cn
2023-10-09 10:03 ` [Bug c/111734] " 19373742 at buaa dot edu.cn
2023-10-09 12:42 ` 19373742 at buaa dot edu.cn
2023-10-10  2:38 ` pinskia at gcc dot gnu.org [this message]
2023-10-17 13:11 ` [Bug tree-optimization/111734] [14 Regression] " rguenth at gcc dot gnu.org
2023-10-31  3:27 ` sjames at gcc dot gnu.org
2023-10-31  5:19 ` sjames at gcc dot gnu.org
2023-10-31  6:27 ` [Bug tree-optimization/111734] [14 Regression] wrong code with '-O3 -fno-inline-functions-called-once -fno-inline-small-functions -fno-omit-frame-pointer -fno-toplevel-reorder -fno-tree-fre' since r14-3226-gd073e2d75d9ed4 sjames at gcc dot gnu.org
2023-10-31  7:43 ` 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-111734-4-NAinIxIAFY@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).