This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fail on invalid operand code in mips_print_operand


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]