This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fail on invalid operand code in mips_print_operand
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Adam Nemet <anemet at caviumnetworks dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 12 May 2009 21:32:28 +0100
- Subject: Re: [PATCH] Fail on invalid operand code in mips_print_operand
- References: <18953.36435.163645.726315@ropi.home>
Adam Nemet <anemet@caviumnetworks.com> writes:
> This has bitten me when I added the "m" operand code. I was merging a patch
> and forgot to update mips_print_operand. mips_print_operand happily printed
> the original constant value rather than the value minus one.
>
> The patch below adds more checking to prevent this in the future.
>
> Regtested on mipsisa64r2-elfoabi{,-mips16}.
>
> OK to install?
Looks good. And I agree that, as far as the recognised letters go,
we should be careful about accepting %L, %M and %D, since they affect
the meaning of the operand.
I'm just a little bit worried about rejecting %z for memory operands.
%z seems at most redundant in that case, and I can imagine some inline
asms accidentally use %z for things that can be memories.
What do you think? I don't have a strong opinion, just though I'd
raise the question.
(A version that allows '%z' for memories is preapproved though.)
Richard