--- /usr/portage/x11-libs/qt/qt-4.3.1-r1.ebuild.orig	2007-09-16 11:21:55.000000000 +0000
+++ /usr/portage/x11-libs/qt/qt-4.3.1-r1.ebuild	2007-09-16 11:55:08.000000000 +0000
@@ -225,6 +225,17 @@ src_compile() {
 	echo ./configure ${myconf}
 	./configure ${myconf} || die
 
+	if use amd64 && [ "$(gcc-version)" = "3.4" ]; then
+		einfo "Appending '-fno-gcse' to CFLAGS/CXXFLAGS in src/gui/Makefile"
+		einfo "This is only necessary for gcc-3.4, so you might want to switch"
+		einfo "to gcc-4.x if possible."
+		einfo "See gentoo bug #178652 for details."
+		sed -r 's,^CFLAGS([ ]+)= (.*)$,CFLAGS\1= \2 -fno-gcse,' -i \
+			src/gui/Makefile
+		sed -r 's,^CXXFLAGS([ ]+)= (.*)$,CXXFLAGS\1= \2 -fno-gcse,' -i \
+			src/gui/Makefile
+	fi
+
 	emake all || die
 }