From: Jakub Jelinek Date: Tue, 6 Mar 2018 09:23:36 +0000 (+0100) Subject: re PR inline-asm/84683 (internal compiler error: in move_for_stack_reg, at reg-stack... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=155958ddfeaf5b657357440bf3127243c61cc951;p=gcc.git re PR inline-asm/84683 (internal compiler error: in move_for_stack_reg, at reg-stack.c:1173) PR inline-asm/84683 * reg-stack.c (move_for_stack_reg): If any_malformed_asm, avoid assertion failure. * g++.dg/ext/pr84683.C: New test. From-SVN: r258273 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 09123ede820..14cf229315c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2018-03-06 Jakub Jelinek + PR inline-asm/84683 + * reg-stack.c (move_for_stack_reg): If any_malformed_asm, avoid + assertion failure. + PR tree-optimization/84687 * omp-simd-clone.c (simd_clone_create): Clear DECL_BUILT_IN_CLASS on new_node->decl. diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c index 94748965ca9..82feb5d84a0 100644 --- a/gcc/reg-stack.c +++ b/gcc/reg-stack.c @@ -1170,7 +1170,8 @@ move_for_stack_reg (rtx_insn *insn, stack_ptr regstack, rtx pat) && XINT (SET_SRC (XVECEXP (pat, 0, 1)), 1) == UNSPEC_TAN) emit_swap_insn (insn, regstack, dest); else - gcc_assert (get_hard_regnum (regstack, dest) < FIRST_STACK_REG); + gcc_assert (get_hard_regnum (regstack, dest) < FIRST_STACK_REG + || any_malformed_asm); gcc_assert (regstack->top < REG_STACK_SIZE); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2e507037951..edce5a57c50 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2018-03-06 Jakub Jelinek + PR inline-asm/84683 + * g++.dg/ext/pr84683.C: New test. + PR tree-optimization/84687 * gcc.dg/pr84687.c: New test. diff --git a/gcc/testsuite/g++.dg/ext/pr84683.C b/gcc/testsuite/g++.dg/ext/pr84683.C new file mode 100644 index 00000000000..3c66bcf59ba --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/pr84683.C @@ -0,0 +1,13 @@ +// PR inline-asm/84683 +// { dg-do compile { target i?86-*-* x86_64-*-* } } +// { dg-options "-O2" } + +void +foo (float b, double c) +{ + for (int e = 0; e < 2; e++) + { + asm volatile ("" : "+f" (c)); // { dg-error "must specify a single register" } + asm ("" : "+rm" (c = b)); + } +}