This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PING [PATCH] treat -Wxxx-larger-than=HWI_MAX special (PR 86631)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Martin Sebor <msebor at gmail dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Jakub Jelinek <jakub at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 2 Aug 2018 16:34:25 +0000
- Subject: Re: PING [PATCH] treat -Wxxx-larger-than=HWI_MAX special (PR 86631)
- References: <fc296cec-7948-5f9f-c241-bd7a5e1b715a@gmail.com> <CAFiYyc1EHG0YGKVvOPc8QyUWy2dc0+f_5ubcqxZsJLX2GsSz-A@mail.gmail.com> <07254dc1-f173-321e-390b-1d79044a5727@gmail.com> <20180725145724.GR17988@tucnak> <3a5817e7-b766-3183-d119-f21bf6fbb838@gmail.com> <CAFiYyc1z6GF8LZ4BpmBJ_wCpeDSiS=kEYoNS0QoqSPBtLzaPxg@mail.gmail.com> <89ad68dc-d98b-8832-adc6-839e82953433@gmail.com> <d92657fa-e665-9065-ab86-ac9e8dcbdf3b@gmail.com> <45e4ec55-f576-43f8-0282-1135ba8b126f@gmail.com>
On Wed, 1 Aug 2018, Martin Sebor wrote:
> Richard, do you have any further comments or suggestions or is
> the patch acceptable?
>
> I realize it's not ideal but I don't see how to achieve the ideal
> (understanding PTRDIFF_MAX) without deferring the processing of
> these options until the back end has been initialized. It would
> still mean setting aside some special value, traversing options
> again, looking for the Host_Wide_Int ones with the special value,
> and replacing it with the value of PTRDIFF_MAX. That doesn't seem
> any cleaner than the current solution, just a lot more work (not
> just to implement but for the compiler to go through at startup).
>
> Joseph, can you think of anything better?
>
> https://gcc.gnu.org/ml/gcc-patches/2018-07/msg01455.html
I think the cleanest option for accepting symbolic values would require
options accepting such a value in addition to numeric arguments to have
additional data allocated (effectively storing both a numeric argument and
an Enum argument), and then the late initialization as noted to set the
numeric value based on the Enum argument if one was given. As noted,
that's significant extra complexity.
--
Joseph S. Myers
joseph@codesourcery.com