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

--- Comment #4 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
Thanks, Richi, Andrew.

(In reply to Andrew Pinski from comment #2)
> I am curious is this causing an assembly failure? Or you were just curious
> about the alignment changes?

For nvptx, this doesn't cause any test suite regressions.  I just happened to
notice the difference in code generated for GCC's target libraries, which
looked like a (minor, indeed) regression.

We don't know how exactly the (proprietary) PTX/Nvidia GPU back end code
operates, how it lays out objects in memory.  GCC/nvptx isn't ELF, it's
unlikely that any such merging of 'CSWTCH'es is able to happen.

> DECL_MERGEABLE will be set on the decls also. So if you need to lower back
> when outing the decl you can check that.

Noted, thanks.  We don't "need to lower back", but maybe we should (if it's
indeed easy; I'll have a look), as the increased alignment isn't beneficial per
my understanding.  Same issue for other non-ELF targets, I suppose?

(In reply to Andrew Pinski from comment #3)
> Maybe there should be a target hook which says DECL_MERGEABLE will do
> anything here so we don't over align on targets which don't have mergeable
> cst sections.

..., so that was my next thought, whether that's worth having general
infrastructure for?

> (macho and elf are the only ones which have support that I
> know of).
> 
> Does NVPTX support mergeable constant sections/variables?

There's no such concept, as far as I know.

Reply via email to