This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Ada] Fix gigi abort on simple package
- From: Geert Bosch <bosch at darwin dot gnat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 4 Dec 2001 21:07:37 -0500 (EST)
- Subject: [Ada] Fix gigi abort on simple package
2001-12-04 Ed Schonberg <schonber@gnat.com>
* einfo.ads: Block_Node points to the identifier of the block, not to
the block node itself, to preserve the link when the block is
rewritten, e.g. within an if-statement with a static condition.
* inline.adb (Cleanup_Scopes): recover block statement from block
entity using new meaning of Block_Node.
* sem_ch5.adb (Analyze_Block_Statement): set Block_Node to point to
identifier of block node, rather than to node itself.
*** einfo.ads 2001/10/03 04:24:59 1.641
--- einfo.ads 2001/10/18 12:25:07 1.642
***************
*** 394,400 ****
-- returns the entity unchanged.
-- Block_Node (Node11)
! -- Present in block entities. Points to the Block_Statement itself.
-- Body_Entity (Node19)
-- Present in package and generic package entities, points to the
--- 394,407 ----
-- returns the entity unchanged.
-- Block_Node (Node11)
! -- Present in block entities. Points to the identifier in the
! -- Block_Statement itself. Used when retrieving the block construct
! -- for finalization purposes, The block entity has an implicit label
! -- declaration in the enclosing declarative part, and has otherwise
! -- no direct connection in the tree with the block statement.
! -- The link is to the identifier (which is an occurence of the entity)
! -- and not to the block_statement itself, because the statement may
! -- be rewritten, e.g. in the process of removing dead code.
-- Body_Entity (Node19)
-- Present in package and generic package entities, points to the
*** inline.adb 2001/09/21 13:57:57 1.55
--- inline.adb 2001/10/18 12:25:09 1.56
***************
*** 672,678 ****
end if;
if Ekind (Scop) = E_Block then
! Decl := Block_Node (Scop);
else
Decl := Unit_Declaration_Node (Scop);
--- 672,678 ----
end if;
if Ekind (Scop) = E_Block then
! Decl := Parent (Block_Node (Scop));
else
Decl := Unit_Declaration_Node (Scop);
*** sem_ch5.adb 2001/09/28 02:40:06 1.263
--- sem_ch5.adb 2001/10/18 12:25:11 1.264
***************
*** 427,433 ****
end if;
Set_Etype (Ent, Standard_Void_Type);
! Set_Block_Node (Ent, N);
New_Scope (Ent);
if Present (Decls) then
--- 427,433 ----
end if;
Set_Etype (Ent, Standard_Void_Type);
! Set_Block_Node (Ent, Identifier (N));
New_Scope (Ent);
if Present (Decls) then