https://bugs.llvm.org/show_bug.cgi?id=48137
Bug ID: 48137
Summary: llvm-diff produces non-empty diff in the same code for
static variables referencing
Product: new-bugs
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: new bugs
Assignee: unassignedb...@nondot.org
Reporter: khit...@gmail.com
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org
Created attachment 24143
--> https://bugs.llvm.org/attachment.cgi?id=24143&action=edit
full clang-produced IR file
Looks like a follow-up for bug 33623.
$ cat a.cpp
struct S {
};
// removing static eliminates the bug
static S s;
void* func() {
return &s;
}
$ clang a.cpp -S -emit-llvm
$ llvm-diff a.ll a.ll
in function _Z4funcv:
in block %0 / %0:
> ret i8* getelementptr inbounds (%struct.S.0, %struct.S.0* @_ZL1s, i32
0, i32 0)
< ret i8* getelementptr inbounds (%struct.S, %struct.S* @_ZL1s, i32 0,
i32 0)
$ llvm-diff -version
LLVM (http://llvm.org/):
LLVM version 11.0.0
Optimized build.
Default target: x86_64-apple-darwin18.7.0
Host CPU: haswell
Reduced testcase with the same llvm-diff output:
$ cat a_reduced.ll
%struct.S = type { i8 }
@_ZL1s = internal global %struct.S zeroinitializer, align 1
define i8* @_Z4funcv() {
ret i8* getelementptr inbounds (%struct.S, %struct.S* @_ZL1s, i32 0, i32 0)
}
Also reproducible on llvm-12 development build for Debian
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs