* c-common.c (verify_tree): Check for x being NULL.
* doc/c-tree.texi: Document COMPOUND_BODY of an empty
COMPOUND_STMT.
Fixes PR c/3259.
testsuite:
* gcc.dg/
20010622-1.c: New test.
From-SVN: r43508
+2001-06-22 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * c-common.c (verify_tree): Check for x being NULL.
+ * doc/c-tree.texi: Document COMPOUND_BODY of an empty
+ COMPOUND_STMT.
+ Fixes PR c/3259.
+
2001-06-22 DJ Delorie <dj@redhat.com>
* config/arm/arm.h (struct machine_function): Remove ra_rtx.
enum tree_code code;
char class;
+ /* X may be NULL if it is the operand of an empty statement expression
+ ({ }). */
+ if (x == NULL)
+ return;
+
restart:
code = TREE_CODE (x);
class = TREE_CODE_CLASS (code);
Used to represent a brace-enclosed block. The first substatement is
given by @code{COMPOUND_BODY}. Subsequent substatements are found by
following the @code{TREE_CHAIN} link from one substatement to the next.
+The @code{COMPOUND_BODY} will be @code{NULL_TREE} if there are no
+substatements.
@item CONTINUE_STMT
+2001-06-22 Joseph S. Myers <jsm28@cam.ac.uk>
+
+ * gcc.dg/20010622-1.c: New test.
+
2001-06-18 Stan Shebs <shebs@apple.com>
* objc.dg: New directory.
--- /dev/null
+/* Test for segfault doing -Wsequence-point processing on an empty
+ statement expression. */
+/* Origin: PR c/3259 from <David.Decotigny@irisa.fr>. */
+/* { dg-do compile } */
+/* { dg-options "-Wall" } */
+
+void
+f (void)
+{
+ ({ });
+}