From: Michael Beck Date: Mon, 5 Jun 2006 15:44:06 +0000 (+0000) Subject: do not remove volatile entities X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=dc045ea9957291a589506bf027d42216a8c7bcbe;p=libfirm do not remove volatile entities [r7865] --- diff --git a/ir/opt/data_flow_scalar_replace.c b/ir/opt/data_flow_scalar_replace.c index 6a45fdab9..8eea83691 100644 --- a/ir/opt/data_flow_scalar_replace.c +++ b/ir/opt/data_flow_scalar_replace.c @@ -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 */ diff --git a/ir/opt/scalar_replace.c b/ir/opt/scalar_replace.c index 881d199f0..9315af941 100644 --- a/ir/opt/scalar_replace.c +++ b/ir/opt/scalar_replace.c @@ -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 */