This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] work around gcc 3.3.4 ICE on armeb (PR23256)


On Sat, Aug 13, 2005 at 05:40:54PM -0400, Mike Frysinger wrote:

> i just started developing on armeb so i havent done any glibc work
> yet (which i assume is what you're working with)

Yeah, glibc here.

It turns out that gcc 3.3.3 miscompiles itself when TARGET_CPU_arm6
is used.  (gcc 3.3.3 with TARGET_CPU_arm6 also gives a nice ICE during
compilation of glibc 2.3.2.)  gcc 3.3.3 used TARGET_CPU_arm7tdmi as
default, which works fine, but the patch that went in between 3.3.3
and 3.3.4 to fix PR12527 switched the default to TARGET_CPU_arm6.

The 3.3 gcc branch is closed, so there's no hope of this ever getting
fixed in an official release, but I decided to add a note to PR12527
and PR23256 about this anyway, just in case anyone else runs into it.


> i used to play with 3.3.[3-6] on arm/glibc but that was too much of a
> pain so i've switched to 3.4.4 now

What other issues were you seeing?  debian sarge uses gcc 3.3.5 and
they seem happy with that.

Dan, would you consider adding the attached patch to crosstool?


cheers,
Lennert


$ cat crosstool-0.38/patches/gcc-3.3.4/gcc-3.3.4-pr23256.patch
On big-endian ARM platforms, gcc 3.3.x miscompiles itself, glibc,
and potentially other programs as well, when SUBTARGET_CPU_DEFAULT
is TARGET_CPU_arm6.

As gcc 3.3.4 switched the default to TARGET_CPU_arm6, this causes gcc
3.3.[456] to fail to compile itself on armeb.  gcc 3.3.3 and earlier
(inadvertently, see PR12527) defaulted to TARGET_CPU_arm7tdmi, which
prevents this miscompilation from occuring.

We don't know what exactly goes wrong when TARGET_CPU_arm6 is used, but
we do know for sure that it's this hunk that triggers the miscompilation,
so let's just change the default back to arm7tdmi so that everyone can
be happy once again.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>


--- gcc-3.3.4/gcc/config/arm/linux-elf.h.orig	2005-08-14 20:58:17.000000000 +0200
+++ gcc-3.3.4/gcc/config/arm/linux-elf.h	2005-08-14 20:58:24.000000000 +0200
@@ -48,7 +48,7 @@
 #undef  TARGET_DEFAULT
 #define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS | TARGET_ENDIAN_DEFAULT)
 
-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm7tdmi
 
 #define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
 

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]