From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp001-out.apm-internet.net (smtp001-out.apm-internet.net [85.119.248.222]) by sourceware.org (Postfix) with ESMTPS id 757813858016 for ; Wed, 28 Sep 2022 19:09:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 757813858016 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=sandoe.co.uk Received: (qmail 95809 invoked from network); 28 Sep 2022 19:09:02 -0000 X-APM-Out-ID: 16643921429580 X-APM-Authkey: 257869/1(257869/1) 11 Received: from unknown (HELO ?192.168.1.95?) (81.138.1.83) by smtp001.apm-internet.net with SMTP; 28 Sep 2022 19:09:02 -0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680] From: Iain Sandoe In-Reply-To: <5B4DCBBB-3237-4A9F-ACCA-6669DE6905B8@sandoe.co.uk> Date: Wed, 28 Sep 2022 20:09:01 +0100 Cc: GCC Patches , Segher Boessenkool Content-Transfer-Encoding: quoted-printable Message-Id: <92415AC8-4A5A-4119-BFCC-D7C66472F961@sandoe.co.uk> References: <9d9f1f43-b528-387d-45a7-1d89400de0fc@linux.ibm.com> <5B4DCBBB-3237-4A9F-ACCA-6669DE6905B8@sandoe.co.uk> To: "Kewen.Lin" X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00,KAM_COUK,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,KAM_SHORT,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP,WEIRD_PORT autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Kewen > On 28 Sep 2022, at 17:18, Iain Sandoe wrote: >=20 > (reduced CC list, if folks want to be re-included .. please add them = back). >=20 >> On 28 Sep 2022, at 07:37, Iain Sandoe wrote: >=20 >>> On 28 Sep 2022, at 06:30, Kewen.Lin via Gcc-patches = wrote: >>=20 >>> PR106680 shows that -m32 -mpowerpc64 is different from >>> -mpowerpc64 -m32, this is determined by the way how we >>> handle option powerpc64 in rs6000_handle_option. >>>=20 >>> Segher pointed out this difference should be taken as >>> a bug and we should ensure that option powerpc64 is >>> independent of -m32/-m64. So this patch removes the >>> handlings in rs6000_handle_option and add some necessary >>> supports in rs6000_option_override_internal instead. >>>=20 >>> With this patch, if users specify -m{no-,}powerpc64, the >>> specified value is honoured, otherwise, for 64bit it >>> always enables OPTION_MASK_POWERPC64 while for 32bit >>> it disables OPTION_MASK_POWERPC64 if OS_MISSING_POWERPC64. >>>=20 >>> Bootstrapped and regress-tested on: >>> - powerpc64-linux-gnu P7 and P8 {-m64,-m32} >>> - powerpc64le-linux-gnu P9 and P10 >>> - powerpc-ibm-aix7.2.0.0 {-maix64,-maix32} >>>=20 >>> Hi Iain, could you help to test this on darwin to ensure >>> it won't break darwin's build and new tests are fine? >>> Thanks in advance! >>=20 >> Will do, it will take a day or so, thanks, >=20 > Perhaps a small exposition on the target: >=20 > powerpc-apple-darwin, is perhaps somewhat unusual in that it is = nominally a 32b kernel, but the OS supports 64b processes on suitable = hardware (and the OS does preserve the upper bits of 64b regs in the = context). >=20 > ----- >=20 > I bootstrapped (all supported languages) and tested r13-2892 yesterday = with =E2=80=9Cnominal=E2=80=9D results. >=20 > Then I added this patch .. and did a clean bootstrap (same = configuration). >=20 > the bootstrap fails on the stage3 libgomp (building the ppc64 = multilib) with the error below > What is somewhat odd here is that libgomp is bootstrapped with the = compiler and, apparently, > openacc-init.c built OK at stage2. >=20 > =E2=80=94=E2=80=94 >=20 > Of course, powerpc-darwin is not a blocker for anything, it should not = hold you up (but sometimes it > manages to find a glitch missed elsewhere). I will try to take a look = at this this evening see if I can throw > any more light on it. >=20 > ------ >=20 > /src-local/gcc-master/libgomp/oacc-init.c:876:1: internal compiler = error: =E2=80=98global_options=E2=80=99 are modified in local context > 876 | { > | ^ > 0xe940d7 cl_optimization_compare(gcc_options*, gcc_options*) > /scratch/10-5-leo/gcc-master/gcc/options-save.cc:14082 This repeats on a cross from x86_64-darwin to powerpc-darwin .. (makes = debug a bit quicker) this is the failing case - which does not (immediately) seem directly = connected .. does it ring any bells for you? 16649 if (ptr1->x_rs6000_sched_restricted_insns_priority !=3D = ptr2->x_rs6000_sched_restricted_insns_priority) -> 16650 internal_error ("% are modified in = local context=E2=80=9D); > 0x15f8fb handle_optimize_attribute > /src-local/gcc-master/gcc/c-family/c-attribs.cc:5619 > 0x8447 decl_attributes(tree_node**, tree_node*, int, tree_node*) > /src-local/gcc-master/gcc/attribs.cc:875 > 0x307bb start_function(c_declspecs*, c_declarator*, tree_node*) > /src-local/gcc-master/gcc/c/c-decl.cc:9537 > 0xb4f27 c_parser_declaration_or_fndef > /src-local/gcc-master/gcc/c/c-parser.cc:2466 > 0xc164f c_parser_external_declaration > /src-local/gcc-master/gcc/c/c-parser.cc:1800 > 0xc2323 c_parser_translation_unit > /src-local/gcc-master/gcc/c/c-parser.cc:1666 > 0xc2323 c_parse_file() > ???:0 > 0x13a5db c_common_parse_file() > /src-local/gcc-master/gcc/c-family/c-opts.cc:1255 > Please submit a full bug report, with preprocessed source (by using = -freport-bug). > Please include the complete backtrace with any bug report. > See for instructions. >=20