public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/115671] New: wrong code at -O1 with "-fgcse -fno-inline -fschedule-insns" on x86_64-linux-gnu
@ 2024-06-26 21:54 zhendong.su at inf dot ethz.ch
  2024-06-27  3:44 ` [Bug target/115671] " sjames at gcc dot gnu.org
  2024-06-27  5:58 ` [Bug target/115671] [15 Regression] " rguenth at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2024-06-26 21:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115671
           Summary: wrong code at -O1 with "-fgcse -fno-inline
                    -fschedule-insns" on x86_64-linux-gnu
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

It seems to be a recent regression as it doesn't reproduce with 14.1. 

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

[648] % 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/15.0.0/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 15.0.0 20240626 (experimental) (GCC) 
[649] % 
[649] % gcctk -O1 small.c; ./a.out
[650] % 
[650] % gcctk -O1 -fgcse -fno-inline -fschedule-insns small.c
[651] % ./a.out
Aborted
[652] % 
[652] % cat small.c
int printf(const char *, ...);
int a, b, c, d, e;
short f[2];
int g(int h, int i) { return 0; }
int j(int h, int i) { return i; }
void k() {
  int l;
  for (; b < 1; b++) {
    l = g(a, e);
    c = l < a;
    e = j(f[1 + b], 2);
    d = a || d;
    if (j(0, 1))
      return;
  }
}
int main() {
  k();
  if (c != 0)
    __builtin_abort();
  return 0;
}

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

* [Bug target/115671] wrong code at -O1 with "-fgcse -fno-inline -fschedule-insns" on x86_64-linux-gnu
  2024-06-26 21:54 [Bug target/115671] New: wrong code at -O1 with "-fgcse -fno-inline -fschedule-insns" on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
@ 2024-06-27  3:44 ` sjames at gcc dot gnu.org
  2024-06-27  5:58 ` [Bug target/115671] [15 Regression] " rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-06-27  3:44 UTC (permalink / raw)
  To: gcc-bugs

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

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sjames at gcc dot gnu.org

--- Comment #1 from Sam James <sjames at gcc dot gnu.org> ---
I can't reproduce this with a GCC patched for PR115661.

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

* [Bug target/115671] [15 Regression] wrong code at -O1 with "-fgcse -fno-inline -fschedule-insns" on x86_64-linux-gnu
  2024-06-26 21:54 [Bug target/115671] New: wrong code at -O1 with "-fgcse -fno-inline -fschedule-insns" on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
  2024-06-27  3:44 ` [Bug target/115671] " sjames at gcc dot gnu.org
@ 2024-06-27  5:58 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-06-27  5:58 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unknown                     |15.0
   Target Milestone|---                         |15.0
             Target|                            |x86_64-*-*
            Summary|wrong code at -O1 with      |[15 Regression] wrong code
                   |"-fgcse -fno-inline         |at -O1 with "-fgcse
                   |-fschedule-insns" on        |-fno-inline
                   |x86_64-linux-gnu            |-fschedule-insns" on
                   |                            |x86_64-linux-gnu

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

end of thread, other threads:[~2024-06-27  5:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-26 21:54 [Bug target/115671] New: wrong code at -O1 with "-fgcse -fno-inline -fschedule-insns" on x86_64-linux-gnu zhendong.su at inf dot ethz.ch
2024-06-27  3:44 ` [Bug target/115671] " sjames at gcc dot gnu.org
2024-06-27  5:58 ` [Bug target/115671] [15 Regression] " 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).