2003-07-09 22:19:21

by J.A. Magallon

[permalink] [raw]
Subject: [PATCH] 2.4.22-pre3: P3 and P4 for chekc_gcc

Hi all...

Her it goes again, just the P3 and P4 part.

--- linux-2.4.21-bp1/arch/i386/Makefile.orig 2003-06-18 23:40:25.000000000 +0200
+++ linux-2.4.21-bp1/arch/i386/Makefile 2003-06-18 23:59:25.000000000 +0200
@@ -53,11 +53,11 @@
endif

ifdef CONFIG_MPENTIUMIII
-CFLAGS += -march=i686
+CFLAGS += $(call check_gcc,-march=pentium3,-march=i686)
endif

ifdef CONFIG_MPENTIUM4
-CFLAGS += -march=i686
+CFLAGS += $(call check_gcc,-march=pentium4,-march=i686)
endif

ifdef CONFIG_MK6


--
J.A. Magallon <[email protected]> \ Software is like sex:
werewolf.able.es \ It's better when it's free
Mandrake Linux release 9.2 (Cooker) for i586
Linux 2.4.22-pre2-jam1 (gcc 3.3 (Mandrake Linux 9.2 3.3-2mdk))


2003-07-09 22:48:29

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH] 2.4.22-pre3: P3 and P4 for chekc_gcc

J.A. Magallon wrote:
> --- linux-2.4.21-bp1/arch/i386/Makefile.orig 2003-06-18 23:40:25.000000000 +0200
> +++ linux-2.4.21-bp1/arch/i386/Makefile 2003-06-18 23:59:25.000000000 +0200
> @@ -53,11 +53,11 @@
> endif
>
> ifdef CONFIG_MPENTIUMIII
> -CFLAGS += -march=i686
> +CFLAGS += $(call check_gcc,-march=pentium3,-march=i686)
> endif
>
> ifdef CONFIG_MPENTIUM4
> -CFLAGS += -march=i686
> +CFLAGS += $(call check_gcc,-march=pentium4,-march=i686)
> endif


Looks ok to me (I run this patch locally, and also am the one who
submitted the check_gcc patch).

I haven't had any problems at all, but I'm curious if anyone has any
negative feedback... It's rather easy to be conservative and ignore the
patch, since -march=i686 should always work.

Jeff



2003-07-09 22:53:23

by J.A. Magallon

[permalink] [raw]
Subject: Re: [PATCH] 2.4.22-pre3: P3 and P4 for chekc_gcc


On 07.10, Jeff Garzik wrote:
> J.A. Magallon wrote:
> > --- linux-2.4.21-bp1/arch/i386/Makefile.orig 2003-06-18 23:40:25.000000000 +0200
> > +++ linux-2.4.21-bp1/arch/i386/Makefile 2003-06-18 23:59:25.000000000 +0200
> > @@ -53,11 +53,11 @@
> > endif
> >
> > ifdef CONFIG_MPENTIUMIII
> > -CFLAGS += -march=i686
> > +CFLAGS += $(call check_gcc,-march=pentium3,-march=i686)
> > endif
> >
> > ifdef CONFIG_MPENTIUM4
> > -CFLAGS += -march=i686
> > +CFLAGS += $(call check_gcc,-march=pentium4,-march=i686)
> > endif
>
>
> Looks ok to me (I run this patch locally, and also am the one who
> submitted the check_gcc patch).
>
> I haven't had any problems at all, but I'm curious if anyone has any
> negative feedback... It's rather easy to be conservative and ignore the
> patch, since -march=i686 should always work.
>

Just curious, what can go wrong ? Only if gcc has a bug when scheduling
insns for P4, for example, or if gcc spits some special that does not
work as supposed...

--
J.A. Magallon <[email protected]> \ Software is like sex:
werewolf.able.es \ It's better when it's free
Mandrake Linux release 9.2 (Cooker) for i586
Linux 2.4.22-pre2-jam1 (gcc 3.3 (Mandrake Linux 9.2 3.3-2mdk))

2003-07-09 23:25:57

by Kurt Wall

[permalink] [raw]
Subject: Re: [PATCH] 2.4.22-pre3: P3 and P4 for chekc_gcc

Quoth Jeff Garzik:
> J.A. Magallon wrote:
> >
> > ifdef CONFIG_MPENTIUMIII
> >-CFLAGS += -march=i686
> >+CFLAGS += $(call check_gcc,-march=pentium3,-march=i686)
> > endif

[...]

> I haven't had any problems at all, but I'm curious if anyone has any
> negative feedback... It's rather easy to be conservative and ignore the
> patch, since -march=i686 should always work.

No problems over here. I've been running it since it was first submitted.

Kurt
--
If God had meant for us to be in the Army, we would have been born with
green, baggy skin.

2003-07-09 23:49:49

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH] 2.4.22-pre3: P3 and P4 for chekc_gcc

J.A. Magallon wrote:
> Just curious, what can go wrong ? Only if gcc has a bug when scheduling
> insns for P4, for example, or if gcc spits some special that does not
> work as supposed...


Well, any number of things, but I admit it's mostly just general
paranoia / conservatism on my part.

In the past, on rare occasions, modification of the global CFLAGS or use
of new gcc features has led to silent miscompilation of a few drivers.

Jeff



2003-07-10 07:35:51

by Margit Schubert-While

[permalink] [raw]
Subject: Re: [PATCH] 2.4.22-pre3: P3 and P4 for chekc_gcc

Been using this in production for over 9 months.
It's interesting to note that, for AMD's, the check has been there for a
long time.

For GCC3, there is another problem.
It does not inline what it should inline.
(Classic example is the ubiquitous copy_(from/to)_user with constant size)

You need either to add "-finline-limit=<n>" to the options
and/or add this into compiler.h
+#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+#define inline __inline__ __attribute__((always_inline))
+#define __inline__ __inline__ __attribute__((always_inline))
+#define __inline __inline__ __attribute__((always_inline))
+#endif


Margit