All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Millan <rmh@aybabtu.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [RFC] Eliminate NESTED_ATTR_FUNC
Date: Tue, 1 Sep 2009 18:02:40 +0200	[thread overview]
Message-ID: <20090901160240.GA27042@thorin> (raw)
In-Reply-To: <ca0f59980909010843w2bf56745j138f479732b1f721@mail.gmail.com>

On Tue, Sep 01, 2009 at 11:43:10PM +0800, Bean wrote:
> On Tue, Sep 1, 2009 at 9:42 PM, Vladimir 'phcoder'
> Serbinenko<phcoder@gmail.com> 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.

I have the impression that using stack isn't a good idea for GRUB, due to
size and speed improvements, except in cases where we can't avoid it.

If older versions of GCC ignore -mregparm, we need a configure check
(I prefer one that checks for the feature itself, but a version check
is also acceptable IMHO).

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."



  reply	other threads:[~2009-09-01 16:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-01 13:42 [RFC] Eliminate NESTED_ATTR_FUNC Vladimir 'phcoder' Serbinenko
2009-09-01 15:43 ` Bean
2009-09-01 16:02   ` Robert Millan [this message]
2009-09-01 16:05   ` Bean
2009-09-01 19:30   ` Yves Blusseau
2009-09-01 22:26     ` David Miller
2009-09-03 15:08       ` Vladimir 'phcoder' Serbinenko
2009-09-03 23:17         ` David Miller
     [not found]           ` <d7ead6de0909051404r50473aeao44aae7842a7d443b@mail.gmail.com>
     [not found]             ` <20090905.152320.164499705.davem@davemloft.net>
2009-09-06 17:12               ` Fwd: " Vladimir 'phcoder' Serbinenko
2009-09-08 14:43                 ` Robert Millan
2009-09-02  4:20   ` Bean
2009-09-02  5:55     ` Yves Blusseau
2009-09-03 15:06     ` Vladimir 'phcoder' Serbinenko
     [not found]       ` <4A9FE6AD.9010509@gnu.org>
2009-09-03 16:52         ` Vladimir 'phcoder' Serbinenko
2009-09-03 15:36     ` Robert Millan
2009-09-03 15:49       ` Felix Zielcke
2009-09-03 15:59         ` Vladimir 'phcoder' Serbinenko
2009-09-03 16:01         ` Bean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090901160240.GA27042@thorin \
    --to=rmh@aybabtu.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.