https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61577

--- Comment #175 from Peter Bisroev <peter.bisroev at groundlabs dot com> ---
(In reply to dave.anglin from comment #173)
> On 2020-02-13 1:11 p.m., peter.bisroev at groundlabs dot com wrote:
> > If I try to compare this to aCC dump in attachment 47840 [details], I do 
> > not see any
> > calls to weak. Equivalent section to the above dump in gimple-expr.s
> > (_Z18tree_operand_checkPK9tree_nodeiPKciS3_) can be found on line 9007, also
> > gimple-expr.o.objdump on line 2099. I believe the place where with gcc we
> > expect to see a call to tree_operand_length() through PCREL21B reloc, aCC 
> > does
> > similar thing in gimple-expr.s line 9098 (gimple-expr.o.objdump line 2181).
> I looked at the definition and branches to
> _Z18tree_operand_checkPK9tree_nodeiPKciS3_
> in the gimple-expr.s file that you uploaded.
> 
> We have the following:
> 
>         .type   _Z18tree_operand_checkPK9tree_nodeiPKciS3_,@function
>         .global _Z18tree_operand_checkPK9tree_nodeiPKciS3_
> 
>         .size   _Z18tree_operand_checkPK9tree_nodeiPKciS3_, 784
> // Routine [id=0064] ( tree_operand_check )
> 
> // ===
>         .secalias .abe$170.text, ".text"
>         .section .abe$170.text = "axC", "progbits", .abe$comdat0010
>         .align  16
>         .proc   _Z18tree_operand_checkPK9tree_nodeiPKciS3_
> ..L0:
> //      $start          ARid768 =               ;; // A
> 
> ..L2:
> _Z18tree_operand_checkPK9tree_nodeiPKciS3_::
> .prologue
> //      $entry          ARid770, S:r32, S:r33, S:r34, S:r35, S:r36 =  ;; //
> A [tree.h: 3177/1]
> //file/line/col tree.h/3177/1
> .save ar.pfs, r39
>         alloc           r39 = ar.pfs, 5, 4, 5, 0   // M [tree.h: 3177/1]
> <snip>
>         br.ret.dptk.many rp                     ;; // B [tree.h: 3181/3]
> 
> ..L1:
> //      $end                                    ;; // A
> 
>         .endp   _Z18tree_operand_checkPK9tree_nodeiPKciS3_
> 
>         nop.m           0                          // M
>         nop.i           0                          // I
>         nop.m           0                          // M
>         nop.m           0                          // M
>         br.call.dptk.many rp = _Z18tree_operand_checkPK9tree_nodeiPKciS3_#
> ;; // B [gimple-expr.c: 658/3]
>         add             r9 = 0, r8                 // M [gimple-expr.c:
> 658/3]
> 
>         .secalias .abe$comdat0010,
> "_Z18tree_operand_checkPK9tree_nodeiPKciS3_"
> 
> The first thing to note is aCC doesn't use weak.  Instead, it uses COMDAT
> sections.  Probably, HP ld does support
> weak but it's unlikely there is support for linkonce sections.  See defines
> in config/pa/som.h.  There we implimented
> one only support using the linker's COMDAT support.
> 
> Regarding the call to _Z18tree_operand_checkPK9tree_nodeiPKciS3_, this is
> preceeded by a bunch of nops.  This is
> probably to allow linker to modify call should it select a different
> instance of _Z18tree_operand_checkPK9tree_nodeiPKciS3_.

Thank you for the explanation Dave!

I have tried playing around with weak using aCC, however even though it accepts
both attribute and pragma (and complains if you misspell "weak"), both compiler
and linker seem to ignore it. But I might have made some mistake there, will
double check tonight.

Reply via email to