From owner-freebsd-toolchain@freebsd.org Thu Mar 14 02:14:16 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 E7C521522794 for ; Thu, 14 Mar 2019 02:14:15 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic311-15.consmr.mail.bf2.yahoo.com (sonic311-15.consmr.mail.bf2.yahoo.com [74.6.131.125]) (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 91A0183D5D for ; Thu, 14 Mar 2019 02:14:14 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: 4dS44lUVM1nTR.xMPGSveJUpmWHbQdDxTpx7zBxDe1wxv_8D0LRbT5.iDq5vv0S NOfWexcv0FEfA9bfBmI_gl2YjkrJSyewlbKmo1EFudwteJtdhgXTxSsb3fkDayBJGkrlduuW2br_ aBQwIyOTy2j21mforYkLBN5bs48fhNhNAeP9IpMnn7juJ0SoZEWcxO7e1N3ccltHbO..QCa2qLtN MMyyWPna27AsRCEavc8ptWMJELmTD478M78OrVwp5FhfE7F99nGKXsErhLqfUvNyCrFNZ2ma9mf9 Bpd6Ozc5SL7m2zqlO.Mh3NMZLdZzhZc767LgiQQrPeiGHDOqdwhVOEmxyqOmjrxN4sMdRiTHI.o2 SPcgQdPjozmmwpV4cIAnjk1mI6f2iE0mGfLK_1.MyQzEiHe.JDlSQUI97AqYH1wOZxuBLVqtnpwz SUyl.qUTMKCfksVkhA9.6wl5QxgP6cbpOcJiJs.T4qJGSN3uqByuECdstYLkxgjZPNj41_fIWwji IUoexNnChsNcK0HFtgWU9oWOG9elUcLmbw56I28db9k2krxVvXUfiV5orD8k4mzQrCfDGzzcI_BQ UEdXM7C5_YXFalvxxCEupAQNb_zOBtg5m_LC6uOIANVOyt4nXNTYp5t8x77xumukLBtqwS_y17rV Xuvs2t0dZ96K473uBGFmRF7fbG7zctNk5BHjp2dlfKs_wDeM8sYOrIYyxwN5HlVcb8FSTshFFTXK V4_Cvxm4GmIyA7LEhmNdrUwBzulXOl_wpA9aTipK7kNjZhONKlpiO9J4Ao6CJBbwwU6WpvSh2fNE NaB8Dlcm5chn5RcvTinE1.Xzr81N8784fqOQbfuk1yA6TkpCJtJPDW7yuUNpx7SfbfVzQmtsss_X 1fNBumiJcmuKfjIDjI3YlvmjXcO_ZNjbu74Kk5GnToV95L9qvUgcuu71sVGoZsUSbNRXZqNuowFB r5CogOd_zYmwQI8MPi0TDTXBRDa0okRhczGwR2u8O5nqo_3HsKQCQ1SVx9duct4vcp8bk.rg19Qy CEWWvPcannOtkDWLA105x6bYeBTIZpf9RxmZ_7r4DDfTMY1RIikKK2jOKAcnNC.Qh10jggnzaTYz VRb.XJwBO_xKDn8Q- Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.bf2.yahoo.com with HTTP; Thu, 14 Mar 2019 02:14:08 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.115]) ([67.170.167.181]) by smtp421.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID f7ff231413ab9d9143064498881ad737; Thu, 14 Mar 2019 02:14:03 +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: Re: llvm submittal 41050 created for powerpc64 C++ exception code generation: ld r2,40(r1) missing or skipped before bl __cxa_begin_catch code Date: Wed, 13 Mar 2019 19:14:01 -0700 References: <0AD5D131-C5E3-424E-A276-D960ABDBDFCD@yahoo.com> To: FreeBSD Toolchain , FreeBSD PowerPC ML In-Reply-To: <0AD5D131-C5E3-424E-A276-D960ABDBDFCD@yahoo.com> Message-Id: <2429D922-3214-4D40-9616-56BC0CB93A15@yahoo.com> X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 91A0183D5D X-Spamd-Bar: ++ X-Spamd-Result: default: False [2.39 / 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)[]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; DKIM_TRACE(0.00)[yahoo.com:+]; 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:26101, ipnet:74.6.128.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)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.93)[0.932,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(1.03)[ip: (2.65), ipnet: 74.6.128.0/21(1.43), asn: 26101(1.14), country: US(-0.07)]; NEURAL_SPAM_MEDIUM(0.52)[0.523,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.41)[0.412,0]; RCVD_IN_DNSWL_NONE(0.00)[125.131.6.74.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: Thu, 14 Mar 2019 02:14:16 -0000 On 2019-Mar-12, at 22:08, Mark Millard wrote: > I have submitted: >=20 > https://bugs.llvm.org//show_bug.cgi?id=3D41050 >=20 > for the clang 8 code generation problem of > no code for setting r2 appropriately before > the: >=20 > bl . . . <00000018.plt_call.__cxa_begin_catch@@CXXABI_1.3> >=20 > in unoptimized code ( no -O ). For the -O2 code: >=20 > ld r2,40(r1) >=20 > is present but is being skipped by the libunwind return > to the code: it returns to the just-following bl > instruction (like above) instead. >=20 > In both cases: >=20 > (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 > . . . >=20 > with an inappropriate r2 value leads to jumping to > inappropriate places. >=20 > The example source code was: >=20 > #include >=20 > int main(void) > { > try { throw std::exception(); } > catch (std::exception& e) {} > return 0; > } >=20 >=20 >=20 > Note: >=20 > This is from investigations of head -r345044 using > WITH_LLVM_LIBUNWIND=3D on powerpc64. >=20 The discussion on https://bugs.llvm.org//show_bug.cgi?id=3D41050 indicates that the ld r2,??? to restore the value appropriate to the a.out code in my example should be happening via the library holding libunwind's code instead of the ld executing in the a.out code. So: thus far it is viewed as a libunwind issue instead of a clang one. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)