public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Do not redefine main_identifier_node
@ 2009-10-21 10:13 Eric Botcazou
  0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2009-10-21 10:13 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 421 bytes --]

main_identifier_node is defined to "main" when gigi starts up but redefined to 
something else when the compilation unit really contains a main.  This breaks 
in LTO mode, including for an all-Ada program.

Tested on i586-suse-linux, applied on the mainline.


2009-10-21  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interfaces/utils.c (create_subprog_decl): Do not redefine
	main_identifier_node.


-- 
Eric Botcazou

[-- Attachment #2: p.diff --]
[-- Type: text/x-diff, Size: 801 bytes --]

Index: gcc-interface/utils.c
===================================================================
--- gcc-interface/utils.c	(revision 153008)
+++ gcc-interface/utils.c	(working copy)
@@ -1866,9 +1866,9 @@ create_subprog_decl (tree subprog_name, 
 	 to be declared as the "main" function literally by default.  Ada
 	 program entry points are typically declared with a different name
 	 within the binder generated file, exported as 'main' to satisfy the
-	 system expectations.  Redirect main_identifier_node in this case.  */
+	 system expectations.  Force main_identifier_node in this case.  */
       if (asm_name == main_identifier_node)
-	main_identifier_node = DECL_NAME (subprog_decl);
+	DECL_NAME (subprog_decl) = main_identifier_node;
     }
 
   process_attributes (subprog_decl, attr_list);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-10-21 10:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-21 10:13 [Ada] Do not redefine main_identifier_node Eric Botcazou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).