------- Comment #19 from ubizjak at gmail dot com 2009-11-16 19:05 -------
(In reply to comment #18)
> This bug also still appears in 4.4.2 with --with-arch=pentium3.
pentium3 fails because it is not TARGET_HIMODE_MATH and TARGET_QIMODE_MATH.
So, it fails following testcase:
unsigned short
plusccsa (unsigned short a, unsigned short b)
{
unsigned short sum = a + b;
if (sum < a)
abort ();
return sum;
}
It used to generate:
plusccsa:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
movzwl 8(%ebp), %edx
movzwl 12(%ebp), %eax
addl %edx, %eax
movzwl %ax, %eax
>> cmpw %ax, %dx
ja .L97
leave
ret
.L97:
call abort
And after the fix for wrong mode of compare insn for these targets [1]:
plusccsa:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
movzwl 8(%ebp), %edx
movzwl 12(%ebp), %eax
addl %edx, %eax
movzwl %ax, %eax
>> cmpl %eax, %edx
ja .L52
leave
ret
.L52:
call abort
You don't want instructions that operate on bytes or words on pentium3...
At the end of the day, no bug here.
[1] http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00787.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30315