public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "zhendong.su at inf dot ethz.ch" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/100810] New: wrong code at -O1 and above on x86_64-linux-gnu
Date: Fri, 28 May 2021 08:59:21 +0000	[thread overview]
Message-ID: <bug-100810-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 100810
           Summary: wrong code at -O1 and above on x86_64-linux-gnu
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

[511] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--prefix=/local/suz-local/software/local/gcc-trunk --enable-languages=c,c++
--disable-werror --enable-multilib --with-system-zlib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210528 (experimental) [master revision
4774807e6e5:0e2d976f72b:cd62d089f6021fd1ad4537b8182836d15b14514f] (GCC) 
[512] % 
[512] % gcctk -O0 small.c; ./a.out
[513] % 
[513] % gcctk -O1 small.c
[514] % ./a.out
Aborted
[515] % 
[515] % cat small.c
int a, b = 1, c = 1, e, f = 1, g, h, j;
volatile int d;
static void k() {
  int i;
  h = b;
  if (c && a >= 0) {
    while (a) {
      i++;
      h--;
    }
    if (g)
      for (h = 0; h < 2; h++)
        ;
    if (!b)
      i &&d;
  }
}
static void l() {
  for (; j < 1; j++)
    if (!e && c && f)
      k();
}
int main() {
  if (f)
    l();
  if (h != 1)
    __builtin_abort();
  return 0;
}

             reply	other threads:[~2021-05-28  8:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-28  8:59 zhendong.su at inf dot ethz.ch [this message]
2021-05-28  9:23 ` [Bug tree-optimization/100810] [12 Regression] wrong code at -O1 and above on x86_64-linux-gnu since r12-397-gda9e6e63d1ae22e530ec7baf59f6ed028bf05776 marxin at gcc dot gnu.org
2021-06-11  8:27 ` [Bug middle-end/100810] " roger at nextmovesoftware dot com
2021-06-14  9:37 ` jakub at gcc dot gnu.org
2021-08-03 21:21 ` roger at nextmovesoftware dot com
2021-08-03 21:36 ` pinskia at gcc dot gnu.org
2021-08-03 21:41 ` pinskia at gcc dot gnu.org
2021-08-03 21:47 ` pinskia at gcc dot gnu.org
2021-08-31  6:23 ` roger at nextmovesoftware dot com
2021-11-11 19:37 ` roger at nextmovesoftware dot com
2022-04-01 11:06 ` rguenth at gcc dot gnu.org
2022-04-01 11:08 ` rguenth at gcc dot gnu.org
2022-04-04 12:59 ` rguenth at gcc dot gnu.org
2022-04-04 13:00 ` rguenth at gcc dot gnu.org
2022-04-22  6:11 ` rguenth at gcc dot gnu.org
2022-04-25  7:52 ` cvs-commit at gcc dot gnu.org
2022-04-25  7:54 ` rguenth at gcc dot gnu.org
2022-06-03  7:05 ` cvs-commit at gcc dot gnu.org
2022-07-27  9:24 ` 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-100810-4@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).