This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [fortran PATCH] Implement a(:,:) = 0.0 using memset
- From: Andrew Pinski <pinskia at gmail dot com>
- To: roger at eyesopen dot com
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Mon, 18 Dec 2006 10:13:53 -0800
- Subject: Re: [fortran PATCH] Implement a(:,:) = 0.0 using memset
- References: <4568.208.41.78.162.1166463384.squirrel@mail.eyesopen.com>
On Mon, 2006-12-18 at 10:36 -0700, roger@eyesopen.com wrote:
> we currently generate the following with -fdump-tree-original
>
> int8 S.0;
>
> S.0 = 1;
> while (1)
> {
> if (S.0 > 20) goto L.1; else (void) 0;
> (*a)[NON_LVALUE_EXPR <S.0> + -1] = 0;
> S.0 = S.0 + 1;
> }
> L.1:;
>
> with the patch below, we now generate this instead.
>
> (void) __builtin_memset ((void *) a, 0, 80);
This optimization should really be done in the tree level and not done
in the front-end.
In fact Thomas from SUSE has a patch to do this (based on my original
patch):
http://www.gccsummit.org/2006/view_abstract.php?content_key=27
Thanks,
Andrew Pinski