public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/114074] New: wrong code at -O1 and above on x86_64-linux-gnu
@ 2024-02-23 10:48 zhendong.su at inf dot ethz.ch
  2024-02-23 10:54 ` [Bug tree-optimization/114074] [11/12/13/14 Regression] wrong code at -O1 and above on x86_64-linux-gnu since r8-343 jakub at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2024-02-23 10:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114074
           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: ---

This seems to be quite long-latent and affects 8.1 and later.

Compiler Explorer: https://godbolt.org/z/vbM6zsq1b

[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/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
--enable-sanitizers --enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.1 20240223 (experimental) (GCC) 
[512] % 
[512] % gcctk -O0 small.c; ./a.out
0
0
[513] % gcctk -O1 small.c
[514] % ./a.out
0
[515] % cat small.c
int printf(const char *, ...);
int a, b;
int main() {
  for (a = 0; a > -3; a -= 2) {
    int c = a;
    b = 2000000000;
    a = ~c * b;
    printf("0\n");
    if (!a)
      break;
    a = c;
  }
  return 0;
}

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-03-19 12:16 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-23 10:48 [Bug tree-optimization/114074] New: wrong code at -O1 and above on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
2024-02-23 10:54 ` [Bug tree-optimization/114074] [11/12/13/14 Regression] wrong code at -O1 and above on x86_64-linux-gnu since r8-343 jakub at gcc dot gnu.org
2024-02-23 11:02 ` jakub at gcc dot gnu.org
2024-02-23 11:34 ` rguenth at gcc dot gnu.org
2024-02-23 12:48 ` jakub at gcc dot gnu.org
2024-02-26  9:38 ` rguenth at gcc dot gnu.org
2024-02-26 11:48 ` rguenth at gcc dot gnu.org
2024-02-26 12:03 ` rguenth at gcc dot gnu.org
2024-02-27  9:55 ` cvs-commit at gcc dot gnu.org
2024-02-27  9:57 ` [Bug tree-optimization/114074] [11/12/13 " rguenth at gcc dot gnu.org
2024-03-08 11:04 ` rguenth at gcc dot gnu.org
2024-03-08 13:41 ` cvs-commit at gcc dot gnu.org
2024-03-19 12:12 ` cvs-commit at gcc dot gnu.org
2024-03-19 12:14 ` [Bug tree-optimization/114074] [11/12/13/14 " rguenth at gcc dot gnu.org
2024-03-19 12:15 ` rguenth at gcc dot gnu.org
2024-03-19 12:15 ` rguenth at gcc dot gnu.org
2024-03-19 12:16 ` rguenth at gcc dot gnu.org

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).