Am 05.08.24 um 15:59 schrieb Stefan Schulze Frielinghaus:
On Mon, Aug 05, 2024 at 02:19:50PM +0200, Georg-Johann Lay wrote:
Am 05.08.24 um 12:28 schrieb Stefan Schulze Frielinghaus:
This is rather unfortunate but I couldn't find a way how to validate
register names during genoutput.  If no one else has an idea I will
replace gcc_assert with a more expressive error message.

[ADDITIONAL_]REGISTER_NAMES isn't available?  Though using that might
bypass the effect of target hooks like TARGET_CONDITIONAL_REGISTER_USAGE.

REGISTER_NAMES references sometimes target variables (see rs6000 e.g.)
which aren't linked into genoutput and are therefore unavailable.

But there are also cases with an asm operand print modifier; you cannot
check that, it's checked by TARGET_PRINT_OPERAND etc. which get a
hard register and not a string for a register name.

Maybe genoutput could add additional information to insn-output.cc or
whatever, and the compiler proper checks that and emits diagnostics
as needed?

Though, this would be a run-time check, right?  I was actually hoping
for a "compile-time" check, i.e., something which errors while compiling
GCC and not when GCC is executed.  The latter is already implemented.

Yes, it would be a run-time check.  As compiler options may be involved,
that's perhaps the only way.

Though such a test would always run, independent of the code being
compiled, so any problem would pop up immediately, e.g.self-test.
Hence not some nasty ICE that only triggers with specific code in
user land.  The runtime overhead would be negligible.

Johann

Reply via email to