public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Kewen.Lin" <linkw@linux.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Iain Sandoe <iain@sandoe.co.uk>, GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] rs6000: Rework option -mpowerpc64 handling [PR106680]
Date: Wed, 12 Oct 2022 16:26:21 +0800	[thread overview]
Message-ID: <8624a8c5-9c8d-418d-0e3b-7ad0f7017638@linux.ibm.com> (raw)
In-Reply-To: <20221010135829.GA25951@gate.crashing.org>

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 enabled explicitly while OS_MISSING_POWERPC64,
>> there is no warning.  One typical case is -m32 compilation on ppc64.  I made
>> a patch to warn for this case as you suggested (btw, this change can be taken
>> separately from this rework), it caused some test cases to fail as below:
> 
> "Explicitly" means the user says "-m32 -mpowerpc64".
> 
> I wonder what "on powerpc64" means in what you say, and why that would
> matter?

I guess you meant to ask "on ppc64"?  I meant to say "ppc64-linux", sorry
for the confusion.  On ppc64-linux, OS_MISSING_POWERPC64 is defined as
!TARGET_64BIT, the explicit option "-m32 -mpowerpc64" doesn't warn before
but it's made to warn as the patch mentioned above, then need some test
cases updates.

> 
>> gcc.dg/vect/vect-82_64.c
>> gcc.dg/vect/vect-83_64.c
>> gcc.target/powerpc/bswap64-4.c
>> gcc.target/powerpc/ppc64-double-1.c
>> gcc.target/powerpc/pr106680-4.c 
>> gcc.target/powerpc/rs6000-fpint-2.c
>>
>> It's fine to fix them with one additional option "-w" to disable the warning.
>> But IIUC one concern is that if we want to test with "--target_board=unix'{-m32,
>> -m32/-mpowerpc64}'", the latter combination will always have this warning,
>> with one extra "-w" (that is -m32/-mpowerpc64/-w) can make some cases which
>> aim to check warning msg ineffective.  So maybe we want to re-consider it
>> (like just leaving it as before)?
> 
> There will always be false positives (and negatives!) if you put any
> warning options in RUNTESTFLAGS.  -w is merely louder than most :-)
> 
> But leave this as further improvement.  Maybe put in a comment.

OK.

> 
>>> and if mpowerpc64 was only implicit, disable it as well (and say
>>> we did!)
>>
>> But on ppc64 linux, for -m32 compilation mpowerpc64 is implicitly enabled
>> since it's with bi-arch supported, I made a patch to disable it as well as
>> warn it, it can't be bootstrapped since it warned for -m32 build (-Werror)
>> and failed.  So I refined it to something like:
>>
>> +          /* With RS6000_BI_ARCH defined (bi-architecture (32/64) supported),
>> +             TARGET_DEFAULT has bit MASK_POWERPC64 on by default, to keep the
>> +             behavior consistent (like: no warnings for -m32 on ppc64), we
>> +             just sliently disable it.  Otherwise, disable it and warn.  */
>> +          rs6000_isa_flags &= ~OPTION_MASK_POWERPC64;
>> +#ifndef RS6000_BI_ARCH
>> +          warning (0, "powerpc64 is unexpected to be enabled on the "
>> +                      "current OS");
>> +#endif
> 
> It has nothing to do with biarch.  Let's just not warn if it is so much
> work to do it correctly.  We never did before, and no one complained,
> how bad can it be :-)
> 

OK, I made a patch v2 which doesn't try to warn for them, fully tested it
and just posted at:

https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603350.html

BR,
Kewen

  reply	other threads:[~2022-10-12  8:26 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-28  5:30 Kewen.Lin
2022-09-28  6:37 ` Iain Sandoe
2022-09-28 16:18   ` Iain Sandoe
2022-09-28 19:09     ` Iain Sandoe
2022-09-29  5:45       ` Kewen.Lin
2022-09-29  8:16         ` Iain Sandoe
2022-09-29  9:12           ` Kewen.Lin
2022-09-29 16:14             ` Iain Sandoe
2022-09-29 17:04           ` Segher Boessenkool
2022-09-29 18:25             ` Iain Sandoe
2022-09-29 18:37               ` Segher Boessenkool
2022-09-30  9:26                 ` Kewen.Lin
2022-09-29 17:11         ` Segher Boessenkool
2022-09-30 12:15           ` Kewen.Lin
2022-10-03 21:15             ` Segher Boessenkool
2022-10-10  2:15               ` Kewen.Lin
2022-10-10 13:58                 ` Segher Boessenkool
2022-10-12  8:26                   ` Kewen.Lin [this message]
2022-09-28 21:30     ` Segher Boessenkool
2022-09-28 23:04       ` Iain Sandoe
2022-09-28 23:16         ` Iain Sandoe
2022-09-29 17:26           ` Segher Boessenkool
2022-09-29 17:18         ` Segher Boessenkool
2022-09-29 18:33           ` Iain Sandoe
2022-09-29 18:50             ` Segher Boessenkool
2022-09-28 22:04 ` Segher Boessenkool
2022-09-29  6:16   ` Kewen.Lin
2022-09-29 18:56     ` Segher Boessenkool

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8624a8c5-9c8d-418d-0e3b-7ad0f7017638@linux.ibm.com \
    --to=linkw@linux.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iain@sandoe.co.uk \
    --cc=segher@kernel.crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).