diff -r 40949afe3df8 sys/src/cmd/cc/cc.y --- a/sys/src/cmd/cc/cc.y Mon Jun 17 13:17:16 2019 +0930 +++ b/sys/src/cmd/cc/cc.y Mon Jun 17 15:55:14 2019 -0700 @@ -499,14 +499,6 @@ { $$ = new(OGOTO, dcllabel($2, 0), Z); } -| LUSED '(' zelist ')' ';' - { - $$ = new(OUSED, $3, Z); - } -| LSET '(' zelist ')' ';' - { - $$ = new(OSET, $3, Z); - } zcexpr: { @@ -733,6 +725,14 @@ dodecl(NODECL, CXXX, $3, $4); $$->type = lastdcl; } +| LUSED '(' zelist ')' + { + $$ = new(OUSED, $3, Z); + } +| LSET '(' zelist ')' + { + $$ = new(OSET, $3, Z); + } | pexpr '(' zelist ')' { $$ = new(OFUNC, $1, Z); diff -r 40949afe3df8 sys/src/cmd/cc/com.c --- a/sys/src/cmd/cc/com.c Mon Jun 17 13:17:16 2019 +0930 +++ b/sys/src/cmd/cc/com.c Mon Jun 17 15:55:14 2019 -0700 @@ -81,6 +81,15 @@ diag(n, "unknown op in type complex: %O", n->op); goto bad; + case OUSED: + case OSET: + /* + * If the node is inside an expression, USED + * and SET are useless; shift the child up. + */ + *n = *n->left; + break; + case ODOTDOT: /* * tcom has already been called on this subtree