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

The order of function differs with or w/o -g #49035

Open llvmbot opened 3 years ago

llvmbot commented 3 years ago
Bugzilla Link 49691
Version trunk
OS All
Blocks llvm/llvm-project#37076
Attachments re.cpp
Reporter LLVM Bugzilla Contributor
CC @dwblaikie,@pogo59,@zygoloid

Extended Description

How to produce:

$ clang++ -S -emit-llvm re.cpp -o dbg.ll -g $ clang++ -S -emit-llvm re.cpp -o rel.ll

Then diff the content of dbgl.ll and rel.ll

Found that the ctor of Re3 (_ZN6extend3re33Re3C2Ev) precedes before the another funciton in rel.ll file, but the order changes in dbg.ll

theo-lw commented 2 years ago

I am able to reproduce this on clang++-trunk. Should this be marked as confirmed?

$ /home/cnsun/usr/bin/clang++-trunk -v
clang version 14.0.0 (https://github.com/llvm/llvm-project.git 73cfa982ba6380ee96c017d044f3f580eb8e18bd)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/cnsun/usr/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
EugeneZelenko commented 2 years ago

I am able to reproduce this on clang++-trunk. Should this be marked as confirmed?

Sure.