This is the mail archive of the
mailing list for the GCC project.
Re: Require '%' to be at the beginning of a constraint string
- From: Jeff Law <law at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, rdsandiford at googlemail dot com
- Date: Tue, 27 May 2014 11:41:54 -0600
- Subject: Re: Require '%' to be at the beginning of a constraint string
- Authentication-results: sourceware.org; auth=none
- References: <87egzokglh dot fsf at talisman dot default> <537B9911 dot 7070604 at redhat dot com> <87mwe4e46w dot fsf_-_ at talisman dot default>
On 05/26/14 13:21, Richard Sandiford wrote:
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 :-)
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?
Those ARC port bits are odd. Why in the world would someone have the
commutative modifier on the last (and only the last) alternative. Strange.
* doc/md.texi: Document that the % constraint character must
be at the beginning of the string.
* genoutput.c (validate_insn_alternatives): Check that '=',
'+' and '%' only appear at the beginning of a constraint.
* ira.c (commutative_constraint_p): Delete.
(ira_get_dup_out_num): Expect the '%' commutativity marker to be
at the start of the string.
* config/alpha/alpha.md (*movmemdi_1, *clrmemdi_1): Remove
* config/arm/neon.md (bicdi3_neon): Likewise.
* config/vax/vax.md (sbcdi3): Likewise.
* config/h8300/h8300.md (*cmpstz): Remove duplicate '+'.
* config/arc/arc.md (mulsi_600, mulsidi_600, umulsidi_600)
(mul64): Move '%' to beginning of constraint.
* config/arm/arm.md (*xordi3_insn): Likewise.
* config/nds32/nds32.md (add<mode>3, mulsi3, andsi3, iorsi3)
Regardless, this is OK. Thanks,