This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR target/21299 (reload accepting invalid asm)
Richard Sandiford <richard@codesourcery.com> writes:
> I'm happy with that. But I was trying to pin down what the rules were
> so that we can enforce those same rules for user asms. So if that's
> the rule, then I think we should be checking something like:
>
> "Two register class constraints may not be used in the same
> alternative for a value of mode M if the backend allows values
> of mode M to be stored in a register that straddles both classes."
>
> Hopefully that's a more general fix than the ones suggested so far.
My thinking is that the documentation should simply say: we recommend
that you do not use more than one register class in a constraint. If
you think you need to, you are most likely doing something wrong.
I don't think we should enforce anything like this in the compiler.
Gcc's inline assembler extension has historically permitted a great
deal of chumminess between the compiler implementation and the code.
This obviously has problems, like the fact that most people write
inline assembler incorrectly. But I don't think we should take small
steps to try to fix that problem: I think small steps would simply be
irritating to the expert and unhelpful to the novice. There have been
sketches of how to improve inline assembler in the past, but as far as
I know nobody has both the interest and the time to work on them.
Ian