diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2013-04-11 16:15:25 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2013-04-11 16:15:25 +0000 |
commit | 966b587e0b513fa8075beaf9ab184ed74686ee97 (patch) | |
tree | 50ecfdf73e14a55579b5dfadb4bcc575c87bafec /gcc/ada/gcc-interface/decl.c | |
parent | 76545796c5181baef9511af159178aef8d93de7c (diff) | |
download | gcc-966b587e0b513fa8075beaf9ab184ed74686ee97.zip gcc-966b587e0b513fa8075beaf9ab184ed74686ee97.tar.gz gcc-966b587e0b513fa8075beaf9ab184ed74686ee97.tar.bz2 |
stor-layout.c (skip_simple_constant_arithmetic): Move to...
* stor-layout.c (skip_simple_constant_arithmetic): Move to...
* tree.c (skip_simple_constant_arithmetic): ...here and make public.
(skip_simple_arithmetic): Tidy up.
* tree.h (skip_simple_constant_arithmetic): Declare.
ada/
* gcc-interface/decl.c (elaborate_expression_1): Skip only constant
arithmetics when looking for a read-only variable in the expression.
From-SVN: r197815
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 7342fa3..e65701b 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -6186,12 +6186,13 @@ elaborate_expression_1 (tree gnu_expr, Entity_Id gnat_entity, tree gnu_name, expr_variable_p = false; else { - /* Skip any conversions and simple arithmetics to see if the expression - is based on a read-only variable. + /* Skip any conversions and simple constant arithmetics to see if the + expression is based on a read-only variable. ??? This really should remain read-only, but we have to think about the typing of the tree here. */ - tree inner - = skip_simple_arithmetic (remove_conversions (gnu_expr, true)); + tree inner = remove_conversions (gnu_expr, true); + + inner = skip_simple_constant_arithmetic (inner); if (handled_component_p (inner)) { |