public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] rs6000: Set rs6000_cpu correctly (PR43871)
@ 2017-11-30 16:32 Segher Boessenkool
  2017-12-02 18:56 ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: Segher Boessenkool @ 2017-11-30 16:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: dje.gcc, Segher Boessenkool

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rs6000: Set rs6000_cpu correctly (PR43871)
  2017-11-30 16:32 [PATCH] rs6000: Set rs6000_cpu correctly (PR43871) Segher Boessenkool
@ 2017-12-02 18:56 ` Andreas Schwab
  2017-12-02 22:41   ` David Edelsohn
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2017-12-02 18:56 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: gcc-patches, dje.gcc

configured by ../configure, generated by GNU Autoconf 2.64,
  with options " '--prefix=/usr' '--build=powerpc64-suse-linux' '--enable-checking=release' '--enable-shared' 'CFLAGS=-O2 -g' 'CXXFLAGS=-O2 -g' '--with-cpu-64=power4' '--enable-secureplt' '--with-long-double-128' '--with-system-zlib' '--disable-bootstrap' 'build_alias=powerpc64-suse-linux' '--enable-languages=c,lto'"

configure:3475: /daten/gcc/test/Build/./gcc/xgcc -B/daten/gcc/test/Build/./gcc/ -B/usr/powerpc64-suse-linux/bin/ -B/usr/powerpc64-suse-linux/lib/ -isystem /usr/powerpc64-suse-linux/include -isystem /usr/powerpc64-suse-linux/sys-include  -m32 -o conftest -O2 -g   conftest.c  >&5
cc1: internal compiler error: in rs6000_option_override_internal, at config/rs6000/rs6000.c:4187
0x10a8fdab rs6000_option_override_internal
	../../gcc/config/rs6000/rs6000.c:4187
0x1017460b process_options
	../../gcc/toplev.c:1234
0x1017460b do_compile
	../../gcc/toplev.c:2015

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rs6000: Set rs6000_cpu correctly (PR43871)
  2017-12-02 18:56 ` Andreas Schwab
@ 2017-12-02 22:41   ` David Edelsohn
  2017-12-02 22:53     ` Segher Boessenkool
  0 siblings, 1 reply; 4+ messages in thread
From: David Edelsohn @ 2017-12-02 22:41 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: GCC Patches, Andreas Schwab

On Sat, Dec 2, 2017 at 1:56 PM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> configured by ../configure, generated by GNU Autoconf 2.64,
>   with options " '--prefix=/usr' '--build=powerpc64-suse-linux' '--enable-checking=release' '--enable-shared' 'CFLAGS=-O2 -g' 'CXXFLAGS=-O2 -g' '--with-cpu-64=power4' '--enable-secureplt' '--with-long-double-128' '--with-system-zlib' '--disable-bootstrap' 'build_alias=powerpc64-suse-linux' '--enable-languages=c,lto'"
>
> configure:3475: /daten/gcc/test/Build/./gcc/xgcc -B/daten/gcc/test/Build/./gcc/ -B/usr/powerpc64-suse-linux/bin/ -B/usr/powerpc64-suse-linux/lib/ -isystem /usr/powerpc64-suse-linux/include -isystem /usr/powerpc64-suse-linux/sys-include  -m32 -o conftest -O2 -g   conftest.c  >&5
> cc1: internal compiler error: in rs6000_option_override_internal, at config/rs6000/rs6000.c:4187
> 0x10a8fdab rs6000_option_override_internal
>         ../../gcc/config/rs6000/rs6000.c:4187
> 0x1017460b process_options
>         ../../gcc/toplev.c:1234
> 0x1017460b do_compile
>         ../../gcc/toplev.c:2015


This broke bootstrap on AIX similarly.

Thanks, David

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rs6000: Set rs6000_cpu correctly (PR43871)
  2017-12-02 22:41   ` David Edelsohn
@ 2017-12-02 22:53     ` Segher Boessenkool
  0 siblings, 0 replies; 4+ messages in thread
From: Segher Boessenkool @ 2017-12-02 22:53 UTC (permalink / raw)
  To: David Edelsohn; +Cc: GCC Patches, Andreas Schwab

On Sat, Dec 02, 2017 at 05:41:20PM -0500, David Edelsohn wrote:
> On Sat, Dec 2, 2017 at 1:56 PM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> > configured by ../configure, generated by GNU Autoconf 2.64,
> >   with options " '--prefix=/usr' '--build=powerpc64-suse-linux' '--enable-checking=release' '--enable-shared' 'CFLAGS=-O2 -g' 'CXXFLAGS=-O2 -g' '--with-cpu-64=power4' '--enable-secureplt' '--with-long-double-128' '--with-system-zlib' '--disable-bootstrap' 'build_alias=powerpc64-suse-linux' '--enable-languages=c,lto'"
> >
> > configure:3475: /daten/gcc/test/Build/./gcc/xgcc -B/daten/gcc/test/Build/./gcc/ -B/usr/powerpc64-suse-linux/bin/ -B/usr/powerpc64-suse-linux/lib/ -isystem /usr/powerpc64-suse-linux/include -isystem /usr/powerpc64-suse-linux/sys-include  -m32 -o conftest -O2 -g   conftest.c  >&5
> > cc1: internal compiler error: in rs6000_option_override_internal, at config/rs6000/rs6000.c:4187
> > 0x10a8fdab rs6000_option_override_internal
> >         ../../gcc/config/rs6000/rs6000.c:4187
> > 0x1017460b process_options
> >         ../../gcc/toplev.c:1234
> > 0x1017460b do_compile
> >         ../../gcc/toplev.c:2015
> 
> 
> This broke bootstrap on AIX similarly.

It was too good to be true, a simple two-liner would solve this, heh.

I think I know what to do (needs testing, will be tomorrow at earliest);
but deeper investigation shows we use rs6000_cpu in quite a few places
where we mean rs6000_tune (which doesn't exist).  I don't know how deep
this pit is.  Feel free to revert my patch (if it takes too long to fix
this, I'll revert it myself).

Sorry :-/


Segher

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-12-02 22:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-30 16:32 [PATCH] rs6000: Set rs6000_cpu correctly (PR43871) Segher Boessenkool
2017-12-02 18:56 ` Andreas Schwab
2017-12-02 22:41   ` David Edelsohn
2017-12-02 22:53     ` Segher Boessenkool

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).