From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 35C80386EC57; Wed, 19 Aug 2020 13:58:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 35C80386EC57 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1597845496; bh=0PW1Rsnq2a6s33nCmMs7EVkWn1/Saof5q6Ngpfo7l6I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hQ93Sbhp20+g2dgFtstzi1H/dK16eC9STVzcxeSLrgbByPWk+VvkssIRjGTHuhHSz pdqBEKDQqsetu1DcQX0NKaYfkNHPDszsOL2MfG559q0s2vK9/FIUjJMTBLQAR7HraH NXMi8uXBsf/FZM2YYId7HH3BCWwUUf4HQrw1kcXY= From: "vries at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/96706] [nvptx] compilation failure of pr89663-1.c Date: Wed, 19 Aug 2020 13:58:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: cf_gcctarget Message-ID: In-Reply-To: References: 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 13:58:16 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96706 Tom de Vries changed: What |Removed |Added ---------------------------------------------------------------------------- Target| |nvptx --- Comment #1 from Tom de Vries --- Tentative patch: ... diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index 39d0275493a..7ad9ab326d0 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -895,12 +895,12 @@ write_fn_proto (std::stringstream &s, bool is_defn, NULL in DECL_ARGUMENTS, for builtin functions without another declaration. So we have to pick the best one we have. */ - tree args =3D TYPE_ARG_TYPES (fntype); - bool prototyped =3D true; + tree args =3D DECL_ARGUMENTS (decl); + bool prototyped =3D false; if (!args) { - args =3D DECL_ARGUMENTS (decl); - prototyped =3D false; + args =3D TYPE_ARG_TYPES (fntype); + prototyped =3D true; } for (; args; args =3D TREE_CHAIN (args), not_atomic_weak_arg--) @@ -1304,12 +1304,12 @@ nvptx_declare_function_name (FILE *file, const char *name, const_tree decl) argno =3D write_arg_type (s, 0, argno, ptr_type_node, true); /* Declare and initialize incoming arguments. */ - tree args =3D TYPE_ARG_TYPES (fntype); - bool prototyped =3D true; + tree args =3D DECL_ARGUMENTS (decl); + bool prototyped =3D false; if (!args) { - args =3D DECL_ARGUMENTS (decl); - prototyped =3D false; + args =3D TYPE_ARG_TYPES (fntype); + prototyped =3D true; } for (; args !=3D NULL_TREE; args =3D TREE_CHAIN (args)) ...=