use the new bitfield types to check for bitfield access; fixes fehler55
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 2 Aug 2007 11:07:36 +0000 (11:07 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 2 Aug 2007 11:07:36 +0000 (11:07 +0000)
[r15425]

ir/lower/lower_hl.c

index b77fcfd..c7df278 100644 (file)
@@ -352,6 +352,10 @@ static void lower_bitfields_loads(ir_node *proj, ir_node *load) {
        ent     = get_Sel_entity(sel);
        bf_type = get_entity_type(ent);
 
        ent     = get_Sel_entity(sel);
        bf_type = get_entity_type(ent);
 
+       /* must be a bitfield type */
+       if (!is_Primitive_type(bf_type) || get_primitive_base_type(bf_type) == NULL)
+               return;
+
        /* We have a bitfield access, if either a bit offset is given, or
           the size is not integral. */
        bf_mode = get_type_mode(bf_type);
        /* We have a bitfield access, if either a bit offset is given, or
           the size is not integral. */
        bf_mode = get_type_mode(bf_type);
@@ -441,6 +445,10 @@ static void lower_bitfields_stores(ir_node *store) {
        ent     = get_Sel_entity(sel);
        bf_type = get_entity_type(ent);
 
        ent     = get_Sel_entity(sel);
        bf_type = get_entity_type(ent);
 
+       /* must be a bitfield type */
+       if (!is_Primitive_type(bf_type) || get_primitive_base_type(bf_type) == NULL)
+               return;
+
        /* We have a bitfield access, if either a bit offset is given, or
           the size is not integral. */
        bf_mode = get_type_mode(bf_type);
        /* We have a bitfield access, if either a bit offset is given, or
           the size is not integral. */
        bf_mode = get_type_mode(bf_type);