!dbg metadata not generated for if.else->if.end branch

Hello,

For this C code:

int func(int foo, char bar) {

int result = foo + bar;

if (foo > bar)

result += 100 - foo;

else

result += 221 - bar;

return result;

}

Compiled with –O0 –g, the following IR represents the relevant parts of the if/else statement:

%0 = load i32* %foo.addr, align 4, !dbg !49

%1 = load i8* %bar.addr, align 1, !dbg !49

%conv = sext i8 %1 to i32, !dbg !49

%add = add nsw i32 %0, %conv, !dbg !49

store i32 %add, i32* %result, align 4, !dbg !49

%2 = load i32* %foo.addr, align 4, !dbg !50

%3 = load i8* %bar.addr, align 1, !dbg !50

%conv1 = sext i8 %3 to i32, !dbg !50

%cmp = icmp sgt i32 %2, %conv1, !dbg !50

br i1 %cmp, label %if.then, label %if.else, !dbg !50

if.then: ; preds = %entry

%4 = load i32* %foo.addr, align 4, !dbg !51

%sub = sub nsw i32 100, %4, !dbg !51

%5 = load i32* %result, align 4, !dbg !51

%add3 = add nsw i32 %5, %sub, !dbg !51

store i32 %add3, i32* %result, align 4, !dbg !51

br label %if.end, !dbg !51

if.else: ; preds = %entry

%6 = load i8* %bar.addr, align 1, !dbg !52

%conv4 = sext i8 %6 to i32, !dbg !52

%sub5 = sub nsw i32 221, %conv4, !dbg !52

%7 = load i32* %result, align 4, !dbg !52

%add6 = add nsw i32 %7, %sub5, !dbg !52

store i32 %add6, i32* %result, align 4, !dbg !52

br label %if.end

if.end: ; preds = %if.else, %if.then

%8 = load i32* %result, align 4, !dbg !53