PR middle-end/30729
* stmt.c (warn_if_unused_value): VA_ARG_EXPR has side
effects unknown to this function, return early.
2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR middle-end/30729
* gcc.dg/Wunused-value-2.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122027
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR middle-end/30729
+ * stmt.c (warn_if_unused_value): VA_ARG_EXPR has side
+ effects unknown to this function, return early.
+
2007-02-15 Ian Lance Taylor <iant@google.com>
* lower-subreg.c (move_eh_region_note): New static function.
case TRY_CATCH_EXPR:
case WITH_CLEANUP_EXPR:
case EXIT_EXPR:
+ case VA_ARG_EXPR:
return 0;
case BIND_EXPR:
+2007-02-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR middle-end/30729
+ * gcc.dg/Wunused-value-2.c: New testcase.
+
2007-02-15 Ian Lance Taylor <iant@google.com>
* g++.dg/eh/subreg-1.C: New test.
--- /dev/null
+/* Test -Wunused-value. Bug 30729. */
+/* { dg-do compile } */
+/* { dg-options "-Wunused-value" } */
+/* Make sure va_arg does not cause a value computed is not used warning
+ because it has side effects. */
+#include <stdarg.h>
+
+int f(int t, ...)
+{
+ va_list a;
+ va_start (a, t);
+ va_arg(a, int);/* { dg-bogus "value computed is not used" } */
+ int t1 = va_arg(a, int);
+ va_end(a);
+ return t1;
+}
+
+