This is the mail archive of the
mailing list for the GCC project.
Re: [RFC PATCH] Avoid most of the BUILT_IN_*_CHKP enum values
- From: Jeff Law <law at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>, David Edelsohn <dje dot gcc at gmail dot com>, Ilya Enkovich <ilya dot enkovich at intel dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 03 Feb 2015 11:37:15 -0700
- Subject: Re: [RFC PATCH] Avoid most of the BUILT_IN_*_CHKP enum values
- Authentication-results: sourceware.org; auth=none
- References: <20150127142709 dot GF1746 at tucnak dot redhat dot com>
On 01/27/15 07:27, Jakub Jelinek wrote:
Pretty sneaky how you arrange to get the right holes so that the code in
ipa-chkp still works (oldcode + BUILTIN_CHKP_BUILTINS + 1) references.
I've grepped for BUILT_IN_.*_CHKP in the sources and we actually need
far fewer enum values than the 1204 that are being defined.
This patch requires builtins.def to say explicitly (by using
DEF_*BUILTIN_CHKP macro instead of corresponding DEF_*BUILTIN) which
ones need that, for all the others only space in the enum is reserved and
I'd hope this could work around the buggy AIX stabs handling, but even
on say x86_64-linux it has a benefit of decreasing cc1plus .debug_info
by about 2.7MB (of course, with dwz that benefit goes to almost nothing,
just the ~ 7000 bytes or so, plus .debug_str cost (that is merged even
without dwz between TUs). The cost without dwz is obviously mainly
from repeating that in most of the translation units. But why declare
BUILT_IN_*_CHKP enums that are never used by anything...
2015-01-27 Jakub Jelinek <email@example.com>
* builtins.def (DEF_BUILTIN_CHKP): Define if not defined.
(DEF_LIB_BUILTIN_CHKP, DEF_EXT_LIB_BUILTIN_CHKP): Redefine.
(DEF_CHKP_BUILTIN): Define using DEF_BUILTIN_CHKP instead
(BUILT_IN_MEMCPY, BUILT_IN_MEMMOVE, BUILT_IN_MEMSET, BUILT_IN_STRCAT,
BUILT_IN_STRCHR, BUILT_IN_STRCPY, BUILT_IN_STRLEN): Use
DEF_LIB_BUILTIN_CHKP macro instead of DEF_LIB_BUILTIN.
(BUILT_IN_MEMCPY_CHK, BUILT_IN_MEMMOVE_CHK, BUILT_IN_MEMPCPY_CHK,
BUILT_IN_MEMPCPY, BUILT_IN_MEMSET_CHK, BUILT_IN_STPCPY_CHK,
BUILT_IN_STPCPY, BUILT_IN_STRCAT_CHK, BUILT_IN_STRCPY_CHK): Use
DEF_EXT_LIB_BUILTIN_CHKP macro instead of DEF_EXT_LIB_BUILTIN.
* tree-core.h (enum built_in_function): In between
BEGIN_CHKP_BUILTINS and END_CHKP_BUILTINS only define enum values
for builtins that use DEF_BUILTIN_CHKP macro.
OK for the trunk.