[Bug target/97158] New: [nvptx] Error compiling atomic complex double
vries at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Sep 22 08:02:15 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97158
Bug ID: 97158
Summary: [nvptx] Error compiling atomic complex double
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: vries at gcc dot gnu.org
Target Milestone: ---
...
$ cat gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-1.c
/* Test for _Atomic in C11. Basic execution tests for atomic loads
and stores. */
/* { dg-do run } */
/* { dg-options "-std=c11 -pedantic-errors" } */
extern void abort (void);
int
main (void)
{
static volatile _Atomic (_Complex double) a;
if (a != 0)
abort ();
return 0;
}
...
We run into:
...
ptxas /tmp/cc0rIzlE.o, line 100; error : Rounding modifier required for
instruction 'cvt'
ptxas /tmp/cc0rIzlE.o, line 105; error : Rounding modifier required for
instruction 'cvt'
...
First there are two loads into u64:
...
//(insn 10 12 11 2 (set (subreg:DI (reg:TI 22 [ _1 ]) 0)
// (mem:DI (plus:DI (reg/f:DI 2 %frame)
// (const_int 16 [0x10])) [3 S8 A128])) 7 {*movdi_insn}
// (nil))
ld.u64 %r22$0, [%frame+16]; // 10 [c=12] *movdi_insn/1
//(insn 11 10 13 2 (set (subreg:DI (reg:TI 22 [ _1 ]) 8)
// (mem:DI (plus:DI (reg/f:DI 2 %frame)
// (const_int 24 [0x18])) [3 S8 A64])) 7 {*movdi_insn}
// (nil))
ld.u64 %r22$8, [%frame+24]; // 11 [c=12] *movdi_insn/1
...
and then two cvt operations from u64 to f64:
...
//(insn 13 11 14 2 (set (reg:DF 28 [ _9 ])
// (subreg:DF (reg:TI 22 [ _1 ]) 0)) 9 {*movdf_insn}
// (nil))
cvt.f64.u64 %r28, %r22$0; // 13 [c=12] *movdf_insn/0
//(insn 14 13 17 2 (set (reg:DF 29 [ _10 ])
// (subreg:DF (reg:TI 22 [ _1 ]) 8)) 9 {*movdf_insn}
// (nil))
cvt.f64.u64 %r29, %r22$8; // 14 [c=12] *movdf_insn/0
//(insn 17 14 18 2 (set (mem/c:DF (reg/f:DI 2 %frame) [2 REALPART_EXPR
<D.1263>+0 S8 A128])
// (reg:DF 28 [ _9 ])) 9 {*movdf_insn}
// (nil))
...
We should have mov.b64 instead.
More information about the Gcc-bugs
mailing list