diff options
author | Richard Henderson <rth@cygnus.com> | 2000-04-27 06:32:52 +0000 |
---|---|---|
committer | Richard Henderson <rth@cygnus.com> | 2000-04-27 06:32:52 +0000 |
commit | d583b266d30c1a2c77471aee0f59e991f959609d (patch) | |
tree | 22fadf755eadc32f5955b0e88ee65edf71872d03 | |
parent | e0e62ec3cbaa4477133bc3370f3971b98f5b09b3 (diff) |
Merge from mainline
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/condexec-branch@33467 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 109 | ||||
-rw-r--r-- | gcc/config/mips/linux.h | 2 | ||||
-rw-r--r-- | gcc/config/pa/pa32-regs.h | 2 | ||||
-rw-r--r-- | gcc/config/pa/pa64-regs.h | 2 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 20 | ||||
-rw-r--r-- | gcc/cp/call.c | 2 | ||||
-rw-r--r-- | gcc/cp/class.c | 2 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 2 | ||||
-rw-r--r-- | gcc/cp/cvt.c | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 6 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 8 | ||||
-rw-r--r-- | gcc/cp/init.c | 6 | ||||
-rw-r--r-- | gcc/cp/pt.c | 4 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 19 | ||||
-rw-r--r-- | gcc/cpplex.c | 179 | ||||
-rw-r--r-- | gcc/cpplib.h | 11 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 64 | ||||
-rw-r--r-- | gcc/dwarf2out.h | 3 | ||||
-rw-r--r-- | gcc/dwarfout.c | 18 | ||||
-rw-r--r-- | gcc/extend.texi | 2 | ||||
-rw-r--r-- | gcc/f/version.c | 2 | ||||
-rw-r--r-- | gcc/flow.c | 46 | ||||
-rw-r--r-- | gcc/integrate.c | 6 | ||||
-rw-r--r-- | gcc/java/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/java/zextract.c | 36 | ||||
-rw-r--r-- | gcc/jump.c | 2 | ||||
-rw-r--r-- | gcc/optabs.c | 3 | ||||
-rw-r--r-- | gcc/ssa.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/toplev.c | 2 | ||||
-rw-r--r-- | gcc/tree.h | 24 | ||||
-rw-r--r-- | gcc/version.c | 2 | ||||
-rw-r--r-- | libf2c/libF77/Version.c | 2 | ||||
-rw-r--r-- | libf2c/libI77/Version.c | 2 | ||||
-rw-r--r-- | libf2c/libU77/Version.c | 2 |
35 files changed, 406 insertions, 205 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 921a3d031e0..1d134c0ee30 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,112 @@ +2000-04-26 Richard Henderson <rth@cygnus.com> + + * jump.c (invert_jump): Always invert REG_BR_PROB. Do it correctly. + + * bb-reorder.c (reorder_basic_blocks): Don't run estimate_probability. + * flow.c (calculate_loop_depth): Remove. + * output.h (calculate_loop_depth): Don't declare. + * toplev.c (rest_of_compilation): Expand calculate_loop_depth + inline; run estimate_probability at the same time. + +2000-04-26 Neil Booth <NeilB@earthling.net> + + * cpplib.h: "~=" is not a single pp-token. + * cpplex.c: Correct commentary. + +2000-04-26 Richard Henderson <rth@cygnus.com> + + * flow.c (mark_set_1): New arguments code and flags; update all + callers. Track regno_first and regno_last; do HARD_REGNO_NREGS + test in one place. Tidy flags tests. Don't bias REG_N_REFS by + loop_depth when optimizing for size. Do new_dead update after + emitting REG_UNUSED notes. Merge mark_set_reg code. + (mark_set_reg): Remove. + (propagate_one_insn): Use mark_set_1 for call-clobbered registers; + arrange to not emit REG_UNUSED notes. + +2000-04-26 Richard Henderson <rth@cygnus.com> + + * flow.c (find_auto_inc): Use pbi->bb instead of BLOCK_FOR_INSN. + * ssa.c (convert_from_ssa): Don't run compute_bb_for_insn. + +2000-04-26 Richard Henderson <rth@cygnus.com> + + * flow.c (propagate_one_insn): Break out from propagate_block. + (init_propagate_block_info): Likewise. + (free_propagate_block_info): Likewise. + (propagate_block): Use them. Export. + * basic-block.h: Declare them all. + +2000-04-26 Richard Henderson <rth@cygnus.com> + + * basic-block.h (life_analysis): Declare here ... + * output.h: ... not here. + * flow.c (life_analysis): Remove nregs parameter; replace + remove_dead_code with flags. Remove ssa dead code check. + Only init alias analysis if we'll use it. + * reg-stack.c (reg_to_stack): Update life_analysis arguments. + * ssa.c (convert_to_ssa): Likewise. + (convert_from_ssa): Likewise. + * toplev.c (rest_of_compilation): Likewise. + +2000-04-26 Richard Henderson <rth@cygnus.com> + + * flow.c (flow_delete_block): Rename from delete_block. Export. + * basic-block.h (flow_delete_block): Declare. + +2000-04-26 David S. Miller <davem@redhat.com> + + * optabs.c (emit_libcall_block): Verify insns with INSN_P before + taking a PATTERN of it. + +2000-04-26 <NeilB@earthling.net> + + * cpplex.c (spell_other, spell_char): Remove. + (SPELL_CHAR): New. + (token_spelling, trigraph_map): Use unsigned chars. + (_cpp_lex_line): Tidy up the switch statement. + * cpplib.h: Implement spell_char with spell_string. + (C): New. + +2000-04-26 <RodneyBrown@pmsc.com> + + * pa/pa32-regs.h (HARD_REGNO_MODE_OK): Warning removal. + * pa/pa64-regs.h (HARD_REGNO_MODE_OK): Warning removal. + +2000-04-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * dwarf2out.c (dw_cfi_oprnd_struct, dw_fde_struct, add_fde_cfi, + reg_save, dwarf2out_frame_debug_expr, dwarf2out_def_cfa, + dwarf2out_window_save, dwarf2out_args_size, dwarf2out_reg_save, + dwarf2out_return_save, dwarf2out_return_reg, + dwarf2out_stack_adjust, dwarf2out_frame_debug, primary_filename, + add_AT_lbl_id, add_AT_lbl_offset, type_tag, decl_start_label, + gen_compile_unit_die, dwarf2out_init): Constify a char*. + + * dwarf2out.h (dwarf2out_init): Likewise. + + * dwarfout.c (filename_entry, primary_filename, last_filename, + type_tag, output_compile_unit_die, dwarfout_init): Likewise. + + * tree.h (dwarf2out_def_cfa, dwarf2out_window_save, + dwarf2out_args_size, dwarf2out_reg_save, dwarf2out_return_save, + dwarf2out_return_reg): Likewise. + +2000-04-26 Andreas Jaeger <aj@suse.de> + + * extend.texi (Function Attributes): Fix description of pure + attribute. + +2000-04-26 Jason Merrill <jason@casey.cygnus.com> + + * integrate.c (output_inline_function): Do clear DECL_DEFER_OUTPUT + before calling rest_of_compilation. + +2000-04-26 Andreas Jaeger <aj@suse.de> + + * config/mips/linux.h: Remove erroneous commit of #if 0/#endif in + last patch. + 2000-04-25 Richard Henderson <rth@cygnus.com> * cse.c (cse_insn): Emit barrier after unconditional jump. diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h index f17ac98a958..a598f169180 100644 --- a/gcc/config/mips/linux.h +++ b/gcc/config/mips/linux.h @@ -169,7 +169,6 @@ Boston, MA 02111-1307, USA. */ %{!fno-PIC:%{!fno-pic:-KPIC}} \ %{fno-PIC:-non_shared} %{fno-pic:-non_shared}" -#if 0 /* Undefine the following which were defined in elf.h. This will cause the linux port to continue to use collect2 for constructors/destructors. These may be removed when .ctor/.dtor section support is desired. */ @@ -197,5 +196,4 @@ Boston, MA 02111-1307, USA. */ #undef CTOR_LIST_END #undef DTOR_LIST_BEGIN #undef DTOR_LIST_END -#endif /* End of undefines to turn off .ctor/.dtor section support */ diff --git a/gcc/config/pa/pa32-regs.h b/gcc/config/pa/pa32-regs.h index 2f7e9e783c1..d201f0e009a 100644 --- a/gcc/config/pa/pa32-regs.h +++ b/gcc/config/pa/pa32-regs.h @@ -177,7 +177,7 @@ ? GET_MODE_SIZE (MODE) <= 4 || ((REGNO) & 1) == 0 \ /* Make wide modes be in aligned registers. */ \ : (GET_MODE_SIZE (MODE) <= UNITS_PER_WORD \ - || GET_MODE_SIZE (MODE) <= 2 * UNITS_PER_WORD && ((REGNO) & 1) == 0)) + || (GET_MODE_SIZE (MODE) <= 2 * UNITS_PER_WORD && ((REGNO) & 1) == 0))) /* How to renumber registers for dbx and gdb. diff --git a/gcc/config/pa/pa64-regs.h b/gcc/config/pa/pa64-regs.h index 5e99ad3d035..9d53adce920 100644 --- a/gcc/config/pa/pa64-regs.h +++ b/gcc/config/pa/pa64-regs.h @@ -165,7 +165,7 @@ Boston, MA 02111-1307, USA. */ ? (MODE) == CCmode || (MODE) == CCFPmode \ /* Make wide modes be in aligned registers. */ \ : (GET_MODE_SIZE (MODE) <= UNITS_PER_WORD \ - || GET_MODE_SIZE (MODE) <= 2 * UNITS_PER_WORD && ((REGNO) & 1) == 0)) + || (GET_MODE_SIZE (MODE) <= 2 * UNITS_PER_WORD && ((REGNO) & 1) == 0))) /* How to renumber registers for dbx and gdb. diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0cfe024dd31..f8357254c7e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,23 @@ +2000-04-26 Mark Mitchell <mark@codesourcery.com> + + * cp-tree.h (TREE_READONLY_DECL_P): Use DECL_P. + * init.c (decl_constant_value): Check TREE_READONLY_DECL_P. + * call.c (convert_like_real): Don't test TREE_READONLY_DECL_P + before calling decl_constant_value. + * class.c (check_bitfield_decl): Likewise. + * cvt.c (ocp_convert): Likewise. + (convert): Likewise. + * decl.c (compute_array_index_type): Likewise. + (build_enumerator): Likewise. + * decl2.c (check_cp_case_value): Likewise. + * pt.c (convert_nontype_argument): Likewise. + (tsubst): Likewise. + * typeck.c (decay_conversion): Likewise. + (build_compound_expr): Likewise. + (build_reinterpret_cast): Likewise. + (build_c_cast): Likewise. + (convert_for_assignment): Likewise. + 2000-04-26 Jason Merrill <jason@casey.cygnus.com> * decl.c (finish_function): Don't play games with DECL_INLINE. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index d8dda3e2416..8cbdd3098d9 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -3720,7 +3720,7 @@ convert_like_real (convs, expr, fn, argnum, inner) /* Convert a non-array constant variable to its underlying value, unless we are about to bind it to a reference, in which case we need to leave it as an lvalue. */ - if (TREE_READONLY_DECL_P (expr) && TREE_CODE (convs) != REF_BIND + if (TREE_CODE (convs) != REF_BIND && TREE_CODE (TREE_TYPE (expr)) != ARRAY_TYPE) expr = decl_constant_value (expr); diff --git a/gcc/cp/class.c b/gcc/cp/class.c index b5d3f3e7b22..5a95bc562f9 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -3061,7 +3061,7 @@ check_bitfield_decl (field) /* detect invalid field size. */ if (TREE_CODE (w) == CONST_DECL) w = DECL_INITIAL (w); - else if (TREE_READONLY_DECL_P (w)) + else w = decl_constant_value (w); if (TREE_CODE (w) != INTEGER_CST) diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 5c4f5ac1400..a36803e8b99 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -1922,7 +1922,7 @@ struct lang_decl /* Non-zero if NODE is a _DECL with TREE_READONLY set. */ #define TREE_READONLY_DECL_P(NODE) \ - (TREE_READONLY (NODE) && TREE_CODE_CLASS (TREE_CODE (NODE)) == 'd') + (TREE_READONLY (NODE) && DECL_P (NODE)) /* Non-zero iff DECL is memory-based. The DECL_RTL of certain const variables might be a CONST_INT, or a REG diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index 376cdaa3460..5a2964f6e3a 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -673,8 +673,7 @@ ocp_convert (type, expr, convtype, flags) complete_type (type); complete_type (TREE_TYPE (expr)); - if (TREE_READONLY_DECL_P (e)) - e = decl_constant_value (e); + e = decl_constant_value (e); if (IS_AGGR_TYPE (type) && (convtype & CONV_FORCE_TEMP) /* Some internal structures (vtable_entry_type, sigtbl_ptr_type) @@ -1003,8 +1002,7 @@ convert (type, expr) if (POINTER_TYPE_P (type) && POINTER_TYPE_P (intype)) { - if (TREE_READONLY_DECL_P (expr)) - expr = decl_constant_value (expr); + expr = decl_constant_value (expr); return fold (build1 (NOP_EXPR, type, expr)); } diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index cd6fd493a95..78c41671957 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -9124,8 +9124,7 @@ compute_array_index_type (name, size) STRIP_TYPE_NOPS (size); /* It might be a const variable or enumeration constant. */ - if (TREE_READONLY_DECL_P (size)) - size = decl_constant_value (size); + size = decl_constant_value (size); /* If this involves a template parameter, it will be a constant at instantiation time, but we don't know what the value is yet. @@ -13019,8 +13018,7 @@ build_enumerator (name, value, enumtype) /* Validate and default VALUE. */ if (value != NULL_TREE) { - if (TREE_READONLY_DECL_P (value)) - value = decl_constant_value (value); + value = decl_constant_value (value); if (TREE_CODE (value) == INTEGER_CST) { diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 61685dd3dda..dd89057f0a4 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -4143,12 +4143,8 @@ check_cp_case_value (value) /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ STRIP_TYPE_NOPS (value); - - if (TREE_READONLY_DECL_P (value)) - { - value = decl_constant_value (value); - STRIP_TYPE_NOPS (value); - } + value = decl_constant_value (value); + STRIP_TYPE_NOPS (value); value = fold (value); if (TREE_CODE (value) != INTEGER_CST diff --git a/gcc/cp/init.c b/gcc/cp/init.c index fc2bcfbecc6..373b7c03ef7 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -1779,13 +1779,15 @@ resolve_offset_ref (exp) return NULL_TREE; } -/* Return either DECL or its known constant value (if it has one). */ +/* If DECL is a `const' declaration, and its value is a known + constant, then return that value. */ tree decl_constant_value (decl) tree decl; { - if (! TREE_THIS_VOLATILE (decl) + if (TREE_READONLY_DECL_P (decl) + && ! TREE_THIS_VOLATILE (decl) && DECL_INITIAL (decl) && DECL_INITIAL (decl) != error_mark_node /* This is invalid if initial value is not constant. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index bfad70f9611..2379a2c3cae 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -2701,7 +2701,7 @@ convert_nontype_argument (type, expr) enumerators. Simplify things by folding them to their values, unless we're about to bind the declaration to a reference parameter. */ - if (INTEGRAL_TYPE_P (expr_type) && TREE_READONLY_DECL_P (expr) + if (INTEGRAL_TYPE_P (expr_type) && TREE_CODE (type) != REFERENCE_TYPE) expr = decl_constant_value (expr); @@ -6200,7 +6200,7 @@ tsubst (t, args, complain, in_decl) /* See if we can reduce this expression to something simpler. */ max = maybe_fold_nontype_arg (max); - if (!processing_template_decl && TREE_READONLY_DECL_P (max)) + if (!processing_template_decl) max = decl_constant_value (max); if (processing_template_decl diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index da5e9546b19..39b47a005d0 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -1710,7 +1710,7 @@ decay_conversion (exp) don't do this for arrays, though; we want the address of the first element of the array, not the address of the first element of its initializing constant. */ - else if (TREE_READONLY_DECL_P (exp) && code != ARRAY_TYPE) + else if (code != ARRAY_TYPE) { exp = decl_constant_value (exp); type = TREE_TYPE (exp); @@ -5084,8 +5084,7 @@ build_compound_expr (list) register tree rest; tree first; - if (TREE_READONLY_DECL_P (TREE_VALUE (list))) - TREE_VALUE (list) = decl_constant_value (TREE_VALUE (list)); + TREE_VALUE (list) = decl_constant_value (TREE_VALUE (list)); if (TREE_CHAIN (list) == 0) { @@ -5272,8 +5271,7 @@ build_reinterpret_cast (type, expr) else if ((TYPE_PTRFN_P (type) && TYPE_PTRFN_P (intype)) || (TYPE_PTRMEMFUNC_P (type) && TYPE_PTRMEMFUNC_P (intype))) { - if (TREE_READONLY_DECL_P (expr)) - expr = decl_constant_value (expr); + expr = decl_constant_value (expr); return fold (build1 (NOP_EXPR, type, expr)); } else if ((TYPE_PTRMEM_P (type) && TYPE_PTRMEM_P (intype)) @@ -5283,16 +5281,14 @@ build_reinterpret_cast (type, expr) cp_pedwarn ("reinterpret_cast from `%T' to `%T' casts away const (or volatile)", intype, type); - if (TREE_READONLY_DECL_P (expr)) - expr = decl_constant_value (expr); + expr = decl_constant_value (expr); return fold (build1 (NOP_EXPR, type, expr)); } else if ((TYPE_PTRFN_P (type) && TYPE_PTROBV_P (intype)) || (TYPE_PTRFN_P (intype) && TYPE_PTROBV_P (type))) { pedwarn ("ISO C++ forbids casting between pointer-to-function and pointer-to-object"); - if (TREE_READONLY_DECL_P (expr)) - expr = decl_constant_value (expr); + expr = decl_constant_value (expr); return fold (build1 (NOP_EXPR, type, expr)); } else @@ -5498,8 +5494,7 @@ build_c_cast (type, expr) { tree ovalue; - if (TREE_READONLY_DECL_P (value)) - value = decl_constant_value (value); + value = decl_constant_value (value); ovalue = value; value = convert_force (type, value, CONV_C_CAST); @@ -6493,7 +6488,7 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum) /* Simplify the RHS if possible. */ if (TREE_CODE (rhs) == CONST_DECL) rhs = DECL_INITIAL (rhs); - else if (TREE_READONLY_DECL_P (rhs) && coder != ARRAY_TYPE) + else if (coder != ARRAY_TYPE) rhs = decl_constant_value (rhs); /* [expr.ass] diff --git a/gcc/cpplex.c b/gcc/cpplex.c index 30614372809..11a88e1b47a 100644 --- a/gcc/cpplex.c +++ b/gcc/cpplex.c @@ -2050,6 +2050,97 @@ _cpp_init_input_buffer (pfile) #if 0 +/* Lexing algorithm. + + The original lexer in cpplib was made up of two passes: a first pass + that replaced trigraphs and deleted esacped newlines, and a second + pass that tokenized the result of the first pass. Tokenisation was + performed by peeking at the next character in the input stream. For + example, if the input stream contained "!=", the handler for the ! + character would peek at the next character, and if it were a '=' + would skip over it, and return a "!=" token, otherwise it would + return just the "!" token. + + To implement a single-pass lexer, this peeking ahead is unworkable. + An arbitrary number of escaped newlines, and trigraphs (in particular + ??/ which translates to the escape \), could separate the '!' and '=' + in the input stream, yet the next token is still a "!=". + + Suppose instead that we lex by one logical line at a time, producing + a token list or stack for each logical line, and when seeing the '!' + push a CPP_NOT token on the list. Then if the '!' is part of a + longer token ("!=") we know we must see the remainder of the token by + the time we reach the end of the logical line. Thus we can have the + '=' handler look at the previous token (at the end of the list / top + of the stack) and see if it is a "!" token, and if so, instead of + pushing a "=" token revise the existing token to be a "!=" token. + + This works in the presence of escaped newlines, because the '\' would + have been pushed on the top of the stack as a CPP_BACKSLASH. The + newline ('\n' or '\r') handler looks at the token at the top of the + stack to see if it is a CPP_BACKSLASH, and if so discards both. + Otherwise it pushes the newline (CPP_VSPACE) token as normal. Hence + the '=' handler would never see any intervening escaped newlines. + + To make trigraphs work in this context, as in precedence trigraphs + are highest and converted before anything else, the '?' handler does + lookahead to see if it is a trigraph, and if so skips the trigraph + and pushes the token it represents onto the top of the stack. This + also works in the particular case of a CPP_BACKSLASH trigraph. + + To the preprocessor, whitespace is only significant to the point of + knowing whether whitespace precedes a particular token. For example, + the '=' handler needs to know whether there was whitespace between it + and a "!" token on the top of the stack, to make the token conversion + decision correctly. So each token has a PREV_WHITESPACE flag to + indicate this - the standard permits consecutive whitespace to be + regarded as a single space. The compiler front ends are not + interested in whitespace at all; they just require a token stream. + Another place where whitespace is significant to the preprocessor is + a #define statment - if there is whitespace between the macro name + and an initial "(" token the macro is "object-like", otherwise it is + a function-like macro that takes arguments. + + However, all is not rosy. Parsing of identifiers, numbers, comments + and strings becomes trickier because of the possibility of raw + trigraphs and escaped newlines in the input stream. + + The trigraphs are three consecutive characters beginning with two + question marks. A question mark is not valid as part of a number or + identifier, so parsing of a number or identifier terminates normally + upon reaching it, returning to the mainloop which handles the + trigraph just like it would in any other position. Similarly for the + backslash of a backslash-newline combination. So we just need the + escaped-newline dropper in the mainloop to check if the token on the + top of the stack after dropping the escaped newline is a number or + identifier, and if so to continue the processing it as if nothing had + happened. + + For strings, we replace trigraphs whenever we reach a quote or + newline, because there might be a backslash trigraph escaping them. + We need to be careful that we start trigraph replacing from where we + left off previously, because it is possible for a first scan to leave + "fake" trigraphs that a second scan would pick up as real (e.g. the + sequence "????/\n=" would find a fake ??= trigraph after removing the + escaped newline.) + + For line comments, on reaching a newline we scan the previous + character(s) to see if it escaped, and continue if it is. Block + comments ignore everything and just focus on finding the comment + termination mark. The only difficult thing, and it is surprisingly + tricky, is checking if an asterisk precedes the final slash since + they could be separated by escaped newlines. If the preprocessor is + invoked with the output comments option, we don't bother removing + escaped newlines and replacing trigraphs for output. + + Finally, numbers can begin with a period, which is pushed initially + as a CPP_DOT token in its own right. The digit handler checks if the + previous token was a CPP_DOT not separated by whitespace, and if so + pops it off the stack and pushes a period into the number's buffer + before calling the number parser. + +*/ + static void expand_comment_space PARAMS ((cpp_toklist *)); void init_trigraph_map PARAMS ((void)); static unsigned char* trigraph_replace PARAMS ((cpp_reader *, unsigned char *, @@ -2070,16 +2161,12 @@ void _cpp_lex_line PARAMS ((cpp_reader *, cpp_toklist *)); static void _cpp_output_list PARAMS ((cpp_reader *, cpp_toklist *)); -unsigned int spell_char PARAMS ((unsigned char *, cpp_toklist *, - cpp_token *token)); unsigned int spell_string PARAMS ((unsigned char *, cpp_toklist *, cpp_token *token)); unsigned int spell_comment PARAMS ((unsigned char *, cpp_toklist *, cpp_token *token)); unsigned int spell_name PARAMS ((unsigned char *, cpp_toklist *, cpp_token *token)); -unsigned int spell_other PARAMS ((unsigned char *, cpp_toklist *, - cpp_token *token)); typedef unsigned int (* speller) PARAMS ((unsigned char *, cpp_toklist *, cpp_token *)); @@ -2109,22 +2196,25 @@ typedef unsigned int (* speller) PARAMS ((unsigned char *, cpp_toklist *, #define SPELL_TEXT 0 #define SPELL_HANDLER 1 -#define SPELL_NONE 2 -#define SPELL_EOL 3 +#define SPELL_CHAR 2 +#define SPELL_NONE 3 +#define SPELL_EOL 4 #define T(e, s) {SPELL_TEXT, s}, #define H(e, s) {SPELL_HANDLER, s}, +#define C(e, s) {SPELL_CHAR, s}, #define N(e, s) {SPELL_NONE, s}, #define E(e, s) {SPELL_EOL, s}, static const struct token_spelling { - char type; + unsigned char type; PTR speller; } token_spellings [N_TTYPES + 1] = {TTYPE_TABLE {0, 0} }; #undef T #undef H +#undef C #undef N #undef E @@ -2155,12 +2245,12 @@ cpp_free_token_list (list) { if (list->comments) free (list->comments); - free (list->tokens - 1); + free (list->tokens - 1); /* Backup over dummy token. */ free (list->namebuf); free (list); } -static char trigraph_map[256]; +static unsigned char trigraph_map[256]; void init_trigraph_map () @@ -3029,10 +3119,6 @@ _cpp_lex_line (pfile, list) cur_token++; break; - case ')': - PUSH_TOKEN (CPP_CLOSE_PAREN); - break; - case '(': /* Is this the beginning of an assertion string? */ if (list->dir_flags & SYNTAX_ASSERT) @@ -3044,11 +3130,6 @@ _cpp_lex_line (pfile, list) PUSH_TOKEN (CPP_OPEN_PAREN); break; - make_complement: - case '~': - PUSH_TOKEN (CPP_COMPL); - break; - case '?': if (cur + 1 < buffer->rlimit && *cur == '?' && trigraph_map[cur[1]] && trigraph_ok (pfile, cur + 1)) @@ -3097,6 +3178,8 @@ _cpp_lex_line (pfile, list) PUSH_TOKEN (CPP_DOT); break; + make_complement: + case '~': PUSH_TOKEN (CPP_COMPL); break; make_xor: case '^': PUSH_TOKEN (CPP_XOR); break; make_open_brace: @@ -3112,6 +3195,7 @@ _cpp_lex_line (pfile, list) case '!': PUSH_TOKEN (CPP_NOT); break; case ',': PUSH_TOKEN (CPP_COMMA); break; case ';': PUSH_TOKEN (CPP_SEMICOLON); break; + case ')': PUSH_TOKEN (CPP_CLOSE_PAREN); break; case '$': if (CPP_OPTION (pfile, dollars_in_ident)) @@ -3169,43 +3253,23 @@ _cpp_lex_line (pfile, list) /* Needs buffer of 3 + len. */ unsigned int -spell_char (buffer, list, token) - unsigned char *buffer; - cpp_toklist *list; - cpp_token *token; -{ - unsigned char* orig_buff = buffer; - size_t len; - - if (token->type == CPP_WCHAR) - *buffer++ = 'L'; - *buffer++ = '\''; - - len = token->val.name.len; - memcpy (buffer, TOK_NAME (list, token), len); - buffer += len; - *buffer++ = '\''; - return buffer - orig_buff; -} - -/* Needs buffer of 3 + len. */ -unsigned int spell_string (buffer, list, token) unsigned char *buffer; cpp_toklist *list; cpp_token *token; { - unsigned char* orig_buff = buffer; + unsigned char c, *orig_buff = buffer; size_t len; - if (token->type == CPP_WSTRING) + if (token->type == CPP_WSTRING || token->type == CPP_WCHAR) *buffer++ = 'L'; - *buffer++ = '"'; + c = token->type == CPP_STRING || token->type == CPP_WSTRING ? '"': '\''; + *buffer++ = c; len = token->val.name.len; memcpy (buffer, TOK_NAME (list, token), len); buffer += len; - *buffer++ = '"'; + *buffer++ = c; return buffer - orig_buff; } @@ -3256,17 +3320,6 @@ spell_name (buffer, list, token) return len; } -/* Needs buffer of 1. */ -unsigned int -spell_other (buffer, list, token) - unsigned char *buffer; - cpp_toklist *list ATTRIBUTE_UNUSED; - cpp_token *token; -{ - *buffer++ = token->aux; - return 1; -} - void _cpp_lex_file (pfile) cpp_reader* pfile; @@ -3299,6 +3352,11 @@ _cpp_lex_file (pfile) } } +/* This could be useful to other routines. If you allocate this many + bytes, you have enough room to spell the token. */ +#define TOKEN_LEN(token) (4 + (token_spellings[token->type].type == \ + SPELL_HANDLER ? token->val.name.len: 0)) + static void _cpp_output_list (pfile, list) cpp_reader *pfile; @@ -3321,8 +3379,7 @@ _cpp_output_list (pfile, list) cpp_token *comment = &list->comments[comment_no]; do { - /* Longest wrapper is 4. */ - CPP_RESERVE (pfile, 4 + 2 + comment->val.name.len); + CPP_RESERVE (pfile, 2 + TOKEN_LEN (comment)); pfile->limit += spell_comment (pfile->limit, list, comment); comment_no++, comment++; if (comment_no == list->comments_used) @@ -3335,6 +3392,7 @@ _cpp_output_list (pfile, list) CPP_PUTC_Q (pfile, ' '); } + CPP_RESERVE (pfile, 2 + TOKEN_LEN (token)); switch (token_spellings[token->type].type) { case SPELL_TEXT: @@ -3342,9 +3400,8 @@ _cpp_output_list (pfile, list) const unsigned char *spelling; unsigned char c; - CPP_RESERVE (pfile, 4 + 2); /* Longest is 4. */ if (token->flags & DIGRAPH) - spelling = digraph_spellings [token->type - CPP_FIRST_DIGRAPH]; + spelling = digraph_spellings[token->type - CPP_FIRST_DIGRAPH]; else spelling = token_spellings[token->type].speller; @@ -3358,12 +3415,14 @@ _cpp_output_list (pfile, list) speller s; s = (speller) token_spellings[token->type].speller; - /* Longest wrapper is 4. */ - CPP_RESERVE (pfile, 4 + 2 + token->val.name.len); pfile->limit += s (pfile->limit, list, token); } break; + case SPELL_CHAR: + *pfile->limit++ = token->aux; + break; + case SPELL_EOL: CPP_PUTC_Q (pfile, '\n'); return; diff --git a/gcc/cpplib.h b/gcc/cpplib.h index aca02a9efce..8233804911d 100644 --- a/gcc/cpplib.h +++ b/gcc/cpplib.h @@ -61,10 +61,10 @@ typedef struct cpp_name cpp_name; T(CPP_AND, "&") /* bit ops */ \ T(CPP_OR, "|") \ T(CPP_XOR, "^") \ - T(CPP_COMPL, "~") \ T(CPP_RSHIFT, ">>") \ T(CPP_LSHIFT, "<<") \ \ + T(CPP_COMPL, "~") \ T(CPP_AND_AND, "&&") /* logical */ \ T(CPP_OR_OR, "||") \ T(CPP_QUERY, "?") \ @@ -85,7 +85,6 @@ typedef struct cpp_name cpp_name; T(CPP_AND_EQ, "&=") /* bit ops */ \ T(CPP_OR_EQ, "|=") \ T(CPP_XOR_EQ, "^=") \ - T(CPP_COMPL_EQ, "~=") \ T(CPP_RSHIFT_EQ, ">>=") \ T(CPP_LSHIFT_EQ, "<<=") \ /* Digraphs together, beginning with CPP_FIRST_DIGRAPH. */ \ @@ -108,14 +107,14 @@ typedef struct cpp_name cpp_name; T(CPP_DOT_STAR, ".*") \ T(CPP_MIN, "<?") /* extension */ \ T(CPP_MAX, ">?") \ - H(CPP_OTHER, spell_other) /* stray punctuation */ \ + C(CPP_OTHER, 0) /* stray punctuation */ \ \ H(CPP_NAME, spell_name) /* word */ \ N(CPP_INT, 0) /* 23 */ \ N(CPP_FLOAT, 0) /* 3.14159 */ \ H(CPP_NUMBER, spell_name) /* 34_be+ta */ \ - H(CPP_CHAR, spell_char) /* 'char' */ \ - H(CPP_WCHAR, spell_char) /* L'char' */ \ + H(CPP_CHAR, spell_string) /* 'char' */ \ + H(CPP_WCHAR, spell_string) /* L'char' */ \ H(CPP_STRING, spell_string) /* "string" */ \ H(CPP_WSTRING, spell_string) /* L"string" */ \ \ @@ -138,6 +137,7 @@ typedef struct cpp_name cpp_name; #define T(e, s) e, #define H(e, s) e, +#define C(e, s) e, #define N(e, s) e, #define E(e, s) e, enum cpp_ttype @@ -147,6 +147,7 @@ enum cpp_ttype }; #undef T #undef H +#undef C #undef N #undef E diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 79bffccce90..bf93491cfc0 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -104,7 +104,7 @@ typedef union dw_cfi_oprnd_struct { unsigned long dw_cfi_reg_num; long int dw_cfi_offset; - char *dw_cfi_addr; + const char *dw_cfi_addr; } dw_cfi_oprnd; @@ -125,9 +125,9 @@ dw_cfi_node; typedef struct dw_fde_struct { - char *dw_fde_begin; - char *dw_fde_current_label; - char *dw_fde_end; + const char *dw_fde_begin; + const char *dw_fde_current_label; + const char *dw_fde_end; dw_cfi_ref dw_fde_cfi; int nothrow; } @@ -221,18 +221,18 @@ static unsigned long size_of_uleb128 PARAMS ((unsigned long)); static unsigned long size_of_sleb128 PARAMS ((long)); static void output_uleb128 PARAMS ((unsigned long)); static void output_sleb128 PARAMS ((long)); -static void add_fde_cfi PARAMS ((char *, dw_cfi_ref)); +static void add_fde_cfi PARAMS ((const char *, dw_cfi_ref)); static void lookup_cfa_1 PARAMS ((dw_cfi_ref, unsigned long *, long *)); static void lookup_cfa PARAMS ((unsigned long *, long *)); -static void reg_save PARAMS ((char *, unsigned, unsigned, - long)); +static void reg_save PARAMS ((const char *, unsigned, + unsigned, long)); static void initial_return_save PARAMS ((rtx)); static void output_cfi PARAMS ((dw_cfi_ref, dw_fde_ref)); static void output_call_frame_info PARAMS ((int)); static unsigned int reg_number PARAMS ((rtx)); static void dwarf2out_stack_adjust PARAMS ((rtx)); -static void dwarf2out_frame_debug_expr PARAMS ((rtx, char *)); +static void dwarf2out_frame_debug_expr PARAMS ((rtx, const char *)); /* Definitions of defaults for assembler-dependent names of various pseudo-ops and section names. @@ -715,7 +715,7 @@ dwarf2out_cfi_label () static void add_fde_cfi (label, cfi) - register char *label; + register const char *label; register dw_cfi_ref cfi; { if (label) @@ -815,7 +815,7 @@ static long old_args_size; void dwarf2out_def_cfa (label, reg, offset) - register char *label; + register const char *label; register unsigned reg; register long offset; { @@ -867,7 +867,7 @@ dwarf2out_def_cfa (label, reg, offset) static void reg_save (label, reg, sreg, offset) - register char * label; + register const char *label; register unsigned reg; register unsigned sreg; register long offset; @@ -916,7 +916,7 @@ reg_save (label, reg, sreg, offset) void dwarf2out_window_save (label) - register char * label; + register const char *label; { register dw_cfi_ref cfi = new_cfi (); cfi->dw_cfi_opc = DW_CFA_GNU_window_save; @@ -928,7 +928,7 @@ dwarf2out_window_save (label) void dwarf2out_args_size (label, size) - char *label; + const char *label; long size; { register dw_cfi_ref cfi; @@ -948,7 +948,7 @@ dwarf2out_args_size (label, size) void dwarf2out_reg_save (label, reg, offset) - register char * label; + register const char *label; register unsigned reg; register long offset; { @@ -960,7 +960,7 @@ dwarf2out_reg_save (label, reg, offset) void dwarf2out_return_save (label, offset) - register char * label; + register const char *label; register long offset; { reg_save (label, DWARF_FRAME_RETURN_COLUMN, -1, offset); @@ -971,7 +971,7 @@ dwarf2out_return_save (label, offset) void dwarf2out_return_reg (label, sreg) - register char * label; + register const char *label; register unsigned sreg; { reg_save (label, DWARF_FRAME_RETURN_COLUMN, sreg, 0); @@ -1041,7 +1041,7 @@ dwarf2out_stack_adjust (insn) rtx insn; { long offset; - char *label; + const char *label; if (! asynchronous_exceptions && GET_CODE (insn) == CALL_INSN) { @@ -1146,7 +1146,7 @@ static long cfa_temp_value; static void dwarf2out_frame_debug_expr (expr, label) rtx expr; - char *label; + const char *label; { rtx src, dest; long offset; @@ -1353,7 +1353,7 @@ void dwarf2out_frame_debug (insn) rtx insn; { - char *label; + const char *label; rtx src; if (insn == NULL_RTX) @@ -2229,7 +2229,7 @@ static unsigned file_table_in_use; /* Local pointer to the name of the main input file. Initialized in dwarf2out_init. */ -static char *primary_filename; +static const char *primary_filename; /* A pointer to the base of a table of references to DIE's that describe declarations. The table is indexed by DECL_UID() which is a unique @@ -2406,10 +2406,10 @@ static void add_AT_addr PARAMS ((dw_die_ref, rtx)); static void add_AT_lbl_id PARAMS ((dw_die_ref, enum dwarf_attribute, - char *)); + const char *)); static void add_AT_lbl_offset PARAMS ((dw_die_ref, enum dwarf_attribute, - char *)); + const char *)); static dw_attr_ref get_AT PARAMS ((dw_die_ref, enum dwarf_attribute)); static const char *get_AT_low_pc PARAMS ((dw_die_ref)); @@ -2502,10 +2502,10 @@ static dw_die_ref scope_die_for PARAMS ((tree, dw_die_ref)); static void pop_decl_scope PARAMS ((void)); static void add_type_attribute PARAMS ((dw_die_ref, tree, int, int, dw_die_ref)); -static char *type_tag PARAMS ((tree)); +static const char *type_tag PARAMS ((tree)); static tree member_declared_type PARAMS ((tree)); #if 0 -static char *decl_start_label PARAMS ((tree)); +static const char *decl_start_label PARAMS ((tree)); #endif static void gen_array_type_die PARAMS ((tree, dw_die_ref)); static void gen_set_type_die PARAMS ((tree, dw_die_ref)); @@ -3767,7 +3767,7 @@ static inline void add_AT_lbl_id (die, attr_kind, lbl_id) register dw_die_ref die; register enum dwarf_attribute attr_kind; - register char *lbl_id; + register const char *lbl_id; { register dw_attr_ref attr = (dw_attr_ref) xmalloc (sizeof (dw_attr_node)); @@ -3784,7 +3784,7 @@ static inline void add_AT_lbl_offset (die, attr_kind, label) register dw_die_ref die; register enum dwarf_attribute attr_kind; - register char *label; + register const char *label; { register dw_attr_ref attr = (dw_attr_ref) xmalloc (sizeof (dw_attr_node)); @@ -7634,11 +7634,11 @@ add_type_attribute (object_die, type, decl_const, decl_volatile, context_die) a pointer to the (string) tag name for the given type, or zero if the type was declared without a tag. */ -static char * +static const char * type_tag (type) register tree type; { - register char *name = 0; + register const char *name = 0; if (TYPE_NAME (type) != 0) { @@ -7679,12 +7679,12 @@ member_declared_type (member) from the DECL_NAME name used in the source file. */ #if 0 -static char * +static const char * decl_start_label (decl) register tree decl; { rtx x; - char *fnname; + const char *fnname; x = DECL_RTL (decl); if (GET_CODE (x) != MEM) abort (); @@ -8674,7 +8674,7 @@ gen_compile_unit_die (filename) { register dw_die_ref die; char producer[250]; - char *wd = getpwd (); + const char *wd = getpwd (); int language; die = new_die (DW_TAG_compile_unit, NULL); @@ -9835,7 +9835,7 @@ dwarf2out_undef (lineno, buffer) void dwarf2out_init (asm_out_file, main_input_filename) register FILE *asm_out_file; - register char *main_input_filename; + register const char *main_input_filename; { /* Remember the name of the primary input file. */ primary_filename = main_input_filename; diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h index 4b975b61eda..7496f9dcdf2 100644 --- a/gcc/dwarf2out.h +++ b/gcc/dwarf2out.h @@ -18,8 +18,7 @@ along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -extern void dwarf2out_init PARAMS ((FILE *asm_out_file, - char *main_input_filename)); +extern void dwarf2out_init PARAMS ((FILE *, const char *)); extern void dwarf2out_finish PARAMS ((void)); extern void dwarf2out_define PARAMS ((unsigned, const char *)); diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c index fafbcaa926f..a8b2a4ae5c1 100644 --- a/gcc/dwarfout.c +++ b/gcc/dwarfout.c @@ -161,7 +161,7 @@ extern int flag_traditional; struct filename_entry { unsigned number; - char * name; + const char * name; }; typedef struct filename_entry filename_entry; @@ -189,11 +189,11 @@ static unsigned ft_entries; /* Local pointer to the name of the main input file. Initialized in dwarfout_init. */ -static char *primary_filename; +static const char *primary_filename; /* Pointer to the most recent filename for which we produced some line info. */ -static char *last_filename; +static const char *last_filename; /* Counter to generate unique names for DIEs. */ @@ -379,7 +379,7 @@ static inline void src_coords_attribute PARAMS ((unsigned, unsigned)); static inline void pure_or_virtual_attribute PARAMS ((tree)); static void name_and_src_coords_attributes PARAMS ((tree)); static void type_attribute PARAMS ((tree, int, int)); -static char *type_tag PARAMS ((tree)); +static const char *type_tag PARAMS ((tree)); static inline void dienum_push PARAMS ((void)); static inline void dienum_pop PARAMS ((void)); static inline tree member_declared_type PARAMS ((tree)); @@ -3136,11 +3136,11 @@ type_attribute (type, decl_const, decl_volatile) a pointer to the (string) tag name for the given type, or zero if the type was declared without a tag. */ -static char * +static const char * type_tag (type) register tree type; { - register char *name = 0; + register const char *name = 0; if (TYPE_NAME (type) != 0) { @@ -3689,7 +3689,7 @@ static void output_compile_unit_die (arg) register void *arg; { - register char *main_input_filename = arg; + register const char *main_input_filename = arg; ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_compile_unit); sibling_attribute (); @@ -3722,7 +3722,7 @@ output_compile_unit_die (arg) last_filename = xstrdup (main_input_filename); { - char *wd = getpwd (); + const char *wd = getpwd (); if (wd) comp_dir_attribute (wd); } @@ -5783,7 +5783,7 @@ dwarfout_init (asm_out_file, main_input_filename) ASM_OUTPUT_PUSH_SECTION (asm_out_file, SFNAMES_SECTION); ASM_OUTPUT_LABEL (asm_out_file, SFNAMES_BEGIN_LABEL); { - register char *pwd = getpwd (); + register const char *pwd = getpwd (); register char *dirname; if (!pwd) diff --git a/gcc/extend.texi b/gcc/extend.texi index 6d310ae0ca5..c3e26484a80 100644 --- a/gcc/extend.texi +++ b/gcc/extend.texi @@ -1382,7 +1382,7 @@ volatile voidfn fatal; @cindex @code{pure} function attribute @item pure Many functions have no effects except the return value and their -return value and depends only on the parameters and/or global variables. +return value depends only on the parameters and/or global variables. Such a function can be subject to common subexpression elimination and loop optimization just as an arithmetic operator would be. These functions should be declared diff --git a/gcc/f/version.c b/gcc/f/version.c index 224802593bd..3a3e079ebe4 100644 --- a/gcc/f/version.c +++ b/gcc/f/version.c @@ -1 +1 @@ -const char *ffe_version_string = "0.5.25 20000425 (experimental)"; +const char *ffe_version_string = "0.5.25 20000426 (experimental)"; diff --git a/gcc/flow.c b/gcc/flow.c index 386dcf03000..0a14a2cb59d 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -1769,9 +1769,8 @@ delete_unreachable_blocks () } } - /* Delete all unreachable basic blocks. Count down so that we - don't interfere with the block renumbering that happens in - flow_delete_block. */ + /* Delete all unreachable basic blocks. Count down so that we don't + interfere with the block renumbering that happens in flow_delete_block. */ deleted_handler = 0; @@ -2499,8 +2498,8 @@ tidy_fallthru_edges () } /* Perform data flow analysis. - F is the first insn of the function and NREGS the number of register numbers - in use. */ + F is the first insn of the function; FLAGS is a set of PROP_* flags + to be used in accumulating flow info. */ void life_analysis (f, file, flags) @@ -4018,13 +4017,14 @@ mark_set_regs (pbi, x, insn) rtx x, insn; { rtx cond = NULL_RTX; + enum rtx_code code; retry: - switch (GET_CODE (x)) + switch (code = GET_CODE (x)) { case SET: case CLOBBER: - mark_set_1 (pbi, GET_CODE (x), SET_DEST (x), cond, insn, pbi->flags); + mark_set_1 (pbi, code, SET_DEST (x), cond, insn, pbi->flags); return; case COND_EXEC: @@ -4038,7 +4038,7 @@ mark_set_regs (pbi, x, insn) for (i = XVECLEN (x, 0) - 1; i >= 0; i--) { rtx sub = XVECEXP (x, 0, i); - switch (GET_CODE (sub)) + switch (code = GET_CODE (sub)) { case COND_EXEC: if (cond != NULL_RTX) @@ -4052,8 +4052,7 @@ mark_set_regs (pbi, x, insn) case SET: case CLOBBER: - mark_set_1 (pbi, GET_CODE (sub), SET_DEST (sub), cond, - insn, pbi->flags); + mark_set_1 (pbi, code, SET_DEST (sub), cond, insn, pbi->flags); break; default: @@ -4077,8 +4076,8 @@ mark_set_1 (pbi, code, reg, cond, insn, flags) rtx reg, cond, insn; int flags; { - register int regno_first, regno_last; - int not_dead; + int regno_first = -1, regno_last = -1; + int not_dead = 0; int i; /* Some targets place small structures in registers for @@ -4096,8 +4095,6 @@ mark_set_1 (pbi, code, reg, cond, insn, flags) byte field of a register does not mean the value from before this insn is now dead. Of course, if it was dead after it's unused now. */ - not_dead = 0; - regno_last = regno_first = -1; switch (GET_CODE (reg)) { case ZERO_EXTRACT: @@ -4231,9 +4228,8 @@ mark_set_1 (pbi, code, reg, cond, insn, flags) #endif ) { - int some_was_live, some_was_dead; + int some_was_live = 0, some_was_dead = 0; - some_was_live = some_was_dead = 0; for (i = regno_first; i <= regno_last; ++i) { int needed_regno = REGNO_REG_SET_P (pbi->reg_live, i); @@ -4275,18 +4271,19 @@ mark_set_1 (pbi, code, reg, cond, insn, flags) y = pbi->reg_next_use[regno_first]; /* The next use is no longer next, since a store intervenes. */ - for (i = regno_first; i <= regno_last; i++) + for (i = regno_first; i <= regno_last; ++i) pbi->reg_next_use[i] = 0; } if (flags & PROP_REG_INFO) { - for (i = regno_first; i <= regno_last; i++) + for (i = regno_first; i <= regno_last; ++i) { /* Count (weighted) references, stores, etc. This counts a register twice if it is modified, but that is correct. */ - REG_N_SETS (i) += 1; - REG_N_REFS (i) += pbi->bb->loop_depth + 1; + REG_N_SETS (i) += 1; + REG_N_REFS (i) += (optimize_size ? 1 + : pbi->bb->loop_depth + 1); /* The insns where a reg is live are normally counted elsewhere, but we want the count to include the insn @@ -4304,9 +4301,9 @@ mark_set_1 (pbi, code, reg, cond, insn, flags) else { /* Keep track of which basic blocks each reg appears in. */ - if (REG_BASIC_BLOCK (regno_first) == REG_BLOCK_UNKNOWN) + if (REG_BASIC_BLOCK (regno_first) == REG_BLOCK_UNKNOWN) REG_BASIC_BLOCK (regno_first) = blocknum; - else if (REG_BASIC_BLOCK (regno_first) != blocknum) + else if (REG_BASIC_BLOCK (regno_first) != blocknum) REG_BASIC_BLOCK (regno_first) = REG_BLOCK_GLOBAL; } } @@ -4335,7 +4332,7 @@ mark_set_1 (pbi, code, reg, cond, insn, flags) else if (! some_was_live) { if (flags & PROP_REG_INFO) - REG_N_DEATHS (regno_first)++; + REG_N_DEATHS (regno_first) += 1; if (flags & PROP_DEATH_NOTES) { @@ -4383,8 +4380,7 @@ mark_set_1 (pbi, code, reg, cond, insn, flags) else if (GET_CODE (reg) == REG) { if (flags & (PROP_LOG_LINKS | PROP_AUTOINC)) - for (i = regno_first; i <= regno_last; ++i) - pbi->reg_next_use[i] = 0; + pbi->reg_next_use[regno_first] = 0; } /* If this is the last pass and this is a SCRATCH, show it will be dying diff --git a/gcc/integrate.c b/gcc/integrate.c index 622acf49deb..ffecfa44bd8 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -2737,12 +2737,12 @@ output_inline_function (fndecl) set_new_last_label_num (f->inl_max_label_num); - /* Compile this function all the way down to assembly code. */ - rest_of_compilation (fndecl); - /* We're not deferring this any longer. */ DECL_DEFER_OUTPUT (fndecl) = 0; + /* Compile this function all the way down to assembly code. */ + rest_of_compilation (fndecl); + /* We can't inline this anymore. */ f->inlinable = 0; DECL_INLINE (fndecl) = 0; diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index dac48d9151b..8693331446e 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2000-04-26 Tom Tromey <tromey@cygnus.com> + + * zextract.c (find_zip_file_start): New function. + (read_zip_archive): Use it. + Mon Apr 24 14:59:36 2000 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (end_class_declaration): Reset the interface number diff --git a/gcc/java/zextract.c b/gcc/java/zextract.c index 359249b6818..b7ced1562a1 100644 --- a/gcc/java/zextract.c +++ b/gcc/java/zextract.c @@ -212,6 +212,7 @@ typedef unsigned long ulg; /* predefined on some systems) & match zip */ static ush makeword PARAMS ((const uch *)); static ulg makelong PARAMS ((const uch *)); +static long find_zip_file_start PARAMS ((int fd, long offset)); /***********************/ /* Function makeword() */ @@ -245,6 +246,32 @@ static ulg makelong(sig) + ((ulg)sig[0]); } +/* Examine file's header in zip file and return the offset of the + start of the actual data. Return -1 on error. OFFSET is the + offset from the beginning of the zip file of the file's header. */ +static long +find_zip_file_start (fd, offset) + int fd; + long offset; +{ + int filename_length, extra_field_length; + unsigned char buffer[LREC_SIZE + 4]; + + if (lseek (fd, offset, SEEK_SET) < 0) + return -1; + + if (read (fd, buffer, LREC_SIZE + 4) != LREC_SIZE + 4) + return -1; + + if (buffer[0] != 'P' || strncmp (&buffer[1], LOCAL_HDR_SIG, 3)) + return -1; + + filename_length = makeword (&buffer[4 + L_FILENAME_LENGTH]); + extra_field_length = makeword (&buffer[4 + L_EXTRA_FIELD_LENGTH]); + + return offset + (4 + LREC_SIZE) + filename_length + extra_field_length; +} + int read_zip_archive (zipf) register ZipFile *zipf; @@ -294,7 +321,6 @@ read_zip_archive (zipf) long uncompressed_size = makelong (&dir_ptr[4+C_UNCOMPRESSED_SIZE]); long filename_length = makeword (&dir_ptr[4+C_FILENAME_LENGTH]); long extra_field_length = makeword (&dir_ptr[4+C_EXTRA_FIELD_LENGTH]); - long file_comment_length = makeword (&dir_ptr[4+C_FILE_COMMENT_LENGTH]); int unpadded_direntry_length; if ((dir_ptr-zipf->central_directory)+filename_length+CREC_SIZE+4>zipf->dir_size) return -1; @@ -306,12 +332,8 @@ read_zip_archive (zipf) #else #define DIR_ALIGN sizeof(long) #endif - zipd->filestart = makelong (&dir_ptr[4+C_RELATIVE_OFFSET_LOCAL_HEADER]) - + (LREC_SIZE+4) + filename_length + file_comment_length + - + (extra_field_length ? extra_field_length+4 : 0); - /* About the last term of the expression above. Should the same - apply if file_comment_length is not zero ? I've never seen - the comment field uses so far. FIXME. */ + zipd->filestart = find_zip_file_start (zipf->fd, + makelong (&dir_ptr[4+C_RELATIVE_OFFSET_LOCAL_HEADER])); zipd->filename_offset = CREC_SIZE+4 - dir_last_pad; unpadded_direntry_length = zipd->filename_offset + zipd->filename_length + extra_field_length; diff --git a/gcc/jump.c b/gcc/jump.c index 70e0dc9cc5e..7d7c5fbd519 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -297,7 +297,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, for (insn = f; insn; insn = next) { rtx reallabelprev; - rtx temp, temp1, temp2 = NULL_RTX, temp3, temp4, temp5; + rtx temp, temp1, temp2 = NULL_RTX; rtx nlabel; int this_is_simplejump, this_is_condjump; int this_is_condjump_in_parallel; diff --git a/gcc/optabs.c b/gcc/optabs.c index 304eb7400d2..2004f6afd0f 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -2789,7 +2789,8 @@ emit_libcall_block (insns, target, result, equiv) if (set != 0 && GET_CODE (SET_DEST (set)) == REG && REGNO (SET_DEST (set)) >= FIRST_PSEUDO_REGISTER && (insn == insns - || (! reg_mentioned_p (SET_DEST (set), PATTERN (insns)) + || ((! INSN_P(insns) + || ! reg_mentioned_p (SET_DEST (set), PATTERN (insns))) && ! reg_used_between_p (SET_DEST (set), insns, insn) && ! modified_in_p (SET_SRC (set), insns) && ! modified_between_p (SET_SRC (set), insns, insn)))) diff --git a/gcc/ssa.c b/gcc/ssa.c index 9fb31a8c7da..979f111868c 100644 --- a/gcc/ssa.c +++ b/gcc/ssa.c @@ -856,8 +856,7 @@ convert_to_ssa() abort (); /* Need global_live_at_{start,end} up to date. */ - life_analysis (get_insns (), NULL, - PROP_KILL_DEAD_CODE | PROP_SCAN_DEAD_CODE); + life_analysis (get_insns (), NULL, PROP_KILL_DEAD_CODE | PROP_SCAN_DEAD_CODE); /* Compute dominators. */ dominators = sbitmap_vector_alloc (n_basic_blocks, n_basic_blocks); @@ -1813,8 +1812,7 @@ convert_from_ssa() rtx insns = get_insns (); /* Need global_live_at_{start,end} up to date. */ - life_analysis (get_insns (), NULL, - PROP_KILL_DEAD_CODE | PROP_SCAN_DEAD_CODE); + life_analysis (insns, NULL, PROP_KILL_DEAD_CODE | PROP_SCAN_DEAD_CODE); /* Figure out which regs in copies and phi nodes don't conflict and therefore can be coalesced. */ diff --git a/gcc/testsuite/gcc.c-torture/ChangeLog b/gcc/testsuite/gcc.c-torture/ChangeLog index 365bc6ad91e..23df8a79119 100644 --- a/gcc/testsuite/gcc.c-torture/ChangeLog +++ b/gcc/testsuite/gcc.c-torture/ChangeLog @@ -1,3 +1,7 @@ +2000-04-26 Geoff Keating <geoffk@cygnus.com> + + * execute/loop-5.c: New test. + 2000-04-25 Jakub Jelinek <jakub@redhat.com> * execute/va-arg-20.c: New test. diff --git a/gcc/toplev.c b/gcc/toplev.c index 04caf9f9587..031f4a65e66 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1098,7 +1098,7 @@ lang_independent_options f_options[] = {"bounded-pointers", &flag_bounded_pointers, 1, "Compile pointers as triples: value, base & end" }, {"bounds-check", &flag_bounds_check, 1, - "Generate code to check bounds before dereferencing pointers and arrays" }, + "Generate code to check bounds before dereferencing pointers and arrays" } }; #define NUM_ELEM(a) (sizeof (a) / sizeof ((a)[0])) diff --git a/gcc/tree.h b/gcc/tree.h index 165a87f5ede..0fe6ab71e36 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -2303,28 +2303,28 @@ extern char *dwarf2out_cfi_label PARAMS ((void)); /* Entry point to update the canonical frame address (CFA). */ -extern void dwarf2out_def_cfa PARAMS ((char *, unsigned, long)); +extern void dwarf2out_def_cfa PARAMS ((const char *, unsigned, long)); /* Add the CFI for saving a register window. */ -extern void dwarf2out_window_save PARAMS ((char *)); +extern void dwarf2out_window_save PARAMS ((const char *)); /* Add a CFI to update the running total of the size of arguments pushed onto the stack. */ -extern void dwarf2out_args_size PARAMS ((char *, long)); +extern void dwarf2out_args_size PARAMS ((const char *, long)); /* Entry point for saving a register to the stack. */ -extern void dwarf2out_reg_save PARAMS ((char *, unsigned, long)); +extern void dwarf2out_reg_save PARAMS ((const char *, unsigned, long)); /* Entry point for saving the return address in the stack. */ -extern void dwarf2out_return_save PARAMS ((char *, long)); +extern void dwarf2out_return_save PARAMS ((const char *, long)); /* Entry point for saving the return address in a register. */ -extern void dwarf2out_return_reg PARAMS ((char *, unsigned)); +extern void dwarf2out_return_reg PARAMS ((const char *, unsigned)); /* Output a marker (i.e. a label) for the beginning of a function, before the prologue. */ @@ -2637,28 +2637,28 @@ extern char *dwarf2out_cfi_label PARAMS ((void)); /* Entry point to update the canonical frame address (CFA). */ -extern void dwarf2out_def_cfa PARAMS ((char *, unsigned, long)); +extern void dwarf2out_def_cfa PARAMS ((const char *, unsigned, long)); /* Add the CFI for saving a register window. */ -extern void dwarf2out_window_save PARAMS ((char *)); +extern void dwarf2out_window_save PARAMS ((const char *)); /* Add a CFI to update the running total of the size of arguments pushed onto the stack. */ -extern void dwarf2out_args_size PARAMS ((char *, long)); +extern void dwarf2out_args_size PARAMS ((const char *, long)); /* Entry point for saving a register to the stack. */ -extern void dwarf2out_reg_save PARAMS ((char *, unsigned, long)); +extern void dwarf2out_reg_save PARAMS ((const char *, unsigned, long)); /* Entry point for saving the return address in the stack. */ -extern void dwarf2out_return_save PARAMS ((char *, long)); +extern void dwarf2out_return_save PARAMS ((const char *, long)); /* Entry point for saving the return address in a register. */ -extern void dwarf2out_return_reg PARAMS ((char *, unsigned)); +extern void dwarf2out_return_reg PARAMS ((const char *, unsigned)); /* Output a marker (i.e. a label) for the beginning of a function, before the prologue. */ diff --git a/gcc/version.c b/gcc/version.c index d1f11747d13..3f98f7a1746 100644 --- a/gcc/version.c +++ b/gcc/version.c @@ -1,4 +1,4 @@ #include "gansidecl.h" #include "version.h" -const char *const version_string = "2.96 20000425 (experimental)"; +const char *const version_string = "2.96 20000426 (experimental)"; diff --git a/libf2c/libF77/Version.c b/libf2c/libF77/Version.c index e4b410398e5..1cc45c70c16 100644 --- a/libf2c/libF77/Version.c +++ b/libf2c/libF77/Version.c @@ -3,7 +3,7 @@ static char junk[] = "\n@(#)LIBF77 VERSION 19991115\n"; /* */ -char __G77_LIBF77_VERSION__[] = "0.5.25 20000425 (prerelease)"; +char __G77_LIBF77_VERSION__[] = "0.5.25 20000426 (prerelease)"; /* 2.00 11 June 1980. File version.c added to library. diff --git a/libf2c/libI77/Version.c b/libf2c/libI77/Version.c index aaeeba5478d..d9086d2b9c5 100644 --- a/libf2c/libI77/Version.c +++ b/libf2c/libI77/Version.c @@ -3,7 +3,7 @@ static char junk[] = "\n@(#) LIBI77 VERSION pjw,dmg-mods 19991115\n"; /* */ -char __G77_LIBI77_VERSION__[] = "0.5.25 20000425 (prerelease)"; +char __G77_LIBI77_VERSION__[] = "0.5.25 20000426 (prerelease)"; /* 2.01 $ format added diff --git a/libf2c/libU77/Version.c b/libf2c/libU77/Version.c index 2dfe4000b16..7cb8357e836 100644 --- a/libf2c/libU77/Version.c +++ b/libf2c/libU77/Version.c @@ -1,6 +1,6 @@ static char junk[] = "\n@(#) LIBU77 VERSION 19980709\n"; -char __G77_LIBU77_VERSION__[] = "0.5.25 20000425 (prerelease)"; +char __G77_LIBU77_VERSION__[] = "0.5.25 20000426 (prerelease)"; #include <stdio.h> |