do not remove volatile entities
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Mon, 5 Jun 2006 15:44:06 +0000 (15:44 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Mon, 5 Jun 2006 15:44:06 +0000 (15:44 +0000)
[r7865]

ir/opt/data_flow_scalar_replace.c
ir/opt/scalar_replace.c

index 6a45fda..8eea836 100644 (file)
@@ -373,6 +373,17 @@ static int find_possible_replacements(ir_graph *irg)
       if (get_entity_link(ent) == ADDRESS_TAKEN)
         continue;
 
+      /*
+       * Beware: in rare cases even entities on the frame might be
+       * volatile. This might happen if the entity serves as a store
+       * to a value that must survive a exception. Do not optimize
+       * such entities away.
+       */
+      if (get_entity_volatility(ent) == volatility_is_volatile) {
+        set_entity_link(ent, ADDRESS_TAKEN);
+        continue;
+      }
+
       ent_type = get_entity_type(ent);
 
       /* we can handle arrays, structs and atomic types yet */
index 881d199..9315af9 100644 (file)
@@ -273,6 +273,17 @@ static int find_possible_replacements(ir_graph *irg)
       if (get_entity_link(ent) == ADDRESS_TAKEN)
         continue;
 
+      /*
+       * Beware: in rare cases even entities on the frame might be
+       * volatile. This might happen if the entity serves as a store
+       * to a value that must survive a exception. Do not optimize
+       * such entities away.
+       */
+      if (get_entity_volatility(ent) == volatility_is_volatile) {
+        set_entity_link(ent, ADDRESS_TAKEN);
+        continue;
+      }
+
       ent_type = get_entity_type(ent);
 
       /* we can handle arrays, structs and atomic types yet */