diff options
author | Yannick Moy <moy@adacore.com> | 2019-08-13 08:07:24 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-08-13 08:07:24 +0000 |
commit | 1788bf118c1c97a2e3cb8c0526ffe617859eb7d4 (patch) | |
tree | 13d25fa03f84232da9405e112199ac46ec4c6912 /gcc | |
parent | 258325dddf752c578f1da15f63577090b1db2de5 (diff) | |
download | gcc-1788bf118c1c97a2e3cb8c0526ffe617859eb7d4.zip gcc-1788bf118c1c97a2e3cb8c0526ffe617859eb7d4.tar.gz gcc-1788bf118c1c97a2e3cb8c0526ffe617859eb7d4.tar.bz2 |
[Ada] Avoid crash in GNATprove due to inlining inside type
The special inlining for GNATprove should not inline calls inside record
types, used for the constraints of components.
There is no impact on compilation.
2019-08-13 Yannick Moy <moy@adacore.com>
gcc/ada/
* sem_res.adb (Resolve_Call): Do not inline calls inside record
types.
From-SVN: r274344
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/sem_res.adb | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 34f41fd..55044f6 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2019-08-13 Yannick Moy <moy@adacore.com> + + * sem_res.adb (Resolve_Call): Do not inline calls inside record + types. + 2019-08-13 Eric Botcazou <ebotcazou@adacore.com> * sem_ch4.adb (Analyze_One_Call): Remove bypass for type diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index 759887c..7a9c85c 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -7062,6 +7062,15 @@ package body Sem_Res is end if; end if; + -- Cannot inline a call inside the definition of a record type, + -- typically inside the constraints of the type. Calls in + -- default expressions are also not inlined, but this is + -- filtered out above when testing In_Default_Expr. + + elsif Is_Record_Type (Current_Scope) then + Cannot_Inline + ("cannot inline & (inside record type)?", N, Nam_UA); + -- With the one-pass inlining technique, a call cannot be -- inlined if the corresponding body has not been seen yet. |