commit deed2f68c71afdeb172a8362c6c9d3f3b9f60c4b
Author:     Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Wed Aug 26 22:26:42 2015 +0200
Commit:     Roberto E. Vargas Caballero <[email protected]>
CommitDate: Wed Aug 26 22:26:42 2015 +0200

    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.

diff --git a/cc1/expr.c b/cc1/expr.c
index 5f22825..62466ad 100644
--- a/cc1/expr.c
+++ b/cc1/expr.c
@@ -430,9 +430,11 @@ constconv(Node *np, Type *newtp)
        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)

Reply via email to