aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/function.c8
-rw-r--r--gcc/testsuite/gcc.target/aarch64/pr98603.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/pr98603.c11
3 files changed, 28 insertions, 2 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 4b9c0a5..a3ed398 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -1785,12 +1785,16 @@ instantiate_virtual_regs_in_insn (rtx_insn *insn)
{
error_for_asm (insn, "impossible constraint in %<asm%>");
/* For asm goto, instead of fixing up all the edges
- just clear the template and clear input operands
- (asm goto doesn't have any output operands). */
+ just clear the template and clear input and output operands
+ and strip away clobbers. */
if (JUMP_P (insn))
{
rtx asm_op = extract_asm_operands (PATTERN (insn));
+ PATTERN (insn) = asm_op;
+ PUT_MODE (asm_op, VOIDmode);
ASM_OPERANDS_TEMPLATE (asm_op) = ggc_strdup ("");
+ ASM_OPERANDS_OUTPUT_CONSTRAINT (asm_op) = "";
+ ASM_OPERANDS_OUTPUT_IDX (asm_op) = 0;
ASM_OPERANDS_INPUT_VEC (asm_op) = rtvec_alloc (0);
ASM_OPERANDS_INPUT_CONSTRAINT_VEC (asm_op) = rtvec_alloc (0);
}
diff --git a/gcc/testsuite/gcc.target/aarch64/pr98603.c b/gcc/testsuite/gcc.target/aarch64/pr98603.c
new file mode 100644
index 0000000..f75d8e4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/pr98603.c
@@ -0,0 +1,11 @@
+/* PR rtl-optimization/98603 */
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+
+int
+foo (void)
+{
+ int b, c;
+ asm goto ("" : "=R" (b), "=r" (c) : : : lab); /* { dg-error "impossible constraint in 'asm'" } */
+lab:;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr98603.c b/gcc/testsuite/gcc.target/i386/pr98603.c
new file mode 100644
index 0000000..9bf924e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr98603.c
@@ -0,0 +1,11 @@
+/* PR rtl-optimization/98603 */
+/* { dg-do compile } */
+/* { dg-options "-O0 -w" } */
+
+int
+foo (void)
+{
+ int b, c;
+ asm goto ("" : "=r" (b), "=r" (c) : "I" (128) : : lab); /* { dg-error "impossible constraint in 'asm'" } */
+lab:;
+}