Bug 871889
Summary: | Internal compiler error from gcc. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Peter Jones <pjones> | ||||||
Component: | gcc | Assignee: | Jakub Jelinek <jakub> | ||||||
Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
Severity: | unspecified | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | 22 | CC: | dwmw2, jakub, law, mnewsome, mpolacek, the.ridikulus.rat | ||||||
Target Milestone: | --- | Keywords: | Reopened | ||||||
Target Release: | --- | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2016-07-19 10:05:52 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: | |||||||||
Attachments: |
|
Description
Peter Jones
2012-10-31 16:22:25 UTC
Created attachment 636198 [details]
Output of compilation with -fdump-rtl-all .
Reproducible with: #include <stdio.h> #include <stdarg.h> struct foo { char *fmt; va_list args; }; int __attribute__((ms_abi)) very_unfortunate(struct foo *foo) { return vprintf(foo->fmt, foo->args); } int __attribute__((ms_abi)) unfortunate(char *fmt, va_list args) { struct foo foo; int rc; foo.fmt = fmt; va_copy(foo.args, args); rc = very_unfortunate(&foo); va_end(foo.args); return rc; } I believe that is a user error, for stdarg in ms_abi functions when compilation is non-ms_abi by default (or vice versa) you should be using cross-stdarg.h header instead, and ms_va_list or sysv_va_list type and __ms_va* resp. __sysv_va* depending on which va_list kind do you need. Note that the two are incompatible, so if you say use the ms va_list, then you can't pass that to vprintf if that expects sysv va_list. CCing Kai who authored all this. yes, this is invalid code. you can't mix ms_abi va_list with gnu-style one. you need to use here types provided by cross-stdarg.h header. But of course be aware that "vprintf" has host's default abi. Even if it's invalid code, an ICE is not the way to present that to the user. The compiler needs to generate a suitable error message. This message is a reminder that Fedora 18 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 18. 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 WONTFIX if it remains open with a Fedora 'version' of '18'. 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 prior to Fedora 18's end of life. Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 18 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 to Fedora 18's end of life. 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 18 changed to end-of-life (EOL) status on 2014-01-14. Fedora 18 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. Still happening in Fedora 22. This is related to GCC PR#50818. We are also seeing this problem when building OpenSSL as part of the TianoCore UEFI implementation. Public functions in UEFI are marked with 'EFIAPI'; i.e. __attribute__((ms_abi)). Internal functions can use whatever the default ABI of the compiler is. Which *might* be the MS ABI for some build environments, and might be the SYSV ABI. We have no way, in the general case, to ensure that our VA_LIST macro does the right thing. It looks like GCC makes an *attempt* to get this right according to the ABI of the function it happens to be compiling at the time — I can see calls to targetm.fn_abi_va_list() in stabilize_va_list_loc() for example, which looks like it's trying to do what we need. But that particular case fails because it *only* calls the fn_abi_va_list() method when the canonical_va_list_type() method returns NULL. Which it doesn't. So this really does look like a bug, rather than a missing feature. And it *ought* to be considered a bug, because there's no way in the general case that the source code can manually use the appropriate __builtin_{sysv,ms}_va_list based on whether the particular function it's invoked in is EFIAPI or not. And it's *certainly* a bug when the failure mode is an ICE, as Jeff noted 2½ years ago! Still present gcc-5.3.1-2.fc23.x86_64 as well as current mainline. Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 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. |