瀏覽代碼

fix instruction matching errors in i386 CFI generation

fdiv and fmul instructions were wrongly matched by the rules for
integer div and mul instructions, leading to incorrect conclusions
about register values being clobbered.
Alex Dowad 9 年之前
父節點
當前提交
dc97951402
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      tools/add-cfi.i386.awk

+ 3 - 3
tools/add-cfi.i386.awk

@@ -188,9 +188,9 @@ function trashed(register) {
 /(add|addl|sub|subl|and|or|xor|lea|sal|sar|shl|shr) %e(ax|bx|cx|dx|si|di|bp),/ {
   trashed(get_reg1())
 }
-/i?mul [^,]*$/                    { trashed("eax"); trashed("edx") }
-/i?mul %e(ax|bx|cx|dx|si|di|bp),/ { trashed(get_reg1()) }
-/i?div/                           { trashed("eax"); trashed("edx") }
+/^i?mul [^,]*$/                    { trashed("eax"); trashed("edx") }
+/^i?mul %e(ax|bx|cx|dx|si|di|bp),/ { trashed(get_reg1()) }
+/^i?div/                           { trashed("eax"); trashed("edx") }
 /(dec|inc|not|neg|pop) %e(ax|bx|cx|dx|si|di|bp)/  { trashed(get_reg()) }
 /cpuid/ { trashed("eax"); trashed("ebx"); trashed("ecx"); trashed("edx") }