Hassan ELMADI via llvm-dev
2019-Mar-21 23:26 UTC
[llvm-dev] strange assertion about CPU feature
Hi all, I ran llc using this command llc -march=abc -mcpu=cpu1 -mattr=+dummy x.bc -O0 -filetype=obj And I got the following assertion: Assertion `SubtargetFeatures::hasFlag(Feature) && "Feature flags should start with '+' or '-'"' failed. I printed the features' string (obtained from Feature inside the loop in llvm/lib/MC/MCSubtargetInfo.cpp:156 ) and these garbage characters got printed: +dummy +dummy �����z Then I used -mattr=+help to the command and I got the same assertion and this got printed +help Available CPUs for this target: cpu1 - Select the generic processor. Available features for this target: dummy - dummy feature enabled. Use +feature to enable a feature, or -feature to disable it. For example, llc -mcpu=mycpu -mattr=+feature1,-feature2 +help Available CPUs for this target: cpu1 - Select the generic processor. Available features for this target: dummy - dummy feature enabled. Use +feature to enable a feature, or -feature to disable it. For example, llc -mcpu=mycpu -mattr=+feature1,-feature2 ��W��z In other words, the feature after -mattr is processed twice followed by a feature with random characters. It started doing this after I upgraded from LLVM 7 to 8 Does anyone know how to fix this? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190321/858f9c45/attachment.html>
Tim Northover via llvm-dev
2019-Mar-22 11:35 UTC
[llvm-dev] strange assertion about CPU feature
On Thu, 21 Mar 2019 at 23:26, Hassan ELMADI via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Does anyone know how to fix this?I've never seen the issue before, but since it looks like some kind of memory corruption or array size issue have you tried building LLVM with -fsanitize=address? If you're lucky that'll fail earlier and there'll be something obviously iffy in the backtrace somewhere. Tim.