Intel® oneAPI DPC++/C++ Compiler Developer Guide and Reference

ID 767253
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

ffunction-sections, Gy

Places each function in its own COMDAT section.

Syntax

Linux:

-ffunction-sections

Windows:

/Gy

Arguments

None

Default

OFF

The compiler does not separate functions into COMDATs.

Description

This option places each function in its own COMDAT section.

When using this compiler option, you can add the linker option -Wl,--gc-sections (Linux) or /link /OPT:REF (Windows), which will remove all unused code.

NOTE:

When you put each function in its own section, it enables the linker to reorder the sections for other possible optimization.

IDE Equivalent

Visual Studio: Code Generation > Enable Function-Level Linking

Eclipse: None

Alternate Options

None

See Also