This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Support simd function declarations via a pre-include.
- From: Martin Liška <mliska at suse dot cz>
- To: Bernhard Reutner-Fischer <rep dot dot dot nop at gmail dot com>, Jakub Jelinek <jakub at redhat dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, Thomas Koenig <tkoenig at netcologne dot de>, Toon Moene <toon at moene dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 19 Nov 2018 13:14:21 +0100
- Subject: Re: [PATCH] Support simd function declarations via a pre-include.
- References: <D6325C52-AE0D-49DB-86A2-F5CBDE6BAC0B@gmail.com> <916e3e10-e020-f4f3-6f8e-c57909c81d55@suse.cz> <CAFiYyc14yjzAojw0o+mJoLvBwobLGhN1ppLKHOt56wan_-ApZw@mail.gmail.com> <20181112163347.4cc3537e@nbbrfq.loc> <CAFiYyc1cczXvCf1v4PPhHVmuvT_W8RuU+8R05vjuJ=_c_nP-6w@mail.gmail.com> <0e9bfe91-eed3-f6e0-9cb6-97c615325fa6@suse.cz> <20181114113527.GP11625@tucnak> <B084CBFD-AAEF-4B6E-9AA5-86F4251C616F@gmail.com> <20181115205423.GC11625@tucnak> <041fb30d-f232-d526-0d8a-275d5ceafa2d@suse.cz> <20181116134952.GI11625@tucnak> <9979fb3e-f010-a48a-8ab7-55017d2d4c81@suse.cz> <E9B34A2F-95C6-40B7-A060-86F1A71E620C@gmail.com>
On 11/17/18 7:16 PM, Bernhard Reutner-Fischer wrote:
> Hi
>
>> I'm sending version, I changed the container to hash_map that should
>> provide
>> faster look up.
>>
>> I've been testing the patch right now.
>
> In find_fortran_preinclude_file() you allocate the filename.
Sure, but that's driver allocation and apparently valgrind
is not complaining about the memory allocation.
>
> diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
> index 55d6dafdb5d..4e500f88174 100644
> --- a/gcc/fortran/scanner.c
> +++ b/gcc/fortran/scanner.c
> @@ -2428,6 +2428,10 @@ gfc_new_file (void)
> {
> bool result;
>
> + if (flag_pre_include != NULL
> + && !load_file (flag_pre_include, NULL, false))
> + exit (FATAL_EXIT_CODE);
> +
> if (gfc_cpp_enabled ())
> {
> result = gfc_cpp_preprocess (gfc_source_file);
>
>
> Don't you leak the filename here?
This string is in FE, which lives in a option string pool.
Martin
> I.e.
> else free()
>
> thanks,
>