return rec_get_accessed_path(ptr, 0);
}
-
/**
* optimize a Load
*/
if (get_irn_op(ptr) == op_Sel) {
ir_node *mem = get_Sel_mem(ptr);
- if (get_irn_op(mem) == op_Alloc) {
+ if (get_irn_op(skip_Proj(mem)) == op_Alloc) {
/* ok, check the types */
entity *ent = get_Sel_entity(ptr);
type *s_type = get_entity_type(ent);
}
}
}
- else if (get_irn_op(ptr) == op_Alloc) {
+ else if ((get_irn_op(skip_Proj(ptr)) == op_Alloc) ||
+ ((get_irn_op(ptr) == op_Cast) && (get_irn_op(skip_Proj(get_Cast_op(ptr))) == op_Alloc))) {
/* simple case: a direct load after an Alloc. Firm Alloc throw
* an exception in case of out-of-memory. So, there is no way for an
* exception in this load.