public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Reference before declaration on C392015
@ 2020-11-27  9:18 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2020-11-27  9:18 UTC (permalink / raw)
  To: gcc-patches; +Cc: Arnaud Charlet

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

When working on LLVM/CCG, we found that the generated tree had a wrong
reference before declaration usage. Fixed for LLVM/CCG. The issue might
still be latent with Modify_Tree_For_C, but this expansion will
disappear in the future, so not worth bothering.

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

gcc/ada/

	* exp_ch6.adb (Expand_Call): Properly split
	Transform_Function_Array and Modify_Tree_For_C.

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

diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -3656,7 +3656,8 @@ package body Exp_Ch6 is
             --  are passed by pointer in the generated C code, and we cannot
             --  take a pointer from a subprogram call.
 
-            elsif Nkind (Parent (Call_Node)) in N_Subprogram_Call
+            elsif Modify_Tree_For_C
+              and then Nkind (Parent (Call_Node)) in N_Subprogram_Call
               and then Is_Record_Type (Etype (Func_Id))
             then
                declare



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

only message in thread, other threads:[~2020-11-27  9:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-27  9:18 [Ada] Reference before declaration on C392015 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).