summaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-03-22 13:31:46 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-03-22 13:31:46 +0100
commit3c896da0fd831fac95a6e9a846bd8c19fa79f338 (patch)
tree83bdd9dd10f9471efd301496ee16442b4bd9ce58 /gcc/function.c
parentf262038551353b15dcc0720c5858249f01c8fba7 (diff)
downloadgcc-3c896da0fd831fac95a6e9a846bd8c19fa79f338.tar.gz
re PR inline-asm/84941 (internal compiler error: in reg_overlap_mentioned_p, at rtlanal.c:1870 (reg_overlap_mentioned_p()/match_asm_constraints_1()))
PR inline-asm/84941 * function.c (match_asm_constraints_1): Don't do the optimization if input isn't a REG, SUBREG, MEM or constant. * gcc.dg/pr84941.c: New test. From-SVN: r258764
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 1a09ff0d31e..485ddfbd642 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -6662,7 +6662,9 @@ match_asm_constraints_1 (rtx_insn *insn, rtx *p_sets, int noutputs)
if (! REG_P (output)
|| rtx_equal_p (output, input)
|| (GET_MODE (input) != VOIDmode
- && GET_MODE (input) != GET_MODE (output)))
+ && GET_MODE (input) != GET_MODE (output))
+ || !(REG_P (input) || SUBREG_P (input)
+ || MEM_P (input) || CONSTANT_P (input)))
continue;
/* We can't do anything if the output is also used as input,