[PATCH] Diagnose earlier invalid inline asm constraints (PR inline-asm/84742)
Jeff Law
law@redhat.com
Thu Mar 8 20:43:00 GMT 2018
On 03/08/2018 11:19 AM, Jakub Jelinek wrote:
> Hi!
>
> We have many loops that use CONSTRAINT_LEN to skip over various constraint
> characters, but we assume the constraints have valid length and don't walk
> the individual characters to double check this.
>
> If that is not the case, when e.g. 2 character constraint starting letter
> is followed by '\0', we'd reject it early (during vregs pass, through
> asm_operand_ok). The PR has different testcase (that fails randomly based
> on ASLR), where a 2 character constraint starting letter is followed by ',',
> and several spots expect that not to happen (they count number of
> alternatives and then for each alternative walk with skipping CONSTRAINT_LEN
> characters).
>
> This patch diagnoses this problematic case early as well.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> 2018-03-08 Jakub Jelinek <jakub@redhat.com>
>
> PR inline-asm/84742
> * recog.c (asm_operand_ok): Return 0 if multi-character constraint
> has ',' character inside of it.
>
> * gcc.target/i386/pr84742-1.c: New test.
> * gcc.target/i386/pr84742-2.c: New test.
OK.
jeff
More information about the Gcc-patches
mailing list