From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102426 invoked by alias); 25 Feb 2015 10:28:28 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 102404 invoked by uid 89); 25 Feb 2015 10:28:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 25 Feb 2015 10:28:25 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-03.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1YQZCX-0005f0-Id from Thomas_Schwinge@mentor.com ; Wed, 25 Feb 2015 02:28:21 -0800 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-03.mgc.mentorg.com (137.202.0.108) with Microsoft SMTP Server id 14.3.224.2; Wed, 25 Feb 2015 10:28:19 +0000 From: Thomas Schwinge To: Bernd Schmidt , Jakub Jelinek CC: GCC Patches Subject: Option overriding in the offloading code path (was: [nvptx] -freorder-blocks-and-partition, -freorder-functions) In-Reply-To: <87a90klcyb.fsf@kepler.schwinge.homeip.net> References: <5454CDF1.3070307@codesourcery.com> <87fvacld85.fsf@kepler.schwinge.homeip.net> <87a90klcyb.fsf@kepler.schwinge.homeip.net> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) Date: Wed, 25 Feb 2015 10:54:00 -0000 Message-ID: <87mw429tfn.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-SW-Source: 2015-02/txt/msg01465.txt.bz2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 4371 Hi! On Wed, 11 Feb 2015 15:50:20 +0100, I wrote: > On Wed, 11 Feb 2015 15:44:26 +0100, I wrote: > > If -freorder-blocks-and-partition is active, this results in PTX code > > such as: [...] > Such partitioning might not make a lot of sense for the virtual ISA that > PTX is, but disabling it in nvptx.c:nvptx_option_override does not work. > (Because that is not invoked in the offloading code path?) I see x86 has > a ix86_option_override_internal (but I don't know how that options > processing works) -- is something like that needed for nvptx, too, and > how to interconnect that with the offloading code path? Sounds a bit > like what Jakub suggests in ? Am I on the right track with my assumption that it is correct that nvptx.c:nvptx_option_override is not invoked in the offloading code path, so we'd need a new target hook (?) to consolidate/override the options in this scenario? Using this to forcefully disable -fvar-tracking (as done in nvptx_option_override), should then allow me to drop the following beautiful specimen of a patch (which I didn't commit anywhere, so far): commit ab5a010357f4c7347dd892f3666cdeecd08cc083 Author: Thomas Schwinge Date: Mon Feb 16 13:57:08 2015 +0100 libgomp Fortran testing: for -g torture testing, disable variable track= ing. =20=20=20=20 Otherwise, the nvptx-none offloading compiler will run into issues such= as: =20=20=20=20 source-gcc/libgomp/testsuite/libgomp.fortran/examples-4/e.50.1.f90:= In function '__e_50_1_mod_MOD_vec_mult._omp_fn.1': source-gcc/libgomp/testsuite/libgomp.fortran/examples-4/e.50.1.f90:= 31:0: internal compiler error: in use_type, at var-tracking.c:5442 p(i) =3D v1(i) * v2(i) ^ 0xc4dc72 use_type source-gcc/gcc/var-tracking.c:5442 0xc504b3 add_stores source-gcc/gcc/var-tracking.c:5869 0xc4cd28 add_with_sets source-gcc/gcc/var-tracking.c:6553 0x5e9b7d cselib_record_sets source-gcc/gcc/cselib.c:2574 0x5ea8a7 cselib_process_insn(rtx_insn*) source-gcc/gcc/cselib.c:2686 0xc586a3 vt_initialize source-gcc/gcc/var-tracking.c:10126 0xc65a8e variable_tracking_main_1 source-gcc/gcc/var-tracking.c:10322 0xc65a8e variable_tracking_main source-gcc/gcc/var-tracking.c:10375 0xc65a8e execute source-gcc/gcc/var-tracking.c:10412 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. mkoffload: fatal error: install/offload-nvptx-none/bin//x86_64-unkn= own-linux-gnu-accel-nvptx-none-gcc returned 1 exit status --- libgomp/testsuite/libgomp.fortran/fortran.exp | 3 +++ libgomp/testsuite/libgomp.oacc-fortran/fortran.exp | 3 +++ 2 files changed, 6 insertions(+) diff --git libgomp/testsuite/libgomp.fortran/fortran.exp libgomp/testsuite/= libgomp.fortran/fortran.exp index 9e6b643..0b597e6 100644 --- libgomp/testsuite/libgomp.fortran/fortran.exp +++ libgomp/testsuite/libgomp.fortran/fortran.exp @@ -21,6 +21,9 @@ dg-init # Turn on OpenMP. lappend ALWAYS_CFLAGS "additional_flags=3D-fopenmp" =20 +# TODO: for -g torture testing, disable variable tracking. +regsub -all -- { -g[^ ]*} $DG_TORTURE_OPTIONS {& -fno-var-tracking} DG_TOR= TURE_OPTIONS + if { $blddir !=3D "" } { set lang_source_re {^.*\.[fF](|90|95|03|08)$} set lang_include_flags "-fintrinsic-modules-path=3D${blddir}" diff --git libgomp/testsuite/libgomp.oacc-fortran/fortran.exp libgomp/tests= uite/libgomp.oacc-fortran/fortran.exp index a8f62e8..080a7b9 100644 --- libgomp/testsuite/libgomp.oacc-fortran/fortran.exp +++ libgomp/testsuite/libgomp.oacc-fortran/fortran.exp @@ -23,6 +23,9 @@ dg-init # Turn on OpenACC. lappend ALWAYS_CFLAGS "additional_flags=3D-fopenacc" =20 +# TODO: for -g torture testing, disable variable tracking. +regsub -all -- { -g[^ ]*} $DG_TORTURE_OPTIONS {& -fno-var-tracking} DG_TOR= TURE_OPTIONS + if { $blddir !=3D "" } { set lang_source_re {^.*\.[fF](|90|95|03|08)$} set lang_include_flags "-fintrinsic-modules-path=3D${blddir}" Gr=C3=BC=C3=9Fe, Thomas --=-=-= Content-Type: application/pgp-signature; name="signature.asc" Content-length: 472 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJU7aO8AAoJEK3/DN1sMFFtyJEH/1JfovJHDzOOJay9lZZ9dQ/k vjQOrFUMR/Pa1J1uQkx4amN+3G/ffSRrTscCY5zF7HJAU9soZEUJvyEolh2+qGwi 7AucrTq8gCOsvX4RxTg120VxKg3Jc6i51QyfJnhM8/1xtLfwxTGueBAtEXHR//V8 Rn+o33Gy3V5bYX+tm83eLIWaETOwyFs5BxSZYqvBHZIkfeK4rlnN0xt8bGC8EQQa 8aRzfvaF8QJ5G4AWLtdPXOUTbsXK9rR3d5Mip9VoIWCAPwo2ksGIpoxy8PD6scy5 B1nucU/CG3ZGSxvapbfs9hgE1RTrrKp+GJ/hj/E/Z3JjNLlqr6mP5IeMnBW9ljw= =cqLT -----END PGP SIGNATURE----- --=-=-=--