This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] (re)assertify more common files
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 21 Apr 2005 19:04:52 +0100
- Subject: [PATCH] (re)assertify more common files
- Organization: CodeSourcery
Hi,
this patch removes more aborts that I either missed or have crept back in.
As with the previous patch, I have reworded comments too.
tree-ssa-operands.c had the misleadingly named 'verify_abort', which
did not abort. I was going to rename it, but then I noticed it was trivial
to fold it into its only caller.
booted & tested on i686-pc-linux-gnu, checked & unchecked. Installed.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
2005-04-21 Nathan Sidwell <nathan@codesourcery.com>
* cfghooks.h (struct cfg_hooks): Reword comments to avoid 'abort'.
* lambda.h (lambda_vector_min_nz): Likewise.
* langhooks.h (struct lang_hooks_for_types,
struct lang_hooks): Likewise.
* output.h (assemble_integer, this_is_asm_operands): Likewise.
* tree.h: Likewise.
* vec.h: Likewise.
* tree-flow-inline.h (relink_imm_use): Use gcc_assert.
* optabs.c (prepare_cmp_insn, emit_cmp_and_jump_insns): Reword
comments to avoid 'abort'. Use gcc_assert as necessary.
* opts.c (common_handle_option): Likewise.
* pretty-print.c (pp_base_format_text): Likewise.
* print-rtl.c (print_rtx): Likewise.
* read-rtl.c (read_rtx_filename, read_rtx_1): Likewise.
* regmove.c (try_auto_increment): Likewise.
* reload.c (find_valid_class, find_reloads_toplev,
find_equiv_reg): Likewise.
* reload1.c (reload, forget_old_reloads_1, function_invariant_p,
merge_assigned_reloads): Likewise.
* tree-inline.c (inline_forbidden_p_1,
estimate_num_insns_1): Likewise.
* tree-optimize.c (execute_todo): Likewise.
* tree-outof-ssa.c (eliminate_phi): Likewise.
* tree-ssa-alias.c (add_pointed_to_expr): Likewise.
* tree-ssa-ccp.c (maybe_fold_stmt_indirect): Likewise.
* tree-ssa-operands.c (parse_ssa_operands,
get_indirect_ref_operands, create_ssa_artficial_load_stmt): Likewise.
* tree-ssa-pre.c (find_or_generate_expression): Likewise.
* tree-ssanames.c (release_ssa_name): Likewise.
* tree.c (int_bit_position, int_byte_position, tree_low_cst,
walk_tree): Likewise.
* tree-ssa-operands.c (verify_abort): Fold into ..
(verify_imm_links): ... here.
Index: cfghooks.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfghooks.h,v
retrieving revision 1.13
diff -c -3 -p -r1.13 cfghooks.h
*** cfghooks.h 3 Apr 2005 08:44:27 -0000 1.13
--- cfghooks.h 21 Apr 2005 12:40:23 -0000
*************** struct cfg_hooks
*** 43,50 ****
edge (*redirect_edge_and_branch) (edge e, basic_block b);
/* Same as the above but allows redirecting of fallthru edges. In that case
! newly created forwarder basic block is returned. It aborts when called
! on abnormal edge. */
basic_block (*redirect_edge_and_branch_force) (edge, basic_block);
/* Remove statements corresponding to a given basic block. */
--- 43,50 ----
edge (*redirect_edge_and_branch) (edge e, basic_block b);
/* Same as the above but allows redirecting of fallthru edges. In that case
! newly created forwarder basic block is returned. The edge must
! not be abnormal. */
basic_block (*redirect_edge_and_branch_force) (edge, basic_block);
/* Remove statements corresponding to a given basic block. */
Index: lambda.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/lambda.h,v
retrieving revision 2.9
diff -c -3 -p -r2.9 lambda.h
*** lambda.h 21 Apr 2005 09:17:19 -0000 2.9
--- lambda.h 21 Apr 2005 12:40:24 -0000
*************** lambda_vector_min_nz (lambda_vector vec1
*** 326,344 ****
{
int j;
int min = -1;
! #ifdef ENABLE_CHECKING
! if (start > n)
! abort ();
! #endif
for (j = start; j < n; j++)
{
if (vec1[j])
if (min < 0 || vec1[j] < vec1[min])
min = j;
}
!
! if (min < 0)
! abort ();
return min;
}
--- 326,340 ----
{
int j;
int min = -1;
!
! gcc_assert (start <= n);
for (j = start; j < n; j++)
{
if (vec1[j])
if (min < 0 || vec1[j] < vec1[min])
min = j;
}
! gcc_assert (min >= 0);
return min;
}
Index: langhooks.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/langhooks.h,v
retrieving revision 1.105
diff -c -3 -p -r1.105 langhooks.h
*** langhooks.h 23 Mar 2005 19:46:44 -0000 1.105
--- langhooks.h 21 Apr 2005 12:40:25 -0000
*************** struct lang_hooks_for_types
*** 120,126 ****
/* Given a type, apply default promotions to unnamed function
arguments and return the new type. Return the same type if no
change. Required by any language that supports variadic
! arguments. The default hook aborts. */
tree (*type_promotes_to) (tree);
/* Register TYPE as a builtin type with the indicated NAME. The
--- 120,126 ----
/* Given a type, apply default promotions to unnamed function
arguments and return the new type. Return the same type if no
change. Required by any language that supports variadic
! arguments. The default hook dies. */
tree (*type_promotes_to) (tree);
/* Register TYPE as a builtin type with the indicated NAME. The
*************** struct lang_hooks
*** 207,213 ****
/* Determines the size of any language-specific tcc_constant or
tcc_exceptional nodes. Since it is called from make_node, the
! only information available is the tree code. Expected to abort
on unrecognized codes. */
size_t (*tree_size) (enum tree_code);
--- 207,213 ----
/* Determines the size of any language-specific tcc_constant or
tcc_exceptional nodes. Since it is called from make_node, the
! only information available is the tree code. Expected to die
on unrecognized codes. */
size_t (*tree_size) (enum tree_code);
Index: optabs.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/optabs.c,v
retrieving revision 1.274
diff -c -3 -p -r1.274 optabs.c
*** optabs.c 21 Apr 2005 10:13:38 -0000 1.274
--- optabs.c 21 Apr 2005 12:40:38 -0000
*************** can_compare_p (enum rtx_code code, enum
*** 3306,3312 ****
comparison or emitting a library call to perform the comparison if no insn
is available to handle it.
The values which are passed in through pointers can be modified; the caller
! should perform the comparison on the modified values. */
static void
prepare_cmp_insn (rtx *px, rtx *py, enum rtx_code *pcomparison, rtx size,
--- 3306,3313 ----
comparison or emitting a library call to perform the comparison if no insn
is available to handle it.
The values which are passed in through pointers can be modified; the caller
! should perform the comparison on the modified values. Constant
! comparisons must have already been folded. */
static void
prepare_cmp_insn (rtx *px, rtx *py, enum rtx_code *pcomparison, rtx size,
*************** prepare_cmp_insn (rtx *px, rtx *py, enum
*** 3320,3330 ****
class = GET_MODE_CLASS (mode);
- /* They could both be VOIDmode if both args are immediate constants,
- but we should fold that at an earlier stage.
- With no special code here, this will call abort,
- reminding the programmer to implement such folding. */
-
if (mode != BLKmode && flag_force_mem)
{
/* Load duplicate non-volatile operands once. */
--- 3321,3326 ----
*************** prepare_cmp_insn (rtx *px, rtx *py, enum
*** 3351,3359 ****
y = force_reg (mode, y);
#ifdef HAVE_cc0
! /* Abort if we have a non-canonical comparison. The RTL documentation
! states that canonical comparisons are required only for targets which
! have cc0. */
gcc_assert (!CONSTANT_P (x) || CONSTANT_P (y));
#endif
--- 3347,3355 ----
y = force_reg (mode, y);
#ifdef HAVE_cc0
! /* Make sure if we have a canonical comparison. The RTL
! documentation states that canonical comparisons are required only
! for targets which have cc0. */
gcc_assert (!CONSTANT_P (x) || CONSTANT_P (y));
#endif
*************** emit_cmp_and_jump_insns (rtx x, rtx y, e
*** 3600,3608 ****
}
#ifdef HAVE_cc0
! /* If OP0 is still a constant, then both X and Y must be constants. Force
! X into a register to avoid aborting in emit_cmp_insn due to non-canonical
! RTL. */
if (CONSTANT_P (op0))
op0 = force_reg (mode, op0);
#endif
--- 3596,3603 ----
}
#ifdef HAVE_cc0
! /* If OP0 is still a constant, then both X and Y must be constants.
! Force X into a register to create canonical RTL. */
if (CONSTANT_P (op0))
op0 = force_reg (mode, op0);
#endif
Index: opts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/opts.c,v
retrieving revision 1.102
diff -c -3 -p -r1.102 opts.c
*** opts.c 12 Apr 2005 20:39:08 -0000 1.102
--- opts.c 21 Apr 2005 12:40:40 -0000
*************** common_handle_option (size_t scode, cons
*** 1027,1036 ****
default:
/* If the flag was handled in a standard way, assume the lack of
processing here is intentional. */
! if (cl_options[scode].flag_var)
! break;
!
! abort ();
}
return 1;
--- 1027,1034 ----
default:
/* If the flag was handled in a standard way, assume the lack of
processing here is intentional. */
! gcc_assert (cl_options[scode].flag_var);
! break;
}
return 1;
Index: output.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/output.h,v
retrieving revision 1.156
diff -c -3 -p -r1.156 output.h
*** output.h 12 Apr 2005 20:39:09 -0000 1.156
--- output.h 21 Apr 2005 12:40:41 -0000
*************** extern bool default_assemble_integer (rt
*** 320,327 ****
/* Assemble the integer constant X into an object of SIZE bytes. ALIGN is
the alignment of the integer in bits. Return 1 if we were able to output
! the constant, otherwise 0. If FORCE is nonzero, abort if we can't output
! the constant. */
extern bool assemble_integer (rtx, unsigned, unsigned, int);
/* An interface to assemble_integer for the common case in which a value is
--- 320,327 ----
/* Assemble the integer constant X into an object of SIZE bytes. ALIGN is
the alignment of the integer in bits. Return 1 if we were able to output
! the constant, otherwise 0. If FORCE is nonzero the constant must
! be outputable. */
extern bool assemble_integer (rtx, unsigned, unsigned, int);
/* An interface to assemble_integer for the common case in which a value is
*************** extern rtx current_insn_predicate;
*** 425,431 ****
extern rtx current_output_insn;
/* Nonzero while outputting an `asm' with operands.
! This means that inconsistencies are the user's fault, so don't abort.
The precise value is the insn being output, to pass to error_for_asm. */
extern rtx this_is_asm_operands;
--- 425,431 ----
extern rtx current_output_insn;
/* Nonzero while outputting an `asm' with operands.
! This means that inconsistencies are the user's fault, so don't die.
The precise value is the insn being output, to pass to error_for_asm. */
extern rtx this_is_asm_operands;
Index: pretty-print.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/pretty-print.c,v
retrieving revision 2.19
diff -c -3 -p -r2.19 pretty-print.c
*** pretty-print.c 22 Oct 2004 17:05:05 -0000 2.19
--- pretty-print.c 21 Apr 2005 12:40:43 -0000
*************** pp_base_format_text (pretty_printer *pp,
*** 365,378 ****
break;
default:
! if (!pp_format_decoder (pp) || !(*pp_format_decoder (pp)) (pp, text))
! {
! /* Hmmm. The client failed to install a format translator
! but called us with an unrecognized format. Or, maybe, the
! translated string just contains an invalid format, or
! has formats in the wrong order. Sorry. */
! abort ();
! }
}
if (quoted)
pp_string (pp, close_quote);
--- 365,377 ----
break;
default:
! {
! bool ok;
!
! gcc_assert (pp_format_decoder (pp));
! ok = pp_format_decoder (pp) (pp, text);
! gcc_assert (ok);
! }
}
if (quoted)
pp_string (pp, close_quote);
Index: print-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/print-rtl.c,v
retrieving revision 1.121
diff -c -3 -p -r1.121 print-rtl.c
*** print-rtl.c 3 Apr 2005 10:27:44 -0000 1.121
--- print-rtl.c 21 Apr 2005 12:40:44 -0000
*************** print_rtx (rtx in_rtx)
*** 554,563 ****
break;
default:
! fprintf (stderr,
! "switch format wrong in rtl.print_rtx(). format was: %c.\n",
! format_ptr[-1]);
! abort ();
}
switch (GET_CODE (in_rtx))
--- 554,560 ----
break;
default:
! gcc_unreachable ();
}
switch (GET_CODE (in_rtx))
Index: read-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/read-rtl.c,v
retrieving revision 1.35
diff -c -3 -p -r1.35 read-rtl.c
*** read-rtl.c 4 Mar 2005 11:10:32 -0000 1.35
--- read-rtl.c 21 Apr 2005 12:40:47 -0000
*************** static struct obstack joined_conditions_
*** 160,166 ****
/* The current line number for the file. */
int read_rtx_lineno = 1;
! /* The filename for aborting with file and line. */
const char *read_rtx_filename = "<unknown>";
static void
--- 160,166 ----
/* The current line number for the file. */
int read_rtx_lineno = 1;
! /* The filename for error reporting. */
const char *read_rtx_filename = "<unknown>";
static void
*************** read_rtx_1 (FILE *infile)
*** 1487,1497 ****
break;
default:
! fprintf (stderr,
! "switch format wrong in rtl.read_rtx(). format was: %c.\n",
! format_ptr[i]);
! fprintf (stderr, "\tfile position: %ld\n", ftell (infile));
! abort ();
}
c = read_skip_spaces (infile);
--- 1487,1493 ----
break;
default:
! gcc_unreachable ();
}
c = read_skip_spaces (infile);
Index: regmove.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/regmove.c,v
retrieving revision 1.166
diff -c -3 -p -r1.166 regmove.c
*** regmove.c 10 Dec 2004 21:11:02 -0000 1.166
--- regmove.c 21 Apr 2005 12:40:52 -0000
*************** try_auto_increment (rtx insn, rtx inc_in
*** 135,141 ****
/* If there is a REG_DEAD note on this insn, we must
change this not to REG_UNUSED meaning that the register
is set, but the value is dead. Failure to do so will
! result in a sched1 abort -- when it recomputes lifetime
information, the number of REG_DEAD notes will have
changed. */
rtx note = find_reg_note (insn, REG_DEAD, reg);
--- 135,141 ----
/* If there is a REG_DEAD note on this insn, we must
change this not to REG_UNUSED meaning that the register
is set, but the value is dead. Failure to do so will
! result in a sched1 dieing -- when it recomputes lifetime
information, the number of REG_DEAD notes will have
changed. */
rtx note = find_reg_note (insn, REG_DEAD, reg);
Index: reload.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload.c,v
retrieving revision 1.269
diff -c -3 -p -r1.269 reload.c
*** reload.c 20 Apr 2005 14:30:38 -0000 1.269
--- reload.c 21 Apr 2005 12:41:08 -0000
*************** clear_secondary_mem (void)
*** 671,677 ****
/* Find the largest class which has at least one register valid in
mode INNER, and which for every such register, that register number
plus N is also valid in OUTER (if in range) and is cheap to move
! into REGNO. Abort if no such class exists. */
static enum reg_class
find_valid_class (enum machine_mode outer ATTRIBUTE_UNUSED,
--- 671,677 ----
/* Find the largest class which has at least one register valid in
mode INNER, and which for every such register, that register number
plus N is also valid in OUTER (if in range) and is cheap to move
! into REGNO. Such a class must exist. */
static enum reg_class
find_valid_class (enum machine_mode outer ATTRIBUTE_UNUSED,
*************** find_reloads_toplev (rtx x, int opnum, e
*** 4559,4572 ****
if (code == SUBREG && REG_P (SUBREG_REG (x)))
{
! /* Check for SUBREG containing a REG that's equivalent to a constant.
! If the constant has a known value, truncate it right now.
! Similarly if we are extracting a single-word of a multi-word
! constant. If the constant is symbolic, allow it to be substituted
! normally. push_reload will strip the subreg later. If the
! constant is VOIDmode, abort because we will lose the mode of
! the register (this should never happen because one of the cases
! above should handle it). */
int regno = REGNO (SUBREG_REG (x));
rtx tem;
--- 4559,4572 ----
if (code == SUBREG && REG_P (SUBREG_REG (x)))
{
! /* Check for SUBREG containing a REG that's equivalent to a
! constant. If the constant has a known value, truncate it
! right now. Similarly if we are extracting a single-word of a
! multi-word constant. If the constant is symbolic, allow it
! to be substituted normally. push_reload will strip the
! subreg later. The constant must not be VOIDmode, because we
! will lose the mode of the register (this should never happen
! because one of the cases above should handle it). */
int regno = REGNO (SUBREG_REG (x));
rtx tem;
*************** find_equiv_reg (rtx goal, rtx insn, enum
*** 6536,6542 ****
different from what they were when calculating the need for
spills. If we notice an input-reload insn here, we will
reject it below, but it might hide a usable equivalent.
! That makes bad code. It may even abort: perhaps no reg was
spilled for this insn because it was assumed we would find
that equivalent. */
|| INSN_UID (p) < reload_first_uid))
--- 6536,6542 ----
different from what they were when calculating the need for
spills. If we notice an input-reload insn here, we will
reject it below, but it might hide a usable equivalent.
! That makes bad code. It may even fail: perhaps no reg was
spilled for this insn because it was assumed we would find
that equivalent. */
|| INSN_UID (p) < reload_first_uid))
Index: reload1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload1.c,v
retrieving revision 1.467
diff -c -3 -p -r1.467 reload1.c
*** reload1.c 20 Apr 2005 18:02:40 -0000 1.467
--- reload1.c 21 Apr 2005 12:41:26 -0000
*************** reload (rtx first, int global)
*** 1090,1097 ****
CLEAR_REGNO_REG_SET (bb->global_live_at_start,
HARD_FRAME_POINTER_REGNUM);
! /* Come here (with failure set nonzero) if we can't get enough spill regs
! and we decide not to abort about it. */
failed:
CLEAR_REG_SET (&spilled_pseudos);
--- 1090,1097 ----
CLEAR_REGNO_REG_SET (bb->global_live_at_start,
HARD_FRAME_POINTER_REGNUM);
! /* Come here (with failure set nonzero) if we can't get enough spill
! regs. */
failed:
CLEAR_REG_SET (&spilled_pseudos);
*************** forget_old_reloads_1 (rtx x, rtx ignored
*** 4059,4065 ****
unsigned int nr;
/* note_stores does give us subregs of hard regs,
! subreg_regno_offset will abort if it is not a hard reg. */
while (GET_CODE (x) == SUBREG)
{
/* We ignore the subreg offset when calculating the regno,
--- 4059,4065 ----
unsigned int nr;
/* note_stores does give us subregs of hard regs,
! subreg_regno_offset requires a hard reg. */
while (GET_CODE (x) == SUBREG)
{
/* We ignore the subreg offset when calculating the regno,
*************** free_for_value_p (int regno, enum machin
*** 4963,4973 ****
}
/* Return nonzero if the rtx X is invariant over the current function. */
! /* ??? Actually, the places where we use this expect exactly what
! * is tested here, and not everything that is function invariant. In
! * particular, the frame pointer and arg pointer are special cased;
! * pic_offset_table_rtx is not, and this will cause aborts when we
! * go to spill these things to memory. */
static int
function_invariant_p (rtx x)
--- 4963,4973 ----
}
/* Return nonzero if the rtx X is invariant over the current function. */
! /* ??? Actually, the places where we use this expect exactly what is
! tested here, and not everything that is function invariant. In
! particular, the frame pointer and arg pointer are special cased;
! pic_offset_table_rtx is not, and we must not spill these things to
! memory. */
static int
function_invariant_p (rtx x)
*************** merge_assigned_reloads (rtx insn)
*** 6087,6096 ****
|| rld[j].when_needed == RELOAD_FOR_INPADDR_ADDRESS)
? RELOAD_FOR_OTHER_ADDRESS : RELOAD_OTHER);
! /* Check to see if we accidentally converted two reloads
! that use the same reload register with different inputs
! to the same type. If so, the resulting code won't work,
! so abort. */
if (rld[j].reg_rtx)
for (k = 0; k < j; k++)
gcc_assert (rld[k].in == 0 || rld[k].reg_rtx == 0
--- 6087,6096 ----
|| rld[j].when_needed == RELOAD_FOR_INPADDR_ADDRESS)
? RELOAD_FOR_OTHER_ADDRESS : RELOAD_OTHER);
! /* Check to see if we accidentally converted two
! reloads that use the same reload register with
! different inputs to the same type. If so, the
! resulting code won't work. */
if (rld[j].reg_rtx)
for (k = 0; k < j; k++)
gcc_assert (rld[k].in == 0 || rld[k].reg_rtx == 0
Index: tree-flow-inline.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-flow-inline.h,v
retrieving revision 2.39
diff -c -3 -p -r2.39 tree-flow-inline.h
*** tree-flow-inline.h 21 Apr 2005 09:17:23 -0000 2.39
--- tree-flow-inline.h 21 Apr 2005 12:41:28 -0000
*************** link_imm_use_stmt (ssa_imm_use_t *linkno
*** 254,264 ****
static inline void
relink_imm_use (ssa_imm_use_t *node, ssa_imm_use_t *old)
{
- #ifdef ENABLE_CHECKING
/* The node one had better be in the same list. */
! if (*(old->use) != *(node->use))
! abort ();
! #endif
node->prev = old->prev;
node->next = old->next;
if (old->prev)
--- 254,261 ----
static inline void
relink_imm_use (ssa_imm_use_t *node, ssa_imm_use_t *old)
{
/* The node one had better be in the same list. */
! gcc_assert (*(old->use) == *(node->use));
node->prev = old->prev;
node->next = old->next;
if (old->prev)
Index: tree-inline.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v
retrieving revision 1.180
diff -c -3 -p -r1.180 tree-inline.c
*** tree-inline.c 13 Apr 2005 06:15:51 -0000 1.180
--- tree-inline.c 21 Apr 2005 12:41:33 -0000
*************** inline_forbidden_p_1 (tree *nodep, int *
*** 1069,1075 ****
UNION_TYPE nodes, then it goes into infinite recursion on a
structure containing a pointer to its own type. If it doesn't,
then the type node for S doesn't get adjusted properly when
! F is inlined, and we abort in find_function_data.
??? This is likely no longer true, but it's too late in the 4.0
cycle to try to find out. This should be checked for 4.1. */
--- 1069,1075 ----
UNION_TYPE nodes, then it goes into infinite recursion on a
structure containing a pointer to its own type. If it doesn't,
then the type node for S doesn't get adjusted properly when
! F is inlined.
??? This is likely no longer true, but it's too late in the 4.0
cycle to try to find out. This should be checked for 4.1. */
*************** estimate_num_insns_1 (tree *tp, int *wal
*** 1430,1436 ****
break;
}
default:
- /* Abort here se we know we don't miss any nodes. */
gcc_unreachable ();
}
return NULL;
--- 1430,1435 ----
Index: tree-optimize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-optimize.c,v
retrieving revision 2.84
diff -c -3 -p -r2.84 tree-optimize.c
*** tree-optimize.c 18 Apr 2005 06:10:35 -0000 2.84
--- tree-optimize.c 21 Apr 2005 12:41:34 -0000
*************** execute_todo (struct tree_opt_pass *pass
*** 476,482 ****
print_rtl (dump_file, get_insns ());
/* Flush the file. If verification fails, we won't be able to
! close the file before aborting. */
fflush (dump_file);
}
--- 476,482 ----
print_rtl (dump_file, get_insns ());
/* Flush the file. If verification fails, we won't be able to
! close the file before dieing. */
fflush (dump_file);
}
Index: tree-outof-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-outof-ssa.c,v
retrieving revision 2.54
diff -c -3 -p -r2.54 tree-outof-ssa.c
*** tree-outof-ssa.c 17 Apr 2005 06:41:49 -0000 2.54
--- tree-outof-ssa.c 21 Apr 2005 12:41:39 -0000
*************** eliminate_phi (edge e, elim_graph g)
*** 493,500 ****
gcc_assert (VARRAY_ACTIVE_SIZE (g->const_copies) == 0);
! /* Abnormal edges already have everything coalesced, or the coalescer
! would have aborted. */
if (e->flags & EDGE_ABNORMAL)
return;
--- 493,499 ----
gcc_assert (VARRAY_ACTIVE_SIZE (g->const_copies) == 0);
! /* Abnormal edges already have everything coalesced. */
if (e->flags & EDGE_ABNORMAL)
return;
Index: tree-ssa-alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-alias.c,v
retrieving revision 2.88
diff -c -3 -p -r2.88 tree-ssa-alias.c
*** tree-ssa-alias.c 21 Apr 2005 09:17:25 -0000 2.88
--- tree-ssa-alias.c 21 Apr 2005 12:41:46 -0000
*************** add_pointed_to_expr (struct alias_info *
*** 1958,1964 ****
}
/* Neither operand is a pointer? VAR can be pointing anywhere.
! FIXME: Shouldn't we abort here? If we get here, we found
PTR = INT_CST + INT_CST, which should not be a valid pointer
expression. */
if (!(POINTER_TYPE_P (TREE_TYPE (op0))
--- 1958,1964 ----
}
/* Neither operand is a pointer? VAR can be pointing anywhere.
! FIXME: Shouldn't we asserting here? If we get here, we found
PTR = INT_CST + INT_CST, which should not be a valid pointer
expression. */
if (!(POINTER_TYPE_P (TREE_TYPE (op0))
Index: tree-ssa-ccp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-ccp.c,v
retrieving revision 2.66
diff -c -3 -p -r2.66 tree-ssa-ccp.c
*** tree-ssa-ccp.c 17 Apr 2005 06:41:52 -0000 2.66
--- tree-ssa-ccp.c 21 Apr 2005 12:41:50 -0000
*************** maybe_fold_stmt_indirect (tree expr, tre
*** 1657,1663 ****
&& TREE_CODE (TREE_OPERAND (t, 0)) == STRING_CST)
{
/* FIXME: Except that this causes problems elsewhere with dead
! code not being deleted, and we abort in the rtl expanders
because we failed to remove some ssa_name. In the meantime,
just return zero. */
/* FIXME2: This condition should be signaled by
--- 1657,1663 ----
&& TREE_CODE (TREE_OPERAND (t, 0)) == STRING_CST)
{
/* FIXME: Except that this causes problems elsewhere with dead
! code not being deleted, and we die in the rtl expanders
because we failed to remove some ssa_name. In the meantime,
just return zero. */
/* FIXME2: This condition should be signaled by
Index: tree-ssa-operands.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-operands.c,v
retrieving revision 2.77
diff -c -3 -p -r2.77 tree-ssa-operands.c
*** tree-ssa-operands.c 17 Apr 2005 06:41:56 -0000 2.77
--- tree-ssa-operands.c 21 Apr 2005 12:41:57 -0000
*************** parse_ssa_operands (tree stmt)
*** 1084,1090 ****
default:
/* Notice that if get_expr_operands tries to use &STMT as the operand
! pointer (which may only happen for USE operands), we will abort in
append_use. This default will handle statements like empty
statements, or CALL_EXPRs that may appear on the RHS of a statement
or as statements themselves. */
--- 1084,1090 ----
default:
/* Notice that if get_expr_operands tries to use &STMT as the operand
! pointer (which may only happen for USE operands), we will fail in
append_use. This default will handle statements like empty
statements, or CALL_EXPRs that may appear on the RHS of a statement
or as statements themselves. */
*************** get_indirect_ref_operands (tree stmt, tr
*** 1680,1686 ****
/* Everything else *should* have been folded elsewhere, but users
are smarter than we in finding ways to write invalid code. We
! cannot just abort here. If we were absolutely certain that we
do handle all valid cases, then we could just do nothing here.
That seems optimistic, so attempt to do something logical... */
else if ((TREE_CODE (ptr) == PLUS_EXPR || TREE_CODE (ptr) == MINUS_EXPR)
--- 1680,1686 ----
/* Everything else *should* have been folded elsewhere, but users
are smarter than we in finding ways to write invalid code. We
! cannot just assert here. If we were absolutely certain that we
do handle all valid cases, then we could just do nothing here.
That seems optimistic, so attempt to do something logical... */
else if ((TREE_CODE (ptr) == PLUS_EXPR || TREE_CODE (ptr) == MINUS_EXPR)
*************** create_ssa_artficial_load_stmt (stmt_ope
*** 2219,2247 ****
ann->operands.vuse_ops = finalize_ssa_vuses (&(tmp.vuse_ops), NULL);
}
-
-
- /* Issue immediate use error for VAR to debug file F. */
- static void
- verify_abort (FILE *f, ssa_imm_use_t *var)
- {
- tree stmt;
- stmt = var->stmt;
- if (stmt)
- {
- if (stmt_modified_p(stmt))
- {
- fprintf (f, " STMT MODIFIED. - <%p> ", (void *)stmt);
- print_generic_stmt (f, stmt, TDF_SLIM);
- }
- }
- fprintf (f, " IMM ERROR : (use_p : tree - %p:%p)", (void *)var,
- (void *)var->use);
- print_generic_expr (f, USE_FROM_PTR (var), TDF_SLIM);
- fprintf(f, "\n");
- }
-
-
/* Scan the immediate_use list for VAR making sure its linked properly.
return RTUE iof there is a problem. */
--- 2219,2224 ----
*************** verify_imm_links (FILE *f, tree var)
*** 2268,2298 ****
for (ptr = list->next; ptr != list; )
{
if (prev != ptr->prev)
! {
! verify_abort (f, ptr);
! return true;
! }
!
if (ptr->use == NULL)
! {
! verify_abort (f, ptr); /* 2 roots, or SAFE guard node. */
! return true;
! }
! else
! if (*(ptr->use) != var)
! {
! verify_abort (f, ptr);
! return true;
! }
prev = ptr;
ptr = ptr->next;
/* Avoid infinite loops. */
if (count++ > 30000)
! {
! verify_abort (f, ptr);
! return true;
! }
}
/* Verify list in the other direction. */
--- 2245,2262 ----
for (ptr = list->next; ptr != list; )
{
if (prev != ptr->prev)
! goto error;
!
if (ptr->use == NULL)
! goto error; /* 2 roots, or SAFE guard node. */
! else if (*(ptr->use) != var)
! goto error;
prev = ptr;
ptr = ptr->next;
/* Avoid infinite loops. */
if (count++ > 30000)
! goto error;
}
/* Verify list in the other direction. */
*************** verify_imm_links (FILE *f, tree var)
*** 2300,2325 ****
for (ptr = list->prev; ptr != list; )
{
if (prev != ptr->next)
! {
! verify_abort (f, ptr);
! return true;
! }
prev = ptr;
ptr = ptr->prev;
if (count-- < 0)
! {
! verify_abort (f, ptr);
! return true;
! }
}
if (count != 0)
! {
! verify_abort (f, ptr);
! return true;
! }
return false;
}
--- 2264,2292 ----
for (ptr = list->prev; ptr != list; )
{
if (prev != ptr->next)
! goto error;
prev = ptr;
ptr = ptr->prev;
if (count-- < 0)
! goto error;
}
if (count != 0)
! goto error;
return false;
+
+ error:
+ if (ptr->stmt && stmt_modified_p (ptr->stmt))
+ {
+ fprintf (f, " STMT MODIFIED. - <%p> ", (void *)ptr->stmt);
+ print_generic_stmt (f, ptr->stmt, TDF_SLIM);
+ }
+ fprintf (f, " IMM ERROR : (use_p : tree - %p:%p)", (void *)ptr,
+ (void *)ptr->use);
+ print_generic_expr (f, USE_FROM_PTR (ptr), TDF_SLIM);
+ fprintf(f, "\n");
+ return true;
}
Index: tree-ssa-pre.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-pre.c,v
retrieving revision 2.79
diff -c -3 -p -r2.79 tree-ssa-pre.c
*** tree-ssa-pre.c 21 Apr 2005 09:17:28 -0000 2.79
--- tree-ssa-pre.c 21 Apr 2005 12:42:00 -0000
*************** find_or_generate_expression (basic_block
*** 1287,1295 ****
{
tree genop = bitmap_find_leader (AVAIL_OUT (block), expr);
! /* If it's still NULL, see if it is a complex expression, and if
! so, generate it recursively, otherwise, abort, because it's
! not really . */
if (genop == NULL)
{
genop = VALUE_HANDLE_EXPR_SET (expr)->head->expr;
--- 1287,1294 ----
{
tree genop = bitmap_find_leader (AVAIL_OUT (block), expr);
! /* If it's still NULL, it must be a complex expression, so generate
! it recursively. */
if (genop == NULL)
{
genop = VALUE_HANDLE_EXPR_SET (expr)->head->expr;
*************** find_or_generate_expression (basic_block
*** 1309,1315 ****
EXPR is the expression to insert (in value form)
STMTS is a statement list to append the necessary insertions into.
! This function will abort if we hit some value that shouldn't be
ANTIC but is (IE there is no leader for it, or its components).
This function may also generate expressions that are themselves
partially or fully redundant. Those that are will be either made
--- 1308,1314 ----
EXPR is the expression to insert (in value form)
STMTS is a statement list to append the necessary insertions into.
! This function will die if we hit some value that shouldn't be
ANTIC but is (IE there is no leader for it, or its components).
This function may also generate expressions that are themselves
partially or fully redundant. Those that are will be either made
Index: tree-ssanames.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssanames.c,v
retrieving revision 2.21
diff -c -3 -p -r2.21 tree-ssanames.c
*** tree-ssanames.c 5 Apr 2005 19:05:15 -0000 2.21
--- tree-ssanames.c 21 Apr 2005 12:42:00 -0000
***************
*** 1,23 ****
/* Generic routines for manipulating SSA_NAME expressions
Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
!
This file is part of GCC.
!
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
!
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
!
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
!
#include "config.h"
#include "system.h"
#include "coretypes.h"
--- 1,23 ----
/* Generic routines for manipulating SSA_NAME expressions
Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
!
This file is part of GCC.
!
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
!
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
!
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
!
#include "config.h"
#include "system.h"
#include "coretypes.h"
*************** release_ssa_name (tree var)
*** 260,272 ****
verify_imm_links (stderr, var);
#endif
while (imm->next != imm)
! {
! delink_imm_use (imm->next);
! }
! #ifdef ENABLE_CHECKING
! if (imm->next != imm)
! abort();
! #endif
VARRAY_TREE (ssa_names, SSA_NAME_VERSION (var)) = NULL;
memset (var, 0, tree_size (var));
--- 260,266 ----
verify_imm_links (stderr, var);
#endif
while (imm->next != imm)
! delink_imm_use (imm->next);
VARRAY_TREE (ssa_names, SSA_NAME_VERSION (var)) = NULL;
memset (var, 0, tree_size (var));
Index: tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.c,v
retrieving revision 1.472
diff -c -3 -p -r1.472 tree.c
*** tree.c 30 Mar 2005 21:34:29 -0000 1.472
--- tree.c 21 Apr 2005 12:42:16 -0000
*************** bit_position (tree field)
*** 1496,1504 ****
DECL_FIELD_BIT_OFFSET (field));
}
! /* Likewise, but return as an integer. Abort if it cannot be represented
! in that way (since it could be a signed value, we don't have the option
! of returning -1 like int_size_in_byte can. */
HOST_WIDE_INT
int_bit_position (tree field)
--- 1496,1504 ----
DECL_FIELD_BIT_OFFSET (field));
}
! /* Likewise, but return as an integer. It must be representable in
! that way (since it could be a signed value, we don't have the
! option of returning -1 like int_size_in_byte can. */
HOST_WIDE_INT
int_bit_position (tree field)
*************** byte_position (tree field)
*** 1516,1524 ****
DECL_FIELD_BIT_OFFSET (field));
}
! /* Likewise, but return as an integer. Abort if it cannot be represented
! in that way (since it could be a signed value, we don't have the option
! of returning -1 like int_size_in_byte can. */
HOST_WIDE_INT
int_byte_position (tree field)
--- 1516,1524 ----
DECL_FIELD_BIT_OFFSET (field));
}
! /* Likewise, but return as an integer. It must be representable in
! that way (since it could be a signed value, we don't have the
! option of returning -1 like int_size_in_byte can. */
HOST_WIDE_INT
int_byte_position (tree field)
*************** host_integerp (tree t, int pos)
*** 3838,3844 ****
/* Return the HOST_WIDE_INT least significant bits of T if it is an
INTEGER_CST and there is no overflow. POS is nonzero if the result must
! be positive. Abort if we cannot satisfy the above conditions. */
HOST_WIDE_INT
tree_low_cst (tree t, int pos)
--- 3838,3844 ----
/* Return the HOST_WIDE_INT least significant bits of T if it is an
INTEGER_CST and there is no overflow. POS is nonzero if the result must
! be positive. We must be able to satisfy the above conditions. */
HOST_WIDE_INT
tree_low_cst (tree t, int pos)
*************** walk_type_fields (tree type, walk_tree_f
*** 6411,6417 ****
/* Apply FUNC to all the sub-trees of TP in a pre-order traversal. FUNC is
called with the DATA and the address of each sub-tree. If FUNC returns a
! non-NULL value, the traversal is aborted, and the value returned by FUNC
is returned. If PSET is non-NULL it is used to record the nodes visited,
and to avoid visiting a node more than once. */
--- 6411,6417 ----
/* Apply FUNC to all the sub-trees of TP in a pre-order traversal. FUNC is
called with the DATA and the address of each sub-tree. If FUNC returns a
! non-NULL value, the traversal is stopped, and the value returned by FUNC
is returned. If PSET is non-NULL it is used to record the nodes visited,
and to avoid visiting a node more than once. */
Index: tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.715
diff -c -3 -p -r1.715 tree.h
*** tree.h 21 Apr 2005 09:17:31 -0000 1.715
--- tree.h 21 Apr 2005 12:42:23 -0000
*************** struct tree_common GTY(())
*** 443,449 ****
#define TREE_SET_CODE(NODE, VALUE) ((NODE)->common.code = (VALUE))
/* When checking is enabled, errors will be generated if a tree node
! is accessed incorrectly. The macros abort with a fatal error. */
#if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
#define TREE_CHECK(T, CODE) __extension__ \
--- 443,449 ----
#define TREE_SET_CODE(NODE, VALUE) ((NODE)->common.code = (VALUE))
/* When checking is enabled, errors will be generated if a tree node
! is accessed incorrectly. The macros die with a fatal error. */
#if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
#define TREE_CHECK(T, CODE) __extension__ \
Index: vec.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/vec.h,v
retrieving revision 2.24
diff -c -3 -p -r2.24 vec.h
*** vec.h 21 Apr 2005 09:17:38 -0000 2.24
--- vec.h 21 Apr 2005 12:42:27 -0000
*************** Software Foundation, 59 Temple Place - S
*** 61,67 ****
Each operation that increases the number of active elements is
available in 'quick' and 'safe' variants. The former presumes that
there is sufficient allocated space for the operation to succeed
! (it aborts if there is not). The latter will reallocate the
vector, if needed. Reallocation causes an exponential increase in
vector size. If you know you will be adding N elements, it would
be more efficient to use the reserve operation before adding the
--- 61,67 ----
Each operation that increases the number of active elements is
available in 'quick' and 'safe' variants. The former presumes that
there is sufficient allocated space for the operation to succeed
! (it dies if there is not). The latter will reallocate the
vector, if needed. Reallocation causes an exponential increase in
vector size. If you know you will be adding N elements, it would
be more efficient to use the reserve operation before adding the
*************** Software Foundation, 59 Temple Place - S
*** 150,156 ****
T VEC_T_last(VEC(T) *v); // Pointer
T *VEC_T_last(VEC(T) *v); // Object
! Return the final element. If V is empty, abort. */
#define VEC_last(T,V) (VEC_OP(T,base,last)(VEC_BASE(V) VEC_CHECK_INFO))
--- 150,156 ----
T VEC_T_last(VEC(T) *v); // Pointer
T *VEC_T_last(VEC(T) *v); // Object
! Return the final element. V must not be empty. */
#define VEC_last(T,V) (VEC_OP(T,base,last)(VEC_BASE(V) VEC_CHECK_INFO))
*************** Software Foundation, 59 Temple Place - S
*** 158,165 ****
T VEC_T_index(VEC(T) *v, unsigned ix); // Pointer
T *VEC_T_index(VEC(T) *v, unsigned ix); // Object
! Return the IX'th element. If IX is outside the domain of V,
! abort. */
#define VEC_index(T,V,I) (VEC_OP(T,base,index)(VEC_BASE(V),I VEC_CHECK_INFO))
--- 158,164 ----
T VEC_T_index(VEC(T) *v, unsigned ix); // Pointer
T *VEC_T_index(VEC(T) *v, unsigned ix); // Object
! Return the IX'th element. If IX must be in the domain of V. */
#define VEC_index(T,V,I) (VEC_OP(T,base,index)(VEC_BASE(V),I VEC_CHECK_INFO))
*************** Software Foundation, 59 Temple Place - S
*** 234,241 ****
Push a new element onto the end, returns a pointer to the slot
filled in. For object vectors, the new value can be NULL, in which
! case NO initialization is performed. Aborts if there is
! insufficient space in the vector. */
#define VEC_quick_push(T,V,O) \
(VEC_OP(T,base,quick_push)(VEC_BASE(V),O VEC_CHECK_INFO))
--- 233,240 ----
Push a new element onto the end, returns a pointer to the slot
filled in. For object vectors, the new value can be NULL, in which
! case NO initialization is performed. There must
! be sufficient space in the vector. */
#define VEC_quick_push(T,V,O) \
(VEC_OP(T,base,quick_push)(VEC_BASE(V),O VEC_CHECK_INFO))
*************** Software Foundation, 59 Temple Place - S
*** 299,305 ****
Insert an element, VAL, at the IXth position of V. Return a pointer
to the slot created. For vectors of object, the new value can be
NULL, in which case no initialization of the inserted slot takes
! place. Aborts if there is insufficient space. */
#define VEC_quick_insert(T,V,I,O) \
(VEC_OP(T,base,quick_insert)(VEC_BASE(V),I,O VEC_CHECK_INFO))
--- 298,304 ----
Insert an element, VAL, at the IXth position of V. Return a pointer
to the slot created. For vectors of object, the new value can be
NULL, in which case no initialization of the inserted slot takes
! place. There must be sufficient space. */
#define VEC_quick_insert(T,V,I,O) \
(VEC_OP(T,base,quick_insert)(VEC_BASE(V),I,O VEC_CHECK_INFO))