From: Falk Hueffner Date: Wed, 21 Jan 2004 15:52:47 +0000 (+0100) Subject: re PR target/12898 (Tru64 UNIX bootstrap failure: ICE in gen_reg_rtx, at emit-rtl... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c3cda381c7dec4b95c20275629acc7194c68a324;p=platform%2Fupstream%2Fgcc.git re PR target/12898 (Tru64 UNIX bootstrap failure: ICE in gen_reg_rtx, at emit-rtl.c:819) PR target/12898 * config/alpha/alpha.c (alpha_emit_set_const_1): If no_new_pseudos, use gen_rtx_SET directly for SImode constants which need multiple instructions to emit. * testsuite/gcc.c-torture/compile/20040121-1.c: New test. From-SVN: r76283 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5eaac36..ac0537f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-01-21 Falk Hueffner + + PR target/12898 + * config/alpha/alpha.c (alpha_emit_set_const_1): If + no_new_pseudos, use gen_rtx_SET directly for SImode constants + which need multiple instructions to emit. + 2004-01-21 Inaoka Kazuhiro * config/m32r/m32r.h (CPP_SPEC): Define. diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index f6485a0..581d344 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -2503,7 +2503,14 @@ alpha_emit_set_const_1 (rtx target, enum machine_mode mode, } else if (n >= 2 + (extra != 0)) { - temp = copy_to_suggested_reg (GEN_INT (high << 16), subtarget, mode); + if (no_new_pseudos) + { + emit_insn (gen_rtx_SET (VOIDmode, target, GEN_INT (high << 16))); + temp = target; + } + else + temp = copy_to_suggested_reg (GEN_INT (high << 16), + subtarget, mode); /* As of 2002-02-23, addsi3 is only available when not optimizing. This means that if we go through expand_binop, we'll try to diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9b022b8..35f7953 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2004-01-21 Falk Hueffner + + * gcc.c-torture/compile/20040121-1.c: New test. + 2004-01-21 Zack Weinberg * gcc.dg/noncompile/20020213-1.c: Add another dg-warning line. diff --git a/gcc/testsuite/gcc.c-torture/compile/20040121-1.c b/gcc/testsuite/gcc.c-torture/compile/20040121-1.c new file mode 100644 index 0000000..2039472 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20040121-1.c @@ -0,0 +1,41 @@ +/* PR target/12898 + 0x8000 needs multiple instructions to be emitted on Alpha; the + fluff around it causes it to be emitted in a no_new_pseudos + context, which triggered a problem in alpha.c. */ + +void f (const char *, ...); +int g (void); +void *p (void); + +int isymBase, ilineBase, sym_hdr, want_line, proc_desc; +char *lines; + +void print_file_desc (int *fdp) +{ + char *str_base = p (); + int symi, pdi = g (); + + for (symi = 0; isymBase;) + { + int proc_ptr = proc_desc + pdi; + f("1", isymBase, proc_ptr + *fdp, str_base); + if (want_line && *fdp) + { + int delta; + long cur_line = proc_ptr; + char *line_ptr = lines + proc_ptr; + char *line_end = p (); + + f("2", sym_hdr); + while (line_ptr < line_end) + { + delta = *line_ptr; + if (delta) + line_ptr++; + else + delta = line_ptr[1] ^ 0x8000; + f("3", cur_line, delta); + } + } + } +}