- switch (type->type) {
- case TYPE_ARRAY:
- case TYPE_COMPOUND_STRUCT:
- case TYPE_COMPOUND_UNION:
- return addr;
-
- default: {
- ir_mode *const mode = get_ir_mode(type);
- ir_node *const memory = get_store();
- ir_node *const load = new_d_Load(dbgi, memory, addr, mode);
- ir_node *const load_mem = new_d_Proj(dbgi, load, mode_M, pn_Load_M);
- ir_node *const load_res = new_d_Proj(dbgi, load, mode, pn_Load_res);
- set_store(load_mem);
- return load_res;
+ if(is_compound_type(irtype) || is_Array_type(irtype)) {
+ return addr;
+ }
+
+ ir_mode *const mode = get_type_mode(irtype);
+ ir_node *const memory = get_store();
+ ir_node *const load = new_d_Load(dbgi, memory, addr, mode);
+ ir_node *const load_mem = new_d_Proj(dbgi, load, mode_M, pn_Load_M);
+ ir_node *const load_res = new_d_Proj(dbgi, load, mode, pn_Load_res);
+ set_store(load_mem);
+ return load_res;
+}
+
+static ir_node *do_strict_conv(dbg_info *dbgi, ir_node *node)
+{
+ ir_mode *mode = get_irn_mode(node);
+
+ if(!(get_irg_fp_model(current_ir_graph) & fp_explicit_rounding))
+ return node;
+ if(!mode_is_float(mode))
+ return node;
+
+ /* check if there is already a Conv */
+ if (get_irn_op(node) == op_Conv) {
+ /* convert it into a strict Conv */
+ set_Conv_strict(node, 1);
+ return node;
+ }
+
+ /* otherwise create a new one */
+ return new_d_strictConv(dbgi, node, mode);
+}
+
+static ir_node *get_global_var_address(dbg_info *const dbgi,
+ const declaration_t *const decl)
+{
+ assert(decl->declaration_type == DECLARATION_TYPE_GLOBAL_VARIABLE);
+
+ ir_entity *const entity = decl->v.entity;
+ switch ((storage_class_tag_t)decl->storage_class) {
+ case STORAGE_CLASS_THREAD:
+ case STORAGE_CLASS_THREAD_EXTERN:
+ case STORAGE_CLASS_THREAD_STATIC: {
+ ir_node *const no_mem = new_NoMem();
+ ir_node *const tls = get_irg_tls(current_ir_graph);
+ return new_d_simpleSel(dbgi, no_mem, tls, entity);