[llvm-bugs] [Bug 34682] New: [SKX] Bus error after Loop Vectorization
https://bugs.llvm.org/show_bug.cgi?id=34682 Bug ID: 34682 Summary: [SKX] Bus error after Loop Vectorization Product: new-bugs Version: trunk Hardware: PC OS: Windows NT Status: NEW Severity: enhancement Priority: P Component: new bugs Assignee: unassignedb...@nondot.org Reporter: ilia.tara...@intel.com CC: llvm-bugs@lists.llvm.org This test fails at run with "Bus error (core dumped)" after Loop Vectorization on O2, skx: = nice.c == int main () { unsigned int j = 0, k = 0, i = 0; unsigned int x [17] [17] = {0}, a [17] = {0}; for (j = 1; j < 10; ++j) for (k = j; k < 17; ++k) for (i = 1; i < j; ++i) x[k][0] = a[i - 1]; printf("res = %u\n", x[0][0]); return 0; } >>> clang -v clang version 6.0.0 (trunk 313612) Target: x86_64-unknown-linux-gnu Thread model: posix ... >>> clang -march=skylake-avx512 -O0 -o nice.exe nice.c >>> sde -skx -- ./nice.exe res = 0 >>> clang -march=skylake-avx512 -O2 -o nice.exe nice.c >>> sde -skx -- ./nice.exe Bus error (core dumped) >>> clang -march=skylake-avx512 -O2 -o nice.exe nice.c -mllvm >>> -opt-bisect-limit=83 ... BISECT: running pass (82) Rotate Loops on loop BISECT: running pass (83) Loop Distribution on function (main) BISECT: NOT running pass (84) Loop Vectorization on function (main) BISECT: NOT running pass (85) Loop Load Elimination on function (main) ... >>> sde -skx -- ./nice.exe res = 0 >>> clang -march=skylake-avx512 -O2 -o nice.exe nice.c -mllvm >>> -opt-bisect-limit=84 ... BISECT: running pass (83) Loop Distribution on function (main) BISECT: running pass (84) Loop Vectorization on function (main) BISECT: NOT running pass (85) Loop Load Elimination on function (main) BISECT: NOT running pass (86) Combine redundant instructions on function (main) ... >>> sde -skx -- ./nice.exe Segmentation fault (core dumped) If we look at generated asm, we'll see that we put -1 into esi, but then use rsi for pointer operations: = nice.s == ... movl$16, %r10d subq%r11, %r10 leal-1(%r11), %esi # put -1 into $esi movq%rax, %rbx cmpq$16, %r10 ... vpaddq %zmm12, %zmm3, %zmm12 vpbroadcastd(%rsp,%rsi,4), %ymm13# SIGBUS rsi = 0x kmovq %k1, %k2 vpscatterqd %ymm13, (,%zmm12) {%k2} ... === So if we change "leal -1(%r11), %esi" to "leaq-1(%r11), %rsi" , our program will finish correctly with "res = 0" >>> clang nice-fixed.s -o nice-fixed.exe >>> sde -skx -- ./nice-fixed.exe res = 0 -- You are receiving this mail because: You are on the CC list for the bug.___ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 34683] New: [Regression] C++03 and lower fails to compile a union with a volatile struct that has a volatile struct filed
https://bugs.llvm.org/show_bug.cgi?id=34683 Bug ID: 34683 Summary: [Regression] C++03 and lower fails to compile a union with a volatile struct that has a volatile struct filed Product: clang Version: 5.0 Hardware: PC OS: All Status: NEW Severity: enhancement Priority: P Component: C++ Assignee: unassignedclangb...@nondot.org Reporter: arpha...@gmail.com CC: dgre...@apple.com, llvm-bugs@lists.llvm.org The following code fails to compile with LLVM 5 and above (with -std=C++03 or less): ``` typedef unsigned short uint16; typedef unsigned int uint32; typedef volatile struct { uint16 field; } t1; typedef volatile struct { t1 a; } t2; typedef volatile union { t2 b; } t3; ``` Clang reports the following error: ``` test.cpp:13:7: error: union member 'b' has a non-trivial copy constructor t2 b; ^ test.cpp:9:7: note: because no constructor can be used to copy field of type 'const t1' (aka 'const volatile (anonymous struct at test.cpp:4:18)') t1 a; ^ 1 error generated. ``` This is a new regression caused by r310983. -- You are receiving this mail because: You are on the CC list for the bug.___ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 34596] Assertion `!NodePtr->isKnownSentinel()' during llvm::MachineTraceMetrics::Ensemble::updateDepths
https://bugs.llvm.org/show_bug.cgi?id=34596 Florian Hahn changed: What|Removed |Added Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #5 from Florian Hahn --- Recommitted the patch with a fix for the off-by-one error: https://reviews.llvm.org/rL313751 -- You are receiving this mail because: You are on the CC list for the bug.___ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 34684] New: "Mask already present!" assertion in SLP Vectorizer
https://bugs.llvm.org/show_bug.cgi?id=34684 Bug ID: 34684 Summary: "Mask already present!" assertion in SLP Vectorizer Product: libraries Version: trunk Hardware: PC OS: All Status: NEW Severity: enhancement Priority: P Component: Loop Optimizer Assignee: unassignedb...@nondot.org Reporter: and...@fubar.geek.nz CC: llvm-bugs@lists.llvm.org I'm getting the following assertion with a recent clang: Assertion failed: (UserEntry->ShuffleMask[OpdNum].empty() && "Mask already present!"), function newTreeEntry, file /jenkins/workspace/clang-head/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp, line 758. #0 0x01d11568 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/jenkins/workspace/FreeBSD-arm64-head-clang/clang-head/bin/clang-6.0+0x1d11568) #1 0x01d11b96 SignalHandler(int) (/jenkins/workspace/FreeBSD-arm64-head-clang/clang-head/bin/clang-6.0+0x1d11b96) #2 0x000804bf8926 (/lib/libthr.so.3+0xe926) #3 0x000804bf7ecf (/lib/libthr.so.3+0xdecf) Stack dump: 0. Program arguments: /jenkins/workspace/FreeBSD-arm64-head-clang/clang-head/bin/clang-6.0 -cc1 -triple aarch64-unknown-freebsd12.0 -emit-obj -O2 -vectorize-slp -x c dmu-eef8dc.c 1. parser at end of file 2. Per-module optimization passes 3. Running pass 'Function Pass Manager' on module 'dmu-eef8dc.c'. 4. Running pass 'SLP Vectorizer' on function '@i' The minimised test case is (from creduce): typedef struct { long a[4] } b; c() { b *d = e(); long f = 0; for (int g = 0; g < 4; g++) f += d->a[g]; if (f >= 0) h(); } i() { c(); } The minimal clang command line to reproduce is: clang-6.0 -cc1 -triple aarch64-unknown-freebsd12.0 -emit-obj -O2 -vectorize-slp -x c test.c -- You are receiving this mail because: You are on the CC list for the bug.___ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 25192] Wrong formatting with AllowShortFunctionsOnASingleLine
https://bugs.llvm.org/show_bug.cgi?id=25192 Marek Kurdej changed: What|Removed |Added Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #4 from Marek Kurdej --- Fixed with: https://reviews.llvm.org/rL312904 -- You are receiving this mail because: You are on the CC list for the bug.___ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 34685] New: Variadic template argument deduction - strange error and segfault in recent clang
https://bugs.llvm.org/show_bug.cgi?id=34685 Bug ID: 34685 Summary: Variadic template argument deduction - strange error and segfault in recent clang Product: clang Version: trunk Hardware: PC OS: Linux Status: NEW Severity: enhancement Priority: P Component: C++11 Assignee: unassignedclangb...@nondot.org Reporter: nils.wentz...@gmail.com CC: dgre...@apple.com, llvm-bugs@lists.llvm.org Created attachment 19179 --> https://bugs.llvm.org/attachment.cgi?id=19179&action=edit preprocessed source The following code-snipped produces an error message and a subsequent segfault with both clang 5.0.0 and the current master(7a69440) branch. It compiles fine with any c++11 compliant g++. #include template struct B {}; template struct gf {}; template B make_B(std::initializer_list> const &V) { return {}; } int main() { auto x = gf{}; auto b = make_B({x, x, x}); // clang segfault //auto b = make_B({x, x, x}); // ok } The error message reads test.cpp:5:26: error: too many template arguments for class template 'gf' template B make_B(std::initializer_list> const &V) { return {}; } ^ test.cpp:9:12: note: in instantiation of function template specialization 'make_B' requested here auto b = make_B({x, x, x}); // clang crash ^ test.cpp:4:30: note: template is declared here template struct gf {}; Why does clang report an error here? The number of template arguments deduced for gf in the call to make_B should be one. The crash backtrace reads #0 0x564f5228774a llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/home/nwentzel/opt/llvm-5.0/bin/clang-5.0+0x1db874a) #1 0x564f52285606 llvm::sys::RunSignalHandlers() (/home/nwentzel/opt/llvm-5.0/bin/clang-5.0+0x1db6606) #2 0x564f5228574c SignalHandler(int) (/home/nwentzel/opt/llvm-5.0/bin/clang-5.0+0x1db674c) #3 0x7f16fe149da0 __restore_rt (/usr/lib/libpthread.so.0+0x11da0) #4 0x564f536c376c CheckOriginalCallArgDeduction(clang::Sema&, clang::Sema::OriginalCallArg, clang::QualType) [clone .isra.1573] (/home/nwentzel/opt/llvm-5.0/bin/clang-5.0+0x31f476c) #5 0x564f536f1e74 clang::Sema::FinishTemplateArgumentDeduction(clang::FunctionTemplateDecl*, llvm::SmallVectorImpl&, unsigned int, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, llvm::SmallVectorImpl co$ st*, bool, llvm::function_ref) (/home/nwentzel/opt/llvm-5.0/bin/clang-5.0+0x3222e74) #6 0x564f536f68b7 clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*, clang::TemplateArgumentListInfo*, llvm::ArrayRef, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, bool, llvm::function_ref)>) (/$ ome/nwentzel/opt/llvm-5.0/bin/clang-5.0+0x32278b7) #7 0x564f53611107 clang::Sema::AddTemplateOverloadCandidate(clang::FunctionTemplateDecl*, clang::DeclAccessPair, clang::TemplateArgumentListInfo*, llvm::ArrayRef, clang::OverloadCandidateSet&, bool, bool) (/home/nwentzel/opt/llvm-5.0/bin/clang-5.0+0x3142107) #8 0x564f5361337a clang::Sema::AddOverloadedCallCandidates(clang::UnresolvedLookupExpr*, llvm::ArrayRef, clang::OverloadCandidateSet&, bool) (/home/nwentzel/opt/llvm-5.0/bin/clang-5.0+0x314437a) #9 0x564f53613623 clang::Sema::buildOverloadedCallSet(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, llvm::MutableArrayRef, clang::SourceLocation, clang::OverloadCandidateSet*, clang::ActionResult*) (/home/nwentzel/opt/llvm-5.0/bin$clang-5.0+0x3144623) #10 0x564f5361748a clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llvm::MutableArrayRef, clang::SourceLocation, clang::Expr*, bool, bool) (/home/nwentzel/opt/llvm-5.0/bin/clang-5.0+0x314848a) #11 0x564f5349865b clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef, clang::SourceLocation, clang::Expr*, bool) (/home/nwentzel/opt/llvm-5.0/bin/clang-5.0+0x2fc965b) #12 0x564f5309e87e clang::Parser::ParsePostfixExpressionSuffix(clang::ActionResult) (/home/nwentzel/opt/llvm-5.0/bin/clang-5.0+0x2bcf87e) #13 0x564f53099acb clang::Parser::ParseCastExpression(bool, bool, bool&, clang::Par
[llvm-bugs] [Bug 34686] New: [X86][SSE] extra pshufhw generated in simple shuffle code
https://bugs.llvm.org/show_bug.cgi?id=34686 Bug ID: 34686 Summary: [X86][SSE] extra pshufhw generated in simple shuffle code Product: new-bugs Version: trunk Hardware: PC OS: All Status: NEW Severity: enhancement Priority: P Component: new bugs Assignee: unassignedb...@nondot.org Reporter: c...@cooper.edu CC: llvm-bugs@lists.llvm.org Trunk turns these two shuffles into three (The commented out line is equivalent and generates the same 3 shuffles): #include __m128i m(__m128i i) { const __m128i a = _mm_shufflelo_epi16(i, 0x14); return _mm_shuffle_epi32(a, 0x44); // return _mm_unpacklo_epi64(a, a); } clang -S -O3 test.c -o - m: pshufd $196, %xmm0, %xmm0 # xmm0 = xmm0[0,1,0,3] pshuflw $20, %xmm0, %xmm0 # xmm0 = xmm0[0,1,1,0,4,5,6,7] pshufhw $20, %xmm0, %xmm0 # xmm0 = xmm0[0,1,2,3,4,5,5,4] retq This can be observed at all optimization levels above 0. I'd expect the same output that gcc generates: gcc -S -O3 test.c -o - m: pshuflw $20, %xmm0, %xmm0 pshufd $68, %xmm0, %xmm0 ret -- You are receiving this mail because: You are on the CC list for the bug.___ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 31777] Union store codegen is silly
https://bugs.llvm.org/show_bug.cgi?id=31777 Simon Pilgrim changed: What|Removed |Added Depends on||34074 Resolution|FIXED |--- Status|RESOLVED|REOPENED --- Comment #6 from Simon Pilgrim --- rL310055 was reverted at rL310123 as it caused PR34074 Referenced Bugs: https://bugs.llvm.org/show_bug.cgi?id=34074 [Bug 34074] Regression(310055): clang crashes compiling chrome for mac/asan -- You are receiving this mail because: You are on the CC list for the bug.___ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 34663] UBSan goes off on uniform_int_distribution
https://bugs.llvm.org/show_bug.cgi?id=34663 Marshall Clow (home) changed: What|Removed |Added Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #3 from Marshall Clow (home) --- Fixed in revision 313776. -- You are receiving this mail because: You are on the CC list for the bug.___ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 34687] New: clang crashes at -O3 with both newgvn and polly: Instruction does not dominate all uses!
https://bugs.llvm.org/show_bug.cgi?id=34687 Bug ID: 34687 Summary: clang crashes at -O3 with both newgvn and polly: Instruction does not dominate all uses! Product: Polly Version: unspecified Hardware: PC OS: All Status: NEW Severity: enhancement Priority: P Component: Optimizer Assignee: polly-...@googlegroups.com Reporter: helloqi...@gmail.com CC: llvm-bugs@lists.llvm.org Unlike Bug 32795, the crash happens in 32-bit mode with both newgvn and polly enabled. $ clang-trunk -v clang version 6.0.0 (trunk 313740) (llvm/trunk 313739) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /usr/local/bin $ clang-trunk -mllvm -polly -mllvm -enable-newgvn -O3 -m32 abc.c Instruction does not dominate all uses! %118 = add <16 x i32> %vec.phi, %116 %16 = and <16 x i32> %118, Instruction does not dominate all uses! %119 = add nuw nsw <16 x i32> %vec.phi94, %117 %17 = and <16 x i32> %119, fatal error: error in backend: Broken function found, compilation aborted! clang-6.0: error: clang frontend command failed with exit code 70 (use -v to see invocation) clang version 6.0.0 (trunk 313740) (llvm/trunk 313739) Target: i386-unknown-linux-gnu Thread model: posix InstalledDir: /usr/local/bin clang-6.0: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script. clang-6.0: note: diagnostic msg: PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang-6.0: note: diagnostic msg: /tmp/abc-fa66e6.c clang-6.0: note: diagnostic msg: /tmp/abc-fa66e6.sh clang-6.0: note: diagnostic msg: $ cat abc.c char a, b = 8, i = 0; long c, g; short d, h, j; int e, f; int *k; void fn1() { long l = c; for (; g;) { l1: for (; l;) ; if (f) goto l1; for (; j <= 2; j++) { e = b; a += (b = 0) || i ? *k %= h : (f || d / h) & (l = j || j / e); } } } -- You are receiving this mail because: You are on the CC list for the bug.___ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 24319] possible lexical analysis or parsing problem with assembly code
https://bugs.llvm.org/show_bug.cgi?id=24319 Konstantin Belochapka changed: What|Removed |Added Assignee|unassignedb...@nondot.org |konstantin.belochapka@sony. ||com Status|NEW |RESOLVED CC||konstantin.belochapka@sony. ||com Resolution|--- |FIXED --- Comment #1 from Konstantin Belochapka --- Fixed in revision: r260521 | s.egerton | 2016-02-11 05:48:49 -0800 (Thu, 11 Feb 2016) [MC] Fixed parsing of macro arguments where expressions with spaces are present. Differential Revision: http://reviews.llvm.org/D13592 -- You are receiving this mail because: You are on the CC list for the bug.___ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 34676] check-lldb target fails on Windows due to incomplete compiler path
https://bugs.llvm.org/show_bug.cgi?id=34676 Adrian McCarthy changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #2 from Adrian McCarthy --- Pilot error on my part. Nothing to see here. Move along. -- You are receiving this mail because: You are on the CC list for the bug.___ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 34441] polly crashes with "opt -gvn -polly-opt-isl -polly-codegen -polly-scops -polly-codegen" while running pass 'Polly - Create LLVM-IR from SCoPs'
https://bugs.llvm.org/show_bug.cgi?id=34441 Michael Kruse changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #3 from Michael Kruse --- Fixed in r313842. -- You are receiving this mail because: You are on the CC list for the bug.___ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] [Bug 34688] New: lld much slower than bfd when linking the linux kernel
https://bugs.llvm.org/show_bug.cgi?id=34688 Bug ID: 34688 Summary: lld much slower than bfd when linking the linux kernel Product: lld Version: unspecified Hardware: PC OS: All Status: NEW Severity: enhancement Priority: P Component: ELF Assignee: unassignedb...@nondot.org Reporter: rafael.espind...@gmail.com CC: llvm-bugs@lists.llvm.org bfd takes about 0.71 seconds to link the kernel, lld takes 60. This is a reversal of what we normally expect in tests not using linker scripts. There is a reproducible (include other benchmarks) in https://s3-us-west-2.amazonaws.com/linker-tests/lld-speed-test.tar.xz -- You are receiving this mail because: You are on the CC list for the bug.___ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
[llvm-bugs] Issue 3450 in oss-fuzz: llvm: Stack-overflow in clang::format::TokenAnnotator::annotate
Status: New Owner: CC: k...@google.com, masc...@google.com, jdevlieg...@apple.com, llvm-b...@lists.llvm.org Labels: ClusterFuzz Stability-Memory-AddressSanitizer Reproducible Engine-libfuzzer Proj-llvm Reported-2017-09-21 New issue 3450 by monor...@clusterfuzz-external.iam.gserviceaccount.com: llvm: Stack-overflow in clang::format::TokenAnnotator::annotate https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3450 Detailed report: https://oss-fuzz.com/testcase?key=6368465902370816 Project: llvm Fuzzer: libFuzzer_llvm_clang-format-fuzzer Job Type: libfuzzer_asan_llvm Platform Id: linux Crash Type: Stack-overflow Crash Address: 0x7ffc84bbdd60 Crash State: clang::format::TokenAnnotator::annotate Sanitizer: address (ASAN) Regressed: https://oss-fuzz.com/revisions?job=libfuzzer_asan_llvm&range=201709130450:201709140449 Reproducer Testcase: https://oss-fuzz.com/download?testcase_id=6368465902370816 Issue filed automatically. See https://github.com/google/oss-fuzz/blob/master/docs/reproducing.md for more information. When you fix this bug, please * mention the fix revision(s). * state whether the bug was a short-lived regression or an old bug in any stable releases. * add any other useful information. This information can help downstream consumers. If you have questions for the OSS-Fuzz team, please file an issue at https://github.com/google/oss-fuzz/issues. -- You received this message because: 1. You were specifically CC'd on the issue You may adjust your notification preferences at: https://bugs.chromium.org/hosting/settings Reply to this email to add a comment. ___ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs