This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: i386: asm("%z0" :: "g" ((char)0)) aborts...
- To: gcc at horizon dot com
- Subject: Re: i386: asm("%z0" :: "g" ((char)0)) aborts...
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 29 Sep 2001 03:55:38 -0300
- Cc: gcc-bugs at gcc dot gnu dot org
- Organization: GCC Team, Red Hat
- References: <20010911122144.18767.qmail@science.horizon.com>
On Sep 11, 2001, gcc@horizon.com wrote:
> It seems that someone forgot the "case 1:" in the relevant switch() in
> print_operand (i386.c:3458 on my snapshot)
Actually, it can't handle CONST_INTs, because they don't have a mode
to indicate its width. A patch that checks for non-VOIDmode and
complains would be appreciated.
> To give a more useful version, try the ones-complement checksum routine
> asm("add%z0 %2,%0; adc%z0 %3,%0" : "=r" (sum) :
> "r" (sum), "g" (c), "g" ((typeof sum)0));
Does this fail similarly? I don't see why. In any case, I suggest
using "+r" instead of "=r" and "r" for sum. If you'd rather not do
that to support older versions of GCC that didn't support "+" in asm
constraints, I suggest using "0" in the input `sum' constraint.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me