Bug 1511021 - "generic thunk code fails" for overridden function which uses ...
Summary: "generic thunk code fails" for overridden function which uses ...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 26
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-08 14:37 UTC by James Legg
Modified: 2018-02-26 18:46 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-26 18:46:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Test case (97 bytes, text/plain)
2017-11-08 14:37 UTC, James Legg
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 83549 0 None None None 2017-12-22 09:27:56 UTC

Description James Legg 2017-11-08 14:37:59 UTC
Created attachment 1349475 [details]
Test case

Description of problem:
When optimisations are enabled, g++ fails to compile an overridden virtual method which takes a variable number of arguments, if there is another base class with virtual functions before the one with the overridden function in the base clause.

Version-Release number of selected component (if applicable):
gcc-7.2.1-2.fc26

How reproducible:
Occurs every time.

Steps to Reproduce:
1. Download test case attachment to a file called test.cpp
2. run g++ -O1 -c test.cpp

Actual results:
Compilation fails with the output:
test.cpp:3:34: error: generic thunk code fails for method ‘virtual void<unnamed class>::_ZThn8_N3._01cEz(...)’ which uses ‘...’
 class : a, b { void c(...) {} } d;
                                  ^
Expected results:
An object file is produced with no error.

Additional info:
I think this is a regression and it previously worked on GCC 6.
It can be worked around by adding the attribute [[gnu::optimize("O0")]] to any offending function definitions.

Comment 1 Marek Polacek 2018-02-26 18:46:56 UTC
Fixed in gcc 8.


Note You need to log in before you can comment on or make changes to this bug.