From owner-freebsd-toolchain@freebsd.org Wed Mar 13 05:08:33 2019 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B5E61525409 for ; Wed, 13 Mar 2019 05:08:33 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic310-22.consmr.mail.gq1.yahoo.com (sonic310-22.consmr.mail.gq1.yahoo.com [98.137.69.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55FB395A85 for ; Wed, 13 Mar 2019 05:08:32 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: oMKI.N4VM1m80RvEaSPy4EcyzDfRQ4V.3ktvKOKzbRCco6OjEJdzrtIb3gvpKUz 8DLHgDQNaCpbjiZ0YOyKfuBQDykt9Hh723GNGHcB4aa00rYOcXUQJTjKHKjraFYpGf8Yeta7kePt ciGtyXoXU7ZSKiuiTsmfkADPmrbRteW.BDpNpEOHe3XN6cY2SHPRQMRcQYBaq2ad0mp049XaruwZ USIod2jOiHiR_ryPInTOplP1byyvXFy62S.LluOdEe9EGHKel28ABwZ9ek.P1KaQZPLfnW2Cs4Hp IYia_Mp6Yb.fnUVRI6MPoTYXABIaib9PGJRr.Yi292xBJG4D4P.9.LI_4RvsOpv601PVdTNbWyhq lWrQZQlw4kFxzcBmYQz9qvt_abUkO.UKI7Ao_AiM_moYUsP459EFAxaWooQ_2x.jXGu3sXXHKcPK wLRobQEMLL6n4SoLhibRS4dSpLiAZ.XavR4aYg02jbH9uY1A6j9pOzHMBHVbb0VQ8JGIyWb8KvOe JbyU7iaqWKNxJfq4SbYzjee.CMB6Dw_Q_DffuaMl033k4NMx_CSR.7R8NM2dfylo1l4stLBuYJTy yoCCLixW2HgXLnyPXNuP93tSzGOTX0KMvBfOiar_lOmI5Jg0E.eUIRkdmq1t7vl.6gq1EUvr5kRN .KyM0sMjsP757dBJEA2NZlEqwvOKadCih20MsyARvXhjOS.aanolfhNJV.GfU_6vfuYVsBM4cYtb I118qfaIvehJSxhsxb5iDm0161Ti9DlEuqLfFIoCmj_7Njjua95DgY7B7wCRZH_cyz3aJjVY0RgQ DdJb3xaP.oaUDcjpGyvOpQyCpMel2QJTUUUA7vaP893jLg0L_BL63fGZRlD6qZIkQWyUFHyywK5J sEzYb44BTXbCAOFq1U33x5EBKQBB0X3ncOXpLlElY3xZiRYy3yuQlOJpKmvx8rseABVj2Sx5Wsle .WytxpQX9nj.b30uZ8Fr0hpI.eJ7o1E17xyHzoGGnvYp9X1khwUbHf6XXJyYB44GmqMQmCz6cn7R pgJ2gIE1NhKU7JzAHzzfPHc1c7u0VJ4aT7F5W74wQxq5s5SG8HSvD0bavbTjU2EIWMBt0o59Qc9P 0Gb6K_0op Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.gq1.yahoo.com with HTTP; Wed, 13 Mar 2019 05:08:25 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.115]) ([67.170.167.181]) by smtp417.mail.gq1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 6c98a8c6421053bf4a99aad6b4df2756; Wed, 13 Mar 2019 05:08:21 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: llvm submittal 41050 created for powerpc64 C++ exception code generation: ld r2,40(r1) missing or skipped before bl __cxa_begin_catch code Message-Id: <0AD5D131-C5E3-424E-A276-D960ABDBDFCD@yahoo.com> Date: Tue, 12 Mar 2019 22:08:20 -0700 To: FreeBSD Toolchain , FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 55FB395A85 X-Spamd-Bar: / X-Spamd-Result: default: False [-0.53 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.48)[-0.476,0]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.84)[0.836,0]; NEURAL_HAM_LONG(-0.87)[-0.870,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(0.49)[ip: (0.77), ipnet: 98.137.64.0/21(0.98), asn: 36647(0.79), country: US(-0.07)]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[148.69.137.98.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Mar 2019 05:08:33 -0000 I have submitted: https://bugs.llvm.org//show_bug.cgi?id=3D41050 for the clang 8 code generation problem of no code for setting r2 appropriately before the: bl . . . <00000018.plt_call.__cxa_begin_catch@@CXXABI_1.3> in unoptimized code ( no -O ). For the -O2 code: ld r2,40(r1) is present but is being skipped by the libunwind return to the code: it returns to the just-following bl instruction (like above) instead. In both cases: (gdb) x/32i 0x100007c0 0x100007c0 <00000018.plt_call.__cxa_begin_catch@@CXXABI_1.3>: std = r2,40(r1) 0x100007c4 <00000018.plt_call.__cxa_begin_catch@@CXXABI_1.3+4>: = ld r12,-32608(r2) 0x100007c8 <00000018.plt_call.__cxa_begin_catch@@CXXABI_1.3+8>: = mtctr r12 0x100007cc <00000018.plt_call.__cxa_begin_catch@@CXXABI_1.3+12>: = ld r11,-32592(r2) 0x100007d0 <00000018.plt_call.__cxa_begin_catch@@CXXABI_1.3+16>: = ld r2,-32600(r2) 0x100007d4 <00000018.plt_call.__cxa_begin_catch@@CXXABI_1.3+20>: = bctr 0x100007d8 <00000018.plt_call.__cxa_begin_catch@@CXXABI_1.3+24>: = .long 0x0 0x100007dc <00000018.plt_call.__cxa_begin_catch@@CXXABI_1.3+28>: = .long 0x0 . . . with an inappropriate r2 value leads to jumping to inappropriate places. The example source code was: #include int main(void) { try { throw std::exception(); } catch (std::exception& e) {} return 0; } Note: This is from investigations of head -r345044 using WITH_LLVM_LIBUNWIND=3D on powerpc64. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)