Le mardi 24 décembre 2013, 16:20:23 Thomas Preud'homme a écrit :
>
Sorry, I don't know what happened when I sent that mail. So I did a patch to
solve this problem but I can't test it due to not having an x86 machine. Can
you try applying the attached patch to the upstream development branch and
tell me if it works? Anyway, thanks for your bug report. There was all the
information for a quick fix as you gave the root cause of the problem.
By the way, was the bug fixed in gcc since?
Best regards,
Thomas
diff --git a/i386-gen.c b/i386-gen.c
index b26b844..5f0c0f4 100644
--- a/i386-gen.c
+++ b/i386-gen.c
@@ -895,7 +895,7 @@ ST_FUNC void gen_opf(int op)
swapped = 0;
if (swapped)
o(0xc9d9); /* fxch %st(1) */
- o(0xe9da); /* fucompp */
+ o(0xd9de); /* fcompp */
o(0xe0df); /* fnstsw %ax */
if (op == TOK_EQ) {
o(0x45e480); /* and $0x45, %ah */
diff --git a/x86_64-gen.c b/x86_64-gen.c
index 0962056..dc2ced1 100644
--- a/x86_64-gen.c
+++ b/x86_64-gen.c
@@ -1792,7 +1792,7 @@ void gen_opf(int op)
swapped = 0;
if (swapped)
o(0xc9d9); /* fxch %st(1) */
- o(0xe9da); /* fucompp */
+ o(0xd9de); /* fcompp */
o(0xe0df); /* fnstsw %ax */
if (op == TOK_EQ) {
o(0x45e480); /* and $0x45, %ah */
@@ -1876,7 +1876,7 @@ void gen_opf(int op)
if ((vtop->type.t & VT_BTYPE) == VT_DOUBLE)
o(0x66);
- o(0x2e0f); /* ucomisd */
+ o(0x2f0f); /* comisd */
if (vtop->r & VT_LVAL) {
gen_modrm(vtop[-1].r, r, vtop->sym, fc);