2019-11-23 Jakub Jelinek <jakub@redhat.com>
+ PR target/92615
+ * config/i386/i386.c (ix86_md_asm_adjust): If dest_mode is
+ GET_MODE (dest), is not QImode, using ZERO_EXTEND and dest is not
+ register_operand, force x into register before storing it into dest.
+ Formatting fix.
+
PR middle-end/83859
* doc/extend.texi (attribute access): Fix a typo.
{
x = force_reg (dest_mode, const0_rtx);
- emit_insn (gen_movstrictqi
- (gen_lowpart (QImode, x), destqi));
+ emit_insn (gen_movstrictqi (gen_lowpart (QImode, x), destqi));
}
else
- x = gen_rtx_ZERO_EXTEND (dest_mode, destqi);
+ {
+ x = gen_rtx_ZERO_EXTEND (dest_mode, destqi);
+ if (dest_mode == GET_MODE (dest)
+ && !register_operand (dest, GET_MODE (dest)))
+ x = force_reg (dest_mode, x);
+ }
}
if (dest_mode != GET_MODE (dest))
2019-11-23 Jakub Jelinek <jakub@redhat.com>
+ PR target/92615
+ * gcc.target/i386/pr92615.c: New test.
+
PR rtl-optimization/92610
* g++.dg/opt/pr92610.C: New test.
--- /dev/null
+/* PR target/92615 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void *a;
+long long b;
+char c;
+
+void
+foo (void)
+{
+ void *p;
+ long long q;
+ char r;
+ __asm__ ("" : : "r" (&p), "r" (&q), "r" (&r));
+ __asm__ ("" : "=@cca" (p));
+ a = p;
+ __asm__ ("" : "=@cca" (q));
+ b = q;
+ __asm__ ("" : "=@cca" (r));
+ c = r;
+ __asm__ ("" : : "r" (&p), "r" (&q), "r" (&r));
+}
+
+void
+bar (void)
+{
+ void *p;
+ long long q;
+ char r;
+ __asm__ ("" : "=@cca" (p));
+ a = p;
+ __asm__ ("" : "=@cca" (q));
+ b = q;
+ __asm__ ("" : "=@cca" (r));
+ c = r;
+ __asm__ ("" : : "r" (p), "A" (q), "q" (r));
+}
+
+void
+baz (void)
+{
+ void *p = (void *) &p;
+ __asm__ __volatile__ ("" : "=@ccng" (p) : "r" (1));
+}