This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, rs6000] Fix PR56010 and PR83743, -mcpu=native use wrong names


On 1/29/18 6:30 PM, Segher Boessenkool wrote:
> On Mon, Jan 29, 2018 at 02:54:15PM -0600, Peter Bergner wrote:
> Why don't you want that?  It let's the compiler say "hey silly human who
> can hardly type his own name correctly(*), you meant -mcpu-power8 where
> you said -mcpu=poewr8".  It's a quite useful feature.  Also amusing in
> the cases where it fails spectacularly :-)>
> Plus, removing support for that would be a regression.

We don't want it, because we're only in this code if the user typed
-mcpu=native (a valid option) and the kernel gave us something we don't
know/understand.  If instead the user typed -mcpu=<unknown cpu>, then they
will go thru the opts-common.c code I showed and get the same error they've
always gotten, so it's not a regression.

For example, the new error when using -mcpu=native gives:

gcc -S -O1 -mcpu=native simple.c
xgcc: fatal error: Unsupported cpu name returned from kernel for -mcpu=native: power9
Please use an explicit cpu name.  Valid cpu names are: 401 403 405 405fp 440 440fp 464 464fp 476 476fp 505 601 602 603 603e 604 604e 620 630 740 7400 7450 750 801 821 823 8540 8548 a2 e300c2 e300c3 e500mc e500mc64 e5500 e6500 860 970 cell ec603e G3 G4 G5 titan power3 power4 power5 power5+ power6 power6x power7 power8 powerpc powerpc64 powerpc64le rs64
compilation terminated.

While -mcpu=<unknown cpu>, you get the old error:

gcc -S -O1 -mcpu=foobar simple.c
xgcc: error: unrecognized argument in option ‘-mcpu=foobar’
xgcc: note: valid arguments to ‘-mcpu=’ are: 401 403 405 405fp 440 440fp 464 464fp 476 476fp 505 601 602 603 603e 604 604e 620 630 740 7400 7450 750 801 821 823 8540 8548 860 970 G3 G4 G5 a2 cell e300c2 e300c3 e500mc e500mc64 e5500 e6500 ec603e native power3 power4 power5 power5+ power6 power6x power7 power8 powerpc powerpc64 powerpc64le rs64 titan


Peter


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]