Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 317187 (PR43572) - [4.5] sys-devel/gcc-4.5.0 -foptimize-sibling-calls produces wrong code (seen with app-editors/emacs-23.1-r3)
Summary: [4.5] sys-devel/gcc-4.5.0 -foptimize-sibling-calls produces wrong code (seen ...
Alias: PR43572
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
Keywords: Inclusion
Depends on:
Reported: 2010-04-25 23:07 UTC by Maciej Piechotka
Modified: 2010-06-27 04:24 UTC (History)
3 users (show)

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

gdb.txt (gdb.txt,23.03 KB, text/plain)
2010-04-25 23:07 UTC, Maciej Piechotka
gcc45-PR43572-tailcall.patch (gcc45-PR43572-tailcall.patch,967 bytes, patch)
2010-04-27 06:07 UTC, Ryan Hill (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Piechotka 2010-04-25 23:07:02 UTC
Compiled with gcc 4.4 works fine.

CFLAGS="-O2 -pipe -ggdb -march=native -msahf -mcx16 -fgcse-sm -fgcse-las -fgcse-after-reload -ftracer -floop-interchange -floop-strip-mine -floop-block"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=both -Wl,--sort-common"
Comment 1 Maciej Piechotka 2010-04-25 23:07:33 UTC
Created attachment 229157 [details]
Comment 2 Ryan Hill (RETIRED) gentoo-dev 2010-04-26 00:09:54 UTC
try again with sane CFLAGS.
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-04-26 00:20:52 UTC
Happens here as well…

Portage 2.2_rc67 (default/linux/amd64/10.0, gcc-4.5.0-asneeded, glibc-2.11-r1, x86_64)
System uname: Linux-
Timestamp of tree: Sun, 25 Apr 2010 23:00:01 +0000
ccache version 2.4 [disabled]
app-shells/bash:     4.1_p5
dev-java/java-config: 2.1.10
dev-lang/python:     2.6.5-r1
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.8.1-r1
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.1-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/gcc:       4.4.3, 4.5.0
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.33
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1 sun-prerelease-jdk6 sun-bcla-java-vm"
CFLAGS="-march=barcelona -O2 -ftracer -pipe -ftree-vectorize -g -ggdb -Wstrict-aliasing=2 -Wno-format-zero-length -Wformat=2 -Wno-error -Wno-pointer-sign -fdiagnostics-show-option"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/init.d /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=barcelona -O2 -ftracer -pipe -ftree-vectorize -g -ggdb -Wno-error -Wformat=2 -Wstrict-aliasing=2 -fvisibility-inlines-hidden"
EMERGE_DEFAULT_OPTS="--alphabetical --with-bdeps=n"
FEATURES="assume-digests autoaddcvs autoconfig collision-protect cvs distlocks fixpackages multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms sign split-log splitdebug unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
FFLAGS="-march=barcelona -O2 -ftracer -pipe -ftree-vectorize -g -ggdb"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -Wl,--sort-common"
LINGUAS="en it"
MAKEOPTS="-j12 -s"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=ChangeLog"
PORTDIR_OVERLAY="/var/spool/portage/overlays/cross /var/lib/layman/x11 /var/lib/layman/x11 /var/lib/layman/tante_overlay /var/lib/layman/emacs /var/lib/layman/java-overlay /var/lib/layman/gnome /var/lib/layman/scarabeus /var/lib/layman/enlightenment /var/lib/layman/graaff /media/repos/flame/flame-overlay /media/repos/flame/gentoo/ruby-overlay /var/spool/portage/overlays/java-experimental"
USE="3dnow 3dnowex 3dnowext S3TC a52 aac acl acpi4linux alsa amd64 apm audiofile avahi avi bluetooth bzip2 bzlib caps cjk cli crypt css cups custom-cflags custom-cxxflags cxx dbus dlloader dnd dpms dri dts emacs emboss fame ffmpeg flac foomaticdb gif gmp gnome gnome-keyring gnutls gpgme gphoto2 gtk gtk2 hal idn ieee1394 imlib imlib2 inotify ipv6 ithreads java5 java6 jpeg kdehiddenvisibility latex libnotify lm_sensors lx700 lzw lzw-tiff maildir matroska midi mmx mmx2 mmxext mng modules mozsvg mp3 mpeg mpeg4 mpm-threadpool mudflap multilib native network-cron nls no_wxgtk1 noantlr nobcel nobeanutils nobsh nocommonslogging nocommonsnet nodrm nojdepend nojsch nojython nolog4j nomotif nooro noregexp norhino noxalan noxerces nptl nptlonly nsplugin ogg oggvorbis openmp pam pch pdf pdflib pic pmount png policykit ppds pppd pulseaudio qemu-fast reflection rtc session snmp speex spell spl sse sse2 ssl ssse3 startup-notification stencil-buffer subversion svg svgz sysfs syslog tetex theora threads tiff truetype truetype-fonts type1 type1-fonts udev uncompressed-sounds unicode usb userlocales utf8 v4l v4l2 vhosts vorbis wxwindows x11vnc xcb xcomposite xorg xpm xv xvid zeroconf zlib zsh-completion zvbi" ALSA_CARDS="hda-intel usb-audio mpu401 ice1712" ALSA_PCM_PLUGINS="iec958 plug ioplug hooks empty route asym softvol extplug" APACHE2_MODULES="actions alias auth_basic auth_digest authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user cache dav dav_fs dav_lock deflate dir env expires ext_filter filter headers include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_http rewrite setenvif speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="prefork" CAMERAS="ptp2" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en it" LIRC_DEVICES="kworld" QEMU_SOFTMMU_TARGETS="i386 x86_64" RUBY_TARGETS="ruby18 ruby19 jruby" SANE_BACKENDS="snapscan" USERLAND="GNU" VIDEO_CARDS="radeon" 

Comment 4 Ulrich Müller gentoo-dev 2010-04-26 08:07:07 UTC
Could you please check if this is the same issue as in <>? Does the problem persist if you compile with -O1 or with -foptimize-sibling-calls removed?
Comment 5 Maciej Piechotka 2010-04-26 18:55:39 UTC
(In reply to comment #4)
> Could you please check if this is the same issue as in
> <>? Does the problem persist if you compile with -O1
> or with -foptimize-sibling-calls removed?

Confirms. It works ok with -O2 & appended -fno-optimize-sibling-calls in ebuild (proably -fno-* should be allowed by strip-cflags - it helps tweaking such situations w/out hand edditing ebuilds).
Comment 6 Ulrich Müller gentoo-dev 2010-04-26 21:59:52 UTC
(In reply to comment #5)
> Confirms. It works ok with -O2 & appended -fno-optimize-sibling-calls in
> ebuild

Upstream requests (see URL):
"Could you please try to find out where exactly the problem is? You can do a binary search on the object files compiled with the options that result in a working binary by linking them with the ones that result in a non-working binary.
Maybe you can find a single file that gets miscompiled, and then find out what function in that file gets miscompiled."
Comment 8 Ulrich Müller gentoo-dev 2010-04-27 11:31:46 UTC
Thanks Ryan. Reassigning to toolchain.
Comment 9 Ryan Hill (RETIRED) gentoo-dev 2010-06-20 06:50:05 UTC
Added to cvs,  will be included in the next patchset.
Comment 10 Ryan Hill (RETIRED) gentoo-dev 2010-06-27 04:24:20 UTC
Released in 1.2.