This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: EH on i960 (and nested functions)


> Date: Wed, 22 Apr 1998 13:06:54 -0700
> From: Jim Wilson <wilson@cygnus.com>

> These patches will fix some nested function problems, but not the
> particular one that I was talking about.

> main()
> {
>   int i = 0;

>   void sub ()
>     {
>       i = 10;
>     };

>   sub ();
>   printf ("i = %d\n");
> }

If I correct it to read:

 printf ("i = %d\n", i);

it works as expected for me.  When I review the code, I see the what
you were talking about, but my i960 CA doesn't clobber r3 in this
testcase before it uses it, so while a problem may exist, this isn't a
testcase for it.

> Compile with -O -S, and note that main sets the static chain
> pointer, r3, before the call to sub, and sub sets `i' by storing
> through r3.  This however won't work because r3 is a local register,
> and local registers are switched on calls.

Apparently not $r3 on my i960 CA, nor, as documented in the Intel i960
Cx users manual.

If you can pull out of your bug bin, something that doesn't work, I
can seek to ensure that it works.

> What is the call1f pattern for?

Ah, thanks for pointing that out.  I think it's a leftover.  I'll
remove it.

I'm still working out -O problems...  (mainly inlining problems, and
the differing notion of what a frame is)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]