Skip to content

ThinLTO seems to break computed goto #38589

Closed
@glandium

Description

@glandium
Bugzilla Link 39241
Resolution FIXED
Resolved on Oct 26, 2018 09:52
Version unspecified
OS Linux
Blocks #38454
CC @eleviant,@pawelsopensource,@rnk,@sylvestre,@tstellar
Fixed by commit(s) r344325 r345401

Extended Description

STR:
git clone https://github.com/silnrsi/graphite
cd graphite
mkdir build
cd build
cmake -GNinja -DCMAKE_C_COMPILER=/path/to/bin/clang -DCMAKE_CXX_COMPILER=/path/to/bin/clang++ -DCMAKE_CXX_FLAGS=-flto=thin -DCMAKE_SHARED_LINKER_FLAGS=-flto=thin -DCMAKE_EXE_LINKER_FLAGS=-flto=thin -DCMAKE_MODULE_LINKER_FLAGS=-flto=thin -DCMAKE_C_FLAGS=-flto=thin -DCMAKE_AR=/path/to/bin/llvm-ar -DCMAKE_RANLIB=/path/to/bin/llvm-ranlib ..
ninja
ninja test

This results in many tests failing (84 out of 93 on my machine). A non-LTO build only fails only 8 tests on my machine.

This worked fine with clang 6, so I bisected it down to:

commit 11b0e47 (refs/bisect/bad)
Author: Eugene Leviant eleviant@accesssoftek.com
Date: Fri Feb 16 08:11:04 2018 +0000

[ThinLTO] Import global variables

Differential revision: https://reviews.llvm.org/D43077


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325320 91177308-0d34-0410-b5e6-96231b3b80d8

I haven't dug into how exactly the generated code is broken, but adding the following to the cmake command line makes it work: -DGRAPHITE2_VM_TYPE=call
That makes call_machine.cpp be used instead of direct_machine.cpp. The main difference between both is that the latter is using computed gotos.

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzilla

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions