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: Require '%' to be at the beginning of a constraint string


On 05/28/14 13:50, Richard Sandiford wrote:
Thanks for the review.

Jeff Law <law@redhat.com> writes:
On 05/26/14 13:21, Richard Sandiford wrote:
If we're going to change it, then clearly the docs need to change and
ideally we'd statically check the port's constraints during the build
process to ensure they meet the tighter definition.

OK, how does this look?  I built a cc1 for one target per config/
directory to (try to) check that there were no remaining cases.

This means that we will silently ignore '%'s that are embedded in the
middle of an asm constraint string, but in a way that's already true for
most places that check for commutativity.  An error seems a bit extreme
when '%' is only a hint.  If we want a warning, what should the option
be called?  And should it be under -Wall, -Wextra, or on by default?

Tested on x86_64-linux-gnu.  OK to install?
OK.  My initial thought on adding a warning was to weed out bad
constraints.  You've already done that for the in-tree ports.  I'm a lot
less inclined to do much more here to help the out-of-tree ports, so
upon further review, let's not worry about the warning unless you've
already got it ready to go :-)

Well, the new genoutput.c error should catch problems in out-of-tree ports.
Right.

It's just asms where the non-initial '%'s would be silently accepted
and have no effect.
Right. And I believe that it's conservatively correct -- so we're OK here as well.


David W suggested off-list that I add "Only input operands can use
@samp{%}." to the documention as well.  That seemed like it was
obviously an improvement so I applied the patch with that change (below).
Funny I was thinking about that when looking at the arc changes. I saw the '%' on operand0 and was confused thinking it made no sense to have a '%' for an output operand. Then I realized that 0/1 were inputs and 2 was the output.

Thanks for pushing this through.

jeff


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