Bug 490509
| Summary: | GCC register allocation wrongly using ebp | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Glauber Costa <gcosta> | ||||||
| Component: | gcc | Assignee: | Jakub Jelinek <jakub> | ||||||
| Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
| Severity: | medium | Docs Contact: | |||||||
| Priority: | low | ||||||||
| Version: | rawhide | CC: | aoliva, ehabkost, jakub, virt-maint | ||||||
| Target Milestone: | --- | ||||||||
| Target Release: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2009-04-02 09:20:39 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: | 490512 | ||||||||
| Attachments: |
|
||||||||
Created attachment 335419 [details]
Patch that fixes the bug
Here's a patch that seems to fix the problem. Still requires further testing.
When tested, are you going to submit it to gcc-patches together with a testcase (if a small testcase is distillable)? Thanks. Yup. I'm not sure about a testcase, though. Register allocation testcases are too fragile, even for glaring errors like this. Patch proposed upstream: http://gcc.gnu.org/ml/gcc-patches/2009-03/msg00891.html This should be fixed in 4.4.0-0.29 and above. |
Created attachment 335390 [details] Preprocessed gcc output Description of problem: Version-Release number of selected component (if applicable): gcc version 4.4.0 20090313 (Red Hat 4.4.0-0.26) (GCC) How reproducible: Always Steps to Reproduce: 1. Compile qemu on an i386 host (./configure --target-list=i386-softmmu; make) 2. Run 3. See a segfault Actual results: QEMU segfaults. Expected results: QEMU runs. Sorry for not having a smaller test case for this Additional info: This works with older versions of gcc, including 4.3. I'm attaching to this BZ a copy of the preprocessed version of the culprit file (op_helper.c) If you look closely, you'll see: register struct CPUX86State *env asm("ebp"); Meaning gcc should not touch it, since it is a global var (or touch it and save it later). The generated object code has something like this: b1a3: 09 e8 or %ebp,%eax b1a5: 89 d5 mov %edx,%ebp which seems invalid to me.