Subject: Re: GCC 2.95

From: Philip Blundell <[email-masked]>
Date: Tue, 07 Sep 1999 20:42:43 +0100

BTW, if you use the 2.95 or 2.95.1 release, you should try to add this patch 
from CVS:

Thu Sep  2 00:06:43 1999  Jeffrey A Law  ([email-masked])

	* fold-const.c (fold_range_test): Do not try to fold the range
	test if the rhs or lhs has side effects.

It fixes a bug that caused miscompilation of one small part of the kernel.  
It's unlikely to affect anything other that device drivers, but you never know.

As to binutils, the default is for gcc 2.95.x to expect binutils 2.9.1.0.x 
(get whatever the latest is).  The 2.9.5.0.x branch of binutils is somewhat 
less buggy and you might like to try that instead though it has a few gotchas 
of its own (see the archives of this mailing list for details).

p.

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Erik Mouw <[email-masked]>
Date: Wed, 8 Sep 99 10:28:07 +0200

> It's unlikely to affect anything other that device drivers, but you never know.

You mean that it fixes the problem that the kernel can't mount its root
filesystem (which is a ramdisk in my case)?

Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2785859  Fax: +31-15-2781843  Email [email-masked]
WWW: http://www-ict.its.tudelft.nl/~erik/

---

From: Philip Blundell <[email-masked]>
Date: Wed, 08 Sep 1999 09:49:22 +0100

>filesystem (which is a ramdisk in my case)?

I doubt it.  It seems unlikely the ramdisk would be affected by this bug.

p.

---

From: Francois Desloges <[email-masked]>
Date: Thu, 9 Sep 1999 08:52:02 -0400

> 	test if the rhs or lhs has side effects.

How do I access/use a CVS and how do I add a patch ?

Oh and BTW, the official linux kernel use an even/odd number system for the
production/development version of its kernel.  Do the ARM branch follow such a
rule? Or are some 2.2.x arm-linux patched kernel more on the "development" side
as well?

--
François Desloges
[email-masked]

---

From: Francois Desloges <[email-masked]>
Date: Thu, 16 Sep 1999 13:45:03 -0400

> of its own (see the archives of this mailing list for details).

Ok! I'm in the process of building gcc 2.95.1. I've applied Philip's
gcc-2.95-diff-990730 patch and perform the #if 0 to # if 1 switch in
gcc/config/arm/linux-elf.h as recommended in
http://www.tazenda.demon.co.uk/phil/armlinux.

Now, what about that extra CVS patch? Where is this CVS thing and how do I
apply the patch ?

And what about these 2.9.5.0.x binutils gotchas?
Is this only the #if 0 to #if 1 switch or more?
I use binutils 2.9.5.0.11 whitout any patches as stated by Philip.
I've look in the mailing list up to June whitout finding any thing very
relevant. Except may be this, dating from Aug 07, from Philip:

>This is the one issue that makes me reluctant to tell everyone to throw away 
>binutils 2.9.1 and use 2.9.5 instead.  Basically, owing to a series of fairly 
>uninteresting slip-ups, we have ended up in a situation where binutils 
>2.9.5 is not 100% compatible with the older versions.  Normal programs 
>shouldn't care but gcc and glibc need to know the difference.
>
>I hope it will be fixed in glibc before 2.1.2 is actually released, though I 
>can't make any promise.
>
>As a side note, I am about to change the mainline egcs sources so that a 
>target name of `arm-*-linux-gnu' implies binutils 2.9.5, and a target name of 
>`arm-*-linux-gnuoldld' implies an older version.  Config.guess can tell the 
>difference so there should be no reason for concern unless you set target 
>names by hand.  This will probably end up being backported to my 2.9.5 
>patchset sooner or later.

Was that finally done?

---

From: Philip Blundell <[email-masked]>
Date: Thu, 16 Sep 1999 20:11:36 +0100

>Now, what about that extra CVS patch? Where is this CVS thing and how do I

I've appended the patch in question below.  See the GCC web site if you are 
interested in CVS access.

>>I hope it will be fixed in glibc before 2.1.2 is actually released, though 
>>I can't make any promise.

This was indeed fixed in glibc 2.1.2.

>>As a side note, I am about to change the mainline egcs sources so that
>>a target name of `arm-*-linux-gnu' implies binutils 2.9.5, and a target
>>name of `arm-*-linux-gnuoldld' implies an older version.

This is true in the GCC mainline now, though config.guess has not yet been 
updated.  It is not in the 2.95 branch but when I get around to making a new 
2.95.x patch (hopefully within a couple of days) it will be in there.

p.

Index: fold-const.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/fold-const.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -p -r1.69 -r1.70
--- fold-const.c	1999/08/27 07:37:16	1.69
+++ fold-const.c	1999/09/02 09:37:20	1.70
@@ -3560,6 +3560,10 @@ fold_range_test (exp)
   tree rhs = make_range (TREE_OPERAND (exp, 1), &in1_p, &low1, &high1);
   tree tem;
 
+  /* Fail if anything is volatile.  */
+  if (TREE_SIDE_EFFECTS (lhs) || TREE_SIDE_EFFECTS (rhs))
+    return 0;
+
   /* If this is an OR operation, invert both sides; we will invert
      again at the end.  */
   if (or_op)