This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug bootstrap/17330] ICE: verify_ssa failed during c++ code build in libjava
- From: "jh at suse dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Sep 2004 15:28:08 -0000
- Subject: [Bug bootstrap/17330] ICE: verify_ssa failed during c++ code build in libjava
- References: <20040905223534.17330.green@redhat.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From jh at suse dot cz 2004-09-06 15:28 -------
Subject: Re: ICE: verify_ssa failed during c++ code build in libjava
>
> ------- Additional Comments From giovannibajo at libero dot it 2004-09-06 14:52 -------
> Yes, it is caused by Zdenek's ivopts patch (that was not tested on 64bit
> machines because of another bootstrap bug, Devang's). Honza is looking into
> this issue:
>
> http://gcc.gnu.org/ml/gcc-bugs/2004-09/msg00448.html
In case there is an interest, this is my current patch. It fixes 3 out
of 4 problems I know of and I hope to have fix for last one soon so I
can bootstrap and commit them.
Index: loop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop.c,v
retrieving revision 1.507
diff -c -3 -p -r1.507 loop.c
*** loop.c 25 Aug 2004 08:20:09 -0000 1.507
--- loop.c 6 Sep 2004 15:25:58 -0000
*************** loop_dump_aux (const struct loop *loop,
*** 10645,10651 ****
{
rtx label;
! if (! loop || ! file)
return;
/* Print diagnostics to compare our concept of a loop with
--- 10645,10651 ----
{
rtx label;
! if (! loop || ! file || !BB_HEAD (loop->first))
return;
/* Print diagnostics to compare our concept of a loop with
Index: tree-ssa-loop-ivopts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop-ivopts.c,v
retrieving revision 2.2
diff -c -3 -p -r2.2 tree-ssa-loop-ivopts.c
*** tree-ssa-loop-ivopts.c 5 Sep 2004 15:24:15 -0000 2.2
--- tree-ssa-loop-ivopts.c 6 Sep 2004 15:25:59 -0000
*************** add_standard_iv_candidates (struct ivopt
*** 1561,1575 ****
{
/* Add 0 + 1 * iteration candidate. */
add_candidate (data,
! fold_convert (unsigned_type_node, integer_zero_node),
! fold_convert (unsigned_type_node, integer_one_node),
true, NULL);
! /* The same for a long type. */
! add_candidate (data,
! fold_convert (long_unsigned_type_node, integer_zero_node),
! fold_convert (long_unsigned_type_node, integer_one_node),
! true, NULL);
}
--- 1561,1576 ----
{
/* Add 0 + 1 * iteration candidate. */
add_candidate (data,
! build_int_cst (unsigned_intSI_type_node, 0),
! build_int_cst (unsigned_intSI_type_node, 1),
true, NULL);
! /* The same for a long type if it is still fast enought. */
! if (BITS_PER_WORD > 32)
! add_candidate (data,
! build_int_cst (unsigned_intDI_type_node, 0),
! build_int_cst (unsigned_intDI_type_node, 1),
! true, NULL);
}
*************** seq_cost (rtx seq)
*** 1883,1888 ****
--- 1884,1907 ----
return cost;
}
+ /* Produce DECL_RTL for object obj so it looks like it is stored in memory. */
+ static rtx
+ produce_memory_decl_rtl (tree obj, int *regno)
+ {
+ rtx x;
+ if (!obj)
+ abort ();
+ if (TREE_STATIC (obj) || DECL_EXTERNAL (obj))
+ {
+ const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (obj));
+ x = gen_rtx_SYMBOL_REF (Pmode, name);
+ }
+ else
+ x = gen_raw_REG (Pmode, (*regno)++);
+
+ return gen_rtx_MEM (DECL_MODE (obj), x);
+ }
+
/* Prepares decl_rtl for variables referred in *EXPR_P. Callback for
walk_tree. DATA contains the actual fake register number. */
*************** prepare_decl_rtl (tree *expr_p, int *ws,
*** 1895,1900 ****
--- 1914,1930 ----
switch (TREE_CODE (*expr_p))
{
+ case ADDR_EXPR:
+ for (expr_p = &TREE_OPERAND (*expr_p, 0);
+ (handled_component_p (*expr_p)
+ || TREE_CODE (*expr_p) == REALPART_EXPR
+ || TREE_CODE (*expr_p) == IMAGPART_EXPR);
+ expr_p = &TREE_OPERAND (*expr_p, 0));
+ obj = *expr_p;
+ if (DECL_P (obj))
+ x = produce_memory_decl_rtl (obj, regno);
+ break;
+
case SSA_NAME:
*ws = 0;
obj = SSA_NAME_VAR (*expr_p);
*************** prepare_decl_rtl (tree *expr_p, int *ws,
*** 1912,1929 ****
break;
if (DECL_MODE (obj) == BLKmode)
! {
! if (TREE_STATIC (obj)
! || DECL_EXTERNAL (obj))
! {
! const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (obj));
! x = gen_rtx_SYMBOL_REF (Pmode, name);
! }
! else
! x = gen_raw_REG (Pmode, (*regno)++);
!
! x = gen_rtx_MEM (DECL_MODE (obj), x);
! }
else
x = gen_raw_REG (DECL_MODE (obj), (*regno)++);
--- 1942,1948 ----
break;
if (DECL_MODE (obj) == BLKmode)
! x = produce_memory_decl_rtl (obj, regno);
else
x = gen_raw_REG (DECL_MODE (obj), (*regno)++);
*************** tree_ssa_iv_optimize (struct loops *loop
*** 4392,4397 ****
--- 4411,4418 ----
/* Scan the loops, inner ones first. */
while (loop != loops->tree_root)
{
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ flow_loop_dump (loop, dump_file, NULL, 1);
if (tree_ssa_iv_optimize_loop (&data, loop))
{
#ifdef ENABLE_CHECKING
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17330