[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] Eliminate NESTED_ATTR_FUNC
From: |
Bean |
Subject: |
Re: [RFC] Eliminate NESTED_ATTR_FUNC |
Date: |
Wed, 2 Sep 2009 00:05:28 +0800 |
On Tue, Sep 1, 2009 at 11:43 PM, Bean<address@hidden> wrote:
> 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 configure.ac?
>
> Hi,
>
> 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
> gcc.
>
> 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.
Hi,
Oh BTW, I just remember a page comparing the benchmark of ubuntu, and
find major slowdown in various tests after Ubuntu 7.04. Note that
ubuntu 7.04 uses gcc 4.1, while ubuntu 8.04 uses gcc 4.2, could this
be caused by the fact that gcc 4.2 starts to ignore some optimization
flags ?
http://www.phoronix.com/scan.php?page=article&item=ubuntu_bench_2008&num=1
--
Bean
gitgrub home: http://github.com/grub/grub/
my fork page: http://github.com/bean123/grub/
- [RFC] Eliminate NESTED_ATTR_FUNC, Vladimir 'phcoder' Serbinenko, 2009/09/01
- Re: [RFC] Eliminate NESTED_ATTR_FUNC, Bean, 2009/09/01
- Re: [RFC] Eliminate NESTED_ATTR_FUNC, Robert Millan, 2009/09/01
- Re: [RFC] Eliminate NESTED_ATTR_FUNC,
Bean <=
- Re: [RFC] Eliminate NESTED_ATTR_FUNC, Yves Blusseau, 2009/09/01
- Re: [RFC] Eliminate NESTED_ATTR_FUNC, David Miller, 2009/09/01
- Re: [RFC] Eliminate NESTED_ATTR_FUNC, Vladimir 'phcoder' Serbinenko, 2009/09/03
- Re: [RFC] Eliminate NESTED_ATTR_FUNC, David Miller, 2009/09/03
- Message not available
- Message not available
- Fwd: [RFC] Eliminate NESTED_ATTR_FUNC, Vladimir 'phcoder' Serbinenko, 2009/09/06
- Re: Fwd: [RFC] Eliminate NESTED_ATTR_FUNC, Robert Millan, 2009/09/08
Re: [RFC] Eliminate NESTED_ATTR_FUNC, Bean, 2009/09/02