| Summary: |
GCC crash on s390x when building a C function which uses _Float16/uint16_t, memcpy() and __builtin_bswap16() |
| Product: |
[Fedora] Fedora
|
Reporter: |
Victor Stinner <vstinner> |
| Component: |
gcc | Assignee: |
Jakub Jelinek <jakub> |
| Status: |
NEW
---
|
QA Contact: |
Fedora Extras Quality Assurance <extras-qa> |
| Severity: |
medium
|
Docs Contact: |
|
| Priority: |
unspecified
|
|
|
| Version: |
44 | CC: |
dmalcolm, fweimer, jakub, jlaw, josmyers, jwakely, mcermak, mpolacek, msebor, nickc, nixuser, sipoyare
|
| Target Milestone: |
--- | |
|
| Target Release: |
--- | |
|
| Hardware: |
s390x | |
|
| OS: |
Linux | |
|
| Whiteboard: |
|
|
Fixed In Version:
|
|
Doc Type:
|
---
|
|
Doc Text:
|
|
Story Points:
|
---
|
|
Clone Of:
|
|
Environment:
|
|
|
Last Closed:
|
|
Type:
|
---
|
|
Regression:
|
---
|
Mount Type:
|
---
|
|
Documentation:
|
---
|
CRM:
|
|
|
Verified Versions:
|
|
Category:
|
---
|
|
oVirt Team:
|
---
|
RHEL 7.3 requirements from Atomic Host:
|
|
|
Cloudforms Team:
|
---
|
Target Upstream Version:
|
|
|
Embargoed:
|
|
| |
| Attachments: |
|
bug.c file to reproduce the crash: ---------- #include <string.h> #include <stdint.h> void PyFloat_Pack2(double x, char *data, int le) { _Float16 y = (_Float16)x; if (!le) { uint16_t word; memcpy(&word, &y, 2); word = __builtin_bswap16(word); memcpy(data, &word, 2); } else { memcpy(data, &y, sizeof(_Float16)); } } ---------- GCC crash with -O1 or higher, but it doesn't crash with -O0 or -Og. Reproducible: Always Steps to Reproduce: 1. Create bug.c 2. gcc -O1 -o bug.o -c bug.c Actual Results: Build with gcc 16.2.1 (Fedora package gcc-16.2.1-2.fc44.s390x): ---------- $ gcc -O1 -o bug.o -c bug.c during RTL pass: split1 bug.c: In function ‘PyFloat_Pack2’: bug.c:17:1: internal compiler error: Segmentation fault 17 | } | ^ /usr/libexec/gcc/s390x-redhat-linux/16/cc1 -quiet bug.c -quiet -dumpbase bug.c -dumpbase-ext .c -mtune=z14 -march=z13 -m64 -mzarch -O1 -o /tmp/cc0XMx28.s Please submit a full bug report, with preprocessed source. See <https://bugzilla.redhat.com/> for instructions. Preprocessed source stored into /tmp/cceEi1QY.out file, please attach this to your bugreport. ---------- Expected Results: No crash. Additional Information: $ uname -a Linux fedora-stable 7.2.5-200.fc44.s390x #1 SMP PREEMPT Fri Sep 11 15:37:18 UTC 2026 s390x GNU/Linux $ sudo virt-what ibm_systemz ibm_systemz-zvm