From owner-freebsd-toolchain@freebsd.org Fri Jul 13 16:45:44 2018 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 5519510439FF for ; Fri, 13 Jul 2018 16:45:44 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE6E38E726; Fri, 13 Jul 2018 16:45:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from coleburn.home.andric.com (coleburn.home.andric.com [192.168.0.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id D0250570BC; Fri, 13 Jul 2018 18:45:41 +0200 (CEST) From: Dimitry Andric Message-Id: <51FD8F40-A5B8-4292-ACD4-A0105E428311@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_16AB790B-1DE4-4E11-A041-73E0BDB3F471"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: Clang 6.0.[01]: UNREACHABLE executed Date: Fri, 13 Jul 2018 18:45:38 +0200 In-Reply-To: <95573ED5-49CD-4BC6-863D-849C1CAA774D@FreeBSD.org> Cc: freebsd-toolchain@freebsd.org To: Jonathan Anderson References: <95573ED5-49CD-4BC6-863D-849C1CAA774D@FreeBSD.org> X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2018 16:45:44 -0000 --Apple-Mail=_16AB790B-1DE4-4E11-A041-73E0BDB3F471 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 13 Jul 2018, at 14:30, Jonathan Anderson = wrote: >=20 > I recently ran into an unreachable statement execution in Clang 6, = both > with v6.0.0 from the llvm60 package and v6.0.1 from HEAD (FreeBSD > r335799 / LLVM r335540). I don't see this issue in Clang 5 or in the > version that ships with macOS High Sierra (which they're calling = 9.1.0, > but that's apparently more of a "marketing version" than a true = version > number). >=20 > creduce managed to shrink my 2.8 MiB preprocessed sources down to a = 604 > B test case: >=20 > https://gist.github.com/trombonehero/2da555bd1292be973f9d14c843c56ae5 >=20 > This isn't a valid C++ file (e.g., it cuts off after `return o` on = line > 23), but I would expect it to cause compiler errors rather than a > compiler crash. You can see the output from the crash at: >=20 > https://gist.github.com/trombonehero/8fce4a8f39ae121a2f9f14b45b0b65a1 >=20 > Any thoughts? It doesn't crash for me, at least not with the command line you provided in the gist. It just gives a large number of parse errors: $ clang -v FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on = LLVM 6.0.0) Target: x86_64-unknown-freebsd11.2 Thread model: posix InstalledDir: /usr/bin $ clang -cc1 -triple x86_64-portbld-freebsd12.0 -emit-obj -mrelax-all = -disable-free -main-file-name test-8fd60b.cpp -mrelocation-model static = -mthread-model posix -mdisable-fp-elim -masm-verbose = -mconstructor-aliases -munwind-tables -target-cpu x86-64 = -dwarf-column-info -debugger-tuning=3Dgdb -coverage-notes-file = /usr/home/jon/Desktop/test-8fd60b.gcno -resource-dir = /usr/local/llvm60/lib/clang/6.0.0 -internal-isystem /usr/include/c++/v1 = -fdeprecated-macro -fdebug-compilation-dir /usr/home/jon/Desktop = -ferror-limit 19 -fmessage-length 80 -fobjc-runtime=3Dgnustep = -fcxx-exceptions -fexceptions -fdiagnostics-show-option = -fcolor-diagnostics -o test-8fd60b.o -x c++ foo.cpp foo.cpp:2:13: error: expected '{' after base class list struct b : a template ^ foo.cpp:2:13: error: expected ';' after struct struct b : a template ^ ; foo.cpp:4:23: error: expected ';' at end of declaration __declval() template ^ ; foo.cpp:6:36: error: expected ';' at end of declaration -> decltype(g(h...)) template ^ ; foo.cpp:8:18: error: no template named 'declval'; did you mean = '__declval'? : decltype(f(declval(), e()...)) template ^~~~~~~ __declval foo.cpp:4:12: note: '__declval' declared here __declval() template ^ foo.cpp:8:40: error: expected '{' after base class list : decltype(f(declval(), e()...)) template ^ foo.cpp:8:40: error: expected ';' after struct : decltype(f(declval(), e()...)) template ^ ; foo.cpp:10:33: error: expected ';' after struct template struct function ^ ; foo.cpp:13:6: error: unknown class name '_Rp0'; did you mean '_Rp'? :_Rp0 ^~~~ _Rp foo.cpp:11:16: note: '_Rp' declared here template ^ foo.cpp:13:10: error: expected '{' after base class list :_Rp0 ^ { foo.cpp:18:1: error: expected ')' } ^ foo.cpp:17:13: note: to match this '(' function(d ^ foo.cpp:17:15: error: expected ';' at end of declaration list function(d ^ ; foo.cpp:18:2: error: expected ';' after struct } ^ ; foo.cpp:23:17: error: expected '}' return o ^ foo.cpp:20:1: note: to match this '{' { ^ foo.cpp:13:6: error: base specifier must name a class :_Rp0 ^~~~ foo.cpp:21:23: note: in instantiation of template class 'function' requested here function n() { ^ foo.cpp:23:16: error: use of undeclared identifier 'o' return o ^ foo.cpp:23:17: error: expected '}' return o ^ foo.cpp:22:21: note: to match this '{' return [](m, m) { ^ foo.cpp:22:12: error: no viable conversion from returned value of type = '(lambda at foo.cpp:22:12)' to function return type 'function' return [](m, m) { ^~~~~~~~~~ foo.cpp:12:8: note: candidate constructor (the implicit copy = constructor) not viable: no known conversion from '(lambda at foo.cpp:22:12)' to = 'const function &' for 1st argument struct function<_Rp(k...)> ^ foo.cpp:12:8: note: candidate constructor (the implicit move = constructor) not viable: no known conversion from '(lambda at foo.cpp:22:12)' to 'function &&' for 1st argument struct function<_Rp(k...)> ^ foo.cpp:17:5: note: candidate template ignored: substitution failure = [with d =3D (lambda at foo.cpp:22:12)]: no member named 'l' in 'b >' function(d ^ foo.cpp:22:12: note: candidate function return [](m, m) { ^ foo.cpp:23:17: error: expected '}' return o ^ foo.cpp:21:27: note: to match this '{' function n() { ^ fatal error: too many errors emitted, stopping now [-ferror-limit=3D] 20 errors generated. -Dimitry --Apple-Mail=_16AB790B-1DE4-4E11-A041-73E0BDB3F471 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCW0jXMgAKCRCwXqMKLiCW o4iZAKD8TJQPmWQm6B8BA35ZkJWUYdXCAACfcrKUNsSzAI4LRSorAQNpQMk8sfU= =Gtm7 -----END PGP SIGNATURE----- --Apple-Mail=_16AB790B-1DE4-4E11-A041-73E0BDB3F471--