From: Steven Rostedt <rostedt@goodmis.org>
To: "Toralf Förster" <toralf.foerster@gmx.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@redhat.com>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: does gcc gives a false warning in kernel/trace/trace_events_filter.c ?
Date: Wed, 05 Sep 2012 13:08:03 -0400 [thread overview]
Message-ID: <1346864883.27919.56.camel@gandalf.local.home> (raw)
In-Reply-To: <50432132.90307@gmx.de>
On Sun, 2012-09-02 at 11:04 +0200, Toralf Förster wrote:
> The current git tree of linux gave with gcc-4.6.3 :
>
> kernel/trace/trace_events_filter.c: In function ‘ftrace_function_set_filter_cb’:
> kernel/trace/trace_events_filter.c:2074:8: warning: ‘ret’ may be used uninitialized in this function [-Wuninitialized]
>
>
> which refers to this piece of code:
>
>
> 2061 static int ftrace_function_set_filter_cb(enum move_type move,
> 2062 struct filter_pred *pred,
> 2063 int *err, void *data)
> 2064 {
> 2065 /* Checking the node is valid for function trace. */
> 2066 if ((move != MOVE_DOWN) ||
> 2067 (pred->left != FILTER_PRED_INVALID)) {
> 2068 *err = ftrace_function_check_pred(pred, 0);
> 2069 } else {
> 2070 *err = ftrace_function_check_pred(pred, 1);
> 2071 if (*err)
> 2072 return WALK_PRED_ABORT;
> 2073
> 2074 *err = __ftrace_function_set_filter(pred->op == OP_EQ,
> 2075 pred->regex.pattern,
> 2076 pred->regex.len,
> 2077 data);
> 2078 }
> 2079
> 2080 return (*err) ? WALK_PRED_ABORT : WALK_PRED_DEFAULT;
> 2081 }
> 2082
>
>
> >From a Gentoo forum user I got a hint :
>
> "Maybe it's some kind of a weird inlining issue? I think it's
> referring to the ret in __ftrace_function_set_filter(), which would be
> uninitialized if the for-loop does not run (re_cnt ≤ 0)"
>
> Now I'm wondering if re_cnt can become zero or if gcc is wrong here ?
>
Strange, as ret is initialized to 'ret = -EINVAL;' in
__ftrace_function_set_filter(). I'm thinking that gcc got confused here.
Maybe report it to the gcc maintainers?
-- Steve
next prev parent reply other threads:[~2012-09-05 17:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-02 9:04 does gcc gives a false warning in kernel/trace/trace_events_filter.c ? Toralf Förster
2012-09-05 17:08 ` Steven Rostedt [this message]
2012-09-06 16:35 ` Toralf Förster
2012-09-06 17:31 ` Steven Rostedt
2012-09-06 22:22 ` Toralf Förster
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=1346864883.27919.56.camel@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=toralf.foerster@gmx.de \
/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.