public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: gcc-patches@gcc.gnu.org
Cc: dje.gcc@gmail.com,	Segher Boessenkool <segher@kernel.crashing.org>
Subject: [PATCH] rs6000: Set rs6000_cpu correctly (PR43871)
Date: Thu, 30 Nov 2017 16:32:00 -0000	[thread overview]
Message-ID: <b2b3437da934358d760b13c58ae83939374aad1a.1512058731.git.segher@kernel.crashing.org> (raw)

We set rs6000_cpu based on tune_index, but it should be cpu_index.
This patch fixes it.

Tested on powerpc64-linux {-m32,-m64}.  I'll commit this later today,
and schedule backports for next week.  Unless it is all terribly wrong
and someone complains :-)


Segher


2017-11-30  Segher Boessenkool  <segher@kernel.crashing.org>

	PR target/43871
	* config/rs6000/rs6000.c (rs6000_option_override_internal): Set
	rs6000_cpu based on cpu_index, not tune_index.

---
 gcc/config/rs6000/rs6000.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 9929a45..9c0df9a 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -4183,8 +4183,8 @@ rs6000_option_override_internal (bool global_init_p)
 	  }
     }
 
-  gcc_assert (tune_index >= 0);
-  rs6000_cpu = processor_target_table[tune_index].processor;
+  gcc_assert (cpu_index >= 0);
+  rs6000_cpu = processor_target_table[cpu_index].processor;
 
   if (rs6000_cpu == PROCESSOR_PPCE300C2 || rs6000_cpu == PROCESSOR_PPCE300C3
       || rs6000_cpu == PROCESSOR_PPCE500MC || rs6000_cpu == PROCESSOR_PPCE500MC64
-- 
1.8.3.1

             reply	other threads:[~2017-11-30 16:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-30 16:32 Segher Boessenkool [this message]
2017-12-02 18:56 ` Andreas Schwab
2017-12-02 22:41   ` David Edelsohn
2017-12-02 22:53     ` 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=b2b3437da934358d760b13c58ae83939374aad1a.1512058731.git.segher@kernel.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@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).