-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Description
| Bugzilla Link | 2083 |
| Resolution | INVALID |
| Resolved on | Feb 28, 2008 11:59 |
| Version | 2.2 |
| OS | Linux |
| Attachments | Demo sourtce file |
| Reporter | LLVM Bugzilla Contributor |
| CC | @asl |
Extended Description
The test case is a C program which makes a series of calls to function check(). When compiled with no optimisation and disassembled thusly:
% llvm-gcc 20000223-1.c -g -c --emit-llvm
% llvm-dis -f 20000223-1.o
you will see that in the code for function check() there are debug intrinsic functions for a region start and end, and the region.end is correctly matched to the block (first and last lines of the code fragment):
20000223-1.o.ll (fragment):
call void @​llvm.dbg.region.start( { }* bitcast (%llvm.dbg.block.type* @​llvm.dbg.block to { }*) )
call void @​llvm.dbg.stoppoint( i32 12, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @​llvm.dbg.compile_unit to { }*) )
call void @​abort( )
unreachable
; No predecessors!
call void @​llvm.dbg.stoppoint( i32 12, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @​llvm.dbg.compile_unit to { }*) )
call void @​llvm.dbg.region.end( { }* bitcast (%llvm.dbg.block.type* @​llvm.dbg.block to { }*) )
If you now optimise by running opt and disassemble:
opt -f -std-compile-opts 20000223-1.o -o 20000223-1.o
llvm-dis -f 20000223-1.o
you will see that the region.end has been amended and is now incorrectly paired with a subprogram. Furthermore, this function check() is inlined into the main function and the problem is replicated in each case.
20000223-1.o.ll (fragment):
cond_true: ; preds = %entry
call void @llvm.dbg.region.start( { }* bitcast (%llvm.dbg.block.type* @llvm.dbg.block to { }) )
call void @llvm.dbg.stoppoint( i32 12, i32 0, { } bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }*) )
call void @abort( )
unreachable
return: ; preds = %entry
call void @llvm.dbg.stoppoint( i32 14, i32 0, { }* bitcast (%llvm.dbg.compile_unit.type* @llvm.dbg.compile_unit to { }) )
call void @llvm.dbg.region.end( { } bitcast (%llvm.dbg.subprogram.type* @llvm.dbg.subprogram to { }*) )