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/100934] New: wrong code at -O3 on x86_64-linux-gnu
Date: Sun, 06 Jun 2021 20:49:44 +0000	[thread overview]
Message-ID: <bug-100934-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 100934
           Summary: wrong code at -O3 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: ---

It seems to affect all versions since GCC 8.4 (but not GCC 8.3). 

[583] % 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 20210606 (experimental) [master revision
28c62475050:a6bc26893ec:a589877a0036fc2f66b7a957859940c53efdc7c9] (GCC) 
[584] % 
[584] % gcctk -O2 small.c; ./a.out
[585] % 
[585] % gcctk -O3 small.c
[586] % ./a.out
Segmentation fault
[587] % 
[587] % cat small.c
int a, b, c, d, e;
int main() {
  int f = 0, g = 0;
  for (; f < 2; f++) {
    int h, i;
    for (h = 0; h < 2; h++) {
      b = e = g ? a % g : 0;
      c = d;
      for (i = 0; i < 1; i++)
        g = 0;
      for (; g < 2; g++)
        ;
    }
  }
  return 0;
}

             reply	other threads:[~2021-06-06 20:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-06 20:49 zhendong.su at inf dot ethz.ch [this message]
2021-06-06 21:07 ` [Bug tree-optimization/100934] [9/10/11/12 Regression] wrong code at -O3 during unrolling pinskia at gcc dot gnu.org
2021-06-07  8:38 ` [Bug tree-optimization/100934] [9/10/11/12 Regression] wrong code at -O3 during unrolling since r9-6299 jakub at gcc dot gnu.org
2021-06-07  8:42 ` jakub at gcc dot gnu.org
2021-06-07 10:28 ` rguenth at gcc dot gnu.org
2021-06-07 13:13 ` rguenth at gcc dot gnu.org
2021-06-11  9:28 ` rguenth at gcc dot gnu.org
2021-06-14  2:48 ` law at gcc dot gnu.org
2021-06-14 12:56 ` rguenth at gcc dot gnu.org
2021-06-14 12:59 ` jakub at gcc dot gnu.org
2021-06-14 13:02 ` rguenther at suse dot de
2021-06-14 14:37 ` cvs-commit at gcc dot gnu.org
2021-06-14 14:39 ` [Bug tree-optimization/100934] [9/10/11 " rguenth at gcc dot gnu.org
2021-06-16 13:12 ` cvs-commit at gcc dot gnu.org
2021-06-16 14:24 ` [Bug tree-optimization/100934] [9/10 " cvs-commit at gcc dot gnu.org
2021-10-13 10:09 ` [Bug tree-optimization/100934] [9 " cvs-commit at gcc dot gnu.org
2021-10-13 10:10 ` rguenth at gcc dot gnu.org
2021-11-09  7:57 ` 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-100934-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).