From: Simon Wright <simon@pushface.org>
Subject: Re: avoiding builtin memset
Date: Wed, 26 Apr 2017 08:35:05 +0100
Date: 2017-04-26T08:35:05+01:00 [thread overview]
Message-ID: <lya8737hau.fsf@pushface.org> (raw)
In-Reply-To: 20287957.514851298.264687.laguest-archeia.com@nntp.aioe.org
Luke A. Guest <laguest@archeia.com> writes:
> Shark8 <onewingedshark@gmail.com> wrote:
>
>>> You'll need to export that as the C memset function.
>>
>> Even if you're only using it in Ada functions?
>
>
> Yup, GNAT expects certain functions to be present and generates calls
> to them. Check system.ads for mention of allowing assignment, that
> basically calls memcpy on assignment for objects that require a memory
> copy rather than a register to register copy.
Not quite sure this is set in system.ads: in the 6.1 sources, the only
reference to memset in the compiler itself is in exp_aggr.adb,
-- The ultimate goal is to generate a call to a fast memset routine
-- specifically optimized for the target.
function Aggr_Assignment_OK_For_Backend (N : Node_Id) return Boolean is
whereas for System.Support_Composite_Assign there is in sem_ch5.adb
-- Check for non-allowed composite assignment
if not Support_Composite_Assign_On_Target
and then (Is_Array_Type (T1) or else Is_Record_Type (T1))
and then (not Has_Size_Clause (T1) or else Esize (T1) > 64)
then
Error_Msg_CRT ("composite assignment", N);
end if;
(don't like the look of that 'Esize (T1) > 64'!)
next prev parent reply other threads:[~2017-04-26 7:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-24 16:06 avoiding builtin memset Jere
2017-04-24 16:56 ` Shark8
2017-04-25 1:21 ` Anh Vo
2017-04-25 2:57 ` Luke A. Guest
2017-04-25 18:43 ` Shark8
2017-04-25 22:18 ` Luke A. Guest
2017-04-26 7:35 ` Simon Wright [this message]
2017-04-26 13:44 ` Lucretia
2017-04-26 15:22 ` Simon Wright
2017-04-27 0:22 ` Jere
2017-04-27 4:35 ` J-P. Rosen
2017-04-27 7:09 ` Simon Wright
2017-05-24 15:08 ` Frédéric PRACA
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox