Unsaved register?

Geoff Keating geoffk@geoffk.org
Tue May 29 15:59:00 GMT 2001


Erik Walthinsen <omega@temple-baptist.com> writes:

> I'm working on a bitstream implementation using mmx, with extensive
> inlining support, etc.  I've run across what I think is a bug in the
> register-stomping code.  The routine in question is:
> 
> extern inline
> uint32_t bitstream_get_mmx(bitstream_t *bs,uint32_t num_bits) {
>   uint32_t bits,result;
> //fprintf(stderr,"num_bits is %d\n",num_bits);
>   asm volatile (
...
>         "call bitstream_get_bh_mmx\n\t" // call the bottom half

> It feels like a bug to me, but I only last night finally conquered the
> inline asm syntax, and maybe only partially at that.  Am I doing something
> wrong in the inline asm routine that's allowing this?

Sure.  Your inline asm clobbers various registers by making the
function call, and you haven't mentioned them.

-- 
- Geoffrey Keating <geoffk@geoffk.org>



More information about the Gcc-bugs mailing list