From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-relay-3.sys.kth.se (smtp-relay-3.sys.kth.se [130.237.32.48]) by sourceware.org (Postfix) with ESMTPS id E027B3858D28 for ; Tue, 30 Nov 2021 17:09:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E027B3858D28 Received: from exdb4.ug.kth.se (exdb4.ug.kth.se [192.168.32.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp-relay-3.sys.kth.se (Postfix) with ESMTPS id 4J3TGB02hPzPGTC for ; Tue, 30 Nov 2021 18:09:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp-relay-3.sys.kth.se 4J3TGB02hPzPGTC Received: from exdb6.ug.kth.se (192.168.32.61) by exdb4.ug.kth.se (192.168.32.59) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Tue, 30 Nov 2021 18:09:05 +0100 Received: from exdb6.ug.kth.se ([192.168.32.61]) by exdb6.ug.kth.se ([192.168.32.61]) with mapi id 15.02.0986.014; Tue, 30 Nov 2021 18:09:05 +0100 From: Petter Tomner To: Petter Tomner , "jit@gcc.gnu.org" Subject: SV: [PATCH] jit: Add support for global rvalue initialization and ctors Thread-Topic: [PATCH] jit: Add support for global rvalue initialization and ctors Thread-Index: AQHX5Vuu9//2bIWgFE2G8blT/CeNBawcTdTN Date: Tue, 30 Nov 2021 17:09:05 +0000 Message-ID: <1854c29a8d4c49538a4d18d4e6e6ba23@kth.se> References: <1d9576bd20cb472da2fe014af22e9551@kth.se> In-Reply-To: <1d9576bd20cb472da2fe014af22e9551@kth.se> Accept-Language: sv-SE, en-US Content-Language: sv-SE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.32.250] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: jit@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Jit mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Nov 2021 17:09:11 -0000 David, please note that this patch was sent before your mail in the other t= hread: https://gcc.gnu.org/pipermail/jit/2021q4/001400.html and that this patch still need fixing for those points discussed in there. Regards, Fr=E5n: Gcc-patches f=F6r= Petter Tomner via Gcc-patches Skickat: den 29 november 2021 21:03 Till: gcc-patches@gcc.gnu.org; jit@gcc.gnu.org =C4mne: [PATCH] jit: Add support for global rvalue initialization and ctors =A0 =20 Hi! I have wrapped up the patch than adds support for initialization of global = variables with rvalues aswell as rvalue constructors for structs, arrays and unions. New entrypoints are: gcc_jit_global_set_initializer_rvalue Which sets the initial value of a global to a rvalue. And: gcc_jit_context_new_array_constructor gcc_jit_context_new_struct_constructor gcc_jit_context_new_union_constructor Those three makes a constructor with a rvalue that e.g. can be assigned to = a local or returned from a function, or most importantly used to set the initial value of globa= l variables with gcc_jit_global_set_initializer_rvalue. If no fields are specified for a struct or union to the constructors, defin= ition order is assumed. There can be gaps in the fields specified to the struct constructor, but th= ey need to be in order. For pointer arithmetic to work with setting DECL_INITIAL, alot of folding i= s added. make check-jit runs fine on gnu-linux-x64 Debian. Regards, =