This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ppc bootstrap failure caused by -Wunused-but-set-* warning (PR bootstrap/43681)
On Thu, Apr 08, 2010 at 11:44:02AM +0200, Richard Guenther wrote:
> On Thu, Apr 8, 2010 at 11:30 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> > If neither OUTGOING_REG_PARM_STACK_SPACE nor REG_PARM_STACK_SPACE
> > macros actually use its arguments, fn is set but not used.
> > The following patch works around that warning.
> >
> > Ok for trunk?
>
> Ugh. How ugly. Well, ok for now.
Yes, it is ugly. That's the drawback of this warning with macroized
code. I hope that the usefulness of the warnings when it e.g.
finds useless expensive computations that aren't needed etc. outweight
the disadvantages.
> If it were an inline function passing the param would count
> as a use, correct?
Yes. The warning is a pure frontend warning, and various
kinds of uses will shut the warning up (including use
in sizeof, 0 && expr, even fn alone used as statement. But it works
after preprocessing, so if preprocessor removes any references, we
warn.
Jakub