[Bug target/100217] [11/12 Regression] ICE when building valgrind testsuite with -march=z14 since r11-7552

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Apr 23 11:27:34 GMT 2021


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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Ilya Leoshkevich from comment #5)
> That would be an ideal solution, but I wonder how to implement it? Suppose
> we find a way to convince expand to pick FPRX2mode for such a long double.
> What if the following comes up?
> 
> register long double x asm ("v0");  /* FPRX2mode */
> long double y;                      /* TFmode */
> x += y;                             /* convert? */
> 
> Would it be feasible to also teach expand to do the mode conversions?

It is certainly doable, but perhaps with extra target hooks or something
similar.
Types have their TYPE_MODE and decls have DECL_MODE, though the question is
what breaks if TYPE_MODE != DECL_MODE, at least the comment in tree.h says that
they can only differ for FIELD_DECLs.  Anyway, in GIMPLE register vars are
non-SSA, so apart from inline asm one needs separate loads and stores to them,
so if we could expand those as having FPRX2 hard reg and loads from it convert
to TFmode and stores into it convert from TFmode, ...

> One other alternative might be to detect `register long double asm("fN")`
> declarations and go back to using floating point register pairs for
> functions that contain them.

But this might be actually best short-time solution (for GCC 11.x).


More information about the Gcc-bugs mailing list