diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2022-06-07 21:46:04 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-07-06 13:29:49 +0000 |
commit | 1141fbd71ea1782c6eac750cfed809f0706aaafc (patch) | |
tree | 45caefd943d0502d4ab25014c1459a99b77d19cc /gcc/ada/gcc-interface/gigi.h | |
parent | 40242ebb71ed7a03ab23349a893afe6140c512d1 (diff) | |
download | gcc-1141fbd71ea1782c6eac750cfed809f0706aaafc.zip gcc-1141fbd71ea1782c6eac750cfed809f0706aaafc.tar.gz gcc-1141fbd71ea1782c6eac750cfed809f0706aaafc.tar.bz2 |
[Ada] Improve code generated for aggregates of VFA type
This avoids using a full access for constants internally generated from
assignments of aggregates with a Volatile_Full_Access type.
gcc/ada/
* gcc-interface/gigi.h (simple_constant_p): Declare.
* gcc-interface/decl.cc (gnat_to_gnu_entity) <E_Variable>: Strip
the qualifiers from the type of a simple constant.
(simple_constant_p): New predicate.
* gcc-interface/trans.cc (node_is_atomic): Return true for objects
with atomic type except for simple constants.
(node_is_volatile_full_access): Return false for simple constants
with VFA type.
Diffstat (limited to 'gcc/ada/gcc-interface/gigi.h')
-rw-r--r-- | gcc/ada/gcc-interface/gigi.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h index b88dfc1..1c1397a 100644 --- a/gcc/ada/gcc-interface/gigi.h +++ b/gcc/ada/gcc-interface/gigi.h @@ -998,6 +998,10 @@ extern Entity_Id get_debug_scope (Node_Id gnat_node, bool *is_subprogram); should be synchronized with Exp_Dbug.Debug_Renaming_Declaration. */ extern bool can_materialize_object_renaming_p (Node_Id expr); +/* Return whether GNAT_ENTITY is a simple constant, i.e. it represents only + its value and reading it has no side effects. */ +extern bool simple_constant_p (Entity_Id gnat_entity); + /* Return the size of TYPE, which must be a positive power of 2. */ extern unsigned int resolve_atomic_size (tree type); |