Skip to content

[Inliner] Should we inline callee containing llvm.frameaddress? #66059

@bzEq

Description

@bzEq

For code

#include <iostream>

void foo() {
  std::cout << __builtin_frame_address(0) << std::endl;
}

int main() {
  std::cout << __builtin_frame_address(0) << std::endl;
  foo();
  return 0;
}

Using trunk's clang, with -O2, the output is

0x7ffd0501a2c0
0x7ffd0501a2a0

With -O3, the output is

0x7ffd97138270
0x7ffd97138270

We have InlinerPass enabled at O3, which inlines callee(foo)'s llvm.frameaddress. The different behaviors at O2 and O3 affects IBM OpenXL C/C++ compiler when compiling and running compiler-rt/test/asan/TestCases/Posix/stack-overflow.cpp.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions