Andrew Pinski <pinskia@gcc.gnu.org>
PR 18050
* c-common.c (verify_tree): Fix handling of ADDR_EXPR.
testsuite/
* gcc.dg/Wsequence-point-pr18050.c: New.
* g++.dg/warn/Wsequence-point-pr18050.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139742
138bc75d-0d04-0410-961f-
82ee72b054a4
+2008-08-28 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+ Andrew Pinski <pinskia@gcc.gnu.org>
+
+ PR 18050
+ * c-common.c (verify_tree): Fix handling of ADDR_EXPR.
+
2008-08-28 Paolo Carlini <paolo.carlini@oracle.com>
* gtrh-posix.h: Fix uses of _POSIX_TIMEOUTS per the normal Posix
return;
}
+ case ADDR_EXPR:
+ x = TREE_OPERAND (x, 0);
+ if (DECL_P (x))
+ return;
+ writer = 0;
+ goto restart;
+
default:
/* For other expressions, simply recurse on their operands.
Manual tail recursion for unary expressions.
+2008-08-28 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+ Andrew Pinski <pinskia@gcc.gnu.org>
+
+ PR 18050
+ * gcc.dg/Wsequence-point-pr18050.c: New.
+ * g++.dg/warn/Wsequence-point-pr18050.C: New.
+
2008-08-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/37260
--- /dev/null
+/* PR 18050 : bogus warning with -Wsequence-point */
+/* { dg-do compile } */
+/* { dg-options "-Wsequence-point" } */
+
+struct x
+{
+ int i;
+};
+void bar(struct x*, int *);
+
+void foo(struct x *y)
+{
+ bar(y++, &y->i); /* { dg-warning "operation on 'y' may be undefined" } */
+}
+
+void zz(int a, int *b)
+{
+ *b = a;
+}
+
+void baz(void) {
+ int a = 5;
+ zz(++a, &a); /* { dg-bogus "operation on 'a' may be undefined" } */
+}
--- /dev/null
+/* PR 18050 : bogus warning with -Wsequence-point */
+/* { dg-do compile } */
+/* { dg-options "-Wsequence-point" } */
+
+struct x
+{
+ int i;
+};
+void bar(struct x*, int *);
+
+void foo(struct x *y)
+{
+ bar(y++, &y->i); /* { dg-warning "operation on 'y' may be undefined" } */
+}
+
+void zz(int a, int *b)
+{
+ *b = a;
+}
+
+void baz(void) {
+ int a = 5;
+ zz(++a, &a); /* { dg-bogus "operation on 'a' may be undefined" } */
+}