On Mon, Jan 09, 2023 at 02:04:48PM +0100, Richard Biener via Gcc-patches wrote:
> On Mon, Jan 9, 2023 at 10:58 AM Jakub Jelinek <ja...@redhat.com> wrote:
> >
> > On Mon, Jan 09, 2023 at 09:05:26AM +0100, Richard Biener wrote:
> > > On Wed, Jan 4, 2023 at 9:54 AM Jose E. Marchesi via Gcc-patches
> > > <gcc-patches@gcc.gnu.org> wrote:
> > > >
> > > >
> > > > ping.
> > > > Would this be a good approach for fixing the issue?
> > >
> > > adding the is_libcall bit enlarges rtx_def by 8 bytes - there's no room 
> > > for more
> > > bits here.
> >
> > That is obviously not the way to go, sure.
> >
> > > I really wonder how other targets avoid the issue you are pointing out?
> > > Do their assemblers prune unused (extern) .global?
> >
> > I think no target solves this, if they see an extern call during expansion
> > and emit some directive for those, they emit the global or whatever 
> > directive
> > which remains there.
> >
> > If all bits for CALL_INSN are taken, can't we add a flag on the CALL
> > rtx inside of the CALL_INSN pattern?  Or a flag on the SYMBOL_REF inside of
> > it (libcalls are always direct calls, aren't they) or SYMBOL_REF_FLAGS ?
> 
> I suppose the SYMBOL_REF would be what I'd target here.  Note we already
> have
> 
> /* 1 if RTX is a symbol_ref that has been the library function in
>    emit_library_call.  */
> #define SYMBOL_REF_USED(RTX)                                            \
>   (RTL_FLAG_CHECK1 ("SYMBOL_REF_USED", (RTX), SYMBOL_REF)->used)
> 
> so can't we just use that during the final scan for the delayed assembling?

No, this one can't, it is used to avoid emitting the external directive
multiple times.  We need something next to it to identify for which symbols
that should be done.  Or of course if we are really out of bits that could
be used for it, the above could be repurposed for SYMBOL_REF_LIBCALL and
the current SYMBOL_REF_USED could be handled with a hash set.

        Jakub

Reply via email to