public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Avoid crash in GNATprove due to inlining inside type
@ 2019-08-13  8:32 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2019-08-13  8:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Yannick Moy

[-- Attachment #1: Type: text/plain, Size: 334 bytes --]

The special inlining for GNATprove should not inline calls inside record
types, used for the constraints of components.

There is no impact on compilation.

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

2019-08-13  Yannick Moy  <moy@adacore.com>

gcc/ada/

	* sem_res.adb (Resolve_Call): Do not inline calls inside record
	types.

[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 778 bytes --]

--- gcc/ada/sem_res.adb
+++ 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.
 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-13  8:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-13  8:32 [Ada] Avoid crash in GNATprove due to inlining inside type Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).