From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 37F203857C60; Fri, 17 Sep 2021 14:15:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 37F203857C60 From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/102347] "fatal error: target specific builtin not available" with MMA and LTO Date: Fri, 17 Sep 2021 14:15:29 +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: 10.3.1 X-Bugzilla-Keywords: lto X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: linkw at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: Fri, 17 Sep 2021 14:15:30 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102347 --- Comment #6 from Martin Li=C5=A1ka --- Quickly looking at the rs6000 code, it fails here: #1 0x0000000011a0993c in rs6000_invalid_builtin (fncode=3DMMA_BUILTIN_DISASSEMBLE_ACC_INTERNAL) at ../../gcc/config/rs6000/rs6000-call.c:11643 #2 0x0000000011a13134 in rs6000_builtin_decl (code=3D1603, initialize_p=3D= true) at ../../gcc/config/rs6000/rs6000-call.c:13870 #3 0x00000000115c3900 in unpack_ts_function_decl_value_fields (bp=3D0x3fffffffe2f0, expr=3D0x3fffaf195700) at ../../gcc/tree-streamer-in.= c:361 #4 0x00000000115c4790 in streamer_read_tree_bitfields (ib=3D0x3fffffffe6a0, data_in=3D0x132d1910, expr=3D0x3fffaf195700) at ../../gcc/tree-streamer-in.= c:528 #5 0x0000000010deaa28 in lto_read_tree_1 (ib=3D0x3fffffffe6a0, data_in=3D0x132d1910, expr=3D0x3fffaf195700) at ../../gcc/lto-streamer-in.c= :1697 which relies on rs6000_builtin_mask. Note the mask is set here: rs6000_builtin_mask =3D rs6000_builtin_mask_calculate (); where rs6000_builtin_mask_calculate is based on TARGET_* values. I think the mask check should be deferred later as it should be based on pr= oper target_node that is set via rs6000_set_current_function. It should not check it in lto_read_tree_1.=