shithub: scc

Download patch

ref: 121cea8b715ba2ca3a8c5abc4b330ded023a7cf8
parent: c65ba1f014232a19cd2b4d27f1a06dc18b9c4c2d
author: Roberto E. Vargas Caballero <[email protected]>
date: Fri Sep 4 16:19:09 EDT 2015

Promote integer values in numericaluop()

Numericaluop() is called with unary numerical operators, which
can be floats or integers, and in the case of integers is mandatory
to do the integer promotion.

--- a/cc1/expr.c
+++ b/cc1/expr.c
@@ -129,6 +129,7 @@
 {
 	switch (BTYPE(np)) {
 	case INT:
+		np = promote(np);
 	case FLOAT:
 		if (op == ONEG && np->op == ONEG)
 			return np->left;