diff options
author | Yannick Moy <moy@adacore.com> | 2019-09-17 08:01:10 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-09-17 08:01:10 +0000 |
commit | cbb0b55385692dca6898a2668766f17ea42c4d2e (patch) | |
tree | 713135b4be8b9de962ed05acc58babf7ed7a5a1f /gcc | |
parent | a9a08e6d331cb454741d2b089cdedaefedfd5271 (diff) | |
download | gcc-cbb0b55385692dca6898a2668766f17ea42c4d2e.zip gcc-cbb0b55385692dca6898a2668766f17ea42c4d2e.tar.gz gcc-cbb0b55385692dca6898a2668766f17ea42c4d2e.tar.bz2 |
[Ada] Do not inline dispatching operations in GNATprove mode
In GNATprove, local subprograms without contracts are candidates for
inlining, so that they are only analyzed in the context of their calls.
This does not apply to dispatching operations, which may be called
through dispatching, in an unknown calling context. Hence such
operations should not be considered as candidates for inlining.
There is no test as this has no effect on compilation.
2019-09-17 Yannick Moy <moy@adacore.com>
gcc/ada/
* inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Add handling
for dispatching operations.
From-SVN: r275779
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/inline.adb | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 94877b2..a2f7e27 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2019-09-17 Yannick Moy <moy@adacore.com> + + * inline.adb (Can_Be_Inlined_In_GNATprove_Mode): Add handling + for dispatching operations. + 2019-09-17 Ed Schonberg <schonberg@adacore.com> * sem_ch13.adb (Check_Aspect_At_End_Of_Declarations): In a diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb index e5ecb55..6e345d6 100644 --- a/gcc/ada/inline.adb +++ b/gcc/ada/inline.adb @@ -1681,6 +1681,12 @@ package body Inline is elsif not In_Extended_Main_Code_Unit (Id) then return False; + -- Do not inline dispatching operations, as only their static calls + -- can be analyzed in context, and not their dispatching calls. + + elsif Is_Dispatching_Operation (Id) then + return False; + -- Do not inline subprograms marked No_Return, possibly used for -- signaling errors, which GNATprove handles specially. |