[Bug target/19161] No emms or femms emitted between MMX and FP instructions

uros at kss-loka dot si gcc-bugzilla@gcc.gnu.org
Wed Aug 24 14:46:00 GMT 2005


------- Additional Comments From uros at kss-loka dot si  2005-08-24 14:33 -------
  There is another bug in ix86_mode_needed() that causes timeouts for
pr20314-1.c. The problem is in asm operands parsing code that gets into 
infinite loop. The correct code should increase variable c instead of cc when 
comma is found:

config/i386/i386.c (ix86_mode_needed):

	      ...
	      for (i = 0; i < noperands; i++)
		{
		  const char *c = constraints[i];
		  enum reg_class class;

		  if (c[0] == '%')
		    c++;
		  if (ISDIGIT ((unsigned char) c[0]) && c[1] == '\0')
		    c = constraints[c[0] - '0'];

		  while (*c)
		    {
		      char cc = *c;
		      int len;
		      switch (cc)
			{
			case ',':
			  c++;            <<<<< here!!
			  continue;
			case '=':
			case '+':
			case '*':
			case '%':
			case '!':
			case '#':
			case '&':
			case '?':
			  break;
	      ...

Regarding emms/efpu instructions in loop: I have made some experiments by 
inserting mode switching insn before NOTE_INSN_LOOP_BEGIN. The failure in 
20050604-1.c is fixed if this mode is set to FPU_MODE_MMX.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19161



More information about the Gcc-bugs mailing list