aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.c
diff options
context:
space:
mode:
authorOlivier Hainque <hainque@adacore.com>2008-08-01 10:36:01 +0000
committerOlivier Hainque <hainque@gcc.gnu.org>2008-08-01 10:36:01 +0000
commit2eee5152fa5975e91ff916630c43e850b4550155 (patch)
tree16ff9fffba11e30b8c249b036fc1ce14f772ee2e /gcc/ada/gcc-interface/decl.c
parent2b7473059a6a2b42731f78480d1b8ecf2215e70f (diff)
downloadgcc-2eee5152fa5975e91ff916630c43e850b4550155.zip
gcc-2eee5152fa5975e91ff916630c43e850b4550155.tar.gz
gcc-2eee5152fa5975e91ff916630c43e850b4550155.tar.bz2
decl.c (gnat_to_gnu_entity): Do not turn Ada Pure into GCC const, now implicitely implying nothrow as well.
ada/ * decl.c (gnat_to_gnu_entity) <case E_Function>: Do not turn Ada Pure into GCC const, now implicitely implying nothrow as well. testsuite/ * gnat.dg/raise_from_pure.ad[bs], * gnat.dg/wrap_raise_from_pure.ad[bs]: Support for ... * gnat.dg/test_raise_from_pure.adb: New test. From-SVN: r138509
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r--gcc/ada/gcc-interface/decl.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index f7f4a0d..89621db 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -4025,19 +4025,15 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
if (TREE_CODE (gnu_return_type) == VOID_TYPE)
pure_flag = false;
- /* The semantics of "pure" in Ada essentially matches that of "const"
- in the back-end. In particular, both properties are orthogonal to
- the "nothrow" property. But this is true only if the EH circuitry
- is explicit in the internal representation of the back-end. If we
- are to completely hide the EH circuitry from it, we need to declare
- that calls to pure Ada subprograms that can throw have side effects
- since they can trigger an "abnormal" transfer of control flow; thus
- they can be neither "const" nor "pure" in the back-end sense. */
+ /* The semantics of "pure" in Ada used to essentially match that of
+ "const" in the middle-end. In particular, both properties were
+ orthogonal to the "nothrow" property. This is not true in the
+ middle-end any more and we have no choice but to ignore the hint
+ at this stage. */
+
gnu_type
= build_qualified_type (gnu_type,
TYPE_QUALS (gnu_type)
- | (Exception_Mechanism == Back_End_Exceptions
- ? TYPE_QUAL_CONST * pure_flag : 0)
| (TYPE_QUAL_VOLATILE * volatile_flag));
Sloc_to_locus (Sloc (gnat_entity), &input_location);