llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.7k stars 11.87k forks source link

Infinite loop in a recursive call graph #49031

Open llvmbot opened 3 years ago

llvmbot commented 3 years ago
Bugzilla Link 49687
Version trunk
OS Linux
Attachments Simplified IR found by bugpoint
Reporter LLVM Bugzilla Contributor

Extended Description

I have a recursive call graph that is apparently entering an infinite loop, at first I observed this when forcing inline in the optimization pipeline but later bugpoint found a more concise pipeline that reproduces the bug.

Bugpoint found the following 'opt' invocation to enter the infinite loop:

opt -inline -simplifycfg -tailcallelim -loop-unroll

As a comparison, the original C code when compiled with GCC and the 'alwaysinline' attribute errors out, for all optimizations, with the following:

out.c: In function ‘__foo’: out.c:252:50: error: inlining failed in call to always_inline ‘__bar’: function not inlinable

llvmbot commented 3 years ago

Confirmed on clang-10 and trunk.