[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Weird behavior of nested functions
From: |
Marco Gerards |
Subject: |
Re: Weird behavior of nested functions |
Date: |
10 Nov 2003 19:01:01 +0100 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Jeroen Dekkers <address@hidden> writes:
> On Mon, Nov 10, 2003 at 03:42:17PM +0100, Jeroen Dekkers wrote:
> > On Mon, Nov 10, 2003 at 10:10:52AM +0100, Yoshinori K. Okuji wrote:
> > > On Monday 10 November 2003 00:11, Marco Gerards wrote:
> > > > Is it possible that some object files for the utils and pupa mix up?
> > >
> > > No. The files in utils are compiled without -mrtd or -mregparm, because
> > > otherwise they are incompatible against your C library. So it is
> > > necessary to
> > > compile files in PUPA in per-target basis.
> > >
> > > BTW, are you good at reading assembly code generated by GCC? For this
> > > kind of
> > > problem, it is inevitable to take a look at what GCC produced. I myself
> > > will
> > > try your code as soon as possible.
> >
> > It's a gcc bug triggered by the combination of -mregparm=3 and nested
> > functions. The problem is that it wants to put the address of test in
> > %ecx but that register is also used for the third argument with
> > -mregparm=3. Below is a copy of the assembly code generated by gcc.
>
> And the bug is already reported by somebody else:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12329
This is interesting. According to this bug report the problem is in
CX, the third register.
What about this option, in addition to the possible workarounds I
proposed in my previous mail?:
- Use -mregparm=2 instead of -mregparm=3.
(I've tried that and it works)
Thanks,
Marco