[Bug c++/85509] New: auto (function pointer) undermining inline expansion with GCC but not LLVM
aaron_sami_abassi at hotmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Apr 23 20:12:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85509
Bug ID: 85509
Summary: auto (function pointer) undermining inline expansion
with GCC but not LLVM
Product: gcc
Version: 7.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: aaron_sami_abassi at hotmail dot com
Target Milestone: ---
Created attachment 44010
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44010&action=edit
This code demonstrates the problem
The attached code when compiled with optimizations in LLVM (I'm using 5.0.0)
expands the call inline through the auto variables PerformQuickly and
PerformSafely.
Adding const solves the issue but GCC should be able to determine that the
function pointer can never be modified and inline the function invocations as
LLVM is doing.
More information about the Gcc-bugs
mailing list