summaryrefslogtreecommitdiffstats
path: root/gcc/ada
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-07 09:47:43 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2008-04-07 09:47:43 +0000
commit27e9f331542a274cf27cb1b4cb7f60f01e90d1fb (patch)
tree5f52e504245f353cbf4c7ab73aff6c9c36257959 /gcc/ada
parentff3ae3759a5c80c7783090c3a26cee5a29862b34 (diff)
downloadppe42-gcc-27e9f331542a274cf27cb1b4cb7f60f01e90d1fb.tar.gz
ppe42-gcc-27e9f331542a274cf27cb1b4cb7f60f01e90d1fb.zip
* fold-const.c (fold) <ARRAY_REF>: New case. Try to fold constant
reference in constructor with non self-referential type. ada/ * utils2.c (build_binary_op): Fold ARRAY_REF and ARRAY_RANGE_REF too. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133977 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog4
-rw-r--r--gcc/ada/utils2.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 44c64cecc1f..826cd0dfa99 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,9 @@
2008-04-07 Eric Botcazou <ebotcazou@adacore.com>
+ * utils2.c (build_binary_op): Fold ARRAY_REF and ARRAY_RANGE_REF too.
+
+2008-04-07 Eric Botcazou <ebotcazou@adacore.com>
+
* gigi.h (create_subprog_type): Remove returns_with_dsp parameter.
* decl.c (gnat_to_gnu_entity): Adjust for above new prototype.
* utils.c (create_subprog_type): Remove returns_with_dsp parameter.
diff --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c
index e9908676b44..8eddde2fb37 100644
--- a/gcc/ada/utils2.c
+++ b/gcc/ada/utils2.c
@@ -1017,8 +1017,8 @@ build_binary_op (enum tree_code op_code, tree result_type,
else if (TREE_CODE (right_operand) == NULL_EXPR)
return build1 (NULL_EXPR, operation_type, TREE_OPERAND (right_operand, 0));
else if (op_code == ARRAY_REF || op_code == ARRAY_RANGE_REF)
- result = build4 (op_code, operation_type, left_operand,
- right_operand, NULL_TREE, NULL_TREE);
+ result = fold (build4 (op_code, operation_type, left_operand,
+ right_operand, NULL_TREE, NULL_TREE));
else
result
= fold_build2 (op_code, operation_type, left_operand, right_operand);
OpenPOWER on IntegriCloud