1992-06-30 05:11:04 +02:00
|
|
|
|
/* Handle #pragma, system V.4 style. Supports #pragma weak and #pragma pack.
|
2000-02-26 06:54:31 +01:00
|
|
|
|
Copyright (C) 1992, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
1992-06-30 05:11:04 +02:00
|
|
|
|
|
|
|
|
|
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
|
1995-06-15 13:33:25 +02:00
|
|
|
|
the Free Software Foundation, 59 Temple Place - Suite 330,
|
|
|
|
|
Boston, MA 02111-1307, USA. */
|
1992-06-30 05:11:04 +02:00
|
|
|
|
|
1992-06-30 05:17:52 +02:00
|
|
|
|
#include "config.h"
|
Major cutover to using system.h:
* Makefile.in (alias.o, bitmap.o, c-aux-info.o, c-common.o,
c-decl.o, c-iterate.o, c-lang.o, c-lex.o, c-pragma.o, c-typeck.o,
caller-save.o, calls.o, collect2.o, combine.o, cse.o, dbxout.o,
dwarf2out.o, dwarfout.o, emit-rtl.o, except.o, explow.o, expmed.o,
expr.o, final.o, flow.o, function.o, getpwd.o, global.o,
integrate.o, jump.o, local-alloc.o, loop.o, optabs.o, pexecute.o,
prefix.o, print-rtl.o, print-tree.o, profile.o, real.o, recog.o,
reg-stack.o, regclass.o, regmove.o, reload.o, reload1.o, reorg.o,
rtl.o, rtlanal.o, sdbout.o, stmt.o, stor-layout.o, stupid.o,
tlink.o, toplev.o, tree.o, unroll.o, varasm.o, xcoffout.o): Depend
on system.h.
* alias.c, bitmap.c, c-aux-info.c, c-common.c, c-decl.c,
c-iterate.c, c-lang.c, c-lex.c, c-pragma.c, c-typeck.c,
caller-save.c, calls.c, collect2.c, combine.c, cse.c, dbxout.c,
dwarf2out.c, dwarfout.c, emit-rtl.c, except.c, explow.c, expmed.c,
expr.c, final.c, flow.c, function.c, gcc.c, getpwd.c, global.c,
integrate.c, jump.c, local-alloc.c, loop.c, optabs.c, pexecute.c,
prefix.c, print-rtl.c, print-tree.c, profile.c, real.c, recog.c,
reg-stack.c, regclass.c, regmove.c, reload.c, reload1.c, reorg.c,
rtl.c, rtlanal.c, sched.c, sdbout.c, stmt.c, stor-layout.c,
stupid.c, tlink.c, toplev.c, tree.c, unroll.c, varasm.c,
xcoffout.c: Include system.h. Organize include ordering so
that stdarg/varargs comes before other system headers. Remove
spurious casts of functions assured of a prototype in system.h.
From-SVN: r18726
1998-03-20 15:58:42 +01:00
|
|
|
|
#include "system.h"
|
1998-05-28 08:47:21 +02:00
|
|
|
|
#include "rtl.h"
|
1992-06-30 05:17:52 +02:00
|
|
|
|
#include "tree.h"
|
1993-09-21 23:25:24 +02:00
|
|
|
|
#include "function.h"
|
1994-02-28 01:47:28 +01:00
|
|
|
|
#include "defaults.h"
|
1995-04-18 20:16:51 +02:00
|
|
|
|
#include "c-pragma.h"
|
1997-12-22 11:05:04 +01:00
|
|
|
|
#include "flags.h"
|
toplev.h: New file.
Wed May 6 06:35:38 1998 Robert Lipe <robertl@dgii.com>
* toplev.h: New file. Protypes for functions in toplev.c.
* tree.h, rtl.h: Deleted protos for functions in toplev.c.
* c-common.c, c-convert.c, c-decl.c, c-iterate.c, c-lex.c,
c-parse.in, c-parse.y, c-pragma.c, c-typeck.c, calls.c,
convert.c, dwarf2out.c, except.c, expr.c, final.c, fold-const.c,
function.c, hash.c, profile.c, real.c, reg-stack.c, regclass.c,
reload.c, reload1.c, stmt.c, stor-layout.c, tlink.c, tree.c,
varasm.c: include it.
From-SVN: r19563
1998-05-06 06:45:47 +02:00
|
|
|
|
#include "toplev.h"
|
1999-09-19 11:56:11 +02:00
|
|
|
|
#include "ggc.h"
|
1992-06-30 05:17:52 +02:00
|
|
|
|
|
1998-10-01 12:50:15 +02:00
|
|
|
|
#ifdef HANDLE_GENERIC_PRAGMAS
|
1992-06-30 05:11:04 +02:00
|
|
|
|
|
1998-10-01 12:50:15 +02:00
|
|
|
|
#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
|
|
|
|
|
typedef struct align_stack
|
|
|
|
|
{
|
|
|
|
|
int alignment;
|
|
|
|
|
unsigned int num_pushes;
|
1999-04-26 23:18:08 +02:00
|
|
|
|
tree id;
|
1998-10-01 12:50:15 +02:00
|
|
|
|
struct align_stack * prev;
|
|
|
|
|
} align_stack;
|
|
|
|
|
|
|
|
|
|
static struct align_stack * alignment_stack = NULL;
|
|
|
|
|
|
1999-10-19 12:44:30 +02:00
|
|
|
|
/* If we have a "global" #pragma pack(<n>) if effect when the first
|
|
|
|
|
#pragma push(pack,<n>) is encountered, this stores the the value of
|
|
|
|
|
maximum_field_alignment in effect. When the final pop_alignment()
|
|
|
|
|
happens, we restore the value to this, not to a value of 0 for
|
|
|
|
|
maximum_field_alignment. Value is in bits. */
|
|
|
|
|
static int default_alignment;
|
|
|
|
|
|
2000-01-12 23:47:13 +01:00
|
|
|
|
static int push_alignment PARAMS ((int, tree));
|
|
|
|
|
static int pop_alignment PARAMS ((tree));
|
Makefile.in (c-common.o): Depend on $(EXPR_H).
* Makefile.in (c-common.o): Depend on $(EXPR_H).
* c-common.c: Include expr.h.
* c-pragma.c (mark_align_stack): Add prototype.
* caller-save.c (add_stored_regs): Likewise.
* combine.c (record_promoted_value): Likewise.
* i386.c (ix86_sched_reorder_pentium, ix86_sched_reorder_ppro):
Likewise.
* cppinit.c (new_pending_define): Likewise.
* cpplib.c (skip_block_comment, skip_line_comment): Likewise.
* dwarf2out.c (save_rtx, splice_child_die, reverse_die_lists,
AT_class, AT_flag, AT_int, AT_unsigned, AT_string, AT_ref, AT_loc,
AT_addr, AT_lbl, get_AT_ref, free_AT, free_die, local_scope_p,
class_scope_p): Likewise.
* dwarf2out.h (dwarf2out_set_demangle_name_func,
dwarf2out_add_library_unit_info): Likewise.
* ggc.h (ggc_page_print_statistics): Likewise.
* haifa-sched.c (propagate_deps): Likewise.
* reg-stack.c (next_flags_user, record_label_references): Likewise.
* rtl.h (set_stack_check_libfunc): Likewise.
* toplev.h (set_fatal_function): Likewise.
* toplev.c (set_fatal_function): Delete prototype.
* diagnostic.c: Deconstify functions returning malloc'ed ptrs.
From-SVN: r31810
2000-02-06 04:40:46 +01:00
|
|
|
|
#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
|
|
|
|
|
static void mark_align_stack PARAMS ((void *));
|
|
|
|
|
#endif
|
1998-10-01 12:50:15 +02:00
|
|
|
|
|
|
|
|
|
/* Push an alignment value onto the stack. */
|
|
|
|
|
static int
|
1999-04-26 23:18:08 +02:00
|
|
|
|
push_alignment (alignment, id)
|
1998-10-01 12:50:15 +02:00
|
|
|
|
int alignment;
|
1999-04-26 23:18:08 +02:00
|
|
|
|
tree id;
|
1998-10-01 12:50:15 +02:00
|
|
|
|
{
|
|
|
|
|
switch (alignment)
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
case 1:
|
|
|
|
|
case 2:
|
|
|
|
|
case 4:
|
|
|
|
|
case 8:
|
|
|
|
|
case 16:
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
warning ("\
|
|
|
|
|
Alignment must be a small power of two, not %d, in #pragma pack",
|
|
|
|
|
alignment);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (alignment_stack == NULL
|
1999-04-26 23:18:08 +02:00
|
|
|
|
|| alignment_stack->alignment != alignment
|
|
|
|
|
|| id != NULL_TREE)
|
1998-10-01 12:50:15 +02:00
|
|
|
|
{
|
|
|
|
|
align_stack * entry;
|
|
|
|
|
|
|
|
|
|
entry = (align_stack *) xmalloc (sizeof (* entry));
|
|
|
|
|
|
|
|
|
|
entry->alignment = alignment;
|
|
|
|
|
entry->num_pushes = 1;
|
1999-04-26 23:18:08 +02:00
|
|
|
|
entry->id = id;
|
1998-10-01 12:50:15 +02:00
|
|
|
|
entry->prev = alignment_stack;
|
|
|
|
|
|
1999-10-19 12:44:30 +02:00
|
|
|
|
/* The current value of maximum_field_alignment is not necessarily
|
|
|
|
|
0 since there may be a #pragma pack(<n>) in effect; remember it
|
|
|
|
|
so that we can restore it after the final #pragma pop(). */
|
|
|
|
|
if (alignment_stack == NULL)
|
|
|
|
|
default_alignment = maximum_field_alignment;
|
|
|
|
|
|
1998-10-01 12:50:15 +02:00
|
|
|
|
alignment_stack = entry;
|
|
|
|
|
|
2000-04-24 19:24:45 +02:00
|
|
|
|
maximum_field_alignment = alignment * BITS_PER_UNIT;
|
1998-10-01 12:50:15 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
alignment_stack->num_pushes ++;
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Undo a push of an alignment onto the stack. */
|
|
|
|
|
static int
|
1999-04-26 23:18:08 +02:00
|
|
|
|
pop_alignment (id)
|
|
|
|
|
tree id;
|
1998-10-01 12:50:15 +02:00
|
|
|
|
{
|
1999-04-26 23:18:08 +02:00
|
|
|
|
align_stack * entry;
|
|
|
|
|
|
1998-10-01 12:50:15 +02:00
|
|
|
|
if (alignment_stack == NULL)
|
|
|
|
|
{
|
|
|
|
|
warning ("\
|
1999-04-26 23:18:08 +02:00
|
|
|
|
#pragma pack (pop) encountered without matching #pragma pack (push, <n>)"
|
|
|
|
|
);
|
1998-10-01 12:50:15 +02:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
1999-04-26 23:18:08 +02:00
|
|
|
|
/* If we got an identifier, strip away everything above the target
|
|
|
|
|
entry so that the next step will restore the state just below it. */
|
|
|
|
|
if (id)
|
|
|
|
|
{
|
|
|
|
|
for (entry = alignment_stack; entry; entry = entry->prev)
|
|
|
|
|
if (entry->id == id)
|
|
|
|
|
{
|
|
|
|
|
entry->num_pushes = 1;
|
|
|
|
|
alignment_stack = entry;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (entry == NULL)
|
|
|
|
|
warning ("\
|
|
|
|
|
#pragma pack(pop, %s) encountered without matching #pragma pack(push, %s, <n>)"
|
|
|
|
|
, IDENTIFIER_POINTER (id), IDENTIFIER_POINTER (id));
|
|
|
|
|
}
|
|
|
|
|
|
1998-10-01 12:50:15 +02:00
|
|
|
|
if (-- alignment_stack->num_pushes == 0)
|
|
|
|
|
{
|
|
|
|
|
entry = alignment_stack->prev;
|
|
|
|
|
|
1999-06-21 07:11:15 +02:00
|
|
|
|
if (entry == NULL)
|
1999-10-19 12:44:30 +02:00
|
|
|
|
maximum_field_alignment = default_alignment;
|
1998-10-01 12:50:15 +02:00
|
|
|
|
else
|
2000-04-24 19:24:45 +02:00
|
|
|
|
maximum_field_alignment = entry->alignment * BITS_PER_UNIT;
|
1998-10-01 12:50:15 +02:00
|
|
|
|
|
|
|
|
|
free (alignment_stack);
|
|
|
|
|
|
|
|
|
|
alignment_stack = entry;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
#endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
|
|
|
|
|
|
|
|
|
|
/* Handle one token of a pragma directive. TOKEN is the current token, and
|
|
|
|
|
STRING is its printable form. Some front ends do not support generating
|
|
|
|
|
tokens, and will only pass in a STRING. Also some front ends will reuse
|
|
|
|
|
the buffer containing STRING, so it must be copied to a local buffer if
|
|
|
|
|
it needs to be preserved.
|
|
|
|
|
|
|
|
|
|
If STRING is non-NULL, then the return value will be ignored, and there
|
tree.h (INT_CST_LT, [...]): Remove unneeded casts.
* tree.h (INT_CST_LT, INT_CST_LT_UNSIGNED): Remove unneeded casts.
(struct tree_int_cst): int_cst_low is now unsigned HOST_WIDE_INT.
(attribute_hash_list, type_hash_canon): hashcode is now unsigned.
(type_hash_lookup, type_hash_add, type_hash_list): Likewise.
(min_precision): Result is unsignd.
(add_double, neg_double, mul_double): Low word is unsigned.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double): Likewise.
(tree_floor_log2, compare_tree_int): New functions.
(preserve_rtl_expr_temps): New declaration.
* c-common.c (declare_hidden_char_array): Use compare_tree_int.
(decl_attributes): Use tree_log2 to find alignment.
Check for TREE_INT_CST_HIGH for format args.
(min_precision): Now unsigned.
Use tree_floor_log2.
(truthvalue_conversion): Delete long-disabled code.
* c-decl.c (finish_struct): Clean up tests on field width.
(finish_function): Use compare_tree_int.
* c-pragma.c (handle_pragma_token): Use tree_log2 for alignment.
* c-typeck.c (comptypes): Use tree_int_cst_equal.
(default_conversion, digest_init): Use compare_tree_int.
(build_binary_op): Use integer_all_onesp and compare_tree_int.
Fix type errors in forming masks.
* calls.c (initialize_argument_information): Use compare_tree_int.
* dbxout.c (dbxout_type): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* except.c (expand_eh_region_start_tree): Use compare_tree_int.
* expr.c (is_zeros_p, case INTEGER_CST): Use integer_zerop.
(store_field): Use compare_tree_int.
(expand_expr, case CONSTRUCTOR): Use TYPE_SIZE_UNIT.
(expand_expr, case ARRAY_REF): Use compare_tree_int.
(do_jump, case BIT_AND_EXPR): Use tree_floor_log2.
(do_store_flag): Use compare_tree_int.
* fold-const.c (encode, decode): Low part is always unsigned.
(force_fit_type, add_double, neg_double, mul_double): Likewise.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double, int_const_binop): Likewise.
(fold_convert): Use compare_tree_int.
(operand_equal_p, case INTEGER_CST): Use tree_int_cst_equal.
(invert_truthvalue, case INTEGER_CST): Likewise.
(fold): Use compare_tree_int; add casts for unsigned TREE_INT_CST_LOW.
* mkdeps.c (deps_dummy_targets): Make I unsigned.
* rtl.h (add_double, neg_double, mul_double): Low words are unsigned.
(lshift_double, rshift_double, lrotate_double, rrotate_double):
Likewise.
* stmt.c (expand_decl): Use compare_tree_int and mode_for_size_tree.
(expand_end_case): Use compare_tree_int.
(estimate_case_costs): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* stor-layout.c (mode_for_size_tree): Use compare_tree_int.
(layout_decl): Likewise.
(layout_record, layout_union): Make sizes unsigned.
(layout_type, case VOID_TYPE): TYPE_SIZE must be bitsizetype.
(layout_type, case QUAL_UNION_TYPE): Use compare_tree_int.
* tree.c (struct type_hash): hashcode is unsigned.
(build_type_attribute_variant, type_hash_list): Likewise.
(type_hash_lookup, type_hash_add, type_hash_canon): Likewise.
(attribute_hash_list, build_array_type, build_method_type): Likewise.
(build_complex_type): Likewise.
(real_value_from_int_cst): Remove unneeded casts.
(integer_all_onesp): Add casts.
(tree_floor_log2, compare_tree_int): New functions.
(build_index_type): Use tree_int_cst_sgn.
* varasm.c (assemble_variable): Use compare_tree_int.
* ch/actions.c (chill_convert_for_assignment): INDEX is unsigned
HOST_WIDE_INT.
* ch/ch-tree.h (DECL_NESTING_LEVEL): Use TREE_INT_CST_HIGH
since unsigned.
* ch/except.c (chill_handle_on_labels): ALTERNATIVE is unsigned.
Use compare_tree_int.
(expand_goto_except_cleanup): Likewise.
* cp/class.c (dfs_modify_vtables): I is now unsigned.
(check_bitfield_decl): Use tree_int_cst_sgn and compare_tree_int.
(build_base_field): Add casts of TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/error.c (dump_expr): Cast TREE_INT_CST_HIGH to unsigned.
* cp/init.c (build_vec_init): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/method.c (build_overload_int): Cast TREE_INT_CST_HIGH to unsigned.
* cp/typeck.c (build_binary_op, case TRUNC_DIV_EXPR):
Call integer_all_onesp.
* cp/typeck2.c (process_init_constructor): Use compare_tree_int.
* f/com.c (ffecom_f2c_set_lio_code_): Use compare_tree_int.
(ffecom_sym_transform_, ffecom_transform_common_): Likewise.
(ffecom_transform_equiv_): Likewise.
* java/decl.c (emit_init_test_initialization): Mark KEY as unused.
* java/expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
(build_anewarray): Likewise.
* java/parse.y (patch_newarray): Likewise.
* java/parse.c: Regenerated.
From-SVN: r32383
2000-03-07 12:41:32 +01:00
|
|
|
|
will be futher calls to handle_pragma_token in order to handle the rest of
|
1998-10-01 12:50:15 +02:00
|
|
|
|
the line containing the #pragma directive. If STRING is NULL, the entire
|
tree.h (INT_CST_LT, [...]): Remove unneeded casts.
* tree.h (INT_CST_LT, INT_CST_LT_UNSIGNED): Remove unneeded casts.
(struct tree_int_cst): int_cst_low is now unsigned HOST_WIDE_INT.
(attribute_hash_list, type_hash_canon): hashcode is now unsigned.
(type_hash_lookup, type_hash_add, type_hash_list): Likewise.
(min_precision): Result is unsignd.
(add_double, neg_double, mul_double): Low word is unsigned.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double): Likewise.
(tree_floor_log2, compare_tree_int): New functions.
(preserve_rtl_expr_temps): New declaration.
* c-common.c (declare_hidden_char_array): Use compare_tree_int.
(decl_attributes): Use tree_log2 to find alignment.
Check for TREE_INT_CST_HIGH for format args.
(min_precision): Now unsigned.
Use tree_floor_log2.
(truthvalue_conversion): Delete long-disabled code.
* c-decl.c (finish_struct): Clean up tests on field width.
(finish_function): Use compare_tree_int.
* c-pragma.c (handle_pragma_token): Use tree_log2 for alignment.
* c-typeck.c (comptypes): Use tree_int_cst_equal.
(default_conversion, digest_init): Use compare_tree_int.
(build_binary_op): Use integer_all_onesp and compare_tree_int.
Fix type errors in forming masks.
* calls.c (initialize_argument_information): Use compare_tree_int.
* dbxout.c (dbxout_type): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* except.c (expand_eh_region_start_tree): Use compare_tree_int.
* expr.c (is_zeros_p, case INTEGER_CST): Use integer_zerop.
(store_field): Use compare_tree_int.
(expand_expr, case CONSTRUCTOR): Use TYPE_SIZE_UNIT.
(expand_expr, case ARRAY_REF): Use compare_tree_int.
(do_jump, case BIT_AND_EXPR): Use tree_floor_log2.
(do_store_flag): Use compare_tree_int.
* fold-const.c (encode, decode): Low part is always unsigned.
(force_fit_type, add_double, neg_double, mul_double): Likewise.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double, int_const_binop): Likewise.
(fold_convert): Use compare_tree_int.
(operand_equal_p, case INTEGER_CST): Use tree_int_cst_equal.
(invert_truthvalue, case INTEGER_CST): Likewise.
(fold): Use compare_tree_int; add casts for unsigned TREE_INT_CST_LOW.
* mkdeps.c (deps_dummy_targets): Make I unsigned.
* rtl.h (add_double, neg_double, mul_double): Low words are unsigned.
(lshift_double, rshift_double, lrotate_double, rrotate_double):
Likewise.
* stmt.c (expand_decl): Use compare_tree_int and mode_for_size_tree.
(expand_end_case): Use compare_tree_int.
(estimate_case_costs): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* stor-layout.c (mode_for_size_tree): Use compare_tree_int.
(layout_decl): Likewise.
(layout_record, layout_union): Make sizes unsigned.
(layout_type, case VOID_TYPE): TYPE_SIZE must be bitsizetype.
(layout_type, case QUAL_UNION_TYPE): Use compare_tree_int.
* tree.c (struct type_hash): hashcode is unsigned.
(build_type_attribute_variant, type_hash_list): Likewise.
(type_hash_lookup, type_hash_add, type_hash_canon): Likewise.
(attribute_hash_list, build_array_type, build_method_type): Likewise.
(build_complex_type): Likewise.
(real_value_from_int_cst): Remove unneeded casts.
(integer_all_onesp): Add casts.
(tree_floor_log2, compare_tree_int): New functions.
(build_index_type): Use tree_int_cst_sgn.
* varasm.c (assemble_variable): Use compare_tree_int.
* ch/actions.c (chill_convert_for_assignment): INDEX is unsigned
HOST_WIDE_INT.
* ch/ch-tree.h (DECL_NESTING_LEVEL): Use TREE_INT_CST_HIGH
since unsigned.
* ch/except.c (chill_handle_on_labels): ALTERNATIVE is unsigned.
Use compare_tree_int.
(expand_goto_except_cleanup): Likewise.
* cp/class.c (dfs_modify_vtables): I is now unsigned.
(check_bitfield_decl): Use tree_int_cst_sgn and compare_tree_int.
(build_base_field): Add casts of TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/error.c (dump_expr): Cast TREE_INT_CST_HIGH to unsigned.
* cp/init.c (build_vec_init): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/method.c (build_overload_int): Cast TREE_INT_CST_HIGH to unsigned.
* cp/typeck.c (build_binary_op, case TRUNC_DIV_EXPR):
Call integer_all_onesp.
* cp/typeck2.c (process_init_constructor): Use compare_tree_int.
* f/com.c (ffecom_f2c_set_lio_code_): Use compare_tree_int.
(ffecom_sym_transform_, ffecom_transform_common_): Likewise.
(ffecom_transform_equiv_): Likewise.
* java/decl.c (emit_init_test_initialization): Mark KEY as unused.
* java/expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
(build_anewarray): Likewise.
* java/parse.y (patch_newarray): Likewise.
* java/parse.c: Regenerated.
From-SVN: r32383
2000-03-07 12:41:32 +01:00
|
|
|
|
line has now been presented to handle_pragma_token and the return value
|
1998-10-01 12:50:15 +02:00
|
|
|
|
should be zero if the pragma flawed in some way, or if the pragma was not
|
|
|
|
|
recognised, and non-zero if it was successfully handled. */
|
1992-06-30 05:11:04 +02:00
|
|
|
|
|
1998-09-02 11:59:57 +02:00
|
|
|
|
int
|
1992-06-30 05:11:04 +02:00
|
|
|
|
handle_pragma_token (string, token)
|
tree.h (INT_CST_LT, [...]): Remove unneeded casts.
* tree.h (INT_CST_LT, INT_CST_LT_UNSIGNED): Remove unneeded casts.
(struct tree_int_cst): int_cst_low is now unsigned HOST_WIDE_INT.
(attribute_hash_list, type_hash_canon): hashcode is now unsigned.
(type_hash_lookup, type_hash_add, type_hash_list): Likewise.
(min_precision): Result is unsignd.
(add_double, neg_double, mul_double): Low word is unsigned.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double): Likewise.
(tree_floor_log2, compare_tree_int): New functions.
(preserve_rtl_expr_temps): New declaration.
* c-common.c (declare_hidden_char_array): Use compare_tree_int.
(decl_attributes): Use tree_log2 to find alignment.
Check for TREE_INT_CST_HIGH for format args.
(min_precision): Now unsigned.
Use tree_floor_log2.
(truthvalue_conversion): Delete long-disabled code.
* c-decl.c (finish_struct): Clean up tests on field width.
(finish_function): Use compare_tree_int.
* c-pragma.c (handle_pragma_token): Use tree_log2 for alignment.
* c-typeck.c (comptypes): Use tree_int_cst_equal.
(default_conversion, digest_init): Use compare_tree_int.
(build_binary_op): Use integer_all_onesp and compare_tree_int.
Fix type errors in forming masks.
* calls.c (initialize_argument_information): Use compare_tree_int.
* dbxout.c (dbxout_type): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* except.c (expand_eh_region_start_tree): Use compare_tree_int.
* expr.c (is_zeros_p, case INTEGER_CST): Use integer_zerop.
(store_field): Use compare_tree_int.
(expand_expr, case CONSTRUCTOR): Use TYPE_SIZE_UNIT.
(expand_expr, case ARRAY_REF): Use compare_tree_int.
(do_jump, case BIT_AND_EXPR): Use tree_floor_log2.
(do_store_flag): Use compare_tree_int.
* fold-const.c (encode, decode): Low part is always unsigned.
(force_fit_type, add_double, neg_double, mul_double): Likewise.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double, int_const_binop): Likewise.
(fold_convert): Use compare_tree_int.
(operand_equal_p, case INTEGER_CST): Use tree_int_cst_equal.
(invert_truthvalue, case INTEGER_CST): Likewise.
(fold): Use compare_tree_int; add casts for unsigned TREE_INT_CST_LOW.
* mkdeps.c (deps_dummy_targets): Make I unsigned.
* rtl.h (add_double, neg_double, mul_double): Low words are unsigned.
(lshift_double, rshift_double, lrotate_double, rrotate_double):
Likewise.
* stmt.c (expand_decl): Use compare_tree_int and mode_for_size_tree.
(expand_end_case): Use compare_tree_int.
(estimate_case_costs): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* stor-layout.c (mode_for_size_tree): Use compare_tree_int.
(layout_decl): Likewise.
(layout_record, layout_union): Make sizes unsigned.
(layout_type, case VOID_TYPE): TYPE_SIZE must be bitsizetype.
(layout_type, case QUAL_UNION_TYPE): Use compare_tree_int.
* tree.c (struct type_hash): hashcode is unsigned.
(build_type_attribute_variant, type_hash_list): Likewise.
(type_hash_lookup, type_hash_add, type_hash_canon): Likewise.
(attribute_hash_list, build_array_type, build_method_type): Likewise.
(build_complex_type): Likewise.
(real_value_from_int_cst): Remove unneeded casts.
(integer_all_onesp): Add casts.
(tree_floor_log2, compare_tree_int): New functions.
(build_index_type): Use tree_int_cst_sgn.
* varasm.c (assemble_variable): Use compare_tree_int.
* ch/actions.c (chill_convert_for_assignment): INDEX is unsigned
HOST_WIDE_INT.
* ch/ch-tree.h (DECL_NESTING_LEVEL): Use TREE_INT_CST_HIGH
since unsigned.
* ch/except.c (chill_handle_on_labels): ALTERNATIVE is unsigned.
Use compare_tree_int.
(expand_goto_except_cleanup): Likewise.
* cp/class.c (dfs_modify_vtables): I is now unsigned.
(check_bitfield_decl): Use tree_int_cst_sgn and compare_tree_int.
(build_base_field): Add casts of TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/error.c (dump_expr): Cast TREE_INT_CST_HIGH to unsigned.
* cp/init.c (build_vec_init): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/method.c (build_overload_int): Cast TREE_INT_CST_HIGH to unsigned.
* cp/typeck.c (build_binary_op, case TRUNC_DIV_EXPR):
Call integer_all_onesp.
* cp/typeck2.c (process_init_constructor): Use compare_tree_int.
* f/com.c (ffecom_f2c_set_lio_code_): Use compare_tree_int.
(ffecom_sym_transform_, ffecom_transform_common_): Likewise.
(ffecom_transform_equiv_): Likewise.
* java/decl.c (emit_init_test_initialization): Mark KEY as unused.
* java/expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
(build_anewarray): Likewise.
* java/parse.y (patch_newarray): Likewise.
* java/parse.c: Regenerated.
From-SVN: r32383
2000-03-07 12:41:32 +01:00
|
|
|
|
const char *string;
|
1992-06-30 05:11:04 +02:00
|
|
|
|
tree token;
|
|
|
|
|
{
|
1998-10-01 12:50:15 +02:00
|
|
|
|
static enum pragma_state state = ps_start;
|
|
|
|
|
static enum pragma_state type;
|
1999-09-14 20:19:09 +02:00
|
|
|
|
#ifdef HANDLE_PRAGMA_WEAK
|
tree.h (INT_CST_LT, [...]): Remove unneeded casts.
* tree.h (INT_CST_LT, INT_CST_LT_UNSIGNED): Remove unneeded casts.
(struct tree_int_cst): int_cst_low is now unsigned HOST_WIDE_INT.
(attribute_hash_list, type_hash_canon): hashcode is now unsigned.
(type_hash_lookup, type_hash_add, type_hash_list): Likewise.
(min_precision): Result is unsignd.
(add_double, neg_double, mul_double): Low word is unsigned.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double): Likewise.
(tree_floor_log2, compare_tree_int): New functions.
(preserve_rtl_expr_temps): New declaration.
* c-common.c (declare_hidden_char_array): Use compare_tree_int.
(decl_attributes): Use tree_log2 to find alignment.
Check for TREE_INT_CST_HIGH for format args.
(min_precision): Now unsigned.
Use tree_floor_log2.
(truthvalue_conversion): Delete long-disabled code.
* c-decl.c (finish_struct): Clean up tests on field width.
(finish_function): Use compare_tree_int.
* c-pragma.c (handle_pragma_token): Use tree_log2 for alignment.
* c-typeck.c (comptypes): Use tree_int_cst_equal.
(default_conversion, digest_init): Use compare_tree_int.
(build_binary_op): Use integer_all_onesp and compare_tree_int.
Fix type errors in forming masks.
* calls.c (initialize_argument_information): Use compare_tree_int.
* dbxout.c (dbxout_type): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* except.c (expand_eh_region_start_tree): Use compare_tree_int.
* expr.c (is_zeros_p, case INTEGER_CST): Use integer_zerop.
(store_field): Use compare_tree_int.
(expand_expr, case CONSTRUCTOR): Use TYPE_SIZE_UNIT.
(expand_expr, case ARRAY_REF): Use compare_tree_int.
(do_jump, case BIT_AND_EXPR): Use tree_floor_log2.
(do_store_flag): Use compare_tree_int.
* fold-const.c (encode, decode): Low part is always unsigned.
(force_fit_type, add_double, neg_double, mul_double): Likewise.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double, int_const_binop): Likewise.
(fold_convert): Use compare_tree_int.
(operand_equal_p, case INTEGER_CST): Use tree_int_cst_equal.
(invert_truthvalue, case INTEGER_CST): Likewise.
(fold): Use compare_tree_int; add casts for unsigned TREE_INT_CST_LOW.
* mkdeps.c (deps_dummy_targets): Make I unsigned.
* rtl.h (add_double, neg_double, mul_double): Low words are unsigned.
(lshift_double, rshift_double, lrotate_double, rrotate_double):
Likewise.
* stmt.c (expand_decl): Use compare_tree_int and mode_for_size_tree.
(expand_end_case): Use compare_tree_int.
(estimate_case_costs): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* stor-layout.c (mode_for_size_tree): Use compare_tree_int.
(layout_decl): Likewise.
(layout_record, layout_union): Make sizes unsigned.
(layout_type, case VOID_TYPE): TYPE_SIZE must be bitsizetype.
(layout_type, case QUAL_UNION_TYPE): Use compare_tree_int.
* tree.c (struct type_hash): hashcode is unsigned.
(build_type_attribute_variant, type_hash_list): Likewise.
(type_hash_lookup, type_hash_add, type_hash_canon): Likewise.
(attribute_hash_list, build_array_type, build_method_type): Likewise.
(build_complex_type): Likewise.
(real_value_from_int_cst): Remove unneeded casts.
(integer_all_onesp): Add casts.
(tree_floor_log2, compare_tree_int): New functions.
(build_index_type): Use tree_int_cst_sgn.
* varasm.c (assemble_variable): Use compare_tree_int.
* ch/actions.c (chill_convert_for_assignment): INDEX is unsigned
HOST_WIDE_INT.
* ch/ch-tree.h (DECL_NESTING_LEVEL): Use TREE_INT_CST_HIGH
since unsigned.
* ch/except.c (chill_handle_on_labels): ALTERNATIVE is unsigned.
Use compare_tree_int.
(expand_goto_except_cleanup): Likewise.
* cp/class.c (dfs_modify_vtables): I is now unsigned.
(check_bitfield_decl): Use tree_int_cst_sgn and compare_tree_int.
(build_base_field): Add casts of TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/error.c (dump_expr): Cast TREE_INT_CST_HIGH to unsigned.
* cp/init.c (build_vec_init): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/method.c (build_overload_int): Cast TREE_INT_CST_HIGH to unsigned.
* cp/typeck.c (build_binary_op, case TRUNC_DIV_EXPR):
Call integer_all_onesp.
* cp/typeck2.c (process_init_constructor): Use compare_tree_int.
* f/com.c (ffecom_f2c_set_lio_code_): Use compare_tree_int.
(ffecom_sym_transform_, ffecom_transform_common_): Likewise.
(ffecom_transform_equiv_): Likewise.
* java/decl.c (emit_init_test_initialization): Mark KEY as unused.
* java/expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
(build_anewarray): Likewise.
* java/parse.y (patch_newarray): Likewise.
* java/parse.c: Regenerated.
From-SVN: r32383
2000-03-07 12:41:32 +01:00
|
|
|
|
static char *name;
|
|
|
|
|
static char *value;
|
1999-09-14 20:19:09 +02:00
|
|
|
|
#endif
|
|
|
|
|
#if defined(HANDLE_PRAGMA_PACK) || defined(HANDLE_PRAGMA_PACK_PUSH_POP)
|
tree.h (INT_CST_LT, [...]): Remove unneeded casts.
* tree.h (INT_CST_LT, INT_CST_LT_UNSIGNED): Remove unneeded casts.
(struct tree_int_cst): int_cst_low is now unsigned HOST_WIDE_INT.
(attribute_hash_list, type_hash_canon): hashcode is now unsigned.
(type_hash_lookup, type_hash_add, type_hash_list): Likewise.
(min_precision): Result is unsignd.
(add_double, neg_double, mul_double): Low word is unsigned.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double): Likewise.
(tree_floor_log2, compare_tree_int): New functions.
(preserve_rtl_expr_temps): New declaration.
* c-common.c (declare_hidden_char_array): Use compare_tree_int.
(decl_attributes): Use tree_log2 to find alignment.
Check for TREE_INT_CST_HIGH for format args.
(min_precision): Now unsigned.
Use tree_floor_log2.
(truthvalue_conversion): Delete long-disabled code.
* c-decl.c (finish_struct): Clean up tests on field width.
(finish_function): Use compare_tree_int.
* c-pragma.c (handle_pragma_token): Use tree_log2 for alignment.
* c-typeck.c (comptypes): Use tree_int_cst_equal.
(default_conversion, digest_init): Use compare_tree_int.
(build_binary_op): Use integer_all_onesp and compare_tree_int.
Fix type errors in forming masks.
* calls.c (initialize_argument_information): Use compare_tree_int.
* dbxout.c (dbxout_type): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* except.c (expand_eh_region_start_tree): Use compare_tree_int.
* expr.c (is_zeros_p, case INTEGER_CST): Use integer_zerop.
(store_field): Use compare_tree_int.
(expand_expr, case CONSTRUCTOR): Use TYPE_SIZE_UNIT.
(expand_expr, case ARRAY_REF): Use compare_tree_int.
(do_jump, case BIT_AND_EXPR): Use tree_floor_log2.
(do_store_flag): Use compare_tree_int.
* fold-const.c (encode, decode): Low part is always unsigned.
(force_fit_type, add_double, neg_double, mul_double): Likewise.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double, int_const_binop): Likewise.
(fold_convert): Use compare_tree_int.
(operand_equal_p, case INTEGER_CST): Use tree_int_cst_equal.
(invert_truthvalue, case INTEGER_CST): Likewise.
(fold): Use compare_tree_int; add casts for unsigned TREE_INT_CST_LOW.
* mkdeps.c (deps_dummy_targets): Make I unsigned.
* rtl.h (add_double, neg_double, mul_double): Low words are unsigned.
(lshift_double, rshift_double, lrotate_double, rrotate_double):
Likewise.
* stmt.c (expand_decl): Use compare_tree_int and mode_for_size_tree.
(expand_end_case): Use compare_tree_int.
(estimate_case_costs): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* stor-layout.c (mode_for_size_tree): Use compare_tree_int.
(layout_decl): Likewise.
(layout_record, layout_union): Make sizes unsigned.
(layout_type, case VOID_TYPE): TYPE_SIZE must be bitsizetype.
(layout_type, case QUAL_UNION_TYPE): Use compare_tree_int.
* tree.c (struct type_hash): hashcode is unsigned.
(build_type_attribute_variant, type_hash_list): Likewise.
(type_hash_lookup, type_hash_add, type_hash_canon): Likewise.
(attribute_hash_list, build_array_type, build_method_type): Likewise.
(build_complex_type): Likewise.
(real_value_from_int_cst): Remove unneeded casts.
(integer_all_onesp): Add casts.
(tree_floor_log2, compare_tree_int): New functions.
(build_index_type): Use tree_int_cst_sgn.
* varasm.c (assemble_variable): Use compare_tree_int.
* ch/actions.c (chill_convert_for_assignment): INDEX is unsigned
HOST_WIDE_INT.
* ch/ch-tree.h (DECL_NESTING_LEVEL): Use TREE_INT_CST_HIGH
since unsigned.
* ch/except.c (chill_handle_on_labels): ALTERNATIVE is unsigned.
Use compare_tree_int.
(expand_goto_except_cleanup): Likewise.
* cp/class.c (dfs_modify_vtables): I is now unsigned.
(check_bitfield_decl): Use tree_int_cst_sgn and compare_tree_int.
(build_base_field): Add casts of TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/error.c (dump_expr): Cast TREE_INT_CST_HIGH to unsigned.
* cp/init.c (build_vec_init): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/method.c (build_overload_int): Cast TREE_INT_CST_HIGH to unsigned.
* cp/typeck.c (build_binary_op, case TRUNC_DIV_EXPR):
Call integer_all_onesp.
* cp/typeck2.c (process_init_constructor): Use compare_tree_int.
* f/com.c (ffecom_f2c_set_lio_code_): Use compare_tree_int.
(ffecom_sym_transform_, ffecom_transform_common_): Likewise.
(ffecom_transform_equiv_): Likewise.
* java/decl.c (emit_init_test_initialization): Mark KEY as unused.
* java/expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
(build_anewarray): Likewise.
* java/parse.y (patch_newarray): Likewise.
* java/parse.c: Regenerated.
From-SVN: r32383
2000-03-07 12:41:32 +01:00
|
|
|
|
static unsigned int align;
|
1999-09-14 20:19:09 +02:00
|
|
|
|
#endif
|
1999-04-26 23:18:08 +02:00
|
|
|
|
static tree id;
|
1992-06-30 05:11:04 +02:00
|
|
|
|
|
1998-10-01 12:50:15 +02:00
|
|
|
|
/* If we have reached the end of the #pragma directive then
|
|
|
|
|
determine what value we should return. */
|
|
|
|
|
|
1998-09-02 11:59:57 +02:00
|
|
|
|
if (string == NULL)
|
1992-06-30 05:11:04 +02:00
|
|
|
|
{
|
1998-10-01 12:50:15 +02:00
|
|
|
|
int ret_val = 0;
|
|
|
|
|
|
|
|
|
|
switch (type)
|
1992-06-30 05:11:04 +02:00
|
|
|
|
{
|
1998-10-01 12:50:15 +02:00
|
|
|
|
default:
|
|
|
|
|
abort ();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ps_done:
|
|
|
|
|
/* The pragma was not recognised. */
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
#ifdef HANDLE_PRAGMA_PACK
|
|
|
|
|
case ps_pack:
|
1992-06-30 05:11:04 +02:00
|
|
|
|
if (state == ps_right)
|
1998-09-02 11:59:57 +02:00
|
|
|
|
{
|
2000-04-24 19:24:45 +02:00
|
|
|
|
maximum_field_alignment = align * BITS_PER_UNIT;
|
1999-10-19 12:44:30 +02:00
|
|
|
|
#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
|
|
|
|
|
default_alignment = maximum_field_alignment;
|
|
|
|
|
#endif
|
1998-10-01 12:50:15 +02:00
|
|
|
|
ret_val = 1;
|
1998-09-02 11:59:57 +02:00
|
|
|
|
}
|
1998-10-01 12:50:15 +02:00
|
|
|
|
else
|
|
|
|
|
warning ("malformed `#pragma pack'");
|
|
|
|
|
break;
|
|
|
|
|
#endif /* HANDLE_PRAGMA_PACK */
|
|
|
|
|
|
|
|
|
|
#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
|
|
|
|
|
case ps_push:
|
|
|
|
|
if (state == ps_right)
|
1999-04-26 23:18:08 +02:00
|
|
|
|
ret_val = push_alignment (align, id);
|
1998-10-01 12:50:15 +02:00
|
|
|
|
else
|
1999-04-26 23:18:08 +02:00
|
|
|
|
warning ("malformed '#pragma pack(push[,id],<n>)'");
|
1998-10-01 12:50:15 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ps_pop:
|
|
|
|
|
if (state == ps_right)
|
1999-04-26 23:18:08 +02:00
|
|
|
|
ret_val = pop_alignment (id);
|
1998-10-01 12:50:15 +02:00
|
|
|
|
else
|
1999-04-26 23:18:08 +02:00
|
|
|
|
warning ("malformed '#pragma pack(pop[,id])'");
|
1998-10-01 12:50:15 +02:00
|
|
|
|
break;
|
|
|
|
|
#endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
|
|
|
|
|
|
1992-07-01 14:58:09 +02:00
|
|
|
|
#ifdef HANDLE_PRAGMA_WEAK
|
1998-10-01 12:50:15 +02:00
|
|
|
|
case ps_weak:
|
1992-07-01 14:58:09 +02:00
|
|
|
|
if (HANDLE_PRAGMA_WEAK)
|
1998-10-01 12:50:15 +02:00
|
|
|
|
{
|
|
|
|
|
if (state == ps_name)
|
|
|
|
|
ret_val = add_weak (name, NULL);
|
|
|
|
|
else if (state == ps_value)
|
|
|
|
|
ret_val = add_weak (name, value);
|
|
|
|
|
else
|
|
|
|
|
warning ("malformed `#pragma weak'");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
ret_val = 1; /* Ignore the pragma. */
|
|
|
|
|
break;
|
1997-12-21 16:24:48 +01:00
|
|
|
|
#endif /* HANDLE_PRAGMA_WEAK */
|
1999-09-09 06:00:37 +02:00
|
|
|
|
|
|
|
|
|
case ps_poison:
|
|
|
|
|
ret_val = 1;
|
|
|
|
|
break;
|
1992-06-30 05:11:04 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type = state = ps_start;
|
1999-04-26 23:18:08 +02:00
|
|
|
|
id = NULL_TREE;
|
1998-09-02 11:59:57 +02:00
|
|
|
|
|
|
|
|
|
return ret_val;
|
1992-06-30 05:11:04 +02:00
|
|
|
|
}
|
|
|
|
|
|
1998-10-01 12:50:15 +02:00
|
|
|
|
/* If we have been given a token, but it is not an identifier,
|
|
|
|
|
or a small constant, then something has gone wrong. */
|
|
|
|
|
if (token)
|
|
|
|
|
{
|
|
|
|
|
switch (TREE_CODE (token))
|
|
|
|
|
{
|
|
|
|
|
case IDENTIFIER_NODE:
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case INTEGER_CST:
|
|
|
|
|
if (TREE_INT_CST_HIGH (token) != 0)
|
|
|
|
|
return 0;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1992-06-30 05:11:04 +02:00
|
|
|
|
switch (state)
|
|
|
|
|
{
|
|
|
|
|
case ps_start:
|
1998-10-01 12:50:15 +02:00
|
|
|
|
type = state = ps_done;
|
|
|
|
|
#ifdef HANDLE_PRAGMA_PACK
|
|
|
|
|
if (strcmp (string, "pack") == 0)
|
|
|
|
|
type = state = ps_pack;
|
|
|
|
|
#endif
|
1998-09-02 11:59:57 +02:00
|
|
|
|
#ifdef HANDLE_PRAGMA_WEAK
|
1998-10-01 12:50:15 +02:00
|
|
|
|
if (strcmp (string, "weak") == 0)
|
|
|
|
|
type = state = ps_weak;
|
1999-09-09 06:00:37 +02:00
|
|
|
|
#endif
|
|
|
|
|
if (strcmp (string, "poison") == 0)
|
|
|
|
|
type = state = ps_poison;
|
1992-06-30 05:11:04 +02:00
|
|
|
|
break;
|
1999-09-09 06:00:37 +02:00
|
|
|
|
|
1998-09-02 11:59:57 +02:00
|
|
|
|
#ifdef HANDLE_PRAGMA_WEAK
|
1992-06-30 05:11:04 +02:00
|
|
|
|
case ps_weak:
|
c-common.c, [...]: Remove all references to obstack functions obsoleted by GC...
* c-common.c, c-decl.c, c-lang.c, c-lex.c, c-parse.in, c-pragma.c,
c-typeck.c, objc/objc-act.c: Remove all references to obstack
functions obsoleted by GC, such as push_obstacks_nochange,
end_temporary_allocation, savealloc, saveable_tree_cons, etc.
and code which existed only to decide whether or not to call
them. Remove now-unused NESTED argument from start_function;
all callers changed. Do not change behavior based on ggc_p.
The use of the ixp_obstack in c-iterate.c and the util_obstack
in objc/objc-act.c remain; these are not obsoleted by garbage
collection.
* c-tree.h: Update prototype for start_function.
* c-parse.y, c-parse.c, objc/objc-parse.c, objc/objc-parse.y: Rebuild.
From-SVN: r31611
2000-01-25 18:13:14 +01:00
|
|
|
|
name = xstrdup (string);
|
|
|
|
|
state = ps_name;
|
1992-06-30 05:11:04 +02:00
|
|
|
|
break;
|
1998-09-02 11:59:57 +02:00
|
|
|
|
|
1992-06-30 05:11:04 +02:00
|
|
|
|
case ps_name:
|
|
|
|
|
state = (strcmp (string, "=") ? ps_bad : ps_equals);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ps_equals:
|
c-common.c, [...]: Remove all references to obstack functions obsoleted by GC...
* c-common.c, c-decl.c, c-lang.c, c-lex.c, c-parse.in, c-pragma.c,
c-typeck.c, objc/objc-act.c: Remove all references to obstack
functions obsoleted by GC, such as push_obstacks_nochange,
end_temporary_allocation, savealloc, saveable_tree_cons, etc.
and code which existed only to decide whether or not to call
them. Remove now-unused NESTED argument from start_function;
all callers changed. Do not change behavior based on ggc_p.
The use of the ixp_obstack in c-iterate.c and the util_obstack
in objc/objc-act.c remain; these are not obsoleted by garbage
collection.
* c-tree.h: Update prototype for start_function.
* c-parse.y, c-parse.c, objc/objc-parse.c, objc/objc-parse.y: Rebuild.
From-SVN: r31611
2000-01-25 18:13:14 +01:00
|
|
|
|
value = xstrdup (string);
|
|
|
|
|
state = ps_value;
|
1992-06-30 05:11:04 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ps_value:
|
|
|
|
|
state = ps_bad;
|
|
|
|
|
break;
|
1998-10-01 12:50:15 +02:00
|
|
|
|
#endif /* HANDLE_PRAGMA_WEAK */
|
|
|
|
|
|
|
|
|
|
#ifdef HANDLE_PRAGMA_PACK
|
1992-06-30 05:11:04 +02:00
|
|
|
|
case ps_pack:
|
1998-10-01 12:50:15 +02:00
|
|
|
|
state = (strcmp (string, "(") ? ps_bad : ps_left);
|
1992-06-30 05:11:04 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ps_left:
|
1998-10-11 23:05:04 +02:00
|
|
|
|
|
1999-04-26 23:18:08 +02:00
|
|
|
|
if (token == NULL_TREE)
|
1999-06-09 04:16:12 +02:00
|
|
|
|
{
|
|
|
|
|
/* #pragma pack () resets packing rules to their
|
|
|
|
|
defaults. */
|
|
|
|
|
if (strcmp (string, ")") == 0)
|
|
|
|
|
{
|
|
|
|
|
align = 0;
|
|
|
|
|
state = ps_right;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
state = ps_bad;
|
|
|
|
|
}
|
1999-04-26 23:18:08 +02:00
|
|
|
|
else if (TREE_CODE (token) == INTEGER_CST)
|
|
|
|
|
goto handle_align;
|
|
|
|
|
|
|
|
|
|
#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
|
|
|
|
|
else if (TREE_CODE (token) == IDENTIFIER_NODE)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp (string, "push") == 0)
|
|
|
|
|
type = state = ps_push;
|
|
|
|
|
else if (strcmp (string, "pop") == 0)
|
|
|
|
|
type = state = ps_pop;
|
|
|
|
|
else
|
|
|
|
|
state = ps_bad;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
1998-10-11 23:05:04 +02:00
|
|
|
|
else
|
1999-04-26 23:18:08 +02:00
|
|
|
|
state = ps_bad;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
handle_align:
|
tree.h (INT_CST_LT, [...]): Remove unneeded casts.
* tree.h (INT_CST_LT, INT_CST_LT_UNSIGNED): Remove unneeded casts.
(struct tree_int_cst): int_cst_low is now unsigned HOST_WIDE_INT.
(attribute_hash_list, type_hash_canon): hashcode is now unsigned.
(type_hash_lookup, type_hash_add, type_hash_list): Likewise.
(min_precision): Result is unsignd.
(add_double, neg_double, mul_double): Low word is unsigned.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double): Likewise.
(tree_floor_log2, compare_tree_int): New functions.
(preserve_rtl_expr_temps): New declaration.
* c-common.c (declare_hidden_char_array): Use compare_tree_int.
(decl_attributes): Use tree_log2 to find alignment.
Check for TREE_INT_CST_HIGH for format args.
(min_precision): Now unsigned.
Use tree_floor_log2.
(truthvalue_conversion): Delete long-disabled code.
* c-decl.c (finish_struct): Clean up tests on field width.
(finish_function): Use compare_tree_int.
* c-pragma.c (handle_pragma_token): Use tree_log2 for alignment.
* c-typeck.c (comptypes): Use tree_int_cst_equal.
(default_conversion, digest_init): Use compare_tree_int.
(build_binary_op): Use integer_all_onesp and compare_tree_int.
Fix type errors in forming masks.
* calls.c (initialize_argument_information): Use compare_tree_int.
* dbxout.c (dbxout_type): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* except.c (expand_eh_region_start_tree): Use compare_tree_int.
* expr.c (is_zeros_p, case INTEGER_CST): Use integer_zerop.
(store_field): Use compare_tree_int.
(expand_expr, case CONSTRUCTOR): Use TYPE_SIZE_UNIT.
(expand_expr, case ARRAY_REF): Use compare_tree_int.
(do_jump, case BIT_AND_EXPR): Use tree_floor_log2.
(do_store_flag): Use compare_tree_int.
* fold-const.c (encode, decode): Low part is always unsigned.
(force_fit_type, add_double, neg_double, mul_double): Likewise.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double, int_const_binop): Likewise.
(fold_convert): Use compare_tree_int.
(operand_equal_p, case INTEGER_CST): Use tree_int_cst_equal.
(invert_truthvalue, case INTEGER_CST): Likewise.
(fold): Use compare_tree_int; add casts for unsigned TREE_INT_CST_LOW.
* mkdeps.c (deps_dummy_targets): Make I unsigned.
* rtl.h (add_double, neg_double, mul_double): Low words are unsigned.
(lshift_double, rshift_double, lrotate_double, rrotate_double):
Likewise.
* stmt.c (expand_decl): Use compare_tree_int and mode_for_size_tree.
(expand_end_case): Use compare_tree_int.
(estimate_case_costs): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* stor-layout.c (mode_for_size_tree): Use compare_tree_int.
(layout_decl): Likewise.
(layout_record, layout_union): Make sizes unsigned.
(layout_type, case VOID_TYPE): TYPE_SIZE must be bitsizetype.
(layout_type, case QUAL_UNION_TYPE): Use compare_tree_int.
* tree.c (struct type_hash): hashcode is unsigned.
(build_type_attribute_variant, type_hash_list): Likewise.
(type_hash_lookup, type_hash_add, type_hash_canon): Likewise.
(attribute_hash_list, build_array_type, build_method_type): Likewise.
(build_complex_type): Likewise.
(real_value_from_int_cst): Remove unneeded casts.
(integer_all_onesp): Add casts.
(tree_floor_log2, compare_tree_int): New functions.
(build_index_type): Use tree_int_cst_sgn.
* varasm.c (assemble_variable): Use compare_tree_int.
* ch/actions.c (chill_convert_for_assignment): INDEX is unsigned
HOST_WIDE_INT.
* ch/ch-tree.h (DECL_NESTING_LEVEL): Use TREE_INT_CST_HIGH
since unsigned.
* ch/except.c (chill_handle_on_labels): ALTERNATIVE is unsigned.
Use compare_tree_int.
(expand_goto_except_cleanup): Likewise.
* cp/class.c (dfs_modify_vtables): I is now unsigned.
(check_bitfield_decl): Use tree_int_cst_sgn and compare_tree_int.
(build_base_field): Add casts of TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/error.c (dump_expr): Cast TREE_INT_CST_HIGH to unsigned.
* cp/init.c (build_vec_init): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/method.c (build_overload_int): Cast TREE_INT_CST_HIGH to unsigned.
* cp/typeck.c (build_binary_op, case TRUNC_DIV_EXPR):
Call integer_all_onesp.
* cp/typeck2.c (process_init_constructor): Use compare_tree_int.
* f/com.c (ffecom_f2c_set_lio_code_): Use compare_tree_int.
(ffecom_sym_transform_, ffecom_transform_common_): Likewise.
(ffecom_transform_equiv_): Likewise.
* java/decl.c (emit_init_test_initialization): Mark KEY as unused.
* java/expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
(build_anewarray): Likewise.
* java/parse.y (patch_newarray): Likewise.
* java/parse.c: Regenerated.
From-SVN: r32383
2000-03-07 12:41:32 +01:00
|
|
|
|
switch (tree_log2 (token))
|
1992-06-30 05:11:04 +02:00
|
|
|
|
{
|
tree.h (INT_CST_LT, [...]): Remove unneeded casts.
* tree.h (INT_CST_LT, INT_CST_LT_UNSIGNED): Remove unneeded casts.
(struct tree_int_cst): int_cst_low is now unsigned HOST_WIDE_INT.
(attribute_hash_list, type_hash_canon): hashcode is now unsigned.
(type_hash_lookup, type_hash_add, type_hash_list): Likewise.
(min_precision): Result is unsignd.
(add_double, neg_double, mul_double): Low word is unsigned.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double): Likewise.
(tree_floor_log2, compare_tree_int): New functions.
(preserve_rtl_expr_temps): New declaration.
* c-common.c (declare_hidden_char_array): Use compare_tree_int.
(decl_attributes): Use tree_log2 to find alignment.
Check for TREE_INT_CST_HIGH for format args.
(min_precision): Now unsigned.
Use tree_floor_log2.
(truthvalue_conversion): Delete long-disabled code.
* c-decl.c (finish_struct): Clean up tests on field width.
(finish_function): Use compare_tree_int.
* c-pragma.c (handle_pragma_token): Use tree_log2 for alignment.
* c-typeck.c (comptypes): Use tree_int_cst_equal.
(default_conversion, digest_init): Use compare_tree_int.
(build_binary_op): Use integer_all_onesp and compare_tree_int.
Fix type errors in forming masks.
* calls.c (initialize_argument_information): Use compare_tree_int.
* dbxout.c (dbxout_type): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* except.c (expand_eh_region_start_tree): Use compare_tree_int.
* expr.c (is_zeros_p, case INTEGER_CST): Use integer_zerop.
(store_field): Use compare_tree_int.
(expand_expr, case CONSTRUCTOR): Use TYPE_SIZE_UNIT.
(expand_expr, case ARRAY_REF): Use compare_tree_int.
(do_jump, case BIT_AND_EXPR): Use tree_floor_log2.
(do_store_flag): Use compare_tree_int.
* fold-const.c (encode, decode): Low part is always unsigned.
(force_fit_type, add_double, neg_double, mul_double): Likewise.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double, int_const_binop): Likewise.
(fold_convert): Use compare_tree_int.
(operand_equal_p, case INTEGER_CST): Use tree_int_cst_equal.
(invert_truthvalue, case INTEGER_CST): Likewise.
(fold): Use compare_tree_int; add casts for unsigned TREE_INT_CST_LOW.
* mkdeps.c (deps_dummy_targets): Make I unsigned.
* rtl.h (add_double, neg_double, mul_double): Low words are unsigned.
(lshift_double, rshift_double, lrotate_double, rrotate_double):
Likewise.
* stmt.c (expand_decl): Use compare_tree_int and mode_for_size_tree.
(expand_end_case): Use compare_tree_int.
(estimate_case_costs): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* stor-layout.c (mode_for_size_tree): Use compare_tree_int.
(layout_decl): Likewise.
(layout_record, layout_union): Make sizes unsigned.
(layout_type, case VOID_TYPE): TYPE_SIZE must be bitsizetype.
(layout_type, case QUAL_UNION_TYPE): Use compare_tree_int.
* tree.c (struct type_hash): hashcode is unsigned.
(build_type_attribute_variant, type_hash_list): Likewise.
(type_hash_lookup, type_hash_add, type_hash_canon): Likewise.
(attribute_hash_list, build_array_type, build_method_type): Likewise.
(build_complex_type): Likewise.
(real_value_from_int_cst): Remove unneeded casts.
(integer_all_onesp): Add casts.
(tree_floor_log2, compare_tree_int): New functions.
(build_index_type): Use tree_int_cst_sgn.
* varasm.c (assemble_variable): Use compare_tree_int.
* ch/actions.c (chill_convert_for_assignment): INDEX is unsigned
HOST_WIDE_INT.
* ch/ch-tree.h (DECL_NESTING_LEVEL): Use TREE_INT_CST_HIGH
since unsigned.
* ch/except.c (chill_handle_on_labels): ALTERNATIVE is unsigned.
Use compare_tree_int.
(expand_goto_except_cleanup): Likewise.
* cp/class.c (dfs_modify_vtables): I is now unsigned.
(check_bitfield_decl): Use tree_int_cst_sgn and compare_tree_int.
(build_base_field): Add casts of TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/error.c (dump_expr): Cast TREE_INT_CST_HIGH to unsigned.
* cp/init.c (build_vec_init): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/method.c (build_overload_int): Cast TREE_INT_CST_HIGH to unsigned.
* cp/typeck.c (build_binary_op, case TRUNC_DIV_EXPR):
Call integer_all_onesp.
* cp/typeck2.c (process_init_constructor): Use compare_tree_int.
* f/com.c (ffecom_f2c_set_lio_code_): Use compare_tree_int.
(ffecom_sym_transform_, ffecom_transform_common_): Likewise.
(ffecom_transform_equiv_): Likewise.
* java/decl.c (emit_init_test_initialization): Mark KEY as unused.
* java/expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
(build_anewarray): Likewise.
* java/parse.y (patch_newarray): Likewise.
* java/parse.c: Regenerated.
From-SVN: r32383
2000-03-07 12:41:32 +01:00
|
|
|
|
case 0:
|
1998-10-01 12:50:15 +02:00
|
|
|
|
case 1:
|
|
|
|
|
case 2:
|
tree.h (INT_CST_LT, [...]): Remove unneeded casts.
* tree.h (INT_CST_LT, INT_CST_LT_UNSIGNED): Remove unneeded casts.
(struct tree_int_cst): int_cst_low is now unsigned HOST_WIDE_INT.
(attribute_hash_list, type_hash_canon): hashcode is now unsigned.
(type_hash_lookup, type_hash_add, type_hash_list): Likewise.
(min_precision): Result is unsignd.
(add_double, neg_double, mul_double): Low word is unsigned.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double): Likewise.
(tree_floor_log2, compare_tree_int): New functions.
(preserve_rtl_expr_temps): New declaration.
* c-common.c (declare_hidden_char_array): Use compare_tree_int.
(decl_attributes): Use tree_log2 to find alignment.
Check for TREE_INT_CST_HIGH for format args.
(min_precision): Now unsigned.
Use tree_floor_log2.
(truthvalue_conversion): Delete long-disabled code.
* c-decl.c (finish_struct): Clean up tests on field width.
(finish_function): Use compare_tree_int.
* c-pragma.c (handle_pragma_token): Use tree_log2 for alignment.
* c-typeck.c (comptypes): Use tree_int_cst_equal.
(default_conversion, digest_init): Use compare_tree_int.
(build_binary_op): Use integer_all_onesp and compare_tree_int.
Fix type errors in forming masks.
* calls.c (initialize_argument_information): Use compare_tree_int.
* dbxout.c (dbxout_type): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* except.c (expand_eh_region_start_tree): Use compare_tree_int.
* expr.c (is_zeros_p, case INTEGER_CST): Use integer_zerop.
(store_field): Use compare_tree_int.
(expand_expr, case CONSTRUCTOR): Use TYPE_SIZE_UNIT.
(expand_expr, case ARRAY_REF): Use compare_tree_int.
(do_jump, case BIT_AND_EXPR): Use tree_floor_log2.
(do_store_flag): Use compare_tree_int.
* fold-const.c (encode, decode): Low part is always unsigned.
(force_fit_type, add_double, neg_double, mul_double): Likewise.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double, int_const_binop): Likewise.
(fold_convert): Use compare_tree_int.
(operand_equal_p, case INTEGER_CST): Use tree_int_cst_equal.
(invert_truthvalue, case INTEGER_CST): Likewise.
(fold): Use compare_tree_int; add casts for unsigned TREE_INT_CST_LOW.
* mkdeps.c (deps_dummy_targets): Make I unsigned.
* rtl.h (add_double, neg_double, mul_double): Low words are unsigned.
(lshift_double, rshift_double, lrotate_double, rrotate_double):
Likewise.
* stmt.c (expand_decl): Use compare_tree_int and mode_for_size_tree.
(expand_end_case): Use compare_tree_int.
(estimate_case_costs): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* stor-layout.c (mode_for_size_tree): Use compare_tree_int.
(layout_decl): Likewise.
(layout_record, layout_union): Make sizes unsigned.
(layout_type, case VOID_TYPE): TYPE_SIZE must be bitsizetype.
(layout_type, case QUAL_UNION_TYPE): Use compare_tree_int.
* tree.c (struct type_hash): hashcode is unsigned.
(build_type_attribute_variant, type_hash_list): Likewise.
(type_hash_lookup, type_hash_add, type_hash_canon): Likewise.
(attribute_hash_list, build_array_type, build_method_type): Likewise.
(build_complex_type): Likewise.
(real_value_from_int_cst): Remove unneeded casts.
(integer_all_onesp): Add casts.
(tree_floor_log2, compare_tree_int): New functions.
(build_index_type): Use tree_int_cst_sgn.
* varasm.c (assemble_variable): Use compare_tree_int.
* ch/actions.c (chill_convert_for_assignment): INDEX is unsigned
HOST_WIDE_INT.
* ch/ch-tree.h (DECL_NESTING_LEVEL): Use TREE_INT_CST_HIGH
since unsigned.
* ch/except.c (chill_handle_on_labels): ALTERNATIVE is unsigned.
Use compare_tree_int.
(expand_goto_except_cleanup): Likewise.
* cp/class.c (dfs_modify_vtables): I is now unsigned.
(check_bitfield_decl): Use tree_int_cst_sgn and compare_tree_int.
(build_base_field): Add casts of TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/error.c (dump_expr): Cast TREE_INT_CST_HIGH to unsigned.
* cp/init.c (build_vec_init): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/method.c (build_overload_int): Cast TREE_INT_CST_HIGH to unsigned.
* cp/typeck.c (build_binary_op, case TRUNC_DIV_EXPR):
Call integer_all_onesp.
* cp/typeck2.c (process_init_constructor): Use compare_tree_int.
* f/com.c (ffecom_f2c_set_lio_code_): Use compare_tree_int.
(ffecom_sym_transform_, ffecom_transform_common_): Likewise.
(ffecom_transform_equiv_): Likewise.
* java/decl.c (emit_init_test_initialization): Mark KEY as unused.
* java/expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
(build_anewarray): Likewise.
* java/parse.y (patch_newarray): Likewise.
* java/parse.c: Regenerated.
From-SVN: r32383
2000-03-07 12:41:32 +01:00
|
|
|
|
case 3:
|
1998-10-01 12:50:15 +02:00
|
|
|
|
case 4:
|
|
|
|
|
state = ps_align;
|
tree.h (INT_CST_LT, [...]): Remove unneeded casts.
* tree.h (INT_CST_LT, INT_CST_LT_UNSIGNED): Remove unneeded casts.
(struct tree_int_cst): int_cst_low is now unsigned HOST_WIDE_INT.
(attribute_hash_list, type_hash_canon): hashcode is now unsigned.
(type_hash_lookup, type_hash_add, type_hash_list): Likewise.
(min_precision): Result is unsignd.
(add_double, neg_double, mul_double): Low word is unsigned.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double): Likewise.
(tree_floor_log2, compare_tree_int): New functions.
(preserve_rtl_expr_temps): New declaration.
* c-common.c (declare_hidden_char_array): Use compare_tree_int.
(decl_attributes): Use tree_log2 to find alignment.
Check for TREE_INT_CST_HIGH for format args.
(min_precision): Now unsigned.
Use tree_floor_log2.
(truthvalue_conversion): Delete long-disabled code.
* c-decl.c (finish_struct): Clean up tests on field width.
(finish_function): Use compare_tree_int.
* c-pragma.c (handle_pragma_token): Use tree_log2 for alignment.
* c-typeck.c (comptypes): Use tree_int_cst_equal.
(default_conversion, digest_init): Use compare_tree_int.
(build_binary_op): Use integer_all_onesp and compare_tree_int.
Fix type errors in forming masks.
* calls.c (initialize_argument_information): Use compare_tree_int.
* dbxout.c (dbxout_type): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* except.c (expand_eh_region_start_tree): Use compare_tree_int.
* expr.c (is_zeros_p, case INTEGER_CST): Use integer_zerop.
(store_field): Use compare_tree_int.
(expand_expr, case CONSTRUCTOR): Use TYPE_SIZE_UNIT.
(expand_expr, case ARRAY_REF): Use compare_tree_int.
(do_jump, case BIT_AND_EXPR): Use tree_floor_log2.
(do_store_flag): Use compare_tree_int.
* fold-const.c (encode, decode): Low part is always unsigned.
(force_fit_type, add_double, neg_double, mul_double): Likewise.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double, int_const_binop): Likewise.
(fold_convert): Use compare_tree_int.
(operand_equal_p, case INTEGER_CST): Use tree_int_cst_equal.
(invert_truthvalue, case INTEGER_CST): Likewise.
(fold): Use compare_tree_int; add casts for unsigned TREE_INT_CST_LOW.
* mkdeps.c (deps_dummy_targets): Make I unsigned.
* rtl.h (add_double, neg_double, mul_double): Low words are unsigned.
(lshift_double, rshift_double, lrotate_double, rrotate_double):
Likewise.
* stmt.c (expand_decl): Use compare_tree_int and mode_for_size_tree.
(expand_end_case): Use compare_tree_int.
(estimate_case_costs): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* stor-layout.c (mode_for_size_tree): Use compare_tree_int.
(layout_decl): Likewise.
(layout_record, layout_union): Make sizes unsigned.
(layout_type, case VOID_TYPE): TYPE_SIZE must be bitsizetype.
(layout_type, case QUAL_UNION_TYPE): Use compare_tree_int.
* tree.c (struct type_hash): hashcode is unsigned.
(build_type_attribute_variant, type_hash_list): Likewise.
(type_hash_lookup, type_hash_add, type_hash_canon): Likewise.
(attribute_hash_list, build_array_type, build_method_type): Likewise.
(build_complex_type): Likewise.
(real_value_from_int_cst): Remove unneeded casts.
(integer_all_onesp): Add casts.
(tree_floor_log2, compare_tree_int): New functions.
(build_index_type): Use tree_int_cst_sgn.
* varasm.c (assemble_variable): Use compare_tree_int.
* ch/actions.c (chill_convert_for_assignment): INDEX is unsigned
HOST_WIDE_INT.
* ch/ch-tree.h (DECL_NESTING_LEVEL): Use TREE_INT_CST_HIGH
since unsigned.
* ch/except.c (chill_handle_on_labels): ALTERNATIVE is unsigned.
Use compare_tree_int.
(expand_goto_except_cleanup): Likewise.
* cp/class.c (dfs_modify_vtables): I is now unsigned.
(check_bitfield_decl): Use tree_int_cst_sgn and compare_tree_int.
(build_base_field): Add casts of TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/error.c (dump_expr): Cast TREE_INT_CST_HIGH to unsigned.
* cp/init.c (build_vec_init): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/method.c (build_overload_int): Cast TREE_INT_CST_HIGH to unsigned.
* cp/typeck.c (build_binary_op, case TRUNC_DIV_EXPR):
Call integer_all_onesp.
* cp/typeck2.c (process_init_constructor): Use compare_tree_int.
* f/com.c (ffecom_f2c_set_lio_code_): Use compare_tree_int.
(ffecom_sym_transform_, ffecom_transform_common_): Likewise.
(ffecom_transform_equiv_): Likewise.
* java/decl.c (emit_init_test_initialization): Mark KEY as unused.
* java/expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
(build_anewarray): Likewise.
* java/parse.y (patch_newarray): Likewise.
* java/parse.c: Regenerated.
From-SVN: r32383
2000-03-07 12:41:32 +01:00
|
|
|
|
align = 1 << tree_log2 (token);
|
1998-10-01 12:50:15 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
state = ps_bad;
|
|
|
|
|
break;
|
1992-06-30 05:11:04 +02:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ps_align:
|
1998-10-01 12:50:15 +02:00
|
|
|
|
state = (strcmp (string, ")") ? ps_bad : ps_right);
|
1992-06-30 05:11:04 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ps_right:
|
|
|
|
|
state = ps_bad;
|
|
|
|
|
break;
|
1998-10-01 12:50:15 +02:00
|
|
|
|
#endif /* HANDLE_PRAGMA_PACK */
|
1992-06-30 05:11:04 +02:00
|
|
|
|
|
1998-10-01 12:50:15 +02:00
|
|
|
|
#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
|
|
|
|
|
case ps_push:
|
1999-04-26 23:18:08 +02:00
|
|
|
|
state = (strcmp (string, ",") ? ps_bad : ps_pushcomma);
|
1998-10-01 12:50:15 +02:00
|
|
|
|
break;
|
|
|
|
|
|
1999-04-26 23:18:08 +02:00
|
|
|
|
case ps_pushid:
|
|
|
|
|
state = (strcmp (string, ",") ? ps_bad : ps_pushcomma2);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ps_pushcomma:
|
|
|
|
|
if (token && TREE_CODE (token) == IDENTIFIER_NODE)
|
|
|
|
|
{
|
|
|
|
|
id = token;
|
|
|
|
|
state = ps_pushid;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* else fall through */
|
|
|
|
|
case ps_pushcomma2:
|
|
|
|
|
if (token && TREE_CODE (token) == INTEGER_CST)
|
|
|
|
|
goto handle_align;
|
|
|
|
|
else
|
|
|
|
|
state = ps_bad;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ps_pop:
|
|
|
|
|
if (strcmp (string, ",") == 0)
|
|
|
|
|
state = ps_popcomma;
|
|
|
|
|
else
|
|
|
|
|
state = (strcmp (string, ")") ? ps_bad : ps_right);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ps_popcomma:
|
|
|
|
|
if (token && TREE_CODE (token) == IDENTIFIER_NODE)
|
|
|
|
|
{
|
|
|
|
|
id = token;
|
|
|
|
|
state = ps_align;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
state = ps_bad;
|
1998-10-01 12:50:15 +02:00
|
|
|
|
break;
|
|
|
|
|
#endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
|
1999-09-09 06:00:37 +02:00
|
|
|
|
|
|
|
|
|
case ps_poison:
|
|
|
|
|
if (token && TREE_CODE (token) != IDENTIFIER_NODE)
|
|
|
|
|
state = ps_bad;
|
|
|
|
|
break;
|
|
|
|
|
|
1992-06-30 05:11:04 +02:00
|
|
|
|
case ps_bad:
|
|
|
|
|
case ps_done:
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
1998-09-02 11:59:57 +02:00
|
|
|
|
|
|
|
|
|
return 1;
|
1992-06-30 05:11:04 +02:00
|
|
|
|
}
|
1998-10-01 12:50:15 +02:00
|
|
|
|
#endif /* HANDLE_GENERIC_PRAGMAS */
|
1999-09-18 20:54:36 +02:00
|
|
|
|
|
|
|
|
|
#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
|
|
|
|
|
static void
|
|
|
|
|
mark_align_stack (p)
|
|
|
|
|
void *p;
|
|
|
|
|
{
|
1999-09-19 23:19:38 +02:00
|
|
|
|
align_stack *a = *(align_stack **) p;
|
1999-09-18 20:54:36 +02:00
|
|
|
|
|
|
|
|
|
while (a)
|
|
|
|
|
{
|
|
|
|
|
ggc_mark_tree (a->id);
|
|
|
|
|
a = a->prev;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
init_pragma ()
|
|
|
|
|
{
|
|
|
|
|
#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
|
|
|
|
|
ggc_add_root (&alignment_stack, 1, sizeof(alignment_stack),
|
|
|
|
|
mark_align_stack);
|
|
|
|
|
#endif
|
|
|
|
|
}
|