Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-10-12 Thread Kewen.Lin via Gcc-patches
Hi Segher! on 2022/10/10 21:58, Segher Boessenkool wrote: > On Mon, Oct 10, 2022 at 10:15:58AM +0800, Kewen.Lin wrote: >> on 2022/10/4 05:15, Segher Boessenkool wrote: >>> Right. If If mpowerpc64 is enabled while OS_MISSING_POWERPC64, warn for >>> that; >> >> Currently if option powerpc64 is ena

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-10-10 Thread Segher Boessenkool
On Mon, Oct 10, 2022 at 10:15:58AM +0800, Kewen.Lin wrote: > on 2022/10/4 05:15, Segher Boessenkool wrote: > > Right. If If mpowerpc64 is enabled while OS_MISSING_POWERPC64, warn for > > that; > > Currently if option powerpc64 is enabled explicitly while > OS_MISSING_POWERPC64, > there is no wa

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-10-09 Thread Kewen.Lin via Gcc-patches
Hi Segher! Thanks for the comments again! on 2022/10/4 05:15, Segher Boessenkool wrote: > On Fri, Sep 30, 2022 at 08:15:37PM +0800, Kewen.Lin wrote: >> on 2022/9/30 01:11, Segher Boessenkool wrote: +#ifdef OS_MISSING_POWERPC64 + else if (OS_MISSING_POWERPC64) + /* It's unexpe

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-10-03 Thread Segher Boessenkool
On Fri, Sep 30, 2022 at 08:15:37PM +0800, Kewen.Lin wrote: > on 2022/9/30 01:11, Segher Boessenkool wrote: > >> +#ifdef OS_MISSING_POWERPC64 > >> + else if (OS_MISSING_POWERPC64) > >> + /* It's unexpected to have OPTION_MASK_POWERPC64 on for OSes which > >> + miss powerpc64 support, so di

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-30 Thread Kewen.Lin via Gcc-patches
on 2022/9/30 01:11, Segher Boessenkool wrote: > On Thu, Sep 29, 2022 at 01:45:16PM +0800, Kewen.Lin wrote: >> I found this flag is mainly related to tune setting and spotted that we have >> some code >> for tune setting when no explicit cpu is given. >> >> ... >> >> else >> { >> size_

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-30 Thread Kewen.Lin via Gcc-patches
Hi Segher & Iain! on 2022/9/30 02:37, Segher Boessenkool wrote: > Hi! > > On Thu, Sep 29, 2022 at 07:25:44PM +0100, Iain Sandoe wrote: >>> On 29 Sep 2022, at 18:04, Segher Boessenkool >>> wrote: >>> On Thu, Sep 29, 2022 at 09:16:33AM +0100, Iain Sandoe wrote: Which means that we do not rep

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-29 Thread Segher Boessenkool
Hi! On Thu, Sep 29, 2022 at 02:16:04PM +0800, Kewen.Lin wrote: > >> +/* { dg-error "'-m64' requires a PowerPC64 cpu" "PR106680" { target > >> powerpc*-*-linux* powerpc-*-rtems* } 0 } */ > > > > Everything except AIX even? So it will include Darwin as well (and the > > BSDs, and powerpc*-elf, et

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-29 Thread Segher Boessenkool
On Thu, Sep 29, 2022 at 07:33:14PM +0100, Iain Sandoe wrote: > > On 29 Sep 2022, at 18:18, Segher Boessenkool > > wrote: > > On Thu, Sep 29, 2022 at 12:04:05AM +0100, Iain Sandoe wrote: > >>> On 28 Sep 2022, at 22:30, Segher Boessenkool > >>> wrote: > >>> That works on Linux as well. What stil

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-29 Thread Segher Boessenkool
Hi! On Thu, Sep 29, 2022 at 07:25:44PM +0100, Iain Sandoe wrote: > > On 29 Sep 2022, at 18:04, Segher Boessenkool > > wrote: > > On Thu, Sep 29, 2022 at 09:16:33AM +0100, Iain Sandoe wrote: > >> Which means that we do not report an error, but a warning, and then we > >> force 64b on (taking > >

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-29 Thread Iain Sandoe
Hi Segher > On 29 Sep 2022, at 18:18, Segher Boessenkool > wrote: > > On Thu, Sep 29, 2022 at 12:04:05AM +0100, Iain Sandoe wrote: >>> On 28 Sep 2022, at 22:30, Segher Boessenkool >>> wrote: >>> That works on Linux as well. What still does not work is user-mode >>> context switches in 32-bit

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-29 Thread Iain Sandoe
Hi Segher > On 29 Sep 2022, at 18:04, Segher Boessenkool > wrote: > On Thu, Sep 29, 2022 at 09:16:33AM +0100, Iain Sandoe wrote: >> OK. So one small wrinkle, >> >> Darwin already has >> >> if (TARGET_64BIT && ! TARGET_POWERPC64) >>{ >> rs6000_isa_flags |= OPTION_MASK_POWERPC64; >>

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-29 Thread Segher Boessenkool
On Thu, Sep 29, 2022 at 12:16:38AM +0100, Iain Sandoe wrote: > > On 29 Sep 2022, at 00:04, Iain Sandoe wrote: > > adding —with-tune=G5 to the configure line .. the cross-build then succeeded > > (at "-O1 -g" as I was building to debug) - maybe that will provide a clue, > > but I’m > > out of time

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-29 Thread Segher Boessenkool
On Thu, Sep 29, 2022 at 12:04:05AM +0100, Iain Sandoe wrote: > > On 28 Sep 2022, at 22:30, Segher Boessenkool > > wrote: > > That works on Linux as well. What still does not work is user-mode > > context switches in 32-bit processes (so setjmp and getcontext stuff). > > AFAIU the Darwin impl. i

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-29 Thread Segher Boessenkool
On Thu, Sep 29, 2022 at 01:45:16PM +0800, Kewen.Lin wrote: > I found this flag is mainly related to tune setting and spotted that we have > some code > for tune setting when no explicit cpu is given. > > ... > > else > { > size_t i; > enum processor_type tune_proc > = (T

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-29 Thread Segher Boessenkool
Hi! On Thu, Sep 29, 2022 at 09:16:33AM +0100, Iain Sandoe wrote: > OK. So one small wrinkle, > > Darwin already has > > if (TARGET_64BIT && ! TARGET_POWERPC64) > { > rs6000_isa_flags |= OPTION_MASK_POWERPC64; > warning (0, "%qs requires PowerPC64 architecture, enabling", "-m6

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-29 Thread Iain Sandoe
Hi Kewen, > On 29 Sep 2022, at 10:12, Kewen.Lin via Gcc-patches > wrote: > on 2022/9/29 16:16, Iain Sandoe wrote: >>> >>> I'm testing the attached diff which can be applied on top of the previous >>> proposed patch >>> on ppc64 and ppc64le, could you help to test it can fix the issue? >> >>

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-29 Thread Kewen.Lin via Gcc-patches
Hi Iain, Thanks again for your help!! on 2022/9/29 16:16, Iain Sandoe wrote: > Hi Kewen, > > thanks for looking at this! > (I suspect it would also affect a 32b linux host with a 64b multilib) > Quite reasonable suspicion. > quite likely powerpc-darwin is the only 32b ppc host in regular test

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-29 Thread Iain Sandoe
Hi Kewen, thanks for looking at this! (I suspect it would also affect a 32b linux host with a 64b multilib) quite likely powerpc-darwin is the only 32b ppc host in regular testing. > On 29 Sep 2022, at 06:45, Kewen.Lin via Gcc-patches > wrote: > > on 2022/9/29 03:09, Iain Sandoe wrote: >> Hi

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-28 Thread Kewen.Lin via Gcc-patches
Hi Segher! Thanks for the review comments!! on 2022/9/29 06:04, Segher Boessenkool wrote: > On Wed, Sep 28, 2022 at 01:30:46PM +0800, Kewen.Lin wrote: >> PR106680 shows that -m32 -mpowerpc64 is different from >> -mpowerpc64 -m32, this is determined by the way how we >> handle option powerpc64 in

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-28 Thread Kewen.Lin via Gcc-patches
Hi Iain, Thanks very much for your time!!! on 2022/9/29 03:09, Iain Sandoe wrote: > Hi Kewen > >> On 28 Sep 2022, at 17:18, Iain Sandoe wrote: >> >> (reduced CC list, if folks want to be re-included .. please add them back). >> >>> On 28 Sep 2022, at 07:37, Iain Sandoe wrote: >> On 28 Sep

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-28 Thread Iain Sandoe
> On 29 Sep 2022, at 00:04, Iain Sandoe wrote: > > adding —with-tune=G5 to the configure line .. the cross-build then succeeded > (at "-O1 -g" as I was building to debug) - maybe that will provide a clue, > but I’m > out of time for today. perhaps we also need a check that the m32 CPU has s

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-28 Thread Iain Sandoe
Hi Folks, > On 28 Sep 2022, at 22:30, Segher Boessenkool > wrote: > On Wed, Sep 28, 2022 at 05:18:47PM +0100, Iain Sandoe wrote: >>> On 28 Sep 2022, at 07:37, Iain Sandoe wrote: On 28 Sep 2022, at 06:30, Kewen.Lin via Gcc-patches wrote: >> powerpc-apple-darwin, is perhaps somewhat

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-28 Thread Segher Boessenkool
On Wed, Sep 28, 2022 at 01:30:46PM +0800, Kewen.Lin wrote: > 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. > > Segher pointed out this difference should be taken as > a bug and we s

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-28 Thread Segher Boessenkool
Hi! On Wed, Sep 28, 2022 at 05:18:47PM +0100, Iain Sandoe wrote: > > On 28 Sep 2022, at 07:37, Iain Sandoe wrote: > >> On 28 Sep 2022, at 06:30, Kewen.Lin via Gcc-patches > >> wrote: > >> PR106680 shows that -m32 -mpowerpc64 is different from > >> -mpowerpc64 -m32, this is determined by the way

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-28 Thread Iain Sandoe
Hi Kewen > On 28 Sep 2022, at 17:18, Iain Sandoe wrote: > > (reduced CC list, if folks want to be re-included .. please add them back). > >> On 28 Sep 2022, at 07:37, Iain Sandoe wrote: > >>> On 28 Sep 2022, at 06:30, Kewen.Lin via Gcc-patches >>> wrote: >> >>> PR106680 shows that -m32 -mp

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-28 Thread Iain Sandoe
(reduced CC list, if folks want to be re-included .. please add them back). > On 28 Sep 2022, at 07:37, Iain Sandoe wrote: >> On 28 Sep 2022, at 06:30, Kewen.Lin via Gcc-patches >> wrote: > >> PR106680 shows that -m32 -mpowerpc64 is different from >> -mpowerpc64 -m32, this is determined by th

Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]

2022-09-27 Thread Iain Sandoe
Hi Kewen, > On 28 Sep 2022, at 06:30, Kewen.Lin via Gcc-patches > wrote: > 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. > > Segher pointed out this difference should be taken a