[hackers] [scc] Allow conversions between integer and pointers || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Wed, 26 Aug 2015 22:32:48 +0200 (CEST)

commit deed2f68c71afdeb172a8362c6c9d3f3b9f60c4b
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Wed Aug 26 22:26:42 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
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
_AT_@ -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)
Received on Wed Aug 26 2015 - 22:32:48 CEST

This archive was generated by hypermail 2.3.0 : Wed Aug 26 2015 - 22:36:24 CEST