Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1689769
Summary: | Surprising effect of register volatile on s390x | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Jerry James <loganjerry> | ||||||
Component: | gcc | Assignee: | Jakub Jelinek <jakub> | ||||||
Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | 29 | CC: | bugproxy, dan, davejohansen, dmalcolm, fweimer, hannsj_uhl, jakub, jwakely, law, mpolacek, msebor, nickc, samuel-rhbugs | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | s390x | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | If docs needed, set a value | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2019-11-27 22:50:54 UTC | Type: | Bug | ||||||
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
Jerry James
2019-03-18 03:46:39 UTC
Created attachment 1545109 [details]
Test code with register volatile
This changed in http://gcc.gnu.org/r203303 Created attachment 1546058 [details]
experimental patch
------- Comment on attachment From Andreas.Krebbel.com 2019-03-20 08:57 EDT-------
The stack pointer needs saving and restoring even if it is a global register. This is currently not handled correctly in s390_optimize_register_info.
I'm testing the attached patch. Does this fix the problem for you?
Comment on attachment 1546058 [details]
experimental patch
Thanks, looks reasonable to me, though not sure if for the testcase it wouldn't be better to just have a runtime testcase with that global register variable, a noipa function that does something that needs stack allocation and perhaps in auxiliary source have the rest, main that calls that noipa function and have that noipa function say call some other noipa one in the auxiliary TU and do some runtime verification which would fail if the stack pointer changed in main (then it wouldn't find some variable for a check or comparison of addresses would fail etc.).
Something like: $ cat prNNNNN-1.c /* PR target/NNNNN */ /* { dg-do run } */ /* { dg-options "-O0 -fomit-frame-pointer" } */ /* { dg-additional-sources "prNNNNN-2.c" } */ register void *sp __asm ("15"); __attribute__((noipa)) int foo (const char *a, const char *b) { while (1) { char c = *a++; if (c != *b++) return 0; if (c == '\0') return 1; } } $ cat prNNNNN-2.c /* PR target/NNNNN */ /* { dg-do compile } */ extern int foo (const char *, const char *); __attribute__((noipa)) void bar (const char *p) { static const char *x; if (!x) x = p; else if (p != x) __builtin_abort (); } int main () { char a[8] = "abcdefg"; bar (a); if (foo (a, a) != 1) __builtin_abort (); bar (a); return 0; } with NNNNN replaced by some gcc bugzilla bug filed for this. At least the above fails for me with the current trunk and commenting out the sp declaration makes it work. ------- Comment From Andreas.Krebbel.com 2019-03-20 11:00 EDT------- GCC Bugzilla: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89775 ------- Comment From Andreas.Krebbel.com 2019-03-20 11:29 EDT------- Test was successful. I've committed the patch with the testcase from Jakub. I've verified that the testcase fails before and succeeds after the patch. Thanks! Thanks for the fast analysis and fix. Once a patched gcc is available in the Fedora repos, I'll try it out on the clisp code. This message is a reminder that Fedora 29 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '29'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 29 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. Fedora 29 changed to end-of-life (EOL) status on 2019-11-26. Fedora 29 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed. |