target/9068: [x86] comisd & comiss intel-syntax constraints are incorrect

kelleycook@comcast.net kelleycook@comcast.net
Fri Dec 27 08:56:00 GMT 2002


>Number:         9068
>Category:       target
>Synopsis:       [x86] comisd & comiss intel-syntax constraints are incorrect
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 27 08:56:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     kelleycook@comcast.net
>Release:        gcc version 3.3 20021223 (prerelease)
>Organization:
>Environment:
CYGWIN_NT-5.1 KELLEYCOOK 1.3.18(0.69/3/2) 2002-12-25 15:37 i686 unknown
>Description:
This testcase:

int ice_using_intel_syntax(int count, double sum) {
    int test;
    test = (sum/count > 0.0000001);
    return test;
}

crashes with

ice_using_intel_syntax.c: In function `ice_using_intel_syntax':
ice_using_intel_syntax.c:5: output_operand: operand number missing after %-letter
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

on 3.2.x, 3.3-branch, and mainline when compiled with -masm=intel and enabling SSE2.

The problem results from a typo in the Intel alternative constaints for "comisd".  The same typo exists in "comiss", so I corrected that one also.  This error has existed since the patterns were added by Jan Hubicka on version 1.217, 2001/02/13 22:32:32.
>How-To-Repeat:
gcc -Wall -march=pentium4 -ffast-math -mfpmath=sse -masm=intel ice_using_intel_syntax.c

>Fix:
2002-12-26  Kelley Cook <kelleycook@comcast.net>

	* config/i386/i386.c (output_fp_compare):  Correct typo in the Intel 
	alternatives for the commisd and comiss patterns.

--- config/i386/i386.c.orig	2002-12-27 11:03:30.656250000 -0500
+++ config/i386/i386.c	2002-12-27 11:04:01.187500000 -0500
@@ -7484,12 +7484,12 @@ output_fp_compare (insn, operands, eflag
 	if (unordered_p)
 	  return "ucomiss\t{%1, %0|%0, %1}";
 	else
-	  return "comiss\t{%1, %0|%0, %y}";
+	  return "comiss\t{%1, %0|%0, %1}";
       else
 	if (unordered_p)
 	  return "ucomisd\t{%1, %0|%0, %1}";
 	else
-	  return "comisd\t{%1, %0|%0, %y}";
+	  return "comisd\t{%1, %0|%0, %1}";
     }
 
   if (! STACK_TOP_P (cmp_op0))

This was made Applies to the current gcc-3_3-branch.  Jugding by CVS annotate, it should also applies cleanly to mainline and gcc-3_2-branch if it is deemed a regression.  The testcase will compile under 3.0.x, since the comis[sd] patterns didn't exist then.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-prs mailing list