This is the mail archive of the 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] Fix debug info for renaming of dereferenced return value

This fixes the debugging information generated for a variable renaming the
dereference of the return value of a function returning an access type.

The compiler was both materializing the renaming object and generating
the special debug renaming variable for it, without generating debugging
information for the temporary capturing the return value and linked to
by the debug renaming variable.

The compiler will now avoid to materialize the renaming object and generate
debugging information for the temporary in the following example:

   type P is access all Integer;
   X : aliased Integer := 42;

   function Val return P is
      return X'Access;
   end Val;

   V : Integer renames Val.all;

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

2013-10-14  Eric Botcazou  <>

	* exp_dbug.adb (Debug_Renaming_Declaration): Do not
	materialize the entity when the renamed object contains an
	* sem_ch8.adb (Analyze_Object_Renaming):
	If the renaming comes from source and the renamed object is a
	dereference, mark the prefix as needing debug information.

Attachment: difs
Description: Text document

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