This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix compiler warnings
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Aditya K <hiraditya at msn dot com>, Richard Sandiford <rdsandiford at googlemail dot com>, Marek Polacek <polacek at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 6 May 2015 16:58:03 +0200
- Subject: Re: Fix compiler warnings
- Authentication-results: sourceware.org; auth=none
- References: <BLU179-W78C3F88CD6DA1340CE7255B6D00 at phx dot gbl>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
See Trevor's comments on ChangeLog.
diff --git a/gcc/reload.h b/gcc/reload.h
index c777e54..ae86150 100644
--- a/gcc/reload.h
+++ b/gcc/reload.h
@@ -168,7 +168,7 @@ struct target_reload {
value indicates the level of indirect addressing supported, e.g., two
means that (MEM (MEM (REG n))) is also valid if (REG n) does not get
a hard register. */
- bool x_spill_indirect_levels;
+ int x_spill_indirect_levels;
/* True if caller-save has been reinitialized. */
bool x_caller_save_initialized_p;
I believe this got broken with the switchable target support changes,
previously it was using char spill_indirect_levels global.
I think no target supports 128 levels of memory indirections, most targets
support zero or 1, so I'd vote for just using char instead of int here.
Otherwise the structure wouldn't pack too well.
Also, it would be nice to figure why gcc doesn't warn (for both meaningful
changes, in the first snippet I believe gcc just determines the static
function is noreturn and that is why it correctly doesn't warn).
I thought Marek has added patches for the !x == Y case recently, so it would
be nice to find out why we don't warn in that case.
Similarly for the bool case, does clang warn on +/++ operation on bool (which
is well defined, supposedly it should be some style warning?), or something
else?
Jakub