1998-07-02 07:42:39 -04:00
|
|
|
/* Virtual array support.
|
2000-01-17 12:16:21 -05:00
|
|
|
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
|
1998-07-02 07:42:39 -04:00
|
|
|
Contributed by Cygnus Solutions.
|
|
|
|
|
|
|
|
This file is part of GNU CC.
|
|
|
|
|
|
|
|
GNU CC 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.
|
|
|
|
|
|
|
|
GNU CC 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 GNU CC; see the file COPYING. If not, write to the Free
|
|
|
|
the Free Software Foundation, 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA. */
|
|
|
|
|
|
|
|
#ifndef _VARRAY_H_
|
|
|
|
#define _VARRAY_H_
|
|
|
|
|
|
|
|
#ifndef HOST_WIDE_INT
|
|
|
|
#include "machmode.h"
|
|
|
|
#endif
|
|
|
|
|
1998-07-10 12:12:26 -04:00
|
|
|
#ifndef __GCC_SYSTEM_H__
|
|
|
|
#include "system.h"
|
|
|
|
#endif
|
|
|
|
|
Use varrays for constant-equivalence data:
* varray.h (struct const_equiv_data): New type.
(union varray_data_tag): New element const_equiv.
(VARRAY_CONST_EQUIV_INIT, VARRAY_CONST_EQUIV): New macros.
(VARRAY_SIZE): New macro, returns number of elements.
* integrate.h: Include varray.h.
(struct inline_remap): Replace const_equiv_map, const_age_map and
const_equiv_map_size with a const_equiv_varray element.
(MAYBE_EXTEND_CONST_EQUIV_VARRAY): New macro; grows varray if needed.
(SET_CONST_EQUIV_DATA): New macro; sets rtx and age fields simultaneously,
growing the varray if needed.
* integrate.c (global_const_equiv_map, global_const_equiv_map_size): Deleted,
replaced by....
(global_const_equiv_varray): New variable.
(expand_inline_function): References changed.
* integrate.h: Update declarations.
* integrate.c (process_reg_parm, expand_inline_function,
copy_rtx_and_substitute, try_constants, subst_constants, mark_stores): Use
varray allocation and accessor macros, new integrate.h macros, and
global_const_equiv_varray. Don't conditionalize non-NULL stores on array size;
instead, expand the array as needed.
* unroll.c (unroll_loop): Likewise.
* unroll.c (unroll_loop): Initialize const_equiv_varray element to zero. After
allocating varray, always exit through bottom of function, where it can be
deallocated if needed. Don't explicitly reallocate const_equiv_map storage;
instead, just ensure the varray has been initialized, and update the global
reference.
From-SVN: r24956
1999-02-01 07:50:53 -05:00
|
|
|
/* Auxiliary structure used inside the varray structure, used for
|
|
|
|
function integration data. */
|
|
|
|
|
|
|
|
struct const_equiv_data {
|
|
|
|
/* Map pseudo reg number in calling function to equivalent constant. We
|
|
|
|
cannot in general substitute constants into parameter pseudo registers,
|
|
|
|
since some machine descriptions (many RISCs) won't always handle
|
|
|
|
the resulting insns. So if an incoming parameter has a constant
|
|
|
|
equivalent, we record it here, and if the resulting insn is
|
|
|
|
recognizable, we go with it.
|
|
|
|
|
|
|
|
We also use this mechanism to convert references to incoming arguments
|
|
|
|
and stacked variables. copy_rtx_and_substitute will replace the virtual
|
|
|
|
incoming argument and virtual stacked variables registers with new
|
|
|
|
pseudos that contain pointers into the replacement area allocated for
|
|
|
|
this inline instance. These pseudos are then marked as being equivalent
|
|
|
|
to the appropriate address and substituted if valid. */
|
1999-09-05 22:10:03 -04:00
|
|
|
struct rtx_def *rtx;
|
Use varrays for constant-equivalence data:
* varray.h (struct const_equiv_data): New type.
(union varray_data_tag): New element const_equiv.
(VARRAY_CONST_EQUIV_INIT, VARRAY_CONST_EQUIV): New macros.
(VARRAY_SIZE): New macro, returns number of elements.
* integrate.h: Include varray.h.
(struct inline_remap): Replace const_equiv_map, const_age_map and
const_equiv_map_size with a const_equiv_varray element.
(MAYBE_EXTEND_CONST_EQUIV_VARRAY): New macro; grows varray if needed.
(SET_CONST_EQUIV_DATA): New macro; sets rtx and age fields simultaneously,
growing the varray if needed.
* integrate.c (global_const_equiv_map, global_const_equiv_map_size): Deleted,
replaced by....
(global_const_equiv_varray): New variable.
(expand_inline_function): References changed.
* integrate.h: Update declarations.
* integrate.c (process_reg_parm, expand_inline_function,
copy_rtx_and_substitute, try_constants, subst_constants, mark_stores): Use
varray allocation and accessor macros, new integrate.h macros, and
global_const_equiv_varray. Don't conditionalize non-NULL stores on array size;
instead, expand the array as needed.
* unroll.c (unroll_loop): Likewise.
* unroll.c (unroll_loop): Initialize const_equiv_varray element to zero. After
allocating varray, always exit through bottom of function, where it can be
deallocated if needed. Don't explicitly reallocate const_equiv_map storage;
instead, just ensure the varray has been initialized, and update the global
reference.
From-SVN: r24956
1999-02-01 07:50:53 -05:00
|
|
|
|
|
|
|
/* Record the valid age for each entry. The entry is invalid if its
|
|
|
|
age is less than const_age. */
|
|
|
|
unsigned age;
|
|
|
|
};
|
|
|
|
|
1998-07-02 07:42:39 -04:00
|
|
|
/* Union of various array types that are used. */
|
|
|
|
typedef union varray_data_tag {
|
|
|
|
char c[1];
|
|
|
|
unsigned char uc[1];
|
|
|
|
short s[1];
|
|
|
|
unsigned short us[1];
|
|
|
|
int i[1];
|
|
|
|
unsigned int u[1];
|
|
|
|
long l[1];
|
|
|
|
unsigned long ul[1];
|
|
|
|
HOST_WIDE_INT hint[1];
|
|
|
|
unsigned HOST_WIDE_INT uhint[1];
|
gansidecl.h (__attribute__, [...]): Delete.
* gansidecl.h (__attribute__, ATTRIBUTE_UNUSED_LABEL,
ATTRIBUTE_UNUSED, ATTRIBUTE_NORETURN, ATTRIBUTE_PRINTF,
ATTRIBUTE_PRINTF_1, ATTRIBUTE_PRINTF_2, ATTRIBUTE_PRINTF_3,
ATTRIBUTE_PRINTF_4, ATTRIBUTE_PRINTF_5, GENERIC_PTR): Delete.
* c-decl.c (field_decl_cmp): Use PTR instead of GENERIC_PTR.
* cccp.c (pcfinclude): Likewise.
* global.c (allocno_compare): Likewise.
* haifa-sched.c (rank_for_schedule): Likewise.
* local-alloc.c (qty_sugg_compare_1, qty_compare_1): Likewise.
* reload1.c (hard_reg_use_compare, reload_reg_class_lower): Likewise.
* stupid.c (stupid_reg_compare): Likewise.
* tree.c (_obstack_allocated_p): Likewise.
* varray.h (varray_data_tag, VARRAY_GENERIC_PTR_INIT): Likewise.
From-SVN: r29208
1999-09-08 11:44:18 -04:00
|
|
|
PTR generic[1];
|
1998-07-02 07:42:39 -04:00
|
|
|
char *cptr[1];
|
|
|
|
struct rtx_def *rtx[1];
|
|
|
|
struct rtvec_def *rtvec[1];
|
|
|
|
union tree_node *tree[1];
|
|
|
|
struct bitmap_head_def *bitmap[1];
|
|
|
|
struct sched_info_tag *sched[1];
|
|
|
|
struct reg_info_def *reg[1];
|
Use varrays for constant-equivalence data:
* varray.h (struct const_equiv_data): New type.
(union varray_data_tag): New element const_equiv.
(VARRAY_CONST_EQUIV_INIT, VARRAY_CONST_EQUIV): New macros.
(VARRAY_SIZE): New macro, returns number of elements.
* integrate.h: Include varray.h.
(struct inline_remap): Replace const_equiv_map, const_age_map and
const_equiv_map_size with a const_equiv_varray element.
(MAYBE_EXTEND_CONST_EQUIV_VARRAY): New macro; grows varray if needed.
(SET_CONST_EQUIV_DATA): New macro; sets rtx and age fields simultaneously,
growing the varray if needed.
* integrate.c (global_const_equiv_map, global_const_equiv_map_size): Deleted,
replaced by....
(global_const_equiv_varray): New variable.
(expand_inline_function): References changed.
* integrate.h: Update declarations.
* integrate.c (process_reg_parm, expand_inline_function,
copy_rtx_and_substitute, try_constants, subst_constants, mark_stores): Use
varray allocation and accessor macros, new integrate.h macros, and
global_const_equiv_varray. Don't conditionalize non-NULL stores on array size;
instead, expand the array as needed.
* unroll.c (unroll_loop): Likewise.
* unroll.c (unroll_loop): Initialize const_equiv_varray element to zero. After
allocating varray, always exit through bottom of function, where it can be
deallocated if needed. Don't explicitly reallocate const_equiv_map storage;
instead, just ensure the varray has been initialized, and update the global
reference.
From-SVN: r24956
1999-02-01 07:50:53 -05:00
|
|
|
struct const_equiv_data const_equiv[1];
|
1999-02-25 18:45:42 -05:00
|
|
|
struct basic_block_def *bb[1];
|
2000-03-14 13:36:18 -05:00
|
|
|
struct elt_list *te[1];
|
1998-07-02 07:42:39 -04:00
|
|
|
} varray_data;
|
|
|
|
|
|
|
|
/* Virtual array of pointers header. */
|
|
|
|
typedef struct varray_head_tag {
|
|
|
|
size_t num_elements; /* maximum element number allocated */
|
1999-12-04 19:20:43 -05:00
|
|
|
size_t elements_used; /* the number of elements used, if
|
|
|
|
using VARRAY_PUSH/VARRAY_POP. */
|
1998-07-02 07:42:39 -04:00
|
|
|
size_t element_size; /* size of each data element */
|
|
|
|
const char *name; /* name of the varray for reporting errors */
|
|
|
|
varray_data data; /* data elements follow, must be last */
|
|
|
|
} *varray_type;
|
|
|
|
|
|
|
|
/* Allocate a virtual array with NUM elements, each of which is SIZE bytes
|
|
|
|
long, named NAME. Array elements are zeroed. */
|
2000-01-17 10:55:18 -05:00
|
|
|
extern varray_type varray_init PARAMS ((size_t, size_t, const char *));
|
1998-07-02 07:42:39 -04:00
|
|
|
|
|
|
|
#define VARRAY_CHAR_INIT(va, num, name) \
|
|
|
|
va = varray_init (num, sizeof (char), name)
|
|
|
|
|
|
|
|
#define VARRAY_UCHAR_INIT(va, num, name) \
|
|
|
|
va = varray_init (num, sizeof (unsigned char), name)
|
|
|
|
|
|
|
|
#define VARRAY_SHORT_INIT(va, num, name) \
|
|
|
|
va = varray_init (num, sizeof (short), name)
|
|
|
|
|
|
|
|
#define VARRAY_USHORT_INIT(va, num, name) \
|
|
|
|
va = varray_init (num, sizeof (unsigned short), name)
|
|
|
|
|
|
|
|
#define VARRAY_INT_INIT(va, num, name) \
|
|
|
|
va = varray_init (num, sizeof (int), name)
|
|
|
|
|
|
|
|
#define VARRAY_UINT_INIT(va, num, name) \
|
|
|
|
va = varray_init (num, sizeof (unsigned int), name)
|
|
|
|
|
|
|
|
#define VARRAY_LONG_INIT(va, num, name) \
|
|
|
|
va = varray_init (num, sizeof (long), name)
|
|
|
|
|
|
|
|
#define VARRAY_ULONG_INIT(va, num, name) \
|
|
|
|
va = varray_init (num, sizeof (unsigned long), name)
|
|
|
|
|
|
|
|
#define VARRAY_WIDE_INT_INIT(va, num, name) \
|
|
|
|
va = varray_init (num, sizeof (HOST_WIDE_INT), name)
|
|
|
|
|
|
|
|
#define VARRAY_UWIDE_INT_INIT(va, num, name) \
|
|
|
|
va = varray_init (num, sizeof (unsigned HOST_WIDE_INT), name)
|
|
|
|
|
|
|
|
#define VARRAY_GENERIC_PTR_INIT(va, num, name) \
|
gansidecl.h (__attribute__, [...]): Delete.
* gansidecl.h (__attribute__, ATTRIBUTE_UNUSED_LABEL,
ATTRIBUTE_UNUSED, ATTRIBUTE_NORETURN, ATTRIBUTE_PRINTF,
ATTRIBUTE_PRINTF_1, ATTRIBUTE_PRINTF_2, ATTRIBUTE_PRINTF_3,
ATTRIBUTE_PRINTF_4, ATTRIBUTE_PRINTF_5, GENERIC_PTR): Delete.
* c-decl.c (field_decl_cmp): Use PTR instead of GENERIC_PTR.
* cccp.c (pcfinclude): Likewise.
* global.c (allocno_compare): Likewise.
* haifa-sched.c (rank_for_schedule): Likewise.
* local-alloc.c (qty_sugg_compare_1, qty_compare_1): Likewise.
* reload1.c (hard_reg_use_compare, reload_reg_class_lower): Likewise.
* stupid.c (stupid_reg_compare): Likewise.
* tree.c (_obstack_allocated_p): Likewise.
* varray.h (varray_data_tag, VARRAY_GENERIC_PTR_INIT): Likewise.
From-SVN: r29208
1999-09-08 11:44:18 -04:00
|
|
|
va = varray_init (num, sizeof (PTR), name)
|
1998-07-02 07:42:39 -04:00
|
|
|
|
|
|
|
#define VARRAY_CHAR_PTR_INIT(va, num, name) \
|
|
|
|
va = varray_init (num, sizeof (char *), name)
|
|
|
|
|
|
|
|
#define VARRAY_RTX_INIT(va, num, name) \
|
|
|
|
va = varray_init (num, sizeof (struct rtx_def *), name)
|
|
|
|
|
|
|
|
#define VARRAY_RTVEC_INIT(va, num, name) \
|
|
|
|
va = varray_init (num, sizeof (struct rtvec_def), name)
|
|
|
|
|
|
|
|
#define VARRAY_TREE_INIT(va, num, name) \
|
|
|
|
va = varray_init (num, sizeof (union tree_node *), name)
|
|
|
|
|
|
|
|
#define VARRAY_BITMAP_INIT(va, num, name) \
|
|
|
|
va = varray_init (num, sizeof (struct bitmap_head_def *), name)
|
|
|
|
|
|
|
|
#define VARRAY_SCHED_INIT(va, num, name) \
|
|
|
|
va = varray_init (num, sizeof (struct sched_info_tag *), name)
|
|
|
|
|
|
|
|
#define VARRAY_REG_INIT(va, num, name) \
|
|
|
|
va = varray_init (num, sizeof (struct reg_info_def *), name)
|
|
|
|
|
Use varrays for constant-equivalence data:
* varray.h (struct const_equiv_data): New type.
(union varray_data_tag): New element const_equiv.
(VARRAY_CONST_EQUIV_INIT, VARRAY_CONST_EQUIV): New macros.
(VARRAY_SIZE): New macro, returns number of elements.
* integrate.h: Include varray.h.
(struct inline_remap): Replace const_equiv_map, const_age_map and
const_equiv_map_size with a const_equiv_varray element.
(MAYBE_EXTEND_CONST_EQUIV_VARRAY): New macro; grows varray if needed.
(SET_CONST_EQUIV_DATA): New macro; sets rtx and age fields simultaneously,
growing the varray if needed.
* integrate.c (global_const_equiv_map, global_const_equiv_map_size): Deleted,
replaced by....
(global_const_equiv_varray): New variable.
(expand_inline_function): References changed.
* integrate.h: Update declarations.
* integrate.c (process_reg_parm, expand_inline_function,
copy_rtx_and_substitute, try_constants, subst_constants, mark_stores): Use
varray allocation and accessor macros, new integrate.h macros, and
global_const_equiv_varray. Don't conditionalize non-NULL stores on array size;
instead, expand the array as needed.
* unroll.c (unroll_loop): Likewise.
* unroll.c (unroll_loop): Initialize const_equiv_varray element to zero. After
allocating varray, always exit through bottom of function, where it can be
deallocated if needed. Don't explicitly reallocate const_equiv_map storage;
instead, just ensure the varray has been initialized, and update the global
reference.
From-SVN: r24956
1999-02-01 07:50:53 -05:00
|
|
|
#define VARRAY_CONST_EQUIV_INIT(va, num, name) \
|
|
|
|
va = varray_init (num, sizeof (struct const_equiv_data), name)
|
|
|
|
|
1999-02-25 18:45:42 -05:00
|
|
|
#define VARRAY_BB_INIT(va, num, name) \
|
|
|
|
va = varray_init (num, sizeof (struct basic_block_def *), name)
|
|
|
|
|
2000-03-14 13:36:18 -05:00
|
|
|
#define VARRAY_ELT_LIST_INIT(va, num, name) \
|
|
|
|
va = varray_init (num, sizeof (struct elt_list *), name)
|
|
|
|
|
1998-07-02 07:42:39 -04:00
|
|
|
/* Free up memory allocated by the virtual array, but do not free any of the
|
|
|
|
elements involved. */
|
1998-08-17 05:08:32 -04:00
|
|
|
#define VARRAY_FREE(vp) \
|
|
|
|
do { if (vp) { free (vp); vp = (varray_type)0; } } while (0)
|
1998-07-02 07:42:39 -04:00
|
|
|
|
|
|
|
/* Grow/shrink the virtual array VA to N elements. */
|
2000-01-17 10:55:18 -05:00
|
|
|
extern varray_type varray_grow PARAMS ((varray_type, size_t));
|
1998-07-02 07:42:39 -04:00
|
|
|
|
|
|
|
#define VARRAY_GROW(VA, N) ((VA) = varray_grow (VA, N))
|
|
|
|
|
Use varrays for constant-equivalence data:
* varray.h (struct const_equiv_data): New type.
(union varray_data_tag): New element const_equiv.
(VARRAY_CONST_EQUIV_INIT, VARRAY_CONST_EQUIV): New macros.
(VARRAY_SIZE): New macro, returns number of elements.
* integrate.h: Include varray.h.
(struct inline_remap): Replace const_equiv_map, const_age_map and
const_equiv_map_size with a const_equiv_varray element.
(MAYBE_EXTEND_CONST_EQUIV_VARRAY): New macro; grows varray if needed.
(SET_CONST_EQUIV_DATA): New macro; sets rtx and age fields simultaneously,
growing the varray if needed.
* integrate.c (global_const_equiv_map, global_const_equiv_map_size): Deleted,
replaced by....
(global_const_equiv_varray): New variable.
(expand_inline_function): References changed.
* integrate.h: Update declarations.
* integrate.c (process_reg_parm, expand_inline_function,
copy_rtx_and_substitute, try_constants, subst_constants, mark_stores): Use
varray allocation and accessor macros, new integrate.h macros, and
global_const_equiv_varray. Don't conditionalize non-NULL stores on array size;
instead, expand the array as needed.
* unroll.c (unroll_loop): Likewise.
* unroll.c (unroll_loop): Initialize const_equiv_varray element to zero. After
allocating varray, always exit through bottom of function, where it can be
deallocated if needed. Don't explicitly reallocate const_equiv_map storage;
instead, just ensure the varray has been initialized, and update the global
reference.
From-SVN: r24956
1999-02-01 07:50:53 -05:00
|
|
|
#define VARRAY_SIZE(VA) ((VA)->num_elements)
|
|
|
|
|
2000-04-07 05:24:06 -04:00
|
|
|
#define VARRAY_ACTIVE_SIZE(VA) ((VA)->elements_used)
|
|
|
|
#define VARRAY_POP_ALL(VA) ((VA)->elements_used = 0)
|
|
|
|
|
system.h: Don't redefine abort or trim_filename.
1999-08-25 22:10 -0700 Zack Weinberg <zack@bitmover.com>
* system.h: Don't redefine abort or trim_filename.
* rtl.h: Define abort to fancy_abort (__FILE__, __LINE__, 0)
or fancy_abort (__FILE__, __LINE__, __FUNCTION__) depending on
whether or not __FUNCTION__ is available.
* tree.h: Duplicate rtl.h's definition of abort, for files
that don't include rtl.h. Delete all code to perform type
checking with a compiler other than GCC.
* varray.h: Delete all code to perform type checking with a
compiler other than GCC. Make VARRAY_CHECK() always evaluate
its arguments exactly once, using a statement expression.
Adjust the VARRAY_<type> accessor macros to match.
* toplev.h (fatal_insn, fatal_insn_not_found): Kill.
(_fatal_insn, _fatal_insn_not_found): New fns, take info on
caller's location. Define fatal_insn and fatal_insn_not_found
as macros that use _fatal_insn and _fatal_insn_not_found.
(fancy_abort, trim_filename): Kill prototypes.
* rtl.c (trim_filename): Move here from toplev.c.
(fancy_abort): New function.
(DIR_SEPARATOR): Provide default definition.
* tree.c (tree_check_failed, tree_class_check_failed): Go
through fancy_abort.
(tree_check, tree_class_check, cst_or_constructor_check,
expr_check): Delete.
* varray.c (varray_check_failed): New function.
* toplev.c (fatal_insn, fatal_insn_not_found): Replace with
_fatal_insn and _fatal_insn_not_found. Go through
fancy_abort.
(trim_filename, fancy_abort): Delete.
* builtins.c (expand_builtin_args_info): Report ICE with abort.
* except.c (start_catch_handler): Report ICE with error/abort
combo.
* final.c (output_operand_lossage): Likewise.
* flow.c (verify_flow_info): Likewise.
* gcc.c: Prototype fatal.
* gengenrtl.c: Undef abort after including rtl.h not system.h.
* genattr.c, genattrtab.c, genemit.c, genextract.c,
genflags.c, genopinit.c, genoutput.c, genpeep.c, genrecog.c:
Don't define fancy_abort.
From-SVN: r28889
1999-08-26 01:18:44 -04:00
|
|
|
/* Check for VARRAY_xxx macros being in bound. */
|
1999-11-10 12:57:21 -05:00
|
|
|
#if defined ENABLE_CHECKING && (GCC_VERSION >= 2007)
|
2000-01-17 10:55:18 -05:00
|
|
|
extern void varray_check_failed PARAMS ((varray_type, size_t,
|
system.h: Don't redefine abort or trim_filename.
1999-08-25 22:10 -0700 Zack Weinberg <zack@bitmover.com>
* system.h: Don't redefine abort or trim_filename.
* rtl.h: Define abort to fancy_abort (__FILE__, __LINE__, 0)
or fancy_abort (__FILE__, __LINE__, __FUNCTION__) depending on
whether or not __FUNCTION__ is available.
* tree.h: Duplicate rtl.h's definition of abort, for files
that don't include rtl.h. Delete all code to perform type
checking with a compiler other than GCC.
* varray.h: Delete all code to perform type checking with a
compiler other than GCC. Make VARRAY_CHECK() always evaluate
its arguments exactly once, using a statement expression.
Adjust the VARRAY_<type> accessor macros to match.
* toplev.h (fatal_insn, fatal_insn_not_found): Kill.
(_fatal_insn, _fatal_insn_not_found): New fns, take info on
caller's location. Define fatal_insn and fatal_insn_not_found
as macros that use _fatal_insn and _fatal_insn_not_found.
(fancy_abort, trim_filename): Kill prototypes.
* rtl.c (trim_filename): Move here from toplev.c.
(fancy_abort): New function.
(DIR_SEPARATOR): Provide default definition.
* tree.c (tree_check_failed, tree_class_check_failed): Go
through fancy_abort.
(tree_check, tree_class_check, cst_or_constructor_check,
expr_check): Delete.
* varray.c (varray_check_failed): New function.
* toplev.c (fatal_insn, fatal_insn_not_found): Replace with
_fatal_insn and _fatal_insn_not_found. Go through
fancy_abort.
(trim_filename, fancy_abort): Delete.
* builtins.c (expand_builtin_args_info): Report ICE with abort.
* except.c (start_catch_handler): Report ICE with error/abort
combo.
* final.c (output_operand_lossage): Likewise.
* flow.c (verify_flow_info): Likewise.
* gcc.c: Prototype fatal.
* gengenrtl.c: Undef abort after including rtl.h not system.h.
* genattr.c, genattrtab.c, genemit.c, genextract.c,
genflags.c, genopinit.c, genoutput.c, genpeep.c, genrecog.c:
Don't define fancy_abort.
From-SVN: r28889
1999-08-26 01:18:44 -04:00
|
|
|
const char *, int,
|
|
|
|
const char *)) ATTRIBUTE_NORETURN;
|
2000-05-06 16:00:03 -04:00
|
|
|
#define VARRAY_CHECK(VA, N, T) __extension__ \
|
system.h: Don't redefine abort or trim_filename.
1999-08-25 22:10 -0700 Zack Weinberg <zack@bitmover.com>
* system.h: Don't redefine abort or trim_filename.
* rtl.h: Define abort to fancy_abort (__FILE__, __LINE__, 0)
or fancy_abort (__FILE__, __LINE__, __FUNCTION__) depending on
whether or not __FUNCTION__ is available.
* tree.h: Duplicate rtl.h's definition of abort, for files
that don't include rtl.h. Delete all code to perform type
checking with a compiler other than GCC.
* varray.h: Delete all code to perform type checking with a
compiler other than GCC. Make VARRAY_CHECK() always evaluate
its arguments exactly once, using a statement expression.
Adjust the VARRAY_<type> accessor macros to match.
* toplev.h (fatal_insn, fatal_insn_not_found): Kill.
(_fatal_insn, _fatal_insn_not_found): New fns, take info on
caller's location. Define fatal_insn and fatal_insn_not_found
as macros that use _fatal_insn and _fatal_insn_not_found.
(fancy_abort, trim_filename): Kill prototypes.
* rtl.c (trim_filename): Move here from toplev.c.
(fancy_abort): New function.
(DIR_SEPARATOR): Provide default definition.
* tree.c (tree_check_failed, tree_class_check_failed): Go
through fancy_abort.
(tree_check, tree_class_check, cst_or_constructor_check,
expr_check): Delete.
* varray.c (varray_check_failed): New function.
* toplev.c (fatal_insn, fatal_insn_not_found): Replace with
_fatal_insn and _fatal_insn_not_found. Go through
fancy_abort.
(trim_filename, fancy_abort): Delete.
* builtins.c (expand_builtin_args_info): Report ICE with abort.
* except.c (start_catch_handler): Report ICE with error/abort
combo.
* final.c (output_operand_lossage): Likewise.
* flow.c (verify_flow_info): Likewise.
* gcc.c: Prototype fatal.
* gengenrtl.c: Undef abort after including rtl.h not system.h.
* genattr.c, genattrtab.c, genemit.c, genextract.c,
genflags.c, genopinit.c, genoutput.c, genpeep.c, genrecog.c:
Don't define fancy_abort.
From-SVN: r28889
1999-08-26 01:18:44 -04:00
|
|
|
(*({ varray_type _va = VA; \
|
|
|
|
size_t _n = N; \
|
|
|
|
if (_n >= _va->num_elements) \
|
2000-07-21 03:10:36 -04:00
|
|
|
varray_check_failed (_va, _n, __FILE__, __LINE__, __FUNCTION__); \
|
system.h: Don't redefine abort or trim_filename.
1999-08-25 22:10 -0700 Zack Weinberg <zack@bitmover.com>
* system.h: Don't redefine abort or trim_filename.
* rtl.h: Define abort to fancy_abort (__FILE__, __LINE__, 0)
or fancy_abort (__FILE__, __LINE__, __FUNCTION__) depending on
whether or not __FUNCTION__ is available.
* tree.h: Duplicate rtl.h's definition of abort, for files
that don't include rtl.h. Delete all code to perform type
checking with a compiler other than GCC.
* varray.h: Delete all code to perform type checking with a
compiler other than GCC. Make VARRAY_CHECK() always evaluate
its arguments exactly once, using a statement expression.
Adjust the VARRAY_<type> accessor macros to match.
* toplev.h (fatal_insn, fatal_insn_not_found): Kill.
(_fatal_insn, _fatal_insn_not_found): New fns, take info on
caller's location. Define fatal_insn and fatal_insn_not_found
as macros that use _fatal_insn and _fatal_insn_not_found.
(fancy_abort, trim_filename): Kill prototypes.
* rtl.c (trim_filename): Move here from toplev.c.
(fancy_abort): New function.
(DIR_SEPARATOR): Provide default definition.
* tree.c (tree_check_failed, tree_class_check_failed): Go
through fancy_abort.
(tree_check, tree_class_check, cst_or_constructor_check,
expr_check): Delete.
* varray.c (varray_check_failed): New function.
* toplev.c (fatal_insn, fatal_insn_not_found): Replace with
_fatal_insn and _fatal_insn_not_found. Go through
fancy_abort.
(trim_filename, fancy_abort): Delete.
* builtins.c (expand_builtin_args_info): Report ICE with abort.
* except.c (start_catch_handler): Report ICE with error/abort
combo.
* final.c (output_operand_lossage): Likewise.
* flow.c (verify_flow_info): Likewise.
* gcc.c: Prototype fatal.
* gengenrtl.c: Undef abort after including rtl.h not system.h.
* genattr.c, genattrtab.c, genemit.c, genextract.c,
genflags.c, genopinit.c, genoutput.c, genpeep.c, genrecog.c:
Don't define fancy_abort.
From-SVN: r28889
1999-08-26 01:18:44 -04:00
|
|
|
&_va->data.T[_n]; }))
|
1998-07-02 07:42:39 -04:00
|
|
|
#else
|
system.h: Don't redefine abort or trim_filename.
1999-08-25 22:10 -0700 Zack Weinberg <zack@bitmover.com>
* system.h: Don't redefine abort or trim_filename.
* rtl.h: Define abort to fancy_abort (__FILE__, __LINE__, 0)
or fancy_abort (__FILE__, __LINE__, __FUNCTION__) depending on
whether or not __FUNCTION__ is available.
* tree.h: Duplicate rtl.h's definition of abort, for files
that don't include rtl.h. Delete all code to perform type
checking with a compiler other than GCC.
* varray.h: Delete all code to perform type checking with a
compiler other than GCC. Make VARRAY_CHECK() always evaluate
its arguments exactly once, using a statement expression.
Adjust the VARRAY_<type> accessor macros to match.
* toplev.h (fatal_insn, fatal_insn_not_found): Kill.
(_fatal_insn, _fatal_insn_not_found): New fns, take info on
caller's location. Define fatal_insn and fatal_insn_not_found
as macros that use _fatal_insn and _fatal_insn_not_found.
(fancy_abort, trim_filename): Kill prototypes.
* rtl.c (trim_filename): Move here from toplev.c.
(fancy_abort): New function.
(DIR_SEPARATOR): Provide default definition.
* tree.c (tree_check_failed, tree_class_check_failed): Go
through fancy_abort.
(tree_check, tree_class_check, cst_or_constructor_check,
expr_check): Delete.
* varray.c (varray_check_failed): New function.
* toplev.c (fatal_insn, fatal_insn_not_found): Replace with
_fatal_insn and _fatal_insn_not_found. Go through
fancy_abort.
(trim_filename, fancy_abort): Delete.
* builtins.c (expand_builtin_args_info): Report ICE with abort.
* except.c (start_catch_handler): Report ICE with error/abort
combo.
* final.c (output_operand_lossage): Likewise.
* flow.c (verify_flow_info): Likewise.
* gcc.c: Prototype fatal.
* gengenrtl.c: Undef abort after including rtl.h not system.h.
* genattr.c, genattrtab.c, genemit.c, genextract.c,
genflags.c, genopinit.c, genoutput.c, genpeep.c, genrecog.c:
Don't define fancy_abort.
From-SVN: r28889
1999-08-26 01:18:44 -04:00
|
|
|
#define VARRAY_CHECK(VA, N, T) ((VA)->data.T[N])
|
1998-07-02 07:42:39 -04:00
|
|
|
#endif
|
|
|
|
|
1999-12-04 19:20:43 -05:00
|
|
|
/* Push X onto VA. T is the name of the field in varray_data
|
|
|
|
corresponding to the type of X. */
|
|
|
|
#define VARRAY_PUSH(VA, T, X) \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
if ((VA)->elements_used >= (VA)->num_elements) \
|
|
|
|
VARRAY_GROW ((VA), 2 * (VA)->num_elements); \
|
|
|
|
(VA)->data.T[(VA)->elements_used++] = (X); \
|
|
|
|
} \
|
|
|
|
while (0)
|
|
|
|
|
|
|
|
/* Pop the top element of VA. */
|
|
|
|
#define VARRAY_POP(VA) \
|
|
|
|
((VA)->elements_used--)
|
|
|
|
|
|
|
|
/* Return the top element of VA. */
|
|
|
|
#define VARRAY_TOP(VA, T) \
|
|
|
|
((VA)->data.T[(VA)->elements_used - 1])
|
|
|
|
|
system.h: Don't redefine abort or trim_filename.
1999-08-25 22:10 -0700 Zack Weinberg <zack@bitmover.com>
* system.h: Don't redefine abort or trim_filename.
* rtl.h: Define abort to fancy_abort (__FILE__, __LINE__, 0)
or fancy_abort (__FILE__, __LINE__, __FUNCTION__) depending on
whether or not __FUNCTION__ is available.
* tree.h: Duplicate rtl.h's definition of abort, for files
that don't include rtl.h. Delete all code to perform type
checking with a compiler other than GCC.
* varray.h: Delete all code to perform type checking with a
compiler other than GCC. Make VARRAY_CHECK() always evaluate
its arguments exactly once, using a statement expression.
Adjust the VARRAY_<type> accessor macros to match.
* toplev.h (fatal_insn, fatal_insn_not_found): Kill.
(_fatal_insn, _fatal_insn_not_found): New fns, take info on
caller's location. Define fatal_insn and fatal_insn_not_found
as macros that use _fatal_insn and _fatal_insn_not_found.
(fancy_abort, trim_filename): Kill prototypes.
* rtl.c (trim_filename): Move here from toplev.c.
(fancy_abort): New function.
(DIR_SEPARATOR): Provide default definition.
* tree.c (tree_check_failed, tree_class_check_failed): Go
through fancy_abort.
(tree_check, tree_class_check, cst_or_constructor_check,
expr_check): Delete.
* varray.c (varray_check_failed): New function.
* toplev.c (fatal_insn, fatal_insn_not_found): Replace with
_fatal_insn and _fatal_insn_not_found. Go through
fancy_abort.
(trim_filename, fancy_abort): Delete.
* builtins.c (expand_builtin_args_info): Report ICE with abort.
* except.c (start_catch_handler): Report ICE with error/abort
combo.
* final.c (output_operand_lossage): Likewise.
* flow.c (verify_flow_info): Likewise.
* gcc.c: Prototype fatal.
* gengenrtl.c: Undef abort after including rtl.h not system.h.
* genattr.c, genattrtab.c, genemit.c, genextract.c,
genflags.c, genopinit.c, genoutput.c, genpeep.c, genrecog.c:
Don't define fancy_abort.
From-SVN: r28889
1999-08-26 01:18:44 -04:00
|
|
|
#define VARRAY_CHAR(VA, N) VARRAY_CHECK (VA, N, c)
|
|
|
|
#define VARRAY_UCHAR(VA, N) VARRAY_CHECK (VA, N, uc)
|
|
|
|
#define VARRAY_SHORT(VA, N) VARRAY_CHECK (VA, N, s)
|
|
|
|
#define VARRAY_USHORT(VA, N) VARRAY_CHECK (VA, N, us)
|
|
|
|
#define VARRAY_INT(VA, N) VARRAY_CHECK (VA, N, i)
|
|
|
|
#define VARRAY_UINT(VA, N) VARRAY_CHECK (VA, N, u)
|
|
|
|
#define VARRAY_LONG(VA, N) VARRAY_CHECK (VA, N, l)
|
|
|
|
#define VARRAY_ULONG(VA, N) VARRAY_CHECK (VA, N, ul)
|
|
|
|
#define VARRAY_WIDE_INT(VA, N) VARRAY_CHECK (VA, N, hint)
|
|
|
|
#define VARRAY_UWIDE_INT(VA, N) VARRAY_CHECK (VA, N, uhint)
|
|
|
|
#define VARRAY_GENERIC_PTR(VA,N) VARRAY_CHECK (VA, N, generic)
|
|
|
|
#define VARRAY_CHAR_PTR(VA,N) VARRAY_CHECK (VA, N, cptr)
|
|
|
|
#define VARRAY_RTX(VA, N) VARRAY_CHECK (VA, N, rtx)
|
|
|
|
#define VARRAY_RTVEC(VA, N) VARRAY_CHECK (VA, N, rtvec)
|
|
|
|
#define VARRAY_TREE(VA, N) VARRAY_CHECK (VA, N, tree)
|
|
|
|
#define VARRAY_BITMAP(VA, N) VARRAY_CHECK (VA, N, bitmap)
|
|
|
|
#define VARRAY_SCHED(VA, N) VARRAY_CHECK (VA, N, sched)
|
|
|
|
#define VARRAY_REG(VA, N) VARRAY_CHECK (VA, N, reg)
|
|
|
|
#define VARRAY_CONST_EQUIV(VA, N) VARRAY_CHECK (VA, N, const_equiv)
|
|
|
|
#define VARRAY_BB(VA, N) VARRAY_CHECK (VA, N, bb)
|
2000-03-14 13:36:18 -05:00
|
|
|
#define VARRAY_ELT_LIST(VA, N) VARRAY_CHECK (VA, N, te)
|
1998-07-02 07:42:39 -04:00
|
|
|
|
1999-12-04 19:20:43 -05:00
|
|
|
/* Push a new element on the end of VA, extending it if necessary. */
|
|
|
|
#define VARRAY_PUSH_CHAR(VA, X) VARRAY_PUSH (VA, c, X)
|
|
|
|
#define VARRAY_PUSH_UCHAR(VA, X) VARRAY_PUSH (VA, uc, X)
|
|
|
|
#define VARRAY_PUSH_SHORT(VA, X) VARRAY_PUSH (VA, s, X)
|
|
|
|
#define VARRAY_PUSH_USHORT(VA, X) VARRAY_PUSH (VA, us, X)
|
|
|
|
#define VARRAY_PUSH_INT(VA, X) VARRAY_PUSH (VA, i, X)
|
|
|
|
#define VARRAY_PUSH_UINT(VA, X) VARRAY_PUSH (VA, u, X)
|
|
|
|
#define VARRAY_PUSH_LONG(VA, X) VARRAY_PUSH (VA, l, X)
|
|
|
|
#define VARRAY_PUSH_ULONG(VA, X) VARRAY_PUSH (VA, ul, X)
|
|
|
|
#define VARRAY_PUSH_WIDE_INT(VA, X) VARRAY_PUSH (VA, hint, X)
|
|
|
|
#define VARRAY_PUSH_UWIDE_INT(VA, X) VARRAY_PUSH (VA, uhint, X)
|
2000-06-01 16:13:29 -04:00
|
|
|
#define VARRAY_PUSH_GENERIC_PTR(VA, X) VARRAY_PUSH (VA, generic, X)
|
|
|
|
#define VARRAY_PUSH_CHAR_PTR(VA, X) VARRAY_PUSH (VA, cptr, X)
|
1999-12-04 19:20:43 -05:00
|
|
|
#define VARRAY_PUSH_RTX(VA, X) VARRAY_PUSH (VA, rtx, X)
|
|
|
|
#define VARRAY_PUSH_RTVEC(VA, X) VARRAY_PUSH (VA, rtvec, X)
|
|
|
|
#define VARRAY_PUSH_TREE(VA, X) VARRAY_PUSH (VA, tree, X)
|
|
|
|
#define VARRAY_PUSH_BITMAP(VA, X) VARRAY_PUSH (VA, bitmap, X)
|
|
|
|
#define VARRAY_PUSH_SCHED(VA, X) VARRAY_PUSH (VA, sched, X)
|
|
|
|
#define VARRAY_PUSH_REG(VA, X) VARRAY_PUSH (VA, reg, X)
|
|
|
|
#define VARRAY_PUSH_CONST_EQUIV(VA, X) VARRAY_PUSH (VA, const_equiv, X)
|
|
|
|
#define VARRAY_PUSH_BB(VA, X) VARRAY_PUSH (VA, bb, X)
|
|
|
|
|
|
|
|
/* Return the last element of VA. */
|
|
|
|
#define VARRAY_TOP_CHAR(VA) VARRAY_TOP (VA, c)
|
|
|
|
#define VARRAY_TOP_UCHAR(VA) VARRAY_TOP (VA, uc)
|
|
|
|
#define VARRAY_TOP_SHORT(VA) VARRAY_TOP (VA, s)
|
|
|
|
#define VARRAY_TOP_USHORT(VA) VARRAY_TOP (VA, us)
|
|
|
|
#define VARRAY_TOP_INT(VA) VARRAY_TOP (VA, i)
|
|
|
|
#define VARRAY_TOP_UINT(VA) VARRAY_TOP (VA, u)
|
|
|
|
#define VARRAY_TOP_LONG(VA) VARRAY_TOP (VA, l)
|
|
|
|
#define VARRAY_TOP_ULONG(VA) VARRAY_TOP (VA, ul)
|
|
|
|
#define VARRAY_TOP_WIDE_INT(VA) VARRAY_TOP (VA, hint)
|
|
|
|
#define VARRAY_TOP_UWIDE_INT(VA) VARRAY_TOP (VA, uhint)
|
|
|
|
#define VARRAY_TOP_GENERIC_PTR(VA,N) VARRAY_TOP (VA, generic)
|
|
|
|
#define VARRAY_TOP_CHAR_PTR(VA,N) VARRAY_TOP (VA, cptr)
|
|
|
|
#define VARRAY_TOP_RTX(VA) VARRAY_TOP (VA, rtx)
|
|
|
|
#define VARRAY_TOP_RTVEC(VA) VARRAY_TOP (VA, rtvec)
|
|
|
|
#define VARRAY_TOP_TREE(VA) VARRAY_TOP (VA, tree)
|
|
|
|
#define VARRAY_TOP_BITMAP(VA) VARRAY_TOP (VA, bitmap)
|
|
|
|
#define VARRAY_TOP_SCHED(VA) VARRAY_TOP (VA, sched)
|
|
|
|
#define VARRAY_TOP_REG(VA) VARRAY_TOP (VA, reg)
|
|
|
|
#define VARRAY_TOP_CONST_EQUIV(VA) VARRAY_TOP (VA, const_equiv)
|
|
|
|
#define VARRAY_TOP_BB(VA) VARRAY_TOP (VA, bb)
|
|
|
|
|
1998-07-02 07:42:39 -04:00
|
|
|
#endif /* _VARRAY_H_ */
|