public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rin at NetBSD dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/100108] New: [10 Regression] powerpc: recognize 32-bit CPU as POWER9 with -misel option
Date: Fri, 16 Apr 2021 02:02:23 +0000	[thread overview]
Message-ID: <bug-100108-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100108

            Bug ID: 100108
           Summary: [10 Regression] powerpc: recognize 32-bit CPU as
                    POWER9 with -misel option
           Product: gcc
           Version: 10.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rin at NetBSD dot org
  Target Milestone: ---

Created attachment 50609
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50609&action=edit
Fix for this regression

GCC10 wrongly recognizes CPU as POWER9 if -misel is specified, even when
it is configured for 32-bit processors:

% cat test.c
int main(void)
{
        return 0;
}
% gcc10 -misel -S test.c -o test10.S
% gcc9  -misel -S test.c -o test9.S
% diff -u test9.S test10.S
--- test.9      2021-04-16 10:53:47.116917225 +0900
+++ test.10     2021-04-16 10:53:38.075282430 +0900
@@ -1,5 +1,5 @@
        .file   "test.c"
-       .machine ppc
+       .machine power9
        .section        ".text"
        .align 2
        .globl main
...(snip)...

This is because rs6000_machine_from_flags() assumes ISEL instructions
are supported only by POWER9 and successors. However, ISEL is also
implemented for 32-bit processors like e500.

Please apply the attached patch to fix the problem.

----

% gcc10 -v
Using built-in specs.
COLLECT_GCC=/build/tools.broken/bin/powerpc--netbsd-gcc
COLLECT_LTO_WRAPPER=/build/tools.broken/libexec/gcc/powerpc--netbsd/10.3.0/lto-wrapper
Target: powerpc--netbsd
Configured with: /usr/src/tools/gcc/../../external/gpl3/gcc/dist/configure
--target=powerpc--netbsd --enable-long-long --enable-threads
--with-bugurl=http://www.NetBSD.org/support/send-pr.html
--with-pkgversion='NetBSD nb1 20210411' --with-system-zlib --without-isl
--enable-__cxa_atexit --enable-libstdcxx-time=rt --enable-libstdcxx-threads
--with-diagnostics-color=auto-if-env --with-default-libstdcxx-abi=new
--with-sysroot=/build/dest/evbppc-powerpc --with-mpc=/build/tools.broken
--with-mpfr=/build/tools.broken --with-gmp=/build/tools.broken --disable-nls
--disable-multilib --program-transform-name='s,^,powerpc--netbsd-,'
--enable-languages='c c++ objc' --prefix=/build/tools.broken
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.3.0 (NetBSD nb1 20210411)

----

% gcc9 -v
Using built-in specs.
COLLECT_GCC=/build/tools.9/bin/powerpc--netbsd-gcc
COLLECT_LTO_WRAPPER=/build/tools.9/libexec/gcc/powerpc--netbsd/9.3.0/lto-wrapper
Target: powerpc--netbsd
Configured with: /usr/src/tools/gcc/../../external/gpl3/gcc.old/dist/configure
--target=powerpc--netbsd --enable-long-long --enable-threads
--with-bugurl=http://www.NetBSD.org/support/send-pr.html
--with-pkgversion='NetBSD nb1 20200907' --with-system-zlib --without-isl
--enable-__cxa_atexit --enable-libstdcxx-time=rt --enable-libstdcxx-threads
--with-diagnostics-color=auto-if-env --with-default-libstdcxx-abi=new
--with-sysroot=/build/dest/evbppc-powerpc --with-mpc=/build/tools.9
--with-mpfr=/build/tools.9 --with-gmp=/build/tools.9 --disable-nls
--disable-multilib --program-transform-name='s,^,powerpc--netbsd-,'
--enable-languages='c c++ objc' --prefix=/build/tools.9
Thread model: posix
gcc version 9.3.0 (NetBSD nb1 20200907)

             reply	other threads:[~2021-04-16  2:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16  2:02 rin at NetBSD dot org [this message]
2021-04-16  7:33 ` [Bug target/100108] [10/11 " rguenth at gcc dot gnu.org
2021-04-16 13:16 ` pinskia at gcc dot gnu.org
2021-04-16 13:50 ` rin at NetBSD dot org
2021-04-19 14:32 ` jakub at gcc dot gnu.org
2021-04-19 14:52 ` segher at gcc dot gnu.org
2021-04-19 14:59 ` segher at gcc dot gnu.org
2021-04-19 15:00 ` segher at gcc dot gnu.org
2021-04-19 15:03 ` jakub at gcc dot gnu.org
2021-04-20  1:02 ` rin at NetBSD dot org
2021-04-20 13:43 ` [Bug target/100108] [10/11/12 " cvs-commit at gcc dot gnu.org
2021-04-20 13:55 ` cvs-commit at gcc dot gnu.org
2021-04-20 14:58 ` [Bug target/100108] [10 " segher at gcc dot gnu.org
2021-04-22  0:49 ` rin at NetBSD dot org
2021-05-10 22:00 ` cvs-commit at gcc dot gnu.org
2021-05-10 22:01 ` segher at gcc dot gnu.org

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=bug-100108-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).