From 98f531ce51bdfc56c5a7fd12a78721b3847d7abf Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Wed, 19 Mar 2008 17:35:54 +0000 Subject: [PATCH] BugFix: scalar replacement should not remove volatile Loads/Stores [r18184] --- ir/opt/scalar_replace.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ir/opt/scalar_replace.c b/ir/opt/scalar_replace.c index 7a8e7e1e7..4a7a07fb1 100644 --- a/ir/opt/scalar_replace.c +++ b/ir/opt/scalar_replace.c @@ -188,6 +188,9 @@ int is_address_taken(ir_node *sel) emode = get_type_mode(get_entity_type(ent)); if (! check_load_store_mode(mode, emode)) return 1; + /* do not remove volatile variables */ + if (get_Load_volatility(succ) == volatility_is_volatile) + return 1; break; case iro_Store: @@ -201,6 +204,9 @@ int is_address_taken(ir_node *sel) emode = get_type_mode(get_entity_type(ent)); if (! check_load_store_mode(mode, emode)) return 1; + /* do not remove volatile variables */ + if (get_Store_volatility(succ) == volatility_is_volatile) + return 1; break; case iro_Sel: { -- 2.20.1