+/* Get the entity of a ptr */
+entity *get_ptr_ent (ir_node *ptr)
+{
+ entity *ent = NULL;
+ const opcode ptr_op = get_irn_opcode (ptr);
+ switch (ptr_op) {
+ case (iro_Cast): {
+ ent = get_ptr_ent (get_Cast_op (ptr));
+ } break;
+ case (iro_Sel): {
+ ent = get_Sel_entity (ptr);
+ } break;
+
+ case (iro_SymConst): {
+ ent = get_SymConst_entity (ptr);
+ } break;
+
+ default: {
+ fprintf (stderr, "%s: no ent for ptr=%s[%ld]\n",
+ __FUNCTION__,
+ get_op_name (get_irn_op (ptr)),
+ get_irn_node_nr (ptr));
+ assert (0);
+ }
+ }
+
+ return (ent);
+}
+
+/* Check whether the load of the given ptr is a dummy */
+int is_dummy_load_ptr (ir_node *ptr)
+{
+ const opcode ptr_op = get_irn_opcode (ptr);
+
+ switch (ptr_op) {
+ case (iro_Cast): {
+ return (is_dummy_load_ptr (get_Cast_op (ptr)));
+ } break;
+ case (iro_Sel):
+ case (iro_SymConst): {
+ return (FALSE);
+ } break;
+
+ default: {
+ return (TRUE);
+ }
+ }
+}