Bug 2273618
Summary: | Optimizing with -O2 causes wrong results on s390x | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Jonas Ådahl <jadahl> | ||||
Component: | gcc | Assignee: | Jakub Jelinek <jakub> | ||||
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 40 | CC: | dan, dmalcolm, fweimer, jakub, jlaw, josmyers, jwakely, mcermak, mpolacek, msebor, nickc, nixuser, sipoyare | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | s390x | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | gcc-14.0.1-0.14.fc41 | Doc Type: | If docs needed, set a value | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2024-04-12 13:45:04 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 467765 | ||||||
Attachments: |
|
Description
Jonas Ådahl
2024-04-05 11:00:05 UTC
Created attachment 2025354 [details]
Reproducer
Jonas, could you make also the attachment public? Thanks. (In reply to Dan Horák from comment #2) > Jonas, could you make also the attachment public? Thanks. Done; sorry about that. Thanks and for the record it reproduces on z14 with gcc-14.0.1-0.13.fc41.s390x, but not with gcc-13.2.1-4.fc38.s390x Simplified for -march=z13 -O0: typedef struct { const float *a; int b, c; float *d; } S; __attribute__((noipa)) void bar (void) { } __attribute__((noinline, optimize (2))) static void foo (S *e) { const float *f; float *g; float h[4] = { 0.0, 0.0, 1.0, 1.0 }; if (!e->b) f = h; else f = e->a; g = &e->d[0]; __builtin_memcpy (g, f, sizeof (float) * 4); bar (); if (!e->b) if (g[0] != 0.0 || g[1] != 0.0 || g[2] != 1.0 || g[3] != 1.0) __builtin_abort (); } int main () { float d[4]; S e = { .d = d }; foo (&e); return 0; } Bisecting now. Bisected to https://gcc.gnu.org/r14-5831 |