ref: a4c6501c1838127d508608bf11f5d2b5013723ac
parent: 505a92789652dbfa4cf19dc088eb29a47eb6e81f
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sun Jun 11 05:51:21 EDT 2017
[cc1] Simplify before testing in null() This function was designed when folding was done at the same time that the tree was built, but this is not true anymore, and it was generating that (void *) 0 wasn't a constant expression which could be compared with 0 to determine that it was a null expression.
--- a/cc1/expr.c
+++ b/cc1/expr.c
@@ -120,6 +120,8 @@
static int
null(Node *np)
{
+ if (np->op == OCAST)
+ np = simplify(np);
if (!(np->flags&NCONST) || np->type != pvoidtype)
return 0;
return cmpnode(np, 0);