This commit is contained in:
Juergen Daubert 2006-03-15 19:00:12 +00:00
parent 8538898507
commit cb53a9a96b
3 changed files with 37 additions and 4 deletions

View File

@ -1 +1,2 @@
31e541f9ac2c8613bc92b91db453f0a9 gcc-4.0.3-latentbug-addrefvars.patch
6ff1af12c53cbb3f79b27f2d6a9a3d50 gcc-4.0.3.tar.bz2

View File

@ -4,10 +4,15 @@
name=gcc
version=4.0.3
release=1
source=(ftp://sources.redhat.com/pub/gcc/releases/$name-$version/$name-$version.tar.bz2)
release=2
source=(ftp://sources.redhat.com/pub/gcc/releases/$name-$version/$name-$version.tar.bz2 \
$name-$version-latentbug-addrefvars.patch)
build() {
cd $name-$version
patch -p1 < $SRC/$name-$version-latentbug-addrefvars.patch
cd ..
mkdir build
cd build
../$name-$version/configure --prefix=/usr \
@ -19,9 +24,11 @@ build() {
--enable-shared \
--disable-nls \
--with-x=no
make bootstrap
make check | tee ~/gcc-${version}_make_test_resul
make check
make DESTDIR=$PKG install
mkdir $PKG/lib
ln -sf ../usr/bin/cpp $PKG/lib/cpp
ln -sf gcc $PKG/usr/bin/cc

View File

@ -0,0 +1,25 @@
diff -Nru gcc-4.0.3-old/gcc/tree-dfa.c gcc-4.0.3/gcc/tree-dfa.c
--- gcc-4.0.3-old/gcc/tree-dfa.c 2006-03-14 03:13:30.000000000 +0100
+++ gcc-4.0.3/gcc/tree-dfa.c 2006-03-14 03:16:56.000000000 +0100
@@ -898,10 +898,18 @@
if (is_global_var (var))
mark_call_clobbered (var);
+
/* Scan DECL_INITIAL for pointer variables as they may contain
- address arithmetic referencing the address of other
- variables. */
- if (DECL_INITIAL (var))
+ address arithmetic referencing the address of other
+ variables. */
+ if (DECL_INITIAL (var)
+ /* Initializers of external variables are not useful to the
+ optimizers. */
+ && !DECL_EXTERNAL (var)
+ /* It's not necessary to walk the initial value of non-constant
+ variables because it cannot be propagated by the
+ optimizers. */
+ && (TREE_CONSTANT (var) || TREE_READONLY (var)))
walk_tree (&DECL_INITIAL (var), find_vars_r, walk_state, 0);
}
}