A89: Re: Re: Re: placing data into C variables from ASM(" ") constructs


[Prev][Next][Index][Thread]

A89: Re: Re: Re: placing data into C variables from ASM(" ") constructs




>  > What did the older versions do if you *did* put an input register as being
>  > clobbered?
>
> Barfed about it, it did not understand it. It was way before egcs,
> though.

:o)

>  > In my program I have three asm() sections with no code in-between
>  > (apart from gcc:s register loading) and I use the same pointer as an input
in
>  > the first and the last sections... however, it seems that unless I tell gcc
to
>  > make that pointer volatile it ignores the fact that it has been clobbered
in the
>  > first section, making the pointer useless in the last :(
>
> It might be a compiler bug. Can you send me (in private email) a
> snipet of code that demonstrates the erroneous behaviour ?

Too late... the original code that did this has been modified.
I now have another bug wherein the same code bugs *sometimes*, but I think it's
calls to ROM functions that alter the lower registers or something similar.

>  > Oh, and on the page where Xav got the cross-compiler from it says it's
based on
>  > EGCS-1.1.2, if that tells you anything.
>
> Egcs is a new compiler that is supposed to be a substitute for gcc.
> I found egcs for the m68k to be somewhat worse than gcc was so I prefer
> gcc. They supposed to be merged sometime in the not very far future.
> I hope they will use gcc's code generator.

Well... I haven't looked that hard for a m68k cross-compiler, and this one seems
to work (most of the time   :)

> Beware that the compiler behaviour with regards to volatile objects is
> very unpredictable, I currently have an argument with the gcc people
> about the interpretation of the C standard - the standard leaves way
> too much freedom for the compiler to treat volatile objects in a
> completely unexpected way.

I'll be careful :o)


 / Niklas Brunlid
Check out Prosit for the TI-89 / TI-92+ at http://prosit.ticalc.org
Random PQF Quote follows:

I don't think I've ever been critical of the money Douglas Adams makes,
especially since, as has been tactfully pointed out, I myself have had to
change banks having filled the first one up.
        -- (Terry Pratchett, alt.fan.pratchett)




References: