[prev in list] [next in list] [prev in thread] [next in thread]
List: gcc-bugs
Subject: BUG: gcc-2.9x with -O2 and non cdecl calling convention
From: "Nick Kurshev" <nick () voshod ! com>
Date: 2000-05-31 18:21:19
[Download RAW message or body]
Hello!
I tried to compile following code in gcc version 2.95.2 with -O2 optimization:
#define __FASTCALL__ __attribute__ (( __regparm__(3) , __stdcall__ ))
unsigned long __FASTCALL__ my_func(unsigned long v,unsigned long a)
{
unsigned long i;
i = v / a;
if(v % a) v = ( v / i ) * i;
return v;
}
but compiler said:
bug.c: In function `my_func':
bug.c:10: fixed or forbidden register 1 (dx) was spilled for class DREG.
bug.c:10: This may be due to a compiler bug or to impossible asm
bug.c:10: statements or clauses.
bug.c:10: This is the instruction:
(insn 14 12 19 (parallel[
(set (reg:SI 1 %edx)
(udiv:SI (reg/v:SI 0 %eax)
(reg:SI 1 %edx)))
(set (reg:SI 2 %ecx)
(umod:SI (reg/v:SI 0 %eax)
(reg:SI 1 %edx)))
] ) 252 {udivmodsi4} (insn_list 5 (nil))
(expr_list:REG_DEAD (reg:SI 1 %edx)
(nil)))
Btw, with -O1 optimization everything o'k.
Best regards! Nick
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic