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] Make sure subprogram locus is initialized


This is another fixlet aimed at making gigi more robust in the presence of 
unexpected nodes in the expanded code.

Tested on x86_64-suse-linux, applied on the mainline and 7 branch.


2017-12-13  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/trans.c (Subprogram_Body_to_gnu): Initialize locus.

-- 
Eric Botcazou
Index: gcc-interface/trans.c
===================================================================
--- gcc-interface/trans.c	(revision 255601)
+++ gcc-interface/trans.c	(working copy)
@@ -3773,7 +3773,8 @@ Subprogram_Body_to_gnu (Node_Id gnat_nod
     }
 
   /* Set the line number in the decl to correspond to that of the body.  */
-  Sloc_to_locus (Sloc (gnat_node), &locus);
+  if (!Sloc_to_locus (Sloc (gnat_node), &locus))
+    locus = input_location;
   DECL_SOURCE_LOCATION (gnu_subprog_decl) = locus;
 
   /* If the body comes from an expression function, arrange it to be inlined

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