Bug 91387 - Segfault using -flto
Summary: Segfault using -flto
Status: RESOLVED DUPLICATE of bug 91375
Alias: None
Product: gcc
Classification: Unclassified
Component: lto (show other bugs)
Version: 8.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: needs-bisection, needs-reduction
Depends on:
Blocks:
 
Reported: 2019-08-07 12:11 UTC by Tobias Gödderz
Modified: 2019-08-07 13:19 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2019-08-07 00:00:00


Attachments
Preprocessed source code (433.39 KB, application/gzip)
2019-08-07 12:11 UTC, Tobias Gödderz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Gödderz 2019-08-07 12:11:11 UTC
Created attachment 46684 [details]
Preprocessed source code

Hi,

I'm experiencing g++ segfaults during compilation. This is a "minimal" example in terms of command line parameters, using the preprocessed source (which is not minimal):

> $ /usr/bin/g++-8 -std=c++14 -O2 -flto -fno-devirtualize -c ShapeContainerTest.ii
> during IPA pass: cp
> /home/tobias/Documents/ArangoDB/arangodb/arangodb/tests/Geo/ShapeContainerTest.cpp: In function ‘arangodb::velocypack::Builder::openCompoundValue(unsigned char) [clone .part.119]’:
> /home/tobias/Documents/ArangoDB/arangodb/arangodb/tests/Geo/ShapeContainerTest.cpp:427:2: internal compiler error: Segmentation fault
>  }}
>   ^
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <file:///usr/share/doc/gcc-8/README.Bugs> for instructions.

This is with g++ (Ubuntu 8.3.0-6ubuntu1~18.04.1) 8.3.0.

I have two other files exhibiting a similar error, if it's of interest. The one referenced above is attached.

Please tell me if and how I can be of further help.

Best regards,

Tobias
Comment 1 Martin Liška 2019-08-07 12:39:30 UTC
Confirmed, I'm reducing that.
Comment 2 Martin Liška 2019-08-07 13:19:36 UTC
Reduced test-case:

class A {
public:
  A();
};
#pragma GCC optimize("fp-contract=off")
class B : virtual A {};
void fn1() { throw B(); }

The suggested fix for the duplicate works.

*** This bug has been marked as a duplicate of bug 91375 ***