Commit 0e5b9de3 by Eric Botcazou Committed by Eric Botcazou

decl.c (gnat_to_gnu_entity): Always take into account the Esize if it is known.

	* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Always take
	into account the Esize if it is known.

From-SVN: r255958
parent 92cd3a86
2017-12-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Variable>: Always take
into account the Esize if it is known.
2017-12-21 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
......
......@@ -723,7 +723,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
TYPE_ALIGN (gnu_type));
/* Likewise, if a size is specified, use it if valid. */
if (Known_Esize (gnat_entity) && No (Address_Clause (gnat_entity)))
if (Known_Esize (gnat_entity))
gnu_size
= validate_size (Esize (gnat_entity), gnu_type, gnat_entity,
VAR_DECL, false, Has_Size_Clause (gnat_entity));
......
2017-12-21 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/atomic9.adb: New test.
2017-12-21 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/80747
......
-- { dg-do compile }
-- { dg-options "-fdump-tree-gimple" }
with Interfaces;
procedure Atomic9 is
Register : Interfaces.Unsigned_32;
type Interrupt_ID is range 0 .. 44;
procedure Trigger_Interrupt (IRQ : Interrupt_ID) is
NVIC_STIR : Interrupt_ID
with
Import,
Atomic,
Size => 32,
Address => Register'Address;
begin
NVIC_STIR := IRQ;
end Trigger_Interrupt;
begin
Register := 16#ffff_ffff#;
Trigger_Interrupt (1);
end;
-- { dg-final { scan-tree-dump "atomic_store_4" "gimple" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment