This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: bogus signed/unsigned warning
- From: Jeff Law <law at porcupine dot slc dot redhat dot com>
- To: Ansgar Esztermann <ansgar at thphy dot uni-duesseldorf dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 06 Sep 2002 14:54:07 -0600
- Subject: Re: bogus signed/unsigned warning
- Reply-to: law at redhat dot com
In message <Pine.LNX.4.44.0208261527110.32252-100000@subraumtor.thphy.uni-duess
eldorf.de>, Ansgar Esztermann writes:
>Hello,
>
>this is my first submission, so if I mixed anything up with the
>formal process, please bear with me.
>I would like to contribute more in the future. I gather that I need
>to sign a copyright assignment for that. Where do I get one, and whom
>do I send it to?
>
>As to the patch, I have also changed the appropriate testcases to no
>longer expect failure.
>Is this the proper approach, or should this be done at a later stage?
>
>Description:
>gcc used to issue bogus warnings with -Wsign-compare if one of the
>operands was a statement expression. This caused testcases 10 and 12 in
>gcc.dg/compare2.c to fail.
>
>ChangeLog:
>2002-08-26 Ansgar Esztermann <ansgar@thphy.uni-duesseldorf.de>
>
> * fold-const.c (tree_expr_nonnegative_p): Handle statement
> expressions.
>
> * gcc.dg/compare2.c Removed xfail from cases 10 and 12.
The problem I see with this patch is that it "pollutes" fold-const
with c-common.
fold-const should be totally language independent.
One way to deal with this would be to have languages register a
routine to call when tree_expr_nonnegative_p encounters a node it
does not understand.
See gcc/langhooks*
jeff