public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Endless loop during bootstrap?
@ 2004-03-21  1:59 James Morrison
  2004-03-21  2:42 ` Eric Christopher
  0 siblings, 1 reply; 3+ messages in thread
From: James Morrison @ 2004-03-21  1:59 UTC (permalink / raw)
  To: gcc


 Hi,

  I tried to bootstrap gcc on sparc-linux.  However, it seems to be stuck
in some loop.

 So far linking crt0 in stage2 cc1 has taken a lot of time:
14856 jim       18   0  3096 3096 1920 R 80.5  1.2 268:44.24 cc1

 This is the line which seems to be taking so long.
./xgcc -B./ -B/usr/local/sparc-unknown-linux-gnu/bin/ -isystem /usr/local/spa
rc-unknown-linux-gnu/include -isystem /usr/local/sparc-unknown-linux-gnu/sys-
include -L/home/jim/cvs/gcc.ssh/sparcif0/gcc/../ld -O2 -DIN_GCC    -W -Wall -
Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definitio
n  -isystem ./include  -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/
gcc/../include   -g0 -finhibit-size-directive -fno-inline-functions -fno-exce
ptions -fno-zero-initialized-in-bss -fno-unit-at-a-time  \
   -c ../../gcc/gcc/crtstuff.c -DCRT_BEGIN \
  -o crtbegin.o

 I attached gdb to the cc1 process and got this backtrace:
Attaching to program: /usr/local/cvs/gcc.ssh/sparcif0/gcc/cc1, process 14856
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
0x001da4a8 in real_to_decimal (str=0xefffd700 "", r_orig=Variable "r_orig" is not available.
)
    at ../../gcc/gcc/real.c:1460
1460        dec_exp /= 10;
Breakpoint 1 at 0xac664: file ../../gcc/gcc/diagnostic.c, line 583.
Breakpoint 2 at 0x700610e4
Breakpoint 3 at 0x7005ffe0
(gdb) bt
#0  0x001da4a8 in real_to_decimal (str=0xefffd700 "", r_orig=Variable "r_orig" is not available.
)
    at ../../gcc/gcc/real.c:1460
#1  0x0006ca04 in builtin_define_with_hex_fp_value (
    macro=0x40 <Address 0x40 out of bounds>, type=0x7036dab0, digits=9,
    hex_str=0xefffd7c8 "0x0.ffffffp128", fp_suffix=0x0)
    at ../../gcc/gcc/c-cppbuiltin.c:545
#2  0x0006cd40 in builtin_define_float_constants (
    name_prefix=0xefffd848 "__FLT_MAX__", fp_suffix=0x7036dab0 "", type=0x9)
    at ../../gcc/gcc/c-cppbuiltin.c:208

 Well, the infinite loop seems to be where gdb says it was at line 1460
of real.c:
  for (max_digits = 1; dec_exp ; max_digits++)
    dec_exp /= 10;

 I can't print dec_exp since gdb doesn't seem to handle that dwarf2 
expression, but max_digits is:
(gdb) p max_digits
$1 = 3716048565

Any ideas what needs to be fixed?

Jim

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Endless loop during bootstrap?
  2004-03-21  1:59 Endless loop during bootstrap? James Morrison
@ 2004-03-21  2:42 ` Eric Christopher
  2004-03-21  5:25   ` James Morrison
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Christopher @ 2004-03-21  2:42 UTC (permalink / raw)
  To: James Morrison; +Cc: gcc


>   -o crtbegin.o

This file definitely shouldn't take very long.

> 
> Any ideas what needs to be fixed?

Not offhand, but if you file a bug in bugzilla (gcc.gnu.org/bugzilla)
I'm sure the sparc maintainer would want to look at it.

-eric

-- 
Eric Christopher <echristo@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Endless loop during bootstrap?
  2004-03-21  2:42 ` Eric Christopher
@ 2004-03-21  5:25   ` James Morrison
  0 siblings, 0 replies; 3+ messages in thread
From: James Morrison @ 2004-03-21  5:25 UTC (permalink / raw)
  To: Eric Christopher; +Cc: gcc


Eric Christopher <echristo@redhat.com> writes:

> >   -o crtbegin.o
> 
> This file definitely shouldn't take very long.
> 
> > 
> > Any ideas what needs to be fixed?
> 
> Not offhand, but if you file a bug in bugzilla (gcc.gnu.org/bugzilla)
> I'm sure the sparc maintainer would want to look at it.
> 
> -eric
> 
> -- 
> Eric Christopher <echristo@redhat.com>

 Alright. I'll dig out my bugzilla account and file a bug.  Anyway,
It seems that the following code:

.LL1136:
        .loc 1 1460 0
        sra     %i1, 31, %o3
.LLVL507:
        srl     %i1, 29, %g4
.LLVL508:
        sll     %o3, 3, %g1
        sll     %i1, 3, %o5
        addcc   %o5, %i1, %o5
        or      %g4, %g1, %o4
        addx    %o4, %o3, %o4
        srl     %o5, 28, %g4
        sll     %o4, 4, %g1
        sll     %o5, 4, %g3
        or      %g4, %g1, %g2
        addcc   %o5, %g3, %o5
        addx    %o4, %g2, %o4
        srl     %o5, 24, %g4
        sll     %o4, 8, %g1
        sll     %o5, 8, %g3
        or      %g4, %g1, %g2
        addcc   %o5, %g3, %o5
        addx    %o4, %g2, %o4
        srl     %o5, 16, %g4
        sll     %o4, 16, %g1
        sll     %o5, 16, %g3
        addcc   %o5, %g3, %o5
        or      %g4, %g1, %g2
        addx    %o4, %g2, %o4
        subcc   %g0, %o5, %o5
        subx    %g0, %o4, %o4
        sra     %o4, 2, %o4
.LLVL509:
        .loc 1 1459 0
        subcc   %o4, %o3, %i1
.LLVL510:
        bne     .LL1136
        add     %l0, 1, %l0
.LL1108:
 
 is supposed to divide by 10.  However, when the input is 1 the result is
-1.  Similarily when the input is -1 the result is 1.  Thus the endless
loop.

Jim

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-03-20 23:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-21  1:59 Endless loop during bootstrap? James Morrison
2004-03-21  2:42 ` Eric Christopher
2004-03-21  5:25   ` James Morrison

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).