Mail Archives: djgpp/2001/03/01/09:51:28
Hello Alexei Frounze and Martin Stromberg,
If you compile this mess without optimization and without other options, the
compiler complaints he has used registers that must not be used. So no code
is generated. But the compiler says that the error is due to illegal assembly
code or a compiler error. I tried to reserve all six general registers and
then,
compute another expression, I believe a.e = a.e*b.e+c.e*d.e, but no error and
correct code. Maybe, I used -fno-defer-pop in the last case.
Michiel de Bondt
> Hello djgpp-ers,
>
> I think I found a bug in gcc. But first, I had to mail the bug to this
> newsgroup. gcc allocates an occupied register for a computation. I made
> the following small sample file of the problem. You should cancel
> optimization, otherwise the problem does not occur due to removal of
> code.
>
> Best regard, Michiel de Bondt
>
> ------------------------------------------------------------------------
> // do not use optimization
>
> union intel
> {
> long e;
> short x;
> struct {
> char l;
> char h;
> } b;
> };
>
> int main ()
> {
> register union intel a __asm__ ("%eax");
> register union intel b __asm__ ("%ebx");
> register union intel c __asm__ ("%ecx");
> register union intel d __asm__ ("%edx");
> b.b.l++;
> }
- Raw text -