diff options
author | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-04-11 16:15:25 +0000 |
---|---|---|
committer | ebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-04-11 16:15:25 +0000 |
commit | 3303f1bb3df37092b3ec7586b0a9077f62b13309 (patch) | |
tree | 50ecfdf73e14a55579b5dfadb4bcc575c87bafec /gcc/ada/gcc-interface | |
parent | 19b271a9085026049393a62ce767c86272898e25 (diff) | |
download | gcc-3303f1bb3df37092b3ec7586b0a9077f62b13309.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197815 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gcc-interface')
-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 7342fa3c9ed..e65701b9a05 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)) { |