Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 120858 - with -Os, gcc-3.4.5 miscompiles kdelibs
Summary: with -Os, gcc-3.4.5 miscompiles kdelibs
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] KDE (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
: 128155 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-01-29 13:18 UTC by Benno Schulenberg
Modified: 2008-09-25 08:26 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benno Schulenberg 2006-01-29 13:18:27 UTC
When CXXFLAGS contains "-Os", kdelibs-3.5.0 gets miscompiled by gcc-3.4.5.

This manifests itself in for example KMail: its window is about 20 pixels wider than the screen and can't be made any smaller horizontally, and in the status bar the progress bar takes up 90% of the space instead of the usual 20%.

It also shows in Konqueror: upon first opening it, it quickly resizes itself twice to a wider format, but on subsequent restarts sticks with the stored size.

That this is triggered by -Os in the CXXFLAGS is proven by changing it to -O2 and re-emerging only kdelibs, after which the problem is gone.

The problem is not limited to gcc-3.4.5: I remember having had it before, many moons ago, probably when trying out gcc-3.4.3 for a while.  I haven't had it with the gcc-3.3.* line.

Emerge --info:

Gentoo Base System version 1.12.0_pre15
Portage 2.0.54 (default-linux/x86/2005.1, gcc-3.4.5, glibc-2.3.6-r2, 2.6.15 i686)
=================================================================
System uname: 2.6.15 i686 AMD Athlon(tm) XP 2800+
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -Os -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks notitles sandbox sfperms strict test userpriv usersandbox"
LINGUAS="en eo es nl"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
USE="x86 3dnow X aac aim alsa apm arts asf audiofile avi bash-completion berkdb bitmap-fonts bzip2 cdparanoia cdr crypt curl dga dio dri dv dvb eds emboss encode esd ethereal exif expat fam fbcon ffmpeg flac gd gdbm gif glut glx gpm gstreamer gtk gtk2 gtkhtml hardened icq idn imagemagick imap imlib jabber jpeg jpeg2k kde kdeenablefinal lcms libg++ libwww lm_sensors lua mad mbox mbrola memlimit mikmod mime mmap mmx mng mp3 mpeg nas ncurses nls nptl ogg openal opengl oscar pam pcre pdflib pic png python qt quicktime readline recode sasl scanner sdl slang sndfile sox speex spell sqlite sse ssl svg svga tcltk test theora threads tidy tiff truetype truetype-fonts type1-fonts unicode vcd vorbis win32codecs wnf xface xine xml xml2 xmms xpm xsl xv xvid yahoo zlib video_cards_via linguas_en linguas_eo linguas_es linguas_nl userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS
Comment 1 Pablo 2006-02-10 11:59:00 UTC
I haven't tried 3.4.5 (3.4.4 here) but I'm having issues with -Os and some KDE parts too, by now KPDF-3.5 (already filters -Os) and kdelibs-3.5.x, recompiling both with -O2 solved the problems.

I thought this bug from gcc was that cause, but it's fixed in 3.4.5: http://gcc.gnu.org/PR22167
Comment 2 Carsten Lohrke (RETIRED) gentoo-dev 2006-04-20 09:03:13 UTC
*** Bug 128155 has been marked as a duplicate of this bug. ***
Comment 3 Carsten Lohrke (RETIRED) gentoo-dev 2006-04-21 11:35:31 UTC
kdelibs-3.5.2-r4 replaces the flags on x86
Comment 4 Dave Armstrong 2007-03-12 23:21:55 UTC
Please reopen this bug.  If "-Os" is going to be filtered, at least restrict the filtering to the affected compiler(s).  The flag is is presently filtered on x86 regardless of compiler version.  Kdelibs is a monolithic package, and "-Os" resulted in a code size reduction of more than 6 MB in my comparison, and that was with a fairly standard set of options.
Comment 5 Benno Schulenberg 2007-03-13 23:51:14 UTC
At comment #4: Better open a new bug, "kdelibs should filter -Os depending on compiler version" or some such.  Drifting the topic of a bug isn't a good idea.