aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2013-04-11 16:15:25 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2013-04-11 16:15:25 +0000
commit966b587e0b513fa8075beaf9ab184ed74686ee97 (patch)
tree50ecfdf73e14a55579b5dfadb4bcc575c87bafec /gcc/ada
parent76545796c5181baef9511af159178aef8d93de7c (diff)
downloadgcc-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')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/gcc-interface/decl.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 53784aa..49f89b6 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2013-04-11 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/decl.c (elaborate_expression_1): Skip only constant
+ arithmetics when looking for a read-only variable in the expression.
+
2013-04-11 Javier Miranda <miranda@adacore.com>
* check.ads, exp_ch6.adb (Install_Null_Excluding_Check): No check in
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))
{