Bug 35706 - [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 blocker
Target Milestone: 4.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-26 14:01 UTC by H.J. Lu
Modified: 2008-03-30 20:28 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2008-03-26 14:01:12 UTC
Gcc 4.4 revision 133605 failed to bootstrap on Fedora 8 at stage 2:

cc1: warnings being treated as errors
insn-emit.c: In function ‘gen_cmpdi_ccno_1_rex64’:
insn-emit.c:37: error: implicit declaration of function ‘gen_rtx_SET’
insn-emit.c:40: error: implicit declaration of function ‘gen_rtx_COMPARE’
insn-emit.c:42: error: return makes pointer from integer without a cast

Many macros are changed at stage 2:
bash-3.2$ diff -up prev-gcc/genrtl.h gcc
--- prev-gcc/genrtl.h   2008-03-26 06:40:15.000000000 -0700
+++ gcc/genrtl.h        2008-03-26 06:42:38.000000000 -0700
@@ -234,343 +234,343 @@ extern rtx gen_rtx_fmt_Ee_stat   (RTX_COD
         gen_rtx_fmt_Ee_stat (c, m, p0, p1 MEM_STAT_INFO)
 
 
-#define gen_rtx_EXPR_LIST(MODE, ARG0, ARG1) \
+#define gen_rtx_raw_EXPR_LIST(MODE, ARG0, ARG1) \
   gen_rtx_fmt_ee (EXPR_LIST, (MODE), (ARG0), (ARG1))
-#define gen_rtx_INSN_LIST(MODE, ARG0, ARG1) \
+#define gen_rtx_raw_INSN_LIST(MODE, ARG0, ARG1) \
   gen_rtx_fmt_ue (INSN_LIST, (MODE), (ARG0), (ARG1))
-#define gen_rtx_SEQUENCE(MODE, ARG0) \
+#define gen_rtx_raw_SEQUENCE(MODE, ARG0) \
   gen_rtx_fmt_E (SEQUENCE, (MODE), (ARG0))
...

Revision 133533 is OK.
Comment 1 Dominique d'Humieres 2008-03-26 14:05:17 UTC
Confirmed on i686-apple-darwin9.

Comment 2 H.J. Lu 2008-03-26 14:06:31 UTC
I started regression hunt. I suspect this patch

http://gcc.gnu.org/ml/gcc-patches/2008-03/msg01572.html

is the cause.
Comment 3 H.J. Lu 2008-03-26 14:08:10 UTC
I think this function

/* Return nonzero if the RTL code given by index IDX is one that we should
   generate a gen_rtx_raw_FOO macro for, not gen_rtx_FOO (because gen_rtx_FOO
   is a wrapper in emit-rtl.c).  */

static int
special_rtx (int idx)
{
  return (strcmp (defs[idx].enumname, "CONST_INT") == 0
          || strcmp (defs[idx].enumname, "REG") == 0
          || strcmp (defs[idx].enumname, "SUBREG") == 0
          || strcmp (defs[idx].enumname, "MEM") == 0
          || strcmp (defs[idx].enumname, "CONST_VECTOR") == 0);
}

in gengenrtl.c is miscompiled at stage 2.
Comment 4 Richard Biener 2008-03-26 15:07:45 UTC
Fixed.
Comment 5 Richard Biener 2008-03-26 21:16:44 UTC
It is actually VRP that is confused:

 <bb 42>:
   # iftmp.10_86 = PHI <&"raw_"[0](37), &""[0](40), &"raw_"[0](83), &"raw_"[0](41), &"raw_"[0](39), &"raw_"[0](38)>
-  printf (&"#define gen_rtx_%s%s(MODE"[0], iftmp.10_86, D.4658_79);
+  printf (&"#define gen_rtx_%s%s(MODE"[0], &"raw_"[0], D.4658_79);

-D.4342_1: ~[0B, 0B]
+D.4342_1: [&"int "[0], &"struct basic_block_def *"[0]]

huhm.
Comment 6 Richard Biener 2008-03-26 21:51:13 UTC
Hm, fold_binary_to_constant (LT_EXPR, boolean_type_node, &"raw_"[0], &""[0])
returns "raw_" < "" (which has TREE_CONSTANT set).  tree-vrp.c:operand_less_p
doesn't expect that, but only expects 0 or non-0:

      tcmp = fold_binary_to_constant (LT_EXPR, boolean_type_node, val, val2);

      if (!tcmp)
        return -2;

      if (!integer_zerop (tcmp))
        return 1;