This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Turn check macros into functions. (issue6188088)


On 12-05-15 13:19 , Lawrence Crowl wrote:
The gcc source uses several constructs that GDB does not understand.
This patch corrects some of them.  It affects only compilers built
with ENABLE_TREE_CHECKING, and hence release compilers are unaffected.

In particular, I change the implementation of CHECK macros using
__extension__ into macros calling template inline functions.  I do not
change the accessor macros themselves.

I was going to ask you about effects on code size, but I had a clean build tree around so I could do some comparisons.


Your patch reduces code size by about 1%. Before the patch:

   text    data     bss     dec     hex filename
14,576,887          43008 1438432 16058327         f507d7 cc1
15,121,560          52048 1443504 16617112         fd8e98 f951
13,896,410          43760 1434640 15374810         ea99da jc1
13,673,077          42216 1435680 15150973         e72f7d lto1

After the patch:

$  size *1 | grep -v libgcc
   text    data     bss     dec     hex filename
14,390,489          43008 1438432 15871929         f22fb9 cc1 (-1.28%)
14,940,242          52048 1443504 16435794         faca52 f951 (-1.20%)
13,716,108          43760 1434640 15194508         e7d98c jc1 (-1.30%)
13,490,551          42216 1435680 14968447         e4667f lto1 (-1.33%)


Clearly, this will only affect binaries built with --enable-checking. But this is a good result anyway. Thanks.



Diego.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]