From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sender3-of-o90.zoho.com (sender3-of-o90.zoho.com [136.143.184.90]) by sourceware.org (Postfix) with ESMTPS id C23FF3858400; Thu, 30 Dec 2021 01:40:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C23FF3858400 ARC-Seal: i=1; a=rsa-sha256; t=1640828439; cv=none; d=zohomail.com; s=zohoarc; b=eCOP8If0YbW745dhJxwDbgAG0o4afpDjR6Oaoki04HllCIy8LD7rjRVnz3YXFecp5hQIe1Y0ybGOzblV2z4jvh9cNsgWPa8IEB8WrykM13d7dMSxbSmPijeEd/gHWbm3VHlAsQmPt42qIjVqvlMFRWZtWF6IooSNwUKzES6HPB0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1640828439; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=L8OTO2tOayt8dhMT4GAI3GagTL1+mAeGIS7tsRQKrjY=; b=fRS+APeLdkOGZa0VMWiqFsYp+XKLoU25C26PdUeYQQEzVz1PjeYaPWIo+/2dzLQnZ9e7wQxwUU/SZa/ElkVFpRR0ODyqSZPYPtmZHFPo1fR6TVprHiITy4Wp4aMHkSSU8kV3eIPC0xqZ24CLwtYKauJtQNOvFoDuSMMMkJ/kXfQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=zoho.com; spf=pass smtp.mailfrom=bouanto@zoho.com; dmarc=pass header.from= Received: from [192.168.1.174] (38.87.11.6 [38.87.11.6]) by mx.zohomail.com with SMTPS id 164082843774589.89163572105076; Wed, 29 Dec 2021 17:40:37 -0800 (PST) Message-ID: <29d9c05526f72bcb53c55ef84f92e2bc9424c045.camel@zoho.com> Subject: Re: SV: [commited] jit: Support for global rvalue initialization and constructors From: Antoni Boucher To: Petter Tomner , David Malcolm , "jit@gcc.gnu.org" , "gcc-patches@gcc.gnu.org" Date: Wed, 29 Dec 2021 20:40:36 -0500 In-Reply-To: References: <8c135550d44f43b9b80c2a3a50939128@kth.se> ,<95b9504a2c0f8d255105a278b04a3dcb6cb5dc4e.camel@zoho.com> <54a63e2ec8954573939d4dcad7d3ae12@kth.se> , Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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: Thu, 30 Dec 2021 01:40:50 -0000 Oh, sorry, I meant when you have an array not in a local variable, and you try to assign to an index of this array. Something like: gcc_jit_rvalue *ctor =3D gcc_jit_context_new_array_constructor (ctxt,0,int50arr_type,6,values); gcc_jit_block_add_assignment (block, 0, gcc_jit_context_new_array_access(NULL, ctor, gcc_jit_context_zero(int_type)), some_value); Le jeudi 30 d=C3=A9cembre 2021 =C3=A0 01:16 +0000, Petter Tomner a =C3=A9cr= it=C2=A0: > Could you be more specific? I tried the equivalent of: >=20 > /*=C2=A0=C2=A0=C2=A0 int [50] foobar =3D {1,2,3,4}; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 int [50] foo() { int arr[50]; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 arr =3D (int [= 50]){-1,-2,-3,-4,-5,-6}; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 arr =3D foobar= ; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 arr =3D (int [= 50]){1,2,3,4,5,6}; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 arr[6] =3D 123= 4; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return arr;} >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 N.B: Not a typo, returning an array. > */ >=20 > in test-local-init-rvalue.c with a global and local "arr" and it ran > fine. (See attachment). >=20 > Regards, Petter >=20 >=20 > Fr=C3=A5n: Antoni Boucher > Skickat: den 29 december 2021 23:45 > Till: Petter Tomner; David Malcolm; jit@gcc.gnu.org; > gcc-patches@gcc.gnu.org > =C3=84mne: Re: [commited] jit: Support for global rvalue initialization > and constructors > =C2=A0=C2=A0=C2=A0=20 > I realized that trying to do an assignment to an array created by the > new array constructor API will result in a "gimplification failed" > error: >=20 > libgccjit.so: error: gimplification failed > 0x7fa3a441e5d3 gimplify_expr(tree_node**, gimple**, gimple**, bool > (*)(tree_node*), int) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ../../../gcc/gcc/gimplify.c:15= 964 > 0x7fa3a442b1ab gimplify_modify_expr > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ../../../gcc/gcc/gimplify.c:59= 75 > 0x7fa3a441ac4c gimplify_expr(tree_node**, gimple**, gimple**, bool > (*)(tree_node*), int) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ../../../gcc/gcc/gimplify.c:14= 951 > 0x7fa3a441e63c gimplify_stmt(tree_node**, gimple**) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ../../../gcc/gcc/gimplify.c:70= 26 > 0x7fa3a441bca3 gimplify_statement_list > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ../../../gcc/gcc/gimplify.c:20= 14 > 0x7fa3a441bca3 gimplify_expr(tree_node**, gimple**, gimple**, bool > (*)(tree_node*), int) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ../../../gcc/gcc/gimplify.c:15= 396 > 0x7fa3a441e63c gimplify_stmt(tree_node**, gimple**) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ../../../gcc/gcc/gimplify.c:70= 26 > 0x7fa3a441f000 gimplify_bind_expr > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ../../../gcc/gcc/gimplify.c:14= 27 > 0x7fa3a441adc6 gimplify_expr(tree_node**, gimple**, gimple**, bool > (*)(tree_node*), int) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ../../../gcc/gcc/gimplify.c:15= 152 > 0x7fa3a441e63c gimplify_stmt(tree_node**, gimple**) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ../../../gcc/gcc/gimplify.c:70= 26 > 0x7fa3a4420671 gimplify_body(tree_node*, bool) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ../../../gcc/gcc/gimplify.c:16= 197 > 0x7fa3a4420b3c gimplify_function_tree(tree_node*) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ../../../gcc/gcc/gimplify.c:16= 351 > 0x7fa3a419fe5e gcc::jit::playback::function::postprocess() > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ../../../gcc/gcc/jit/jit-playb= ack.c:1909 > 0x7fa3a41a13dc gcc::jit::playback::context::replay() > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ../../../gcc/gcc/jit/jit-playb= ack.c:3250 >=20 >=20 > Should an assignment to such a value be supported? >=20 > Le mercredi 15 d=C3=A9cembre 2021 =C3=A0 19:19 +0000, Petter Tomner a =C3= =A9crit=C2=A0: > > Oh ye I accidentally dropped that in the merge thank you. > >=20 > > I believe there is an implicit "global:" in the top of each version > > scope, so it shouldn't > > matter other than looking a bit deviant. > >=20 > > Regards, > > Petter > >=20 > > Fr=C3=A5n: Antoni Boucher > > Skickat: den 15 december 2021 15:19 > > Till: Petter Tomner; David Malcolm; jit@gcc.gnu.org; > > gcc-patches@gcc.gnu.org > > =C3=84mne: Re: [commited] jit: Support for global rvalue initialization > > and constructors > > =C2=A0=C2=A0=C2=A0=20 > > Hi Petter. > > I believe you have forgotten the line `global:` in the file > > `gcc/jit/libgccjit.map`. > > I'm not sure what this line does, but it is there for all other > > ABI. > > David: What do you think? > > Regards. > >=20 > > Le mardi 14 d=C3=A9cembre 2021 =C3=A0 17:22 +0000, Petter Tomner via Ji= t a > > =C3=A9crit=C2=A0: > > > Hi! > > >=20 > > > I have pushed the patch for rvalue initialization and ctors for > > > libgccjit, for ABI 19. > > >=20 > > > Please see attached patch. > > >=20 > > > Regards, > > > Petter > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=20 > >=20 > > =C2=A0=C2=A0=C2=A0=20 >=20 > =C2=A0=C2=A0=C2=A0=20