[Top][All Lists]

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


From: Bean
Subject: Re: [RFC] Eliminate NESTED_ATTR_FUNC
Date: Tue, 1 Sep 2009 23:43:10 +0800

On Tue, Sep 1, 2009 at 9:42 PM, Vladimir 'phcoder'
Serbinenko<address@hidden> wrote:
> Hello. NESTED_ATTR_FUNC was introduced 6 years ago to workaround a bug
> in compiler. Now it creates only problems. In particular if they are
> used wrong it creates a bug of argument passing. Such bugs are
> difficult to find because it usually results in strange behaviour and
> in grub-emu NESTED_FUNC_ATTR is exteneded to an empty string so gdb
> and valgrind can't detect any error. Should we perhaps remove it
> coupled with adding a requirement for at least gcc 4.2? Can I run
> s/NESTED_FUNC_ATTR//g; on entire codebase and remove corresponding
> entry in


I make an assembly dump of the code generated by gcc-4.2. Apparently,
the "FIX" is achieved by ignoring the regparm attribute at all.
__attribute__ ((__regparm__ (3))) doesn't have any effect any more, it
always pass the parameters on the stack. This defeats the original
purpose of -mregparm=3, which passes parameters using register and
therefore reduce module size. In fact, if we are going to use stack,
we could just remove -mregparm=3 option, this works for all version of

IMO, if we are to tackle the NESTED_FUNC_ATTR issue, we should do it
properly by removing nested function, this also has other advantages,
like allowing to run tools on systems like OSX that doesn't allow to
execute code in stack by default.


gitgrub home:
my fork page:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]