shithub: scc

Download patch

ref: deed2f68c71afdeb172a8362c6c9d3f3b9f60c4b
parent: 79ccb978a8d4f8c9c9700bb16d2b97625f3f1dd4
author: Roberto E. Vargas Caballero <[email protected]>
date: Wed Aug 26 18:26:42 EDT 2015

Allow conversions between integer and pointers

This kind of constant conversions are very common in array expressions
so this optimization can simplify a lot the IR generated.

--- a/cc1/expr.c
+++ b/cc1/expr.c
@@ -430,9 +430,11 @@
 	Symbol aux, *sym, *osym = np->sym;
 
 	switch (newtp->op) {
+	case PTR:
 	case INT:
 	case ENUM:
 		switch (oldtp->op) {
+		case PTR:
 		case INT:
 		case ENUM:
 			if (newtp->sign == oldtp->sign)