From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D96673857C4D; Wed, 19 Aug 2020 12:59:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D96673857C4D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1597841945; bh=eQt6AtCxxupFePAT4yQ3/ryi1IWx7POZGd89kUT2+3Y=; h=From:To:Subject:Date:From; b=QuuWqvgDK6sm68sHFwDpZsE4a7bcWYOJqlEriKjk60M2Nje/F5iBC46jYh0cg5J/W 49t1IVyJLwGymL3JGCzsVj7n8loVt6xwkDI+wXxopXBJCjt99laAdjCqG+E9HT9ByB Lkq91X0mOPrTgCrvuY3KB06NQFekiAr3GMAYGjmA= From: "vries at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/96706] New: [nvptx] compilation failure of pr89663-1.c Date: Wed, 19 Aug 2020 12:59:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2020 12:59:06 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96706 Bug ID: 96706 Summary: [nvptx] compilation failure of pr89663-1.c 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: --- Consider test-case pr89663-1.c, minimized from gcc/testsuite/gcc.c-torture/compile/pr89663-1.c, and with added main: ... long lrint (); void foo (long long *p) { int n =3D 0; p[n++] =3D lrint (1); } long lrint (a) int a;=20=20 { return a + 1; } int main (void) { long long l; foo (&l); return l =3D=3D 2; } ... With gcc on x86_64, we have: ... $ gcc pr89663-1.c -fno-builtin $ ./a.out; echo $? 1 ... and: ... $ gcc pr89663-1.c pr89663-1.c: In function =E2=80=98lrint=E2=80=99: pr89663-1.c:12:7: warning: argument =E2=80=98a=E2=80=99 doesn=E2=80=99t mat= ch built-in prototype int a; ^ $ ./a.out; echo $? 1 ... With nvptx, we have: ... $ /home/vries/nvptx/mainkernel-2/build-gcc/gcc/xgcc -B/home/vries/nvptx/mainkernel-2/build-gcc/gcc/ -fdiagnostics-plain-output --sysroot=3D/home/vries/nvptx/mainkernel-2/install/nvptx-none -w -O0 -isyst= em /home/vries/nvptx/mainkernel-2/build-gcc/nvptx-none/./newlib/targ-include -isystem /home/vries/nvptx/mainkernel-2/source-gcc/newlib/libc/include -B/home/vries/nvptx/mainkernel-2/build-gcc/nvptx-none/./newlib/ -L/home/vries/nvptx/mainkernel-2/build-gcc/nvptx-none/./newlib -mmainkernel= -lm pr89663-1.c -fno-builtin $ ~/nvptx/mainkernel-2/install/bin/nvptx-none-run a.out; echo $? 1 ... and: ... $ /home/vries/nvptx/mainkernel-2/build-gcc/gcc/xgcc -B/home/vries/nvptx/mainkernel-2/build-gcc/gcc/ -fdiagnostics-plain-output --sysroot=3D/home/vries/nvptx/mainkernel-2/install/nvptx-none -w -O0 -isyst= em /home/vries/nvptx/mainkernel-2/build-gcc/nvptx-none/./newlib/targ-include -isystem /home/vries/nvptx/mainkernel-2/source-gcc/newlib/libc/include -B/home/vries/nvptx/mainkernel-2/build-gcc/nvptx-none/./newlib/ -L/home/vries/nvptx/mainkernel-2/build-gcc/nvptx-none/./newlib -mmainkernel= -lm pr89663-1.c=20 ptxas /tmp/ccbuZdU3.o, line 26; error : Arguments mismatch for instruction 'mov' ptxas /tmp/ccbuZdU3.o, line 71; error : Type of argument does not match formal parameter '%in_ar0' ptxas /tmp/ccbuZdU3.o, line 71; error : Alignment of argument does not ma= tch formal parameter '%in_ar0' ptxas fatal : Ptx assembly aborted due to errors nvptx-as: ptxas returned 255 exit status ... because: ... // BEGIN GLOBAL FUNCTION DECL: lrint=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20 .visible .func (.param.u64 %value_out) lrint (.param.f64 %in_ar0);=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 // BEGIN GLOBAL FUNCTION DEF: lrint=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20 .visible .func (.param.u64 %value_out) lrint (.param.f64 %in_ar0) { .reg.f64 %ar0;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ld.param.f64 %ar0, [%in_ar0];=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20 .reg.u32 %r25;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 mov.u32 %r25, %ar0;=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20 ... The problem is that we end up in nvptx_declare_function_name with a decl th= at has as decl args: ... arguments unit-size ... but we to emit the declaration, we use the fntype, which has arg: ... (gdb) call debug_tree (args) ...=