Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Optimized gcc function calling assembler.

13 views
Skip to first unread message

Dave Pitts

unread,
Sep 7, 2012, 11:34:48 AM9/7/12
to
Hello:

I've been working with a third party supplied assembler function that seems to
have issues when being called from optimized gcc code. I get spurious values in
calling function. It appears that the assembler function is using registers that
the gcc code is expecting to not change. Is there a way, in gcc, to protect
against the assembler function from doing immoral acts.... The system is an
x86_64 based Linux system. I don't know the assembler language for this system
very well.

Thanks in advance....

--
Dave Pitts PULLMAN: Travel and sleep in safety and comfort.
dpi...@cozx.com

Andrew Haley

unread,
Sep 8, 2012, 5:05:17 AM9/8/12
to
Dave Pitts <dpi...@cozx.com> wrote:

> I've been working with a third party supplied assembler function
> that seems to have issues when being called from optimized gcc
> code. I get spurious values in calling function. It appears that the
> assembler function is using registers that the gcc code is expecting
> to not change.

Oops.

> Is there a way, in gcc, to protect against the assembler function
> from doing immoral acts.... The system is an x86_64 based Linux
> system. I don't know the assembler language for this system very
> well.

Sure, you just have to save and restore the registers; it's not hard.
We can't tell you any more without specifics.

Andrew.
0 new messages