[llvm-dev] strange assertion about CPU feature

Hassan ELMADI via llvm-dev llvm-dev at lists.llvm.org
Thu Mar 21 16:26:21 PDT 2019


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>


More information about the llvm-dev mailing list