* more "unreplaced symbol" warnings
@ 2011-05-29 21:54 Randy Dunlap
2011-05-31 17:39 ` Christopher Li
0 siblings, 1 reply; 7+ messages in thread
From: Randy Dunlap @ 2011-05-29 21:54 UTC (permalink / raw)
To: linux-sparse
I see that there was a short thread in Feb. 2008 about unreplaced symbols.
Here are more warnings from Linux 2.6.39-git18 mainline.
Obviously lots of them are just repeats, but this is what I get from x86_64
allmodconfig.
Any suggestions about how to eliminate them?
Thanks.
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/linux/netfilter_bridge.h:62:14: warning: unreplaced symbol 'val'
include/linux/netfilter_bridge.h:62:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/linux/netfilter_bridge.h:64:14: warning: unreplaced symbol 'val'
include/linux/netfilter_bridge.h:64:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/linux/netfilter_bridge.h:62:14: warning: unreplaced symbol 'val'
include/linux/netfilter_bridge.h:62:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/linux/netfilter_bridge.h:64:14: warning: unreplaced symbol 'val'
include/linux/netfilter_bridge.h:64:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/linux/netfilter_bridge.h:62:14: warning: unreplaced symbol 'val'
include/linux/netfilter_bridge.h:62:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/linux/netfilter_bridge.h:64:14: warning: unreplaced symbol 'val'
include/linux/netfilter_bridge.h:64:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/linux/netfilter_bridge.h:62:14: warning: unreplaced symbol 'val'
include/linux/netfilter_bridge.h:62:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/linux/netfilter_bridge.h:64:14: warning: unreplaced symbol 'val'
include/linux/netfilter_bridge.h:64:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/linux/netfilter_bridge.h:62:14: warning: unreplaced symbol 'val'
include/linux/netfilter_bridge.h:62:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/linux/netfilter_bridge.h:64:14: warning: unreplaced symbol 'val'
include/linux/netfilter_bridge.h:64:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/linux/netfilter_bridge.h:62:14: warning: unreplaced symbol 'val'
include/linux/netfilter_bridge.h:62:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/linux/netfilter_bridge.h:64:14: warning: unreplaced symbol 'val'
include/linux/netfilter_bridge.h:64:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/linux/netfilter_bridge.h:62:14: warning: unreplaced symbol 'val'
include/linux/netfilter_bridge.h:62:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/linux/netfilter_bridge.h:64:14: warning: unreplaced symbol 'val'
include/linux/netfilter_bridge.h:64:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/linux/netfilter_bridge.h:62:14: warning: unreplaced symbol 'val'
include/linux/netfilter_bridge.h:62:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/linux/netfilter_bridge.h:64:14: warning: unreplaced symbol 'val'
include/linux/netfilter_bridge.h:64:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/linux/netfilter_bridge.h:62:14: warning: unreplaced symbol 'val'
include/linux/netfilter_bridge.h:62:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/linux/netfilter_bridge.h:64:14: warning: unreplaced symbol 'val'
include/linux/netfilter_bridge.h:64:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/linux/netfilter_bridge.h:62:14: warning: unreplaced symbol 'val'
include/linux/netfilter_bridge.h:62:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/linux/netfilter_bridge.h:64:14: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
net/bridge/br_multicast.c:80:14: warning: unreplaced symbol 'val'
net/bridge/br_multicast.c:80:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
net/bridge/br_multicast.c:83:14: warning: unreplaced symbol 'val'
net/bridge/br_multicast.c:83:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
net/bridge/br_multicast.c:53:14: warning: unreplaced symbol 'val'
net/bridge/br_multicast.c:53:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
net/bridge/br_multicast.c:56:14: warning: unreplaced symbol 'val'
net/bridge/br_multicast.c:56:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
net/bridge/br_multicast.c:80:14: warning: unreplaced symbol 'val'
net/bridge/br_multicast.c:80:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
net/bridge/br_multicast.c:83:14: warning: unreplaced symbol 'val'
net/bridge/br_multicast.c:83:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
net/bridge/br_multicast.c:80:14: warning: unreplaced symbol 'val'
net/bridge/br_multicast.c:80:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
net/bridge/br_multicast.c:83:14: warning: unreplaced symbol 'val'
net/bridge/br_multicast.c:83:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/net/inet_ecn.h:126:14: warning: unreplaced symbol 'val'
include/net/inet_ecn.h:126:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/net/inet_ecn.h:131:14: warning: unreplaced symbol 'val'
include/net/inet_ecn.h:131:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/net/inet_ecn.h:126:14: warning: unreplaced symbol 'val'
include/net/inet_ecn.h:126:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/net/inet_ecn.h:131:14: warning: unreplaced symbol 'val'
include/net/inet_ecn.h:131:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/net/inet_ecn.h:126:14: warning: unreplaced symbol 'val'
include/net/inet_ecn.h:126:14: warning: unreplaced symbol 'return'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
include/linux/swab.h:51:9: warning: unreplaced symbol 'return'
include/net/inet_ecn.h:131:14: warning: unreplaced symbol 'val'
include/net/inet_ecn.h:131:14: warning: unreplaced symbol 'return'
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: more "unreplaced symbol" warnings
2011-05-29 21:54 more "unreplaced symbol" warnings Randy Dunlap
@ 2011-05-31 17:39 ` Christopher Li
2011-05-31 18:30 ` Al Viro
2011-05-31 18:58 ` Al Viro
0 siblings, 2 replies; 7+ messages in thread
From: Christopher Li @ 2011-05-31 17:39 UTC (permalink / raw)
To: Randy Dunlap; +Cc: linux-sparse
On Sun, May 29, 2011 at 2:54 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
> I see that there was a short thread in Feb. 2008 about unreplaced symbols.
> Here are more warnings from Linux 2.6.39-git18 mainline.
> Obviously lots of them are just repeats, but this is what I get from x86_64
> allmodconfig.
>
> Any suggestions about how to eliminate them?
> Thanks.
>
> include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
> include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
I am trying to produce those now. If you know which C file causing
this warning would be great.
It just hit me that, if there is a script to help reproduce the error
would be great. I just give this error line it emits. The script takes the
C source file and try to eliminate as much lines as possible while
still reproduce the error.
Chris
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: more "unreplaced symbol" warnings
2011-05-31 17:39 ` Christopher Li
@ 2011-05-31 18:30 ` Al Viro
2011-05-31 18:58 ` Al Viro
1 sibling, 0 replies; 7+ messages in thread
From: Al Viro @ 2011-05-31 18:30 UTC (permalink / raw)
To: Christopher Li; +Cc: Randy Dunlap, linux-sparse
On Tue, May 31, 2011 at 10:39:52AM -0700, Christopher Li wrote:
> On Sun, May 29, 2011 at 2:54 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
> > I see that there was a short thread in Feb. 2008 about unreplaced symbols.
> > Here are more warnings from Linux 2.6.39-git18 mainline.
> > Obviously lots of them are just repeats, but this is what I get from x86_64
> > allmodconfig.
> >
> > Any suggestions about how to eliminate them?
> > Thanks.
> >
> > include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
> > include/linux/swab.h:51:16: warning: unreplaced symbol 'val'
>
> I am trying to produce those now. If you know which C file causing
> this warning would be great.
>
> It just hit me that, if there is a script to help reproduce the error
> would be great. I just give this error line it emits. The script takes the
> C source file and try to eliminate as much lines as possible while
> still reproduce the error.
Hell knows... net/bridge/br_netfilter.c will give you just that. From the
look of other similar instances, I suspect that it's handling of case ...:
somewhere:
static inline unsigned int nf_bridge_encap_header_len(const struct sk_buff *skb)
{
switch (skb->protocol) {
case __cpu_to_be16(ETH_P_8021Q):
return VLAN_HLEN;
case __cpu_to_be16(ETH_P_PPP_SES):
return PPPOE_SES_HLEN;
default:
return 0;
}
}
also warns the same way on both __cpu_to_be16()...
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: more "unreplaced symbol" warnings
2011-05-31 17:39 ` Christopher Li
2011-05-31 18:30 ` Al Viro
@ 2011-05-31 18:58 ` Al Viro
2011-05-31 19:05 ` Christopher Li
2011-06-01 7:41 ` Christopher Li
1 sibling, 2 replies; 7+ messages in thread
From: Al Viro @ 2011-05-31 18:58 UTC (permalink / raw)
To: Christopher Li; +Cc: Randy Dunlap, linux-sparse
Here's what is actually triggering that crap. Have fun...
#define __u16 unsigned short
static inline __attribute__((__const__)) __u16 f(__u16 val)
{
return val;
}
static inline void barf(unsigned int len)
{
}
static inline unsigned int bar(__u16 n)
{
switch (n) {
case (__builtin_constant_p(1) ? 1 : f(1)):
return 4;
default:
return 0;
}
}
int foo(__u16 n)
{
unsigned int x = bar(n);
barf(bar(n));
return 0;
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: more "unreplaced symbol" warnings
2011-05-31 18:58 ` Al Viro
@ 2011-05-31 19:05 ` Christopher Li
2011-06-01 7:41 ` Christopher Li
1 sibling, 0 replies; 7+ messages in thread
From: Christopher Li @ 2011-05-31 19:05 UTC (permalink / raw)
To: Al Viro; +Cc: Randy Dunlap, linux-sparse
On Tue, May 31, 2011 at 11:58 AM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> Here's what is actually triggering that crap. Have fun...
Thanks,
I will take a look.
Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: more "unreplaced symbol" warnings
2011-05-31 18:58 ` Al Viro
2011-05-31 19:05 ` Christopher Li
@ 2011-06-01 7:41 ` Christopher Li
2011-08-15 19:34 ` Christopher Li
1 sibling, 1 reply; 7+ messages in thread
From: Christopher Li @ 2011-06-01 7:41 UTC (permalink / raw)
To: Al Viro; +Cc: Randy Dunlap, linux-sparse
On Tue, May 31, 2011 at 11:58 AM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> Here's what is actually triggering that crap. Have fun...
Here is a slightly simpler version. However I haven't figure out how this happen
yet. Here is what I know so far:
1) It happens with two nested inline within one function.
Inline bar() once the bug does not trigger.
2) It seems have some thing to do with dead statement call to inline functions.
I am still scratching my head on that inline/uninline business. My guess is that
there is some where we short circuit the inline copy due to dead
statement but some
other part of the code does not agree.
Chris
#define __u16 unsigned short
int foo(__u16 n);
static inline __u16 f(__u16 val)
{
return val;
}
static inline unsigned int bar(__u16 n)
{
switch (n) {
case (1 ? 1 : f(1)):
return 4;
}
}
int foo(__u16 n)
{
bar(n);
bar(n);
return 0;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: more "unreplaced symbol" warnings
2011-06-01 7:41 ` Christopher Li
@ 2011-08-15 19:34 ` Christopher Li
0 siblings, 0 replies; 7+ messages in thread
From: Christopher Li @ 2011-08-15 19:34 UTC (permalink / raw)
To: Al Viro; +Cc: Randy Dunlap, linux-sparse
On Wed, Jun 1, 2011 at 12:41 AM, Christopher Li <sparse@chrisli.org> wrote:
> #define __u16 unsigned short
> int foo(__u16 n);
> static inline __u16 f(__u16 val)
> {
> return val;
> }
>
> static inline unsigned int bar(__u16 n)
> {
> switch (n) {
> case (1 ? 1 : f(1)):
> return 4;
> }
> }
>
> int foo(__u16 n)
> {
> bar(n);
> bar(n);
> return 0;
> }
I just submit a fix for this bug. It took me a few days staring at the
inlining code to figure out what is going on. I am glad this is bug is
resolved now.
The example above is actually the minimal setup to trigger this
bug. The root cause is in one of the member during copying case statement
did not replace to the new statement. e.g. when inlining f(), it actually
change the original copy of function definition in bar().
The warning is triggered during the second time bar() get inlined.
The fix is just one line. Finding it is the hard part.
Chris
@@ -381,6 +381,7 @@ static struct statement *copy_one_statement(struct
statement *stmt)
case STMT_CASE: {
stmt = dup_statement(stmt);
stmt->case_label = copy_symbol(stmt->pos, stmt->case_label);
+ stmt->case_label->stmt = stmt;
stmt->case_expression = copy_expression(stmt->case_expression);
stmt->case_to = copy_expression(stmt->case_to);
stmt->case_statement = copy_one_statement(stmt->case_statement);
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-08-15 19:34 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-29 21:54 more "unreplaced symbol" warnings Randy Dunlap
2011-05-31 17:39 ` Christopher Li
2011-05-31 18:30 ` Al Viro
2011-05-31 18:58 ` Al Viro
2011-05-31 19:05 ` Christopher Li
2011-06-01 7:41 ` Christopher Li
2011-08-15 19:34 ` Christopher Li
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).