delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/03/01/09:51:28

From: Michiel de Bondt <michielb AT sci DOT kun DOT nl>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: bug
Date: Thu, 01 Mar 2001 15:37:03 +0100
Organization: University of Nijmegen
Lines: 46
Message-ID: <3A9E5E8F.59BF6B78@sci.kun.nl>
References: <3A9CFB23 DOT 86C6D3EF AT sci DOT kun DOT nl>
NNTP-Posting-Host: fanth.sci.kun.nl
Mime-Version: 1.0
X-Trace: wnnews.sci.kun.nl 983457424 13037 131.174.132.54 (1 Mar 2001 14:37:04 GMT)
X-Complaints-To: usenet AT sci DOT kun DOT nl
NNTP-Posting-Date: Thu, 1 Mar 2001 14:37:04 +0000 (UTC)
X-Mailer: Mozilla 4.75 [en] (X11; U; SunOS 5.7 sun4u)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019