public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/112998] New: s390x: Incorrect code generation
@ 2023-12-13 10:30 22s302h0659 at sonline20 dot sen.go.kr
  2023-12-13 11:50 ` [Bug target/112998] " rguenth at gcc dot gnu.org
  2023-12-14  8:41 ` xry111 at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: 22s302h0659 at sonline20 dot sen.go.kr @ 2023-12-13 10:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112998
           Summary: s390x: Incorrect code generation
           Product: gcc
           Version: 11.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: 22s302h0659 at sonline20 dot sen.go.kr
  Target Milestone: ---

# Environment

- Compiler: s390x-linux-gnu-gcc (64bit)
- Version: gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
- Platform: Windows 11_5.15.90.1-microsoft-standard-WSL2
- Build Optimization Options: O0, O1, O2, O3

I installed the s390x-linux-gnu toolchain using the 'apt' package manager in
Ubuntu and utilized s390x-linux-gnu-gcc (version 11.4.0) from it.

# build script & excution script

```c
s390x-linux-gnu-gcc -o bug0 bug.c -O0 -fsanitize=undefined 
s390x-linux-gnu-gcc -o bug1 bug.c -O1 -fsanitize=undefined 
s390x-linux-gnu-gcc -o bug2 bug.c -O2 -fsanitize=undefined 
s390x-linux-gnu-gcc -o bug3 bug.c -O3 -fsanitize=undefined 
```

```c
qemu-s390x-static -L /usr/s390x-linux-gnu/ ./bug0
qemu-s390x-static -L /usr/s390x-linux-gnu/ ./bug1
qemu-s390x-static -L /usr/s390x-linux-gnu/ ./bug2
qemu-s390x-static -L /usr/s390x-linux-gnu/ ./bug3
```

This is the build script and the execution script.

# Source Code

```c
#include <stdio.h>
int g_59 = -1;
short g_64 = -1;
long long g_73 = 0;

int main ()
{   
    (g_59 >= (g_73 = ((g_64 < g_59) | 0)));

    printf("bug = %lld\n", g_73);
    return 0;
}
```

# output

```c
Expected output
O0: 0
O1: 0
O2: 0
O3: 0

Actual output
O0: 0
O1: 0
O2: 1
O3: 1
```

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

end of thread, other threads:[~2023-12-14  8:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-13 10:30 [Bug c/112998] New: s390x: Incorrect code generation 22s302h0659 at sonline20 dot sen.go.kr
2023-12-13 11:50 ` [Bug target/112998] " rguenth at gcc dot gnu.org
2023-12-14  8:41 ` xry111 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).