We may return a parameter and thus need to copy them.
authorSebastian Buchwald <Sebastian.Buchwald@kit.edu>
Fri, 2 Sep 2011 12:53:34 +0000 (14:53 +0200)
committerSebastian Buchwald <Sebastian.Buchwald@kit.edu>
Fri, 2 Sep 2011 13:47:08 +0000 (15:47 +0200)
This fixes opt/fehler200.c.

ir/lower/lower_calls.c

index 9d64b13..f557ec4 100644 (file)
@@ -363,6 +363,16 @@ static void fix_args_and_collect_calls(ir_node *n, void *ctx)
                }
                break;
        }
+       case iro_Sel: {
+               ir_entity *ent  = get_Sel_entity(n);
+               ir_type   *type = get_entity_type(ent);
+
+               /* we need to copy compound parameters */
+               if (is_parameter_entity(ent) && is_compound_type(type)) {
+                       env->only_local_mem = 0;
+               }
+               break;
+       }
        default:
                /* do nothing */
                break;