<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi all, <br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I ran llc using this command <br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
llc -march=abc -mcpu=cpu1 -mattr=+dummy x.bc -O0 -filetype=obj</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
And I got the following assertion:<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
<strong><em></em></strong></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Assertion `SubtargetFeatures::hasFlag(Feature) && "Feature flags should start with '+' or '-'"' failed.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I printed the features' string (obtained from Feature inside the loop in llvm/lib/MC/MCSubtargetInfo.cpp:156 ) and these garbage characters got printed:</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>+dummy<br>
</span>
<div>+dummy<br>
</div>
<span>�����z</span><br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Then I used -mattr=+help to the command and I got the same assertion and this got printed</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
</div>
<span>+help<br>
</span>
<div>Available CPUs for this target:<br>
</div>
<div><br>
</div>
<div> cpu1 - Select the generic processor.<br>
</div>
<div><br>
</div>
<div>Available features for this target:<br>
</div>
<div><br>
</div>
<div> dummy - dummy feature enabled.<br>
</div>
<div><br>
</div>
<div>Use +feature to enable a feature, or -feature to disable it.<br>
</div>
<div>For example, llc -mcpu=mycpu -mattr=+feature1,-feature2<br>
</div>
<div>+help<br>
</div>
<div>Available CPUs for this target:<br>
</div>
<div><br>
</div>
<div> cpu1 - Select the generic processor.<br>
</div>
<div><br>
</div>
<div>Available features for this target:<br>
</div>
<div><br>
</div>
<div> dummy - dummy feature enabled.<br>
</div>
<div><br>
</div>
<div>Use +feature to enable a feature, or -feature to disable it.<br>
</div>
<div>For example, llc -mcpu=mycpu -mattr=+feature1,-feature2<br>
</div>
<span>��W��z</span>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span></span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>In other words, the feature after -mattr is processed twice followed by a feature with random characters.</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>It started doing this after I upgraded from LLVM 7 to 8</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>Does anyone know how to fix this?</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>Thanks.</span><br>
</div>
</body>
</html>