[PATCH] MC: Improve the .fill directive's compatibility with GAS

David Majnemer david.majnemer at gmail.com
Fri Jan 31 10:37:26 PST 2014



================
Comment at: lib/MC/MCParser/AsmParser.cpp:2450
@@ +2449,3 @@
+  if (!isUInt<32>(FillExpr) && FillSize == 8) {
+    Warning(ExprLoc, "'.fill' directive pattern has been truncated to 32-bits");
+    FillExpr = Lo_32(FillExpr);
----------------
Rafael Ávila de Espíndola wrote:
> Why? Does gas really use only the lower 32 bits? Why only if FillSize is 8? What about 5 6 and 7?
Yep, the only use the lower 32-bits.  Their documentation explicitly mentions this.

================
Comment at: lib/MC/MCParser/AsmParser.cpp:2445
@@ +2444,3 @@
+  if (FillSize > 8) {
+    Warning(SizeLoc, "'.fill' directive with negative size has no effect");
+    NumValues = 8;
----------------
Rafael Ávila de Espíndola wrote:
> this warning looks like a copy and paste error.
Sorry! I will change it immediately.

================
Comment at: test/MC/AsmParser/directive_fill.s:36
@@ +35,3 @@
+# CHECK: TEST5
+# CHECK: .asciz "\002\000"
+# CHECK: .asciz "\002\000"
----------------
Rafael Ávila de Espíndola wrote:
> Why is this repeating 4 times?
Because it should be: ·.fill 4, 3, 2

*sigh* Thanks again!


http://llvm-reviews.chandlerc.com/D2667



More information about the llvm-commits mailing list