On 14/06/2021 13:36, Julian Brown wrote:
On Wed, 9 Jun 2021 16:47:21 +0200
Marcel Vollweiler <mar...@codesourcery.com> wrote:

This patch fixes an issue with global_load assembler functions leading
to a "invalid operand for instruction" error since in different LLVM
versions those functions use either one or two registers.

LLVM is neither forward- nor backward-compatible with regards to those
registers then, I guess? That's unfortunate...

In this patch a compatibility check is added to the configure.ac.

The implementation of the solution looks fine, but I worry it's the
wrong approach. What would someone packing GCC for a distribution use
for the configuration setting? It'd mean having a dependency on the
exact LLVM version for a given offloading-compiler build -- so LLVM
couldn't be upgraded separately from the offloading compiler. Maybe
that's OK in practice?

Isn't that true of every configure test? They configure the built binary to work with what's there right now?

This will only be a problem, in practice, when upgrading from LLVM 11 to LLVM 12, and most distros will do that *before* upgrading to GCC 12. The real problem is that GCC 11 will be broken in the meantime (I guess we have to backport this to GCC 11.2, too.)

I wonder if the LLVM assembler has a macro system we could abuse
instead? Perhaps not. Or another (very ugly) alternative that would work
with either assembler is giving up and emitting the instruction bit
patterns directly (as we have done elsewhere for certain "SCC"-setting
instructions).

I'm not aware of anything.

Andrew

Reply via email to