* [PATCH] ignore __cold__ attribute
@ 2008-04-22 10:41 Johannes Berg
[not found] ` <20080422090739.2izftuclwocs80o4-cebfxv@fcnzpbc.arg@webmail.spamcop.net>
0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2008-04-22 10:41 UTC (permalink / raw)
To: Josh Triplett; +Cc: linux-sparse, Al Viro, David Woodhouse
This is a new attribute in gcc 4.3, which when used and sparse is
compiled with gcc 4.3 leads to unknown attribute errors. Ignore it.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
diff --git a/parse.c b/parse.c
index 83e2d67..cdcd742 100644
--- a/parse.c
+++ b/parse.c
@@ -355,6 +355,7 @@ static struct init_keyword {
{ "__constructor__", NS_KEYWORD, .op = &ignore_attr_op },
{ "destructor", NS_KEYWORD, .op = &ignore_attr_op },
{ "__destructor__", NS_KEYWORD, .op = &ignore_attr_op },
+ { "__cold__", NS_KEYWORD, .op = &ignore_attr_op },
};
void init_parser(int stream)
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] ignore __cold__ attribute
[not found] ` <20080422090739.2izftuclwocs80o4-cebfxv@fcnzpbc.arg@webmail.spamcop.net>
@ 2008-04-22 13:25 ` Johannes Berg
2008-04-22 21:35 ` Pavel Roskin
0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2008-04-22 13:25 UTC (permalink / raw)
To: Pavel Roskin; +Cc: Josh Triplett, linux-sparse, Al Viro, David Woodhouse
[-- Attachment #1: Type: text/plain, Size: 871 bytes --]
On Tue, 2008-04-22 at 09:07 -0400, Pavel Roskin wrote:
> Quoting Johannes Berg <johannes@sipsolutions.net>:
>
> > This is a new attribute in gcc 4.3, which when used and sparse is
> > compiled with gcc 4.3 leads to unknown attribute errors. Ignore it.
>
> According to
> http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html, the new
> attributes are "cold" and "hot". I think we need them ignored both
> with and without underscores.
>
> The attributes indicate whether the function is likely to be executed,
> and thus affect optimization. There is nothing useful for sparse in
> that information.
*Shrug*. I just wanted the kernel to work again and failed (in about 20
minutes of searching) to find a changelog for gcc mentioning this so
gave up and just added the one that the kernel uses. Want to amend the
patch?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ignore __cold__ attribute
2008-04-22 13:25 ` Johannes Berg
@ 2008-04-22 21:35 ` Pavel Roskin
2008-04-25 2:26 ` Josh Triplett
0 siblings, 1 reply; 6+ messages in thread
From: Pavel Roskin @ 2008-04-22 21:35 UTC (permalink / raw)
To: Johannes Berg; +Cc: Josh Triplett, linux-sparse, Al Viro, David Woodhouse
On Tue, 2008-04-22 at 15:25 +0200, Johannes Berg wrote:
> *Shrug*. I just wanted the kernel to work again and failed (in about 20
> minutes of searching) to find a changelog for gcc mentioning this so
> gave up and just added the one that the kernel uses. Want to amend the
> patch?
I think this would be better. Now sparse would ignore both "cold" and
"hot", both with and without underscores. They are also added to
ident-list.h.
diff --git a/ident-list.h b/ident-list.h
index 8fcd7de..6104826 100644
--- a/ident-list.h
+++ b/ident-list.h
@@ -74,6 +74,8 @@ IDENT(__malloc__);
IDENT(nonnull); IDENT(__nonnull); IDENT(__nonnull__);
IDENT(constructor); IDENT(__constructor__);
IDENT(destructor); IDENT(__destructor__);
+IDENT(cold); IDENT(__cold__);
+IDENT(hot); IDENT(__hot__);
IDENT(cdecl); IDENT(__cdecl__);
IDENT(stdcall); IDENT(__stdcall__);
IDENT(fastcall); IDENT(__fastcall__);
diff --git a/parse.c b/parse.c
index 137ba77..877414c 100644
--- a/parse.c
+++ b/parse.c
@@ -353,6 +353,10 @@ static struct init_keyword {
{ "__constructor__", NS_KEYWORD, .op = &ignore_attr_op },
{ "destructor", NS_KEYWORD, .op = &ignore_attr_op },
{ "__destructor__", NS_KEYWORD, .op = &ignore_attr_op },
+ { "cold", NS_KEYWORD, .op = &ignore_attr_op },
+ { "__cold__", NS_KEYWORD, .op = &ignore_attr_op },
+ { "hot", NS_KEYWORD, .op = &ignore_attr_op },
+ { "__hot__", NS_KEYWORD, .op = &ignore_attr_op },
};
void init_parser(int stream)
--
Regards,
Pavel Roskin
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] ignore __cold__ attribute
2008-04-22 21:35 ` Pavel Roskin
@ 2008-04-25 2:26 ` Josh Triplett
2008-05-02 19:42 ` Pavel Roskin
2008-06-19 5:04 ` Pavel Roskin
0 siblings, 2 replies; 6+ messages in thread
From: Josh Triplett @ 2008-04-25 2:26 UTC (permalink / raw)
To: Pavel Roskin; +Cc: Johannes Berg, linux-sparse, Al Viro, David Woodhouse
[-- Attachment #1: Type: text/plain, Size: 1630 bytes --]
Pavel Roskin wrote:
> On Tue, 2008-04-22 at 15:25 +0200, Johannes Berg wrote:
>> *Shrug*. I just wanted the kernel to work again and failed (in about 20
>> minutes of searching) to find a changelog for gcc mentioning this so
>> gave up and just added the one that the kernel uses. Want to amend the
>> patch?
>
> I think this would be better. Now sparse would ignore both "cold" and
> "hot", both with and without underscores. They are also added to
> ident-list.h.
>
> diff --git a/ident-list.h b/ident-list.h
> index 8fcd7de..6104826 100644
> --- a/ident-list.h
> +++ b/ident-list.h
> @@ -74,6 +74,8 @@ IDENT(__malloc__);
> IDENT(nonnull); IDENT(__nonnull); IDENT(__nonnull__);
> IDENT(constructor); IDENT(__constructor__);
> IDENT(destructor); IDENT(__destructor__);
> +IDENT(cold); IDENT(__cold__);
> +IDENT(hot); IDENT(__hot__);
> IDENT(cdecl); IDENT(__cdecl__);
> IDENT(stdcall); IDENT(__stdcall__);
> IDENT(fastcall); IDENT(__fastcall__);
> diff --git a/parse.c b/parse.c
> index 137ba77..877414c 100644
> --- a/parse.c
> +++ b/parse.c
> @@ -353,6 +353,10 @@ static struct init_keyword {
> { "__constructor__", NS_KEYWORD, .op = &ignore_attr_op },
> { "destructor", NS_KEYWORD, .op = &ignore_attr_op },
> { "__destructor__", NS_KEYWORD, .op = &ignore_attr_op },
> + { "cold", NS_KEYWORD, .op = &ignore_attr_op },
> + { "__cold__", NS_KEYWORD, .op = &ignore_attr_op },
> + { "hot", NS_KEYWORD, .op = &ignore_attr_op },
> + { "__hot__", NS_KEYWORD, .op = &ignore_attr_op },
> };
Looks good to me. Could I get a signoff and commit message please?
- Josh Triplett
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ignore __cold__ attribute
2008-04-25 2:26 ` Josh Triplett
@ 2008-05-02 19:42 ` Pavel Roskin
2008-06-19 5:04 ` Pavel Roskin
1 sibling, 0 replies; 6+ messages in thread
From: Pavel Roskin @ 2008-05-02 19:42 UTC (permalink / raw)
To: Josh Triplett; +Cc: Johannes Berg, linux-sparse
On Thu, 2008-04-24 at 19:26 -0700, Josh Triplett wrote:
> Looks good to me. Could I get a signoff and commit message please?
I posted it already, but I think it was lost, so here it is again.
Ignore "cold" and "hot" attributes, which appeared in gcc 4.3
They describe how likely the function is to be executed, which can
affect optimization. Also ignore the attributes with underscores.
Signed-off-by: Pavel Roskin <proski@gnu.org>
---
ident-list.h | 2 ++
parse.c | 4 ++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/ident-list.h b/ident-list.h
index 8fcd7de..6104826 100644
--- a/ident-list.h
+++ b/ident-list.h
@@ -74,6 +74,8 @@ IDENT(__malloc__);
IDENT(nonnull); IDENT(__nonnull); IDENT(__nonnull__);
IDENT(constructor); IDENT(__constructor__);
IDENT(destructor); IDENT(__destructor__);
+IDENT(cold); IDENT(__cold__);
+IDENT(hot); IDENT(__hot__);
IDENT(cdecl); IDENT(__cdecl__);
IDENT(stdcall); IDENT(__stdcall__);
IDENT(fastcall); IDENT(__fastcall__);
diff --git a/parse.c b/parse.c
index 137ba77..877414c 100644
--- a/parse.c
+++ b/parse.c
@@ -353,6 +353,10 @@ static struct init_keyword {
{ "__constructor__", NS_KEYWORD, .op = &ignore_attr_op },
{ "destructor", NS_KEYWORD, .op = &ignore_attr_op },
{ "__destructor__", NS_KEYWORD, .op = &ignore_attr_op },
+ { "cold", NS_KEYWORD, .op = &ignore_attr_op },
+ { "__cold__", NS_KEYWORD, .op = &ignore_attr_op },
+ { "hot", NS_KEYWORD, .op = &ignore_attr_op },
+ { "__hot__", NS_KEYWORD, .op = &ignore_attr_op },
};
void init_parser(int stream)
--
Regards,
Pavel Roskin
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] ignore __cold__ attribute
2008-04-25 2:26 ` Josh Triplett
2008-05-02 19:42 ` Pavel Roskin
@ 2008-06-19 5:04 ` Pavel Roskin
1 sibling, 0 replies; 6+ messages in thread
From: Pavel Roskin @ 2008-06-19 5:04 UTC (permalink / raw)
To: Josh Triplett; +Cc: linux-sparse
On Thu, 2008-04-24 at 19:26 -0700, Josh Triplett wrote:
> Pavel Roskin wrote:
> > On Tue, 2008-04-22 at 15:25 +0200, Johannes Berg wrote:
> >> *Shrug*. I just wanted the kernel to work again and failed (in about 20
> >> minutes of searching) to find a changelog for gcc mentioning this so
> >> gave up and just added the one that the kernel uses. Want to amend the
> >> patch?
> >
> > I think this would be better. Now sparse would ignore both "cold" and
> > "hot", both with and without underscores. They are also added to
> > ident-list.h.
> >
> > diff --git a/ident-list.h b/ident-list.h
> > index 8fcd7de..6104826 100644
> > --- a/ident-list.h
> > +++ b/ident-list.h
> > @@ -74,6 +74,8 @@ IDENT(__malloc__);
> > IDENT(nonnull); IDENT(__nonnull); IDENT(__nonnull__);
> > IDENT(constructor); IDENT(__constructor__);
> > IDENT(destructor); IDENT(__destructor__);
> > +IDENT(cold); IDENT(__cold__);
> > +IDENT(hot); IDENT(__hot__);
> > IDENT(cdecl); IDENT(__cdecl__);
> > IDENT(stdcall); IDENT(__stdcall__);
> > IDENT(fastcall); IDENT(__fastcall__);
> > diff --git a/parse.c b/parse.c
> > index 137ba77..877414c 100644
> > --- a/parse.c
> > +++ b/parse.c
> > @@ -353,6 +353,10 @@ static struct init_keyword {
> > { "__constructor__", NS_KEYWORD, .op = &ignore_attr_op },
> > { "destructor", NS_KEYWORD, .op = &ignore_attr_op },
> > { "__destructor__", NS_KEYWORD, .op = &ignore_attr_op },
> > + { "cold", NS_KEYWORD, .op = &ignore_attr_op },
> > + { "__cold__", NS_KEYWORD, .op = &ignore_attr_op },
> > + { "hot", NS_KEYWORD, .op = &ignore_attr_op },
> > + { "__hot__", NS_KEYWORD, .op = &ignore_attr_op },
> > };
>
> Looks good to me. Could I get a signoff and commit message please?
Signed-off-by: Pavel Roskin <proski@gnu.org>
Sorry for delay. I thought I answered it already.
--
Regards,
Pavel Roskin
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-06-19 5:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-22 10:41 [PATCH] ignore __cold__ attribute Johannes Berg
[not found] ` <20080422090739.2izftuclwocs80o4-cebfxv@fcnzpbc.arg@webmail.spamcop.net>
2008-04-22 13:25 ` Johannes Berg
2008-04-22 21:35 ` Pavel Roskin
2008-04-25 2:26 ` Josh Triplett
2008-05-02 19:42 ` Pavel Roskin
2008-06-19 5:04 ` Pavel Roskin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).