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
```