From: Trevor Saunders <tbsaunde@tbsaunde.org>
To: Thomas Schwinge <thomas@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org, David Malcolm <dmalcolm@redhat.com>,
Jeff Law <law@redhat.com>, Andrew MacLeod <amacleod@redhat.com>
Subject: Re: (patch,rfc) s/gimple/gimple */
Date: Sat, 26 Sep 2015 07:10:00 -0000 [thread overview]
Message-ID: <20150926054035.GA3637@tsaunders-iceball.corp.tor1.mozilla.com> (raw)
In-Reply-To: <87pp18w4cj.fsf@kepler.schwinge.homeip.net>
On Thu, Sep 24, 2015 at 11:31:40AM +0200, Thomas Schwinge wrote:
> Hi!
>
> On Sat, 19 Sep 2015 20:55:35 -0400, Trevor Saunders <tbsaunde@tbsaunde.org> wrote:
> > On Fri, Sep 18, 2015 at 09:32:37AM -0600, Jeff Law wrote:
> > > On 09/18/2015 07:32 AM, Trevor Saunders wrote:
> > > >On Wed, Sep 16, 2015 at 03:11:14PM -0400, David Malcolm wrote:
> > > >>On Wed, 2015-09-16 at 09:16 -0400, Trevor Saunders wrote:
> > > >>>I gave changing from gimple to gimple * a shot last week.
>
> > ok, its committed now :)
>
> [...]/source-gcc/gcc/tree-object-size.c:62:13: warning: 'bool plus_stmt_object_size(object_size_info*, tree, gimple)' declared 'static' but never defined [-Wunused-function]
> static bool plus_stmt_object_size (struct object_size_info *, tree, gimple);
> ^
> [...]/source-gcc/gcc/tree-object-size.c:63:13: warning: 'bool cond_expr_object_size(object_size_info*, tree, gimple)' declared 'static' but never defined [-Wunused-function]
> static bool cond_expr_object_size (struct object_size_info *, tree, gimple);
> ^
>
> Not sure why your automation didn't catch these? Anyway, in r228080 I
> now committed these additional changes (as obvious):
well, it wasn't that automated ;) but this does point out some
interesting things.
> diff --git gcc/tree-object-size.c gcc/tree-object-size.c
> index f76f160..230761b 100644
> --- gcc/tree-object-size.c
> +++ gcc/tree-object-size.c
> @@ -59,8 +59,8 @@ static void collect_object_sizes_for (struct object_size_info *, tree);
> static void expr_object_size (struct object_size_info *, tree, tree);
> static bool merge_object_sizes (struct object_size_info *, tree, tree,
> unsigned HOST_WIDE_INT);
> -static bool plus_stmt_object_size (struct object_size_info *, tree, gimple);
> -static bool cond_expr_object_size (struct object_size_info *, tree, gimple);
> +static bool plus_stmt_object_size (struct object_size_info *, tree, gimple *);
> +static bool cond_expr_object_size (struct object_size_info *, tree, gimple *);
so, these forward decls aren't actually needed, and I'd be tempted to
just remove them, however I was curious why they didn't generate a
warning, and I found we regressed the warning for undefined declared
static functions. Consider this C++ test case:
static bool bar(int);
static bool
bar(int *p)
{
return p;
}
int main()
{
int x;
bar(&x);
return 0;
}
g++ (Debian 5.2.1-17) 5.2.1 20150911
/tmp/test.cc:1:13: warning: ‘bool bar(int)’ declared ‘static’ but never defined [-Wunused-function]
static bool bar(int);
^
xgcc (GCC) 6.0.0 20150920 (experimental)
bool bar(int*) int main()
Analyzing compilation unit
Performing interprocedural optimizations
<*free_lang_data> <visibility> <build_ssa_passes> <opt_local_passes> <free-inline-summary> <whole-program> <inline>Assembling functions:
bool bar(int*) int main()
Execution times (seconds)
phase setup : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.01 (50%) wall 1381 kB (76%) ggc
phase parsing : 0.00 ( 0%) usr 0.01 (100%) sys 0.00 ( 0%) wall 330 kB (18%) ggc
phase opt and generate : 0.01 (100%) usr 0.00 ( 0%) sys 0.01 (50%) wall 95 kB ( 5%) ggc
parser (global) : 0.00 ( 0%) usr 0.01 (100%) sys 0.00 ( 0%) wall 311 kB (17%) ggc
initialize rtl : 0.01 (100%) usr 0.00 ( 0%) sys 0.01 (50%) wall 12 kB ( 1%) ggc
TOTAL : 0.01 0.01 0.02 1818 kB
Extra diagnostic checks enabled; compiler may run slowly.
Configure with --enable-checking=release to disable checks.
I guess I'll try and file a bug about that soon :)
Trev
prev parent reply other threads:[~2015-09-26 5:41 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-16 13:22 Trevor Saunders
2015-09-16 14:19 ` Richard Biener
2015-09-16 19:25 ` David Malcolm
2015-09-18 13:38 ` Trevor Saunders
2015-09-18 13:51 ` Richard Biener
2015-09-21 20:39 ` Richard Sandiford
2015-09-22 6:53 ` Trevor Saunders
2015-09-22 11:42 ` Richard Biener
2015-09-22 12:02 ` Richard Biener
2015-09-18 15:37 ` Jeff Law
2015-09-20 2:03 ` Trevor Saunders
2015-09-20 6:38 ` Jeff Law
2015-09-23 17:57 ` Thomas Schwinge
2015-09-24 9:51 ` Thomas Schwinge
2015-09-26 7:10 ` Trevor Saunders [this message]
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=20150926054035.GA3637@tsaunders-iceball.corp.tor1.mozilla.com \
--to=tbsaunde@tbsaunde.org \
--cc=amacleod@redhat.com \
--cc=dmalcolm@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=law@redhat.com \
--cc=thomas@codesourcery.com \
/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 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 read-only IMAP folder(s) and NNTP newsgroup(s).