Commit 8d0d7a63 by Jakub Jelinek Committed by Jakub Jelinek

re PR inline-asm/92615 (ICE in extract_insn)

	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.

	* gcc.target/i386/pr92615.c: New test.

From-SVN: r278642
parent 1fbf51cb
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.
......@@ -20819,11 +20819,15 @@ ix86_md_asm_adjust (vec<rtx> &outputs, vec<rtx> &/*inputs*/,
{
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.
......
/* 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));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment