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] Avoid making library-level subprograms public unnecessarily


In order to support various features of the language, the compiler needs to
make library-level symbols that are initially local to a unit public under
certain circumstances.  This applies to both code (subprograms) and data.

Making subprograms public can change the inlining decisions made by the code
generator on a purely local basis and degrade performances of the generated
code at low or intermediate optimization levels.

This enhancement is aimed at not making library-level subprograms public
unnecessarily when pragma Inline subprograms are present in the unit by
scanning those and finding out whether they reference other subprograms.

No functional changes.

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

2010-10-04  Eric Botcazou  <ebotcazou@adacore.com>

	* sem_ch7.adb (Analyze_Package_Body_Helper) <Has_Referencer>: New
	Check_Subprogram_Ref function and Check_Subprogram_Refs instantiation
	of Traverse_Func on it to look for subprogram references in a body.
	Call Check_Subprogram_Refs on the body of inlined subprograms at the
	outer level and keep clearing the Is_Public flag of subprograms as long
	as it returns OK.  Do not look at anything else than subprograms once
	an inlined subprogram has been seen.

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]