This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [patch] explicit_bzero constraint on the destination buffer



On 28/06/2018 13:05, David CARLIER wrote:
> Hi,
> 
> This is my first message but here a little patch proposal for
> explicit_bzero function.
> 
> Hope it s good.
> 
> Thanks.
> 
> Kind regards.
> 

Does it improve the generate code and/or compile support in any meaningful
way? What are you trying to accomplish by passing the memory pointer as an 
input operand? 

At least for x86_64 and aarch64 I am not seeing any code generation 
difference. For powerpc64le it seems it forces the frame-pointer to be
saved/restored on GCC 6.2.1:

$ diff -u original.S patched.S 
--- original.S  2018-06-28 14:09:55.576497556 -0300
+++ patched.S   2018-06-28 14:11:26.914362203 -0300
@@ -12,18 +12,21 @@
        addi 2,2,.TOC.-.LCF0@l
        .localentry     explicit_bzero,.-explicit_bzero
        mflr 0
+       std 31,-8(1)
        mr 5,4
        li 4,0
+       mr 31,3
        std 0,16(1)
-       stdu 1,-32(1)
+       stdu 1,-48(1)
        bl memset
        nop
-       addi 1,1,32
+       addi 1,1,48
        ld 0,16(1)
+       ld 31,-8(1)
        mtlr 0
        blr
        .long 0
-       .byte 0,0,0,1,128,0,0,0
+       .byte 0,0,0,1,128,1,0,0
        .size   explicit_bzero,.-explicit_bzero
        .ident  "GCC: (GNU) 6.2.1 20161129 [gcc-6-branch revision 242956]"
        .section        .note.GNU-stack,"",@progbits

I do not see it on GCC 8.1.1, but I sceptical this change brings any advantage.

[1] https://sourceware.org/ml/libc-alpha/2016-12/msg00537.html


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