Bug 240772 - gcc-3.2.3 i386 can not bootstrap gcc-4.2.0, gcc-3.4.6 can
Summary: gcc-3.2.3 i386 can not bootstrap gcc-4.2.0, gcc-3.4.6 can
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc   
(Show other bugs)
Version: 3.8
Hardware: i386 Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2007-05-21 15:57 UTC by Tru Huynh
Modified: 2007-11-17 01:14 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-05-30 12:21:25 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 29382 None None None Never

Description Tru Huynh 2007-05-21 15:57:01 UTC
Description of problem:
On i386, using gcc-3.2.3-58.i386 bootstraping gcc-4.2.0 released version fails
but using gcc-3.4.6 works.
On x86_64 gcc-3.2.3-58.x86_64 bootstraps fine (glibc-devel.i386 and x86_64

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. tar xzf gcc-4.2.0.tar.gz
2. mkdir build && cd build && ../gcc-4.2.0/configure && make
Actual results:

Comparing stages 2 and 3
warning: ./cc1-checksum.o differs
warning: ./cc1plus-checksum.o differs
warning: ./cc1obj-checksum.o differs
Bootstrap comparison failure!
./cfg.o differs
./cfgloopanal.o differs
./loop-iv.o differs
./predict.o differs
./profile.o differs
./value-prof.o differs
./ipa-inline.o differs
make[2]: *** [compare] Error 1
make[1]: *** [stage3-bubble] Error 2
make: *** [all] Error 2

Expected results:

no errors

Additional info:
bootstrapping with a home built gcc-3.4.6 yields no error.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29382 mention the same bug
but was closed because no feedback was given by the reporter

Comment 1 Jakub Jelinek 2007-05-29 09:57:48 UTC
Some places in i386.c are miscompiled by gcc 3.2.x with -O0
-fkeep-inline-functions, e.g.
typedef struct rtx_def *rtx;
enum machine_mode
  VOIDmode = 0,
  DImode = 13
extern rtx gen_rtx_CONST_INT (enum machine_mode, long);
extern rtx gen_x86_shld_1 (rtx, rtx, rtx);
static __inline__ rtx
gen_x86_64_shld(rtx a, rtx b, rtx c)
  return 0;
extern rtx emit_insn (rtx);

foo (rtx *high, rtx *low, enum machine_mode mode, int count)
  emit_insn ((mode == DImode ? gen_x86_shld_1 : gen_x86_64_shld)
             (high[0], low[0], gen_rtx_CONST_INT (VOIDmode, count)));

will unconditionally call gen_x86_64_shld, no matter what mode contains. 
Removing -fkeep-inline-functions or compiling with optimizations cures this.
Will investigate more, that said, this was reported too late to be fixed
in RHEL3.9's gcc and it might be a good idea to workaround this in gcc 4.2+

Comment 2 Jakub Jelinek 2007-05-30 12:21:25 UTC
Further details in the upstream PR.
This will be worked around in GCC 4.2.1/4.3+, it is too late to fix this in
RHEL3.9 and the bug isn't severe enough to warrant an asynchronous gcc errata,
so closing as WONTFIX.
ought to fix the problem.

Note You need to log in before you can comment on or make changes to this bug.