public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Don't set x86_prefetch_sse based on -mtune= option
@ 2004-07-07 17:38 Jakub Jelinek
  2004-07-07 17:45 ` Richard Henderson
  2004-07-07 21:03 ` Jan Hubicka
  0 siblings, 2 replies; 10+ messages in thread
From: Jakub Jelinek @ 2004-07-07 17:38 UTC (permalink / raw)
  To: Richard Henderson, jh; +Cc: gcc-patches

Hi!

gcc -O2 -march=i386 -mtune=pentium4,
which ought to mean generate code which will run on any i386 compatible CPU,
but tune for P4, might use SSE prefetch instructions, which IMHO is a big
no no.  Only -march= should influence selection of instructions which aren't
available on all CPUs, -mtune= should only be about scheduling and/or
selection among instructions which are available on the -march= CPU.
Certainly e.g. VIA C3 SIGILLs on the prefetch instructions present
in -O2 -march=i386 -mtune=pentium4 compiled gcc.

Not to mention that for invalid -mtune= value this if accesses memory
past the end of processor_alias_table array.

Ok for HEAD/3.4/3.3?

2004-07-07  Jakub Jelinek  <jakub@redhat.com>

	* config/i386/i386.c (override_options): Don't set x86_prefetch_sse
	from -mtune= option.

--- gcc/config/i386/i386.c.jj	2004-06-23 23:04:17.000000000 +0200
+++ gcc/config/i386/i386.c	2004-07-07 18:32:50.771416824 +0200
@@ -1310,8 +1310,6 @@ override_options (void)
 	  error ("CPU you selected does not support x86-64 instruction set");
 	break;
       }
-  if (processor_alias_table[i].flags & PTA_PREFETCH_SSE)
-    x86_prefetch_sse = true;
   if (i == pta_size)
     error ("bad value (%s) for -mtune= switch", ix86_tune_string);
 

	Jakub

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

end of thread, other threads:[~2004-07-08 15:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-07 17:38 [PATCH] Don't set x86_prefetch_sse based on -mtune= option Jakub Jelinek
2004-07-07 17:45 ` Richard Henderson
2004-07-07 21:03 ` Jan Hubicka
2004-07-07 21:26   ` Jakub Jelinek
2004-07-08 12:02     ` Paolo Bonzini
2004-07-08 12:24       ` Paolo Bonzini
2004-07-08 12:36       ` [PATCH] Don't set x86_prefetch_sse based on -mtune= option (followup) Jakub Jelinek
2004-07-08 12:42         ` Paolo Bonzini
2004-07-08 13:12           ` Paolo Bonzini
2004-07-08 16:58         ` Richard Henderson

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