This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] gnatbind: ghost code with -gnatQ


This patch fixes a bug where if a library unit is compiled with -gnatQ,
and that library unit is an ignored Ghost unit, then gnatbind silently
fails.

Tested on x86_64-pc-linux-gnu, committed on trunk

2018-12-11  Bob Duff  <duff@adacore.com>

gcc/ada/

	* gnat1drv.adb (gnat1drv): Pass the correct Object value when
	calling Write_ALI in the case of -gnatQ.
	* gnatbind.adb (Gnatbind): Avoid silent failure; give an error
	message.
--- gcc/ada/gnat1drv.adb
+++ gcc/ada/gnat1drv.adb
@@ -1452,10 +1452,11 @@ begin
          Tree_Gen;
 
          --  Generate ALI file if specially requested, or for missing subunits,
-         --  subunits or predefined generic.
+         --  subunits or predefined generic. For ignored ghost code, the object
+         --  file IS generated, so Object should be True.
 
          if Opt.Force_ALI_Tree_File then
-            Write_ALI (Object => False);
+            Write_ALI (Object => Is_Ignored_Ghost_Unit (Main_Unit_Node));
          end if;
 
          Namet.Finalize;

--- gcc/ada/gnatbind.adb
+++ gcc/ada/gnatbind.adb
@@ -790,6 +790,7 @@ begin
       --  Quit if some file needs compiling
 
       if No_Object_Specified then
+         Error_Msg ("no object specified");
          raise Unrecoverable_Error;
       end if;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]