[Bug tree-optimization/71258] Missed optimizations: dynamic allocation, virtual calls, empty destructors

phosit at autistici dot org gcc-bugzilla@gcc.gnu.org
Tue Mar 19 19:28:32 GMT 2024


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71258

Phosit <phosit at autistici dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |phosit at autistici dot org

--- Comment #5 from Phosit <phosit at autistici dot org> ---
struct Base{
    virtual ~Base() = default;
};

int main(){
    delete new Base;
    return 0;
}

In this partial test case the destructor is not inlined.
Curiously when changing the function name the destructor is inlined.
I compiled with -O3


More information about the Gcc-bugs mailing list