diff options
author | Jakub Jelinek <jakub@redhat.com> | 2015-04-17 18:43:28 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2015-04-17 18:43:28 +0200 |
commit | 98c1627cb57af18a873847eda17b5a15e7cec03a (patch) | |
tree | ea89bc53cc7f08fb1d28f5bca8fb11c0881cf295 /gcc/stmt.c | |
parent | 96583f22d708d874ca90a012d8587e7ad484faed (diff) | |
download | gcc-98c1627cb57af18a873847eda17b5a15e7cec03a.zip gcc-98c1627cb57af18a873847eda17b5a15e7cec03a.tar.gz gcc-98c1627cb57af18a873847eda17b5a15e7cec03a.tar.bz2 |
re PR target/65689 ([AArch64] S constraint fails for inline asm at -O0)
PR target/65689
* genpreds.c (struct constraint_data): Add maybe_allows_reg and
maybe_allows_mem bitfields.
(maybe_allows_none_start, maybe_allows_none_end,
maybe_allows_reg_start, maybe_allows_reg_end, maybe_allows_mem_start,
maybe_allows_mem_end): New variables.
(compute_maybe_allows): New function.
(add_constraint): Use it to initialize maybe_allows_reg and
maybe_allows_mem fields.
(choose_enum_order): Sort the non-is_register/is_const_int/is_memory/
is_address constraints such that those that allow neither mem nor
reg come first, then those that only allow reg but not mem, then
those that only allow mem but not reg, then the rest.
(write_allows_reg_mem_function): New function.
(write_tm_preds_h): Call it.
* stmt.c (parse_output_constraint, parse_input_constraint): Use
the generated insn_extra_constraint_allows_reg_mem function
instead of always setting *allows_reg = true; *allows_mem = true;
for unknown extra constraints.
* gcc.target/aarch64/c-output-template-4.c: New test.
From-SVN: r222186
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r-- | gcc/stmt.c | 16 |
1 files changed, 2 insertions, 14 deletions
@@ -342,13 +342,7 @@ parse_output_constraint (const char **constraint_p, int operand_num, else if (insn_extra_memory_constraint (cn)) *allows_mem = true; else - { - /* Otherwise we can't assume anything about the nature of - the constraint except that it isn't purely registers. - Treat it like "g" and hope for the best. */ - *allows_reg = true; - *allows_mem = true; - } + insn_extra_constraint_allows_reg_mem (cn, allows_reg, allows_mem); break; } @@ -465,13 +459,7 @@ parse_input_constraint (const char **constraint_p, int input_num, else if (insn_extra_memory_constraint (cn)) *allows_mem = true; else - { - /* Otherwise we can't assume anything about the nature of - the constraint except that it isn't purely registers. - Treat it like "g" and hope for the best. */ - *allows_reg = true; - *allows_mem = true; - } + insn_extra_constraint_allows_reg_mem (cn, allows_reg, allows_mem); break; } |