[PATCH] Fix c/4697

Richard Henderson rth@redhat.com
Wed Feb 20 21:25:00 GMT 2002


On Wed, Feb 20, 2002 at 08:32:23PM +0100, Jakub Jelinek wrote:
> This PR is about value computed not used warning not given where it should.
> I couldn't find any mail about your patch to warn_if_unused_value from
> 2000-12 where you moved it...

Thread starts here:

  http://gcc.gnu.org/ml/gcc-patches/2000-11/msg01738.html

Not sure why the change labels me and not Zack...

> ... so I can just guess that you saw incorrect warnings in the
> NOP_EXPR/CONVERT_EXPR/NON_LVALUE_EXPR case where it does goto warn.

Yep.

> ... for compound expr, TREE_SIDE_EFFECTS can be set because the first
> operand has side effects, but if the second one does not have any side
> effects and is not used, it should still produce a warning.

Good point.

> 	PR c/4697:
> 	* stmt.c (warn_if_unused_value): Move side effects test once more.
> 
> 	* gcc.dg/20020220-2.c: New test.

Ok.


r~



More information about the Gcc-patches mailing list