Handle IR generation for access to global variables of compound type.
authorChristoph Mallon <christoph.mallon@gmx.de>
Sat, 17 Nov 2007 16:35:53 +0000 (16:35 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Sat, 17 Nov 2007 16:35:53 +0000 (16:35 +0000)
[r18447]

ast2firm.c

index 47a0010..f98e0a7 100644 (file)
@@ -651,12 +651,7 @@ static ir_node *reference_expression_to_firm(const reference_expression_t *ref)
        case DECLARATION_TYPE_GLOBAL_VARIABLE: {
                ir_entity *entity   = declaration->v.entity;
                ir_node   *symconst = create_symconst(dbgi, entity);
-
-               if(type->type == TYPE_ARRAY) {
-                       return symconst;
-               } else {
-                       return load_from_expression_addr(type, symconst, dbgi);
-               }
+               return deref_address(type, symconst, dbgi);
        }
        case DECLARATION_TYPE_LOCAL_VARIABLE_ENTITY: {
                ir_entity *entity = declaration->v.entity;