if (def_insn->is_artificial ())
return false;
+ /* Do not propagate asms. The only kind of propagation that would
+ succeed is propagation into a register move. Such a propagation
+ is neutral if the destination of the move is a pseudo and unnecessarily
+ restricts the register allocator if the destination of the move is
+ a hard register.
+
+ Furthermore, unlike for a normal instruction, we cannot take a SET from an
+ asm and try dropping the CLOBBERs. The recog process does not (and should
+ not try to) second-guess whether what the user wrote can be changed and
+ so it has to assume that any asm given to it is a fair reflection of
+ what the user wrote. */
+ if (def_insn->is_asm ())
+ return false;
+
rtx_insn *def_rtl = def_insn->rtl ();
if (!NONJUMP_INSN_P (def_rtl))
return false;
--- /dev/null
+/* { dg-options "-O" } */
+
+struct s128 {
+ long a, b;
+};
+
+struct s128 foo(void) {
+ struct s128 ret;
+ asm("mov %0, #0 \n\t"
+ "mov %R0, #0 \n\t"
+ "mov x0, #12345"
+ : "=r" (ret) : : "x0");
+ return ret;
+}
+
+/* { dg-final { scan-assembler-not {mov x0, #0} } } */