Bug 36974 - [4.4 Regression]: Gcc failed to bootstrap
Summary: [4.4 Regression]: Gcc failed to bootstrap
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: build, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2008-07-30 15:41 UTC by H.J. Lu
Modified: 2008-12-27 19:50 UTC (History)
3 users (show)

See Also:
Host:
Target: ia64-unknown-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
proposed fix (221 bytes, patch)
2008-07-30 16:51 UTC, Rafael Avila de Espindola
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2008-07-30 15:41:27 UTC
Gcc 4.4 revision 138310 failed to bootstrap on Linux/ia64:

./../../src/libgcc/../gcc/libgcc2.c: In function '__addvsi3':
../../../src/libgcc/../gcc/libgcc2.c:104: internal compiler error: in call_from_call_insn, at final.c:1760
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[5]: *** [_addvsi3.o] Error 1

I think it is introduced by revision 138310:

http://gcc.gnu.org/ml/gcc-cvs/2008-07/msg01023.html

Revision 138296 is OK.
Comment 1 H.J. Lu 2008-07-30 16:24:11 UTC
[hjl@gnu-12 libgcc]$ cat foo.i
extern void abort (void);
typedef int SItype __attribute__ ((mode (SI)));
typedef unsigned int USItype __attribute__ ((mode (SI)));
SItype
__addvsi3 (SItype a, SItype b)
{
  const SItype w = (USItype) a + (USItype) b;

  if (b >= 0 ? w < a : w > a)
    abort ();

  return w;
}
[hjl@gnu-12 libgcc]$ ../../gcc/xgcc -B../../gcc/ -O -S foo.i
foo.i: In function ‘__addvsi3’:
foo.i:13: internal compiler error: in call_from_call_insn, at final.c:1760
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
[hjl@gnu-12 libgcc]$ 
Comment 2 H.J. Lu 2008-07-30 16:26:48 UTC
call_from_call_insn doesn't support:

(gdb) b fancy_abort 
Breakpoint 1 at 0x4000000000317081: file ../../src/gcc/diagnostic.c, line 689.
(gdb) r
Starting program: /export/gnu/import/svn/gcc-test/bld/gcc/cc1 -fpreprocessed foo.i -quiet -dumpbase foo.i -auxbase foo -O -version -o foo.s
GNU C (GCC) version 4.4.0 20080730 (experimental) [trunk revision 138310] (ia64-unknown-linux-gnu)
	compiled by GNU C version 4.1.2 20071124 (Red Hat 4.1.2-42), GMP version 4.2.2, MPFR version 2.3.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: fd482fe43a51139098c909d8f96fdc49

Breakpoint 1, fancy_abort (file=0x400000000145bf10 "../../src/gcc/final.c", 
    line=1760, function=0x400000000145c000 "call_from_call_insn")
    at ../../src/gcc/diagnostic.c:689
689	  internal_error ("in %s, at %s:%d", function, trim_filename (file), line);
(gdb) f 1
#1  0x4000000000458050 in call_from_call_insn (insn=0x2000000003c8d310)
    at ../../src/gcc/final.c:1760
1760		  gcc_unreachable ();
(gdb) call debug_rtx (insn)
(call_insn 51 83 84 5 foo.i:10 (cond_exec (eq (reg:BI 262 p6 [353])
            (const_int 0 [0x0]))
        (parallel [
                (call (mem:DI (symbol_ref:DI ("abort") [flags 0x41] <function_decl 0x2000000003d2dc00 abort>) [0 S8 A64])
                    (const_int 0 [0x0]))
                (clobber (reg:DI 320 b0))
            ])) 1114 {divdf3_internal_thr+317} (expr_list:REG_BR_PROB (const_int 100 [0x64])
        (expr_list:REG_EH_REGION (const_int 0 [0x0])
            (expr_list:REG_NORETURN (const_int 0 [0x0])
                (nil))))
    (expr_list:REG_DEP_TRUE (use (reg:DI 1 r1))
        (nil)))
(gdb) 
Comment 3 Rafael Avila de Espindola 2008-07-30 16:51:58 UTC
Created attachment 15978 [details]
proposed fix
Comment 4 espindola 2008-07-30 23:24:58 UTC
Subject: Bug 36974

Author: espindola
Date: Wed Jul 30 23:23:33 2008
New Revision: 138347

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=138347
Log:
2008-07-30  Rafael Avila de Espindola  <espindola@google.com>

	PR 36974
	* final.c (call_from_call_insn): Handle COND_EXEC


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/final.c

Comment 5 H.J. Lu 2008-07-31 03:42:50 UTC
Fixed.