-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrong code at -O2 and -O3 on x86_64-linux-gnu #49005
Comments
https://gcc.godbolt.org/z/xTv9PG Seems to be an alignment issue @_ZL1a.1 = internal unnamed_addr global [3 x [3 x i32*]] zeroinitializer, align 16 define dso_local i32 @main() local_unnamed_addr #0 { |
This looks the same as bug 50253, but not making it a duplicate yet since I don't know anything about -globalopt. Before that pass, we have: @c = internal unnamed_addr global i32 0, align 4 ; Function Attrs: nofree norecurse nosync nounwind ssp uwtable And after: @a.1 = internal unnamed_addr global [3 x [3 x i32*]] zeroinitializer, align 16 ; Function Attrs: nofree norecurse nosync nounwind ssp uwtable |
Should be fixed with: |
*** Bug llvm/llvm-bugzilla-archive#50253 has been marked as a duplicate of this bug. *** |
mentioned in issue llvm/llvm-bugzilla-archive#50253 |
Extended Description
[520] % clangtk -v
clang version 13.0.0 (https://github.com/llvm/llvm-project.git f860187)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /local/suz-local/opfuzz/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@MX32
Selected multilib: .;@m64
[521] %
[521] % clangtk -Os small.c; ./a.out
[522] %
[522] % clangtk -O2 small.c
[523] % ./a.out
Segmentation fault
[524] %
[524] % cat small.c
static int *a[2][3][3], b, c;
int main() {
for (c = 0; c < 2; c++)
for (b = 0; b < 2; b++)
a[1][c][b] = a[0][0][0];
return 0;
}
The text was updated successfully, but these errors were encountered: