diff options
author | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2011-06-18 10:18:38 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2011-06-18 10:18:38 +0000 |
commit | 7e4680c1a2cf543559a1db79368a2d476f1c233c (patch) | |
tree | a7356c2f1b6f9502b952ce84f57e10fc9f2fe1b8 /gcc/ada/sem_attr.adb | |
parent | 0e27699a8a99b215173bd62e83e91f9d7128a826 (diff) | |
download | gcc-7e4680c1a2cf543559a1db79368a2d476f1c233c.zip gcc-7e4680c1a2cf543559a1db79368a2d476f1c233c.tar.gz gcc-7e4680c1a2cf543559a1db79368a2d476f1c233c.tar.bz2 |
einfo.ads (Address_Taken): Document use for the second argument of Asm_Input and Asm_Output attributes.
* einfo.ads (Address_Taken): Document use for the second argument of
Asm_Input and Asm_Output attributes.
* sem_attr.adb (Analyze_Attribute) <Attribute_Asm_Input>: If the second
argument is an entity name, then set Address_Taken on it.
<Attribute_Asm_Output>: Likewise.
* gcc-interface/trans.c (lvalue_required_for_attribute_p): Handle the
Attr_Asm_Input and Attr_Asm_Output attributes explicitly.
(gnat_to_gnu) <N_Code_Statement>: If an operand is going to end up in
memory and is a CONST_DECL, retrieve its corresponding VAR_DECL.
From-SVN: r175171
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r-- | gcc/ada/sem_attr.adb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index b7b4f2f6..b2c7a83 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -2243,6 +2243,13 @@ package body Sem_Attr is when Attribute_Asm_Input => Check_Asm_Attribute; + + -- The back-end may need to take the address of E2 + + if Is_Entity_Name (E2) then + Set_Address_Taken (Entity (E2)); + end if; + Set_Etype (N, RTE (RE_Asm_Input_Operand)); ---------------- @@ -2263,6 +2270,13 @@ package body Sem_Attr is end if; Note_Possible_Modification (E2, Sure => True); + + -- The back-end may need to take the address of E2 + + if Is_Entity_Name (E2) then + Set_Address_Taken (Entity (E2)); + end if; + Set_Etype (N, RTE (RE_Asm_Output_Operand)); --------------- |