www.delorie.com/archives/browse.cgi   search  
Mail Archives: pgcc/1999/07/20/17:04:42.7

Date: Tue, 20 Jul 1999 09:18:38 +0200
To: pgcc AT delorie DOT com
Subject: Re: clobbering revisited ...
Message-ID: <19990720091838.H263@cerebro.laendle>
Mail-Followup-To: pgcc AT delorie DOT com
References: <Pine DOT LNX DOT 4 DOT 10 DOT 9907161452030 DOT 2178-100000 AT linuxware DOT adm DOT deu DOT edu DOT tr>
Mime-Version: 1.0
In-Reply-To: <Pine.LNX.4.10.9907161452030.2178-100000@linuxware.adm.deu.edu.tr>; from root on Fri, Jul 16, 1999 at 02:53:54PM +0300
X-Operating-System: Linux version 2.2.10 (root AT cerebro) (gcc driver version egcs-2.91.66 19990314 (egcs-1.1.2 release) executing gcc version 2.7.2.3)
From: Marc Lehmann <pcg AT goof DOT com>
Reply-To: pgcc AT delorie DOT com
X-Mailing-List: pgcc AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Fri, Jul 16, 1999 at 02:53:54PM +0300, root wrote:
> #define DO_BANK_READ_WRITE(_bank)
> $__asm__ __volatile__                                                    \
> ("call *%0"                                                             \
>  : /* OUT     */ \
>  : /* IN      */ "c" /*ecx*/ ((unsigned long)vgaSetReadWriteFunc),      \
>                  "a" /*eax*/ (_bank)                                    \
>  : /* CLOBBER */ "ax","dx","memory" /*eax,edx*/                         \
> );
> 
> 
>  yes , it clobbers register ax where it is also used as input . the manual
> says that it is illegal and should also be declared as output , too . but
> that did not work either

anything _more_ specific than "that did not work"?

>  on an amd k6-2 . there is no problem with pgcc-1.1.3 that it accepts the
> code

And still miscompiles it quite as often.

> is it a problem of gcc-2.95 ? or is the code just broken ?

Just broken. However, declaring them as dummy outputs instead of as
clobbers would make it legal.

--  
      -----==-                                             |
      ----==-- _                                           |
      ---==---(_)__  __ ____  __       Marc Lehmann      +--
      --==---/ / _ \/ // /\ \/ /       pcg AT goof DOT com      |e|
      -=====/_/_//_/\_,_/ /_/\_\       XX11-RIPE         --+
    The choice of a GNU generation                       |
                                                         |

- Raw text -


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