Commit Graph

127 Commits

Author SHA1 Message Date
J"orn Rennecke
36e9ee91ef * unroll.c (copy_loop_body): Don't copy VTOP notes from copy_notes_from.
From-SVN: r26786
1999-05-05 16:47:48 +01:00
Jeffrey A Law
47cf37f924 h8300.c (h8300_adjust_insn_length): Avoid trying to recognize USE, CLOBBER or SEQUENCE insns.
* h8300.c (h8300_adjust_insn_length): Avoid trying to recognize
       USE, CLOBBER or SEQUENCE insns.
       * unroll.c (unroll_loop): For HAVE_cc0 machines, adjust copy_end_luid
       to account for the uncopied insn that sets cc0 at the end of the loop.

From-SVN: r26283
1999-04-07 17:07:06 -06:00
Jeffrey A Law
94d5c4563f unroll.c (copy_loop_body): Always ensure at least two insns are in the copied loop.
* unroll.c (copy_loop_body): Always ensure at least two insns
        are in the copied loop.

From-SVN: r26261
1999-04-07 07:22:29 -06:00
J"orn Rennecke
d24de7d183 unroll.c (loop_iterations): Don't return a final value for EQ comparison loops.
* unroll.c (loop_iterations): Don't return a final value for EQ
	comparison loops.

From-SVN: r25729
1999-03-12 12:46:36 +00:00
Jim Wilson
66830675f2 Fix cygwin toolchain build failure reported by Geoffrey Noer.
* unroll.c (loop_iterations): Only call loop_find_equiv_value if we
	have a REG or SUBREG.

From-SVN: r25643
1999-03-08 08:09:05 -08:00
J"orn Rennecke
c956720a54 unroll.c (copy_loop_body): Don't make extra copies of NOTE_INSN_LOOP_CONT notes.
* unroll.c (copy_loop_body): Don't make extra copies of
	NOTE_INSN_LOOP_CONT notes.

From-SVN: r25535
1999-03-02 08:48:09 +00:00
Richard Henderson
e881bb1b1b Flow rewrite to use basic block structures and edge lists.
From-SVN: r25450
1999-02-25 15:45:42 -08:00
J"orn Rennecke
c99f8c2a3e loop.h (loop_insn_first_p): Declare.
* loop.h (loop_insn_first_p): Declare.
	* loop.c (loop_insn_first_p): No longer static.
	* unroll.c (iteration_info) Fix comparison to
	reg_iv_type->num_elements.
	Before accessing reg_biv_class, check index against
	max_reg_before_loop.
	Fix and enable code for giv iterators.
	(loop_iterations): Compare with reg_iv_type->num_elements instead
	of with max_reg_before_loop.

From-SVN: r25401
1999-02-24 11:50:54 +00:00
J"orn Rennecke
69688f1ed7 * unroll.c (unroll_loop): Avoid out-of-bounds index for local_regno.
From-SVN: r25399
1999-02-24 11:18:59 +00:00
Jim Wilson
8318490b1e unroll.c (find_splittable_givs): After express_from, call replace_rtx to convert dest_reg to new_reg.
* unroll.c (find_splittable_givs): After express_from, call replace_rtx
        to convert dest_reg to new_reg.

From-SVN: r25056
1999-02-06 03:08:51 -07:00
J"orn Rennecke
a5af23fe12 unroll.c (entire file): Remove tabs / spaces at end of lines.
* unroll.c (entire file): Remove tabs / spaces at end of lines.
	Replace spaces with tabs where appropriate.

From-SVN: r25033
1999-02-04 22:55:55 +00:00
J"orn Rennecke
4d87f7a77c loop.h (express_from): Declare.
* loop.h (express_from): Declare.
	(struct induction): Replace derived flag with derived_from pointer.
	* loop.c (strength_reduce, record_giv, recombine_givs): Likewise.
	(express_from): No longer static.
	* unroll.c (find_splittable_givs): Replace derived with derived_from.
	When processing an address giv with which another giv has been
	combined that has also been derived from a third giv, handle like
	having combined with the third giv.
	Set splittable_regs_updates appropriately for derived givs.

From-SVN: r25007
1999-02-03 12:48:48 +00:00
Ken Raeburn
c68da89c45 Use varrays for constant-equivalence data:
* varray.h (struct const_equiv_data): New type.
(union varray_data_tag): New element const_equiv.
(VARRAY_CONST_EQUIV_INIT, VARRAY_CONST_EQUIV): New macros.
(VARRAY_SIZE): New macro, returns number of elements.
* integrate.h: Include varray.h.
(struct inline_remap): Replace const_equiv_map, const_age_map and
const_equiv_map_size with a const_equiv_varray element.
(MAYBE_EXTEND_CONST_EQUIV_VARRAY): New macro; grows varray if needed.
(SET_CONST_EQUIV_DATA): New macro; sets rtx and age fields simultaneously,
growing the varray if needed.
* integrate.c (global_const_equiv_map, global_const_equiv_map_size): Deleted,
replaced by....
(global_const_equiv_varray): New variable.
(expand_inline_function): References changed.
* integrate.h: Update declarations.
* integrate.c (process_reg_parm, expand_inline_function,
copy_rtx_and_substitute, try_constants, subst_constants, mark_stores): Use
varray allocation and accessor macros, new integrate.h macros, and
global_const_equiv_varray.  Don't conditionalize non-NULL stores on array size;
instead, expand the array as needed.
* unroll.c (unroll_loop): Likewise.
* unroll.c (unroll_loop): Initialize const_equiv_varray element to zero.  After
allocating varray, always exit through bottom of function, where it can be
deallocated if needed.  Don't explicitly reallocate const_equiv_map storage;
instead, just ensure the varray has been initialized, and update the global
reference.

From-SVN: r24956
1999-02-01 12:50:53 +00:00
J"orn Rennecke
3ec2b59097 rtl.h (insn_first_p): Declare.
* rtl.h (insn_first_p): Declare.
	* rtlanal.c (insn_first_p): New function.
	* loop.h (varray.h): Include.
	(struct induction): Change combined_with to unsigned.
	New members derived, ix and last_use.
	(reg_iv_type, reg_iv_info): Now varray_type.  All references changed.
	(REG_IV_TYPE, REG_IV_INFO): Define.
	(first_increment_giv, last_increment_giv): Declare.
	* loop.c (loop_number_loop_cont): New static variable.
	(loop_number_cont_dominator): Likewise.
	(reg_iv_type, reg_iv_info): Now varray_type.
	(first_increment_giv, last_increment_giv): New variables.
	(compute_luids, verify_dominator, find_life_end): New functions.
	(cmp_recombine_givs_stats, recombine_givs): Likewise.
	(loop_optimize): Allocate loop_number_loop_cont and
	loop_number_cont_dominator.  Use compute_luids.
	(find_and_verify_loops): Initialize loop_number_loop_cont and
	loop_number_cont_dominator.
	(strength_reduce): Try to find bivs that can be expressed as givs
	of another biv, and to convert biv increments into givs.
	Call recombine_givs.  Handle derived givs.
	(record_biv): New argument location.  All callers changed.
	(record_giv): Initialize derived and last_use fields.
	(basic_induction_var): New argument location.  All callers changed.
	(combine_givs): Don't combine a DEST_REG giv with a DEST_ADDR giv.
	Increment combined_with instead of setting to 1.
	* unroll.c (derived_regs): New static variable.
	(unroll_loop): Initialize it.
	Allocate local_regno according to max_reg_num.
	(copy_loop_body): Cope with derived givs.
	(find_splittable_givs): Check for Givs made from biv increments.
	Set derived_regs for givs.
	* Makefile.in (stmt.o, loop.o, unroll.o): Depend on loop.h .

From-SVN: r24889
1999-01-27 15:45:50 +00:00
Michael Hayes
98dcbc07f5 unroll.c (loop_iterations): Return 0 if the last loop insn is not a jump insn or if...
8
	* unroll.c (loop_iterations): Return 0 if the last loop insn
	is not a jump insn or if the loop has multiple back edges.

From-SVN: r24680
1999-01-15 03:05:56 -07:00
Jeffrey A Law
f387b2e4ff unroll.c (find_splittable_givs): For a DEST_ADDR giv...
* unroll.c (find_splittable_givs): For a DEST_ADDR giv, do not share
        a register with another DEST_ADDR giv if the address is not valid.

From-SVN: r24673
1999-01-14 18:53:08 -07:00
Jeff Law
ad83f53748 Fix copyrights.
From-SVN: r24529
1999-01-06 12:48:38 -07:00
Michael Hayes
362cc3d434 optabs.c (emit_cmp_insn): Abort if asked to emit non-canonical RTL for a target with HAVE_cc0 defined.
* optabs.c (emit_cmp_insn): Abort if asked to emit non-canonical RTL
        for a target with HAVE_cc0 defined.
        (emit_cmp_and_jump_insns): New function.
        * expr.h (emit_cmp_and_jump_insns): Prototype it.
        * loop.c (check_dbra_loop): Use it to replace calls
        to emit_cmp_insn and emit_jump_insn and to canonicalise
        the comparison if necessary.
        * unroll.c (unroll_loop): Likewise.

From-SVN: r24471
1999-01-03 13:43:14 -07:00
Michael Hayes
35704c4661 loop.h (loop_info): New field 'vtop'.
* loop.h (loop_info): New field 'vtop'.
	* loop.c (check_dbra_loop):  Use loop_info->vtop rather than
	scanning loop for vtop.
	* unroll.c (subtract_reg_term, find_common_reg_term): New functions.
	(loop_iterations): Use them to determine if loop has a constant
 	number of iterations.  Set loop_info->vtop.  Don't subtract
	common reg term from initial_value and final_value if have a
	do-while loop.

From-SVN: r24333
1998-12-15 20:31:18 +00:00
J"orn Rennecke
5353610bac loop.c (strength_reduce): If scan_start points to the loop exit test...
* loop.c (strength_reduce): If scan_start points to the loop exit
	test, be wary of subversive use of gotos inside expression statements.
	Don't set maybe_multiple for a backward jump that does not
	include the label under consideration into its range.
	* unroll.c (biv_total_increment): Make use of maybe_multiple field.

From-SVN: r24196
1998-12-08 14:50:03 +00:00
H.J. Lu
5edc923076 print-rtl.c (print_rtx): Add prototype.
* print-rtl.c (print_rtx): Add prototype.
        * unroll.c (iteration_info): Make it static.

From-SVN: r24116
1998-12-05 16:23:52 -07:00
Michael Hayes
e96b4d7a44 loop.h (precondition_loop_p): Added new mode argument.
* loop.h (precondition_loop_p): Added new mode argument.
	* unroll.c (precondition_loop_p): Likewise.
	(approx_final_value): Function deleted and subsumed
 	into loop_iterations.
	(loop_find_equiv_value): New function.
	(loop_iterations): Use loop_find_equiv_value to find increments
	too large to be immediate constants.  Also use it to find terms
	common to initial and final iteration values that can be removed.

From-SVN: r23885
1998-11-25 21:32:27 +00:00
Michael Hayes
302670f3f0 loop.h (struct loop_info): Define new structure.
* loop.h (struct loop_info): Define new structure.
	(precondition_loop_p): Added prototype.
	(unroll_loop): Added new argument loop_info to prototype.
	(final_biv_value, final_giv_value): Added new argument n_iterations
	to prototype.
	* loop.c (strength_reduce): Declare new structure loop_iteration_info
	and new pointer loop_info.
	(loop_n_iterations): Replace global variable by element in
	loop_info structure.
	(check_final_value): New argument n_iterations.
	(insert_bct): New argument loop_info.
	(loop_unroll_factor): Replace global array by element in
	loop_info structure.
	(loop_optimize): Remove code to allocate and initialise
	loop_unroll_factor_array.
	* unroll.c (precondition_loop_p):  No longer static since
	used by branch on count optimization.
	(precondition_loop_p, unroll_loop): New argument loop_info.
	(final_biv_value, final_giv_value, find_splittable_regs): New
	argument n_iterations.
	(loop_iteration_var, loop_initial_value, loop_increment,
	loop_final_value, loop_comparison_code, loop_unroll_factor):
	Replaced global variables by loop_info structure.
	(loop_unroll_factor): Replace global array by element in
	loop_info structure.

From-SVN: r23884
1998-11-25 21:19:21 +00:00
Michael Hayes
a70603680e loop.c (check_dbra_loop): Update JUMP_LABEL field of jump insn when loop reversed.
* loop.c (check_dbra_loop): Update JUMP_LABEL field of jump insn
	when loop reversed.
	* unroll.c (precondition_loop_p): Return loop_initial_value
	for initial_value instead of loop_iteration_var.

From-SVN: r23881
1998-11-25 20:51:09 +00:00
Kaveh R. Ghazi
e51712db0d Warning fixes:
* Makefile.in (sched.o): Depend on recog.h.
        * alias.c (REG_BASE_VALUE): Cast the result of REGNO() macro to
        (unsigned) when comparing against one.
        (find_base_value): Likewise.
        (record_base_value): Cast variable `regno' to (unsigned) when
        comparing against one.  Cast the result of REGNO() macro to
        (unsigned) when comparing against one.
        (memrefs_conflict_p): Change type of variables `r_x' and `r_y'  to
        unsigned.
        (init_alias_analysis): Add unsigned variable `ui'.  Use it as loop
        variable where an unsigned index is needed.
        * caller-save.c (init_caller_save): Cast `-1' to (enum insn_code)
        before comparing against one.
        * collect2.c: Add prototypes for functions `error', `fatal' and
        `fatal_perror'.  Make these functions take variable arguments
        instead of faking it with a fixed number of args.
        (write_c_file_stat): Cast the argument of ctype macro to (unsigned
        char).
        * combine.c (can_combine_p): Mark parameter `pred' with
        ATTRIBUTE_UNUSED.
        (find_split_point): Cast variable `src' to (unsigned
        HOST_WIDE_INT) when comparing against one.
        HOST_WIDE_INT) when comparing against one.
        (simplify_rtx): Cast 1 to (unsigned HOST_WIDE_INT) in shift.
        (simplify_logical): Likewise.
        (force_to_mode): Cast result of INTVAL() macro to (unsigned
        HOST_WIDE_INT) when comparing against one.  Cast 1 to (unsigned
        HOST_WIDE_INT) in shift.
        (simplify_and_const_int): Cast result of INTVAL() macro to
        `unsigned HOST_WIDE_INT' when comparing against one.
        (merge_outer_ops): Cast variable const0 to `unsigned
        HOST_WIDE_INT' when comparing against the result of
        GET_MODE_MASK() macro.
        (simplify_comparison): Likewise for variable `c0'.  Cast variable
        `const_op' to `unsigned HOST_WIDE_INT' when comparing against
        one.  Cast `1' to `unsigned HOST_WIDE_INT' in shift.  Cast the
        result of `GET_MODE_MASK()/2' to `HOST_WIDE_INT' when comparing
        against one.  Cast `1' to `unsigned HOST_WIDE_INT' in shift.  Cast
        result of INTVAL() macro to `unsigned HOST_WIDE_INT' when
        comparing against one.
        (distribute_notes): Wrap variable `cc0_setter' in macro `HAVE_cc0'.
        config/mips/mips.c (gen_int_relational): Cast result of INTVAL()
        macro to `unsigned HOST_WIDE_INT' when comparing against one.
        (output_block_move): Cast `sizeof' expression to (int) when
        comparing against one.
        (function_arg): Cast BITS_PER_WORD to `unsigned' when comparing
        against one.
        (save_restore_insns): Cast `base_offset' to `long' to match format
        specifier in fprintf.
        * config/mips/mips.h (Pmode): Cast the result of `Pmode' macro
        to `enum machine_mode'.
        * flow.c (life_analysis_1): Remove unused variable `insn'.
        * gcc.c (translate_options): Move variables `j' and `k' into the
        scope in which they are used.  Change their types to `size_t'.
        (set_spec): Cast the argument of ctype macro to `unsigned char'.
        (read_specs): Likewise.
        (process_command): Cast `sizeof' to (int) when comparing against one.
        (do_spec_1): Cast the argument of ctype macro to `unsigned char'.
        (handle_braces): Cast both sides of `==' expression to `long' to
        ensure sign matching.
        (main): Cast variable `i' to `int' when comparing against one.
        * gcov-io.h (__fetch_long): Change type of parameter `bytes' from
        int to size_t.  Cast variable `i' to size_t when comparing against
        one.
        * genattrtab.c (convert_set_attr_alternative): Remove unused
        parameter `insn_code'.  All callers changed.
        (convert_set_attr): Likewise.
        * genrecog.c (add_to_sequence): Cast result of XVECLEN() macro to
        size_t when comparing against one.  Likewise for variable `len'.
        * global.c (global_alloc): Cast variable `max_regno' to size_t
        when comparing against one.  Likewise for variable `max_allocno'.
        * jump.c (sets_cc0_p): Mark parameter `x' with ATTRIBUTE_UNUSED.
        * local-alloc.c (validate_equiv_mem_from_store): Mark parameter
        `set' with ATTRIBUTE_UNUSED.
        (find_free_reg): Cast `sizeof' expression to (int) when comparing
        against one.
        * loop.c (count_loop_regs_set): Remove unused variable `dest'.
        (strength_reduce): Mark parameter `bct_p' with ATTRIBUTE_UNUSED.
        (get_condition): Cast variable `const_val' to `unsigned
        HOST_WIDE_INT' when comparing against one.  Cast unsigned
        expression to HOST_WIDE_INT when comparing against one.
        (insert_loop_mem): Mark parameter `data' with ATTRIBUTE_UNUSED.
        (load_mems_and_recount_loop_regs_set): Cast variable `nregs' to
        `unsigned' when comparing against one.
        * protoize.c (is_id_char): Change type of parameter `ch' to
        unsigned char.
        (munge_compile_params): Cast argument of ctype macro to (const
        unsigned char).
        (process_aux_info_file): Cast variable `aux_info_size' to int when
        comparing against one.
        (forward_to_next_token_char): Cast argument of ctype macro to
        `const unsigned char'.
        (edit_formals_lists): Likewise.
        (find_rightmost_formals_list): Likewise.
        (add_local_decl): Likewise.
        (add_global_decls): Likewise.
        (edit_fn_definition): Likewise.
        (do_cleaning): Likewise.
        (scan_for_missed_items): Likewise.
        (edit_file): Cast variable `orig_size' to (int) when comparing
        against one.
        (main): Cast argument of ctype macro to `const unsigned char'.
        * recog.c (const_int_operand): Mark parameter `mode' with
        ATTRIBUTE_UNUSED.
        * regclass.c (record_reg_classes): Change type of variable `c' to
        `unsigned char'.  Cast `char' array index to `unsigned char'.
        * reload.c (push_secondary_reload): Cast argument to
        REG_CLASS_FROM_LETTER() macro to `unsigned char'.
        * reload1.c (calculate_needs): Cast `char' array index to
        `unsigned char'.
        (set_label_offsets): Change type of variable `i' to unsigned int.
        Cast result of XVECLEN() macro to unsigned when comparing against
        one.
        (mark_not_eliminable): Change type of variable `i' to unsigned.
        (order_regs_for_reload): Likewise.  Cast `max_regno' to unsigned
        when comparing against one.
        (reload_as_needed): Cast macro NUM_ELIMINABLE_REGS to (int) when
        comparing against one.
        (choose_reload_regs): Hide unused label `fail'.
        (reload_cse_simplify_operands): Cast `char' array index to
        `unsigned char'.
        (reload_combine_note_store): Mark parameter `set' with
        ATTRIBUTE_UNUSED.  Cast UNITS_PER_WORD to unsigned when comparing
        against one.
        (reload_cse_move2add): Remove unused variable `src2'.
        * sched.c: Include recog.h.
        (sched_note_set): Remove unused parameter `b'.  All callers
        changed.
        (split_hard_reg_notes): Likewise for parameter `orig_insn'.
        (blockage_range): Cast result of UNIT_BLOCKED() macro to (int)
        when comparing against one.
        * stupid.c (stupid_find_reg): Mark parameter `changes_size' with
        ATTRIBUTE_UNUSED.  Cast `sizeof' expression to (int) when
        comparing against one.
        * unroll.c (precondition_loop_p): Remove unused parameter
        `loop_end'.  All callers changed.

From-SVN: r23079
1998-10-14 09:02:55 +00:00
David Edelsohn
cac8ce95a1 unroll.c (loop_iteration_var, [...]): No longer static.
* unroll.c (loop_iteration_var, loop_initial_value, loop_increment
        loop_final_value, loop_comparison_code): No longer static.
        (unroll_loop): Delete loop_start_value update.
        * loop.h (loop_iteration_var, loop_initial_value, loop_increment,
        loop_final_value, loop_comparison_code): Extern.
        (loop_start_value): Delete extern.
        * loop.c (loop_can_insert_bct, loop_increment, loop_start_value,
        loop_comparison_value, loop_comparison_code): Delete.
        (loop_optimize): Remove initialization for deleted variables.
        (strength_reduce): Delete analyze_loop_iterations call.  Only call
        insert_bct if flag_branch_count_on_reg set.
        (analyze_loop_iterations): Delete.
        (insert_bct): Remove iteration count calculation.  Move checks for
        viable BCT optimization to here.  Obtain iteration count from
        loop_iterations and correct for unrolling.  Check for enough
        iteration to be beneficial.  Comment out runtime iteration count
        case.
        (insert_bct): Print iteration count in dump file.  Remove
        loop_var_mode and use word_mode directly.
        * rs6000.h (processor_type): Add PROCESSOR_PPC604e.
        * rs6000.c (rs6000_override_options): Use it.
        (optimization_options): Enable use of flag_branch_on_count_reg.
        * rs6000.md (define_function_unit): Describe 604e.

From-SVN: r22852
1998-10-05 18:03:25 -04:00
Jeff Law
15fec413e7 unroll.c (unroll_loop): Do not abort for an UNROLL_MODULO or UNROLL_COMPLETELY loop that starts with a...
P
        * unroll.c (unroll_loop): Do not abort for an UNROLL_MODULO
        or UNROLL_COMPLETELY loop that starts with a jump to its
        exit code.

From-SVN: r21476
1998-07-29 15:41:04 -06:00
Kaveh R. Ghazi
4f70758f37 Warning fixes:
* Makefile.in (fix-header): Don't needlessly depend on cpperror.o.
        * alias.c (CHECK_ALIAS_SETS_FOR_CONSISTENCY): Cast expansion to
        void since it is evaluated in a comma list.
        * mips.h (ASM_GENERATE_INTERNAL_LABEL): Always sprintf `NUM'
        argument as a long and cast `NUM' to long to ensure it is of the
        proper width.  Wrap macro arguments in parens when they appear in
        the expansion.
        * sol2.h (ASM_GENERATE_INTERNAL_LABEL): Likewise.
        * sparc.h (ASM_GENERATE_INTERNAL_LABEL): Likewise.
        (ASM_DECLARE_RESULT): Fix fprintf format specifier to match
        function argument return type.
        (REGNO_OK_FOR_INDEX_P, REGNO_OK_FOR_BASE_P, REGNO_OK_FOR_FP_P,
        REGNO_OK_FOR_CCFP_P): Use `(unsigned)' not `U'.
        * cpplib.c (cpp_message_from_errno): Remove unneeded argument to
        cpp_message.
        * dbxout.c: Fix the comments after an #endif to reflect the actual
        condition tested in the preceding #if.
        * except.c (find_all_handler_type_matches): Switch to old-style
        function definition.
        * expr.c (expand_builtin): Remove unused variable `type' twice.
        * gbl-ctors.h (DO_GLOBAL_CTORS_BODY): Cast -1 before comparing it
        to an unsigned long.
        * haifa-sched.c (print_insn_chain): Remove unused function.
        * objc/objc-act.c (build_msg_pool_reference): Hide prototype and
        definition.
        * toplev.c: When testing whether to include dbxout.h, also include
        it when XCOFF_DEBUGGING_INFO is defined.
        * unroll.c (unroll_loop): Add parentheses around assignment used
        as truth value.

From-SVN: r20801
1998-06-29 17:36:07 +00:00
Jim Wilson
aeb2f500b0 Fix irix6 -O3 -funroll-all-loops bootstrap failure reported by Kaveh Ghazi.
* gcse.c (add_label_notes): New function.
	(pre_insert_insn): Call it.
	* unroll.c (unroll_loop): Look for insns with a REG_LABEL note, and
	pass the label to set_label_in_map.

From-SVN: r20658
1998-06-22 05:02:52 -07:00
Kaveh R. Ghazi
e016950d0c Warning fixes:
* reload1.c (reload_cse_regs): Cast first arg of `bzero' to char *.
        * sdbout.c: Include output.h and toplev.h.
        (PUT_SDB_INT_VAL): Use HOST_WIDE_INT_PRINT_DEV to print argument
        `a'.  Cast `a' to HOST_WIDE_INT to force it to always be so.
        (PUT_SDB_SIZE): Likewise.
        * sdbout.h (sdbout_mark_begin_function): Add prototype.
        * stmt.c (check_for_full_enumeration_handling): Cast argument of
        `warning' to long and use %ld specifier.
        * toplev.c (main): Likewise for `fprintf'.
        * toplev.h (output_file_directive): Add prototype.
        * unroll.c (unroll_loop): Use HOST_WIDE_INT_PRINT_DEC specifier in
        call to `fprintf'.
        (precondition_loop_p): Likewise.
        * varasm.c Include sdbout.h.
        (assemble_static_space): Move sometimes-unused variable `rounded'
        into the scope in which it is used.

From-SVN: r20651
1998-06-22 05:32:38 +00:00
Graham Stott
2e107e9ea1 alias.c: Include toplev.h
* alias.c: Include toplev.h
        * caller-save.c: Include toplev.h
        * combine.c: Include toplev.h
        * flow.c Include toplev.h
        * global.c: Include toplev.h
        * jump.c: Include toplev.h
        * local-alloc.c: Include toplev.h
        * loop.c: Include toplev.h
        * regmove.c: Include toplev.h
        * stupid.c: Include toplev.h
        * unroll.c: Include toplev.h
        * Makefile.in: Add toplev.h dependencies.

From-SVN: r20623
1998-06-19 17:37:04 -06:00
Jim Wilson
7e7ca3a1bd Fix hpux loop unrolling bug reported by Tim Prince.
* loop.h (struct induction): Clarify comment for unrolled field.
	* unroll.c (find_splittable_givs): Move set of unrolled field
	after address validity check.

From-SVN: r20598
1998-06-19 11:54:44 -07:00
Richard Earnshaw
951930309f unroll.c (verify_addresses): Use validate_replace_rtx to undo the changes.
* unroll.c (verify_addresses): Use validate_replace_rtx to undo the
changes.  Abort if the undo fails.

From-SVN: r20404
1998-06-10 09:49:30 +00:00
Jeff Law
38e012594e typo typo fixes fixes
From-SVN: r19601
1998-05-06 15:09:07 -06:00
John Carr
de12be1743 alias.c (alias_invariant): New variable.
* alias.c (alias_invariant): New variable.
	(record_base_value): New argument INVARIANT.
	(memrefs_conflict_p): If a register has an entry in the alias_invariant
	array, try substituting that value for the register.
	* rtl.h: Declare record_base_value.
	* loop.c, unroll.c: Update callers of record_base_value.
	* alias.c (find_base_value, find_base_term): SIGN_EXTEND and
	ZERO_EXTEND do not affect base values.

From-SVN: r19408
1998-04-25 16:09:24 +00:00
Jeff Law
0e05e8ea12 varasm.c (asm_output_bss): Add prototype.
* varasm.c (asm_output_bss): Add prototype.
        (asm_output_aligned_bss): Likewise.
        * unroll.c (verify_addresses): Add prototype.
        * toplev.c: Add many prototypes.  Too many to mention here.
        * stmt.c (check_seenlabel): Add prototype.
        * rtlanal.c (reg_set_p_1): Add prototype.
        (reg_set_last_1): Likewise.
        * reorg.c (find_dead_or_set_registers): Add prototype.
        * regmove (try_auto_increment): Add prototype.
        * regstack.c (pop_stack): Add prototype.

From-SVN: r19254
1998-04-16 18:40:39 -06:00
Jeff Law
e5e809f419 * Check in merge from gcc2. See ChangeLog.11 and ChangeLog.12
for details.

        * haifa-sched.c: Mirror recent changes from gcc2.

From-SVN: r18984
1998-04-04 06:32:39 -07:00
Kaveh R. Ghazi
670ee92097 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 14:58:42 +00:00
Kaveh R. Ghazi
5172371191 Fix warious warnings:
* c-aux-info.c: Include string.h/strings.h.
	* pa.c: Include stdlib.h.
	(pa_combine_instructions): Prototype the function.
	(pa_can_combine_p, forward_branch_p, shadd_constant_p): Likewise.
	(reloc_needed): Add default case for enumeration switch.
	(remove_useless_addtr_insns): Remove unused variable `all'.
	(hppa_expand_prologue): Add explicit braces to avoid
	ambiguous `else'.
	(output_function_epilogue): Remove unused variable `i'.
	(output_millicode_call): Remove unused variable `link'.
	(shadd_constant_p, forward_branch_p): Make the function static.
	(following_call): Explicitly declare to return int.
	(pa_reorg): Declare as void.
	(pa_combine_instructions): Declare as static void.  Add
	parentheses around && within ||.
	* pa.h: Add prototypes for pa_reorg, symbolic_operand,
	following_call, function_label_operand, lhs_lshift_cint_operand
	and zdepi_cint_p.
	* pa.md: Add parentheses around && within ||.
	* cppalloc.c: Include stdlib.h.
	* cpperror.c (cpp_print_containing_files): Remove unused variable
	`i'.  Fix format specifier in fprintf.
	* cse.c (cse_around_loop): Add explicit braces to avoid
	ambiguous `else'.
	(delete_dead_from_cse): Wrap variable `tem' in macro HAVE_cc0.
	* expr.c (expand_expr): Add parentheses around && within ||.
	* final.c (app_enable): Replace fprintf with fputs where there are
	no format specifiers and no trailing argument after the string.
	Eg, when printing ASM_APP_ON/ASM_APP_OFF.
	(app_disable): Likewise.
	(final_end_function): Likewise.
	(final_scan_insn): Likewise.  Remove unused variable `set'.
	(profile_function): Wrap empty if-statement body in {} brackets.
	* function.c: Include stdlib.h.
	(pad_below): Wrap prototype and definition in ARGS_GROW_DOWNWARD.
	(reposition_prologue_and_epilogue_notes): Add parentheses
	around assignment used as truth value.
	* integrate.c (expand_inline_function): Wrap variable
	`cc0_insn' in macro HAVE_cc0.
	* jump.c (jump_optimize): Wrap variable `q' in macro
	HAVE_cc0.  Remove unused variable `prev1'.
	* libgcc2.c (__bb_exit_trace_func): Add parentheses around &&
	within ||.  Fix format specifier in fprintf.
	(__bb_init_prg): Add parentheses around assignment used as
	truth value.
	* local-alloc.c: Include stdlib.h.
	(requires_inout): Add parentheses around assignment used
	as truth value.
	* loop.c (analyze_loop_iterations): Wrap prototype and definition
	in macro HAVE_decrement_and_branch_on_count.
	(insert_bct, instrument_loop_bct): Likewise.
	(move_movables): Add parentheses around assignment used as
	truth value.
	(consec_sets_invariant_p): Likewise.
	(maybe_eliminate_biv_1): Wrap variable `new' in macro HAVE_cc0.
	* objc/objc-act.c: Include stdlib.h.
	(lookup_method_in_protocol_list): Wrap empty else-statement body
	in braces.
	(lookup_protocol_in_reflist): Likewise.
	(objc_add_static_instance): Remove unused variables `decl_expr'
	and `decl_spec'.
	(get_objc_string_decl): Remove unused variable `decl'.
	(generate_static_references): Remove unused variables `idecl' and
	`instance'.
	(check_protocols): Wrap empty else-statement body in braces.
	* protoize.c: Include stdlib.h.
	(substr): Add parentheses around assignment used as truth value.
	(abspath): Likewise.
	(shortpath): Likewise.
	* regmove.c (fixup_match_1): Add parentheses around assignment
	used as truth value.
	* reload.c (push_secondary_reload): Remove unused variable `i'.
	(find_reloads): Add parentheses around assignment used as truth
	value.
	* reload1.c: Include stdlib.h.
	* rtl.h: Correct typo in prototype of offsettable_memref_p.
	* stmt.c (add_case_node): Add parentheses around assignment used
	as truth value.
	(case_tree2list): Likewise.
	* tree.c (valid_machine_attribute): Wrap variable `decl_attr_list'
	in macro VALID_MACHINE_DECL_ATTRIBUTE.  Wrap variable
	`type_attr_list' in macro VALID_MACHINE_TYPE_ATTRIBUTE.
	(merge_attributes): Add explicit braces to avoid ambiguous
	`else'.
	* unroll.c (copy_loop_body): Wrap variable `cc0_insn' in
	macro HAVE_cc0.
	* varasm.c: Include stdlib.h.

From-SVN: r18290
1998-02-28 07:06:53 +00:00
Jeffrey A Law
29a820586a varasm.c (output_constant_pool): Bring back 'done' label inside an appropriate #ifdef.
* varasm.c (output_constant_pool): Bring back 'done' label inside
        an appropriate #ifdef.
        * bitmap.c (bitmap_element_allocate): Wrap variable 'i' in an
        appropriate #ifdef.
        (bitmap_copy, bitmap_operation): Likewise.
        * combine.c (combinable_i3pat): Similarly for 'src'.
        * function.c (fixup_var_refs_1): Similarly for 'outerdest'.
        (locate_and_pad_parm): Similarly for 'reg_parm_stack_space'.
        * regclass.c (copy_cost): Similarly for 'secondary_class'.
        * reload.c (make_memloc): Simliarly for 'i'.
        (find_reloads_address_1): Similarly for 'link'.
        * reload1.c (reload): Similarly for 'previous_frame_pointer_needed'.
        (emit_reload_insns): Similarly for 'second_reloadreg'.
        * unroll.c (iteration_info): Similarly for 'v'.
        * caller-save.c (insert_save_restore): Remove unused variable 'i'.
        * calls.c (expand_call): Similarly for 'i'.
        (emit_library_call, emit_library_call_value): Similarly for 'mode'.
        * fold-const.c (strip_compund_expr): Similarly for 'type'.
        * function.c (fixup_var_refs_1): Similarly  for 'width'.
        (fixup_memory_subreg): Similarly for 'saved'.
        (locate_and_pad_parm): Similarly for 'boundary_in_bytes.'
        (setjmp_protect): Similarly for 'sub'.
        (thread_prologue_and_epilogue_insns): Similarly for 'insn'.
        * loop.c (record_giv): Similarly for 'p'.
        (combine_givs): Similarly for 'temp_iv'.
        (indirect_jump_in_function_p): Similarly for 'is_indirect_jump'.
        * recog.c (validate_replace_rtx_1): Similarly for 'width'.
        * tree.c (get_set_constructor_bytes): Similarly for 'vals'.
        * unroll.c (unroll_loop): Similarly for 'copy'.
        (iteration_info): Similarly for 'b'.
        * varasm.c (assemble_string): Similarly for 'i'.
        * i386.h (LEGITIMIZE_ADDRESS): Similarly for 'orig_x'.

From-SVN: r17973
1998-02-13 18:13:58 -07:00
Robert Lipe
ccd043a956 c-common.c: Include <stdlib.h> and <string.h>/<strings.h>.
* c-common.c: Include <stdlib.h> and <string.h>/<strings.h>.
        * calls.c (expand_call): Remove unused variables funtree,
        n_regs, and tmpmode.
        * dbxout.c, except.c: Include <string.h>/<strings.h>.
        * explow.c: (plus_constant_for_output_wide) Removed unused
        variable all_constant.
        * c-decl.c, genattr.c, genattrtab.c, getconfig.c, genemit.c
        genextract.c, genflags.c, genopinit.c genoutput.c, genpeep.c,
        genrecog.c, global.c, integrate.c , stupid.c : Include
        <stdlib.h>.
        * genextract.c: (walk_rtx) Remove unused variable link.
        * genrecog.c: (concat) Remove unreferenced static function.
        * prefix.c: Include <string.h>/<strings.h>, <stdlib.h>
        * stmt.c: Include <stdlib.h>.
        (expand_asm_operands): Remove unused variable val1.
        (expand_return): Remove unused variable block.
        (pushcase): Remove unused variables l and n.
        (pushcaserange): Likewise.
        * unroll.c (unroll_loop): Remove unused variable temp.

From-SVN: r17766
1998-02-07 15:55:54 -07:00
Richard Henderson
38a448ca5d alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO...
* alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO;
change gen_rtx(expr...) to gen_rtx_fmt_foo(expr...).
* caller-save.c, calls.c, combine.c, cse.c: Likewise.
* dwarf2out.c, except.c, explow.c, expmed.c, expr.c: Likewise.
* final.c, flow.c, function.c, genpeep.c, haifa-sched.c: Likewise.
* halfpic.c, integrate.c, jump.c, local-alloc.c, loop.c: Likewise.
* profile.c, recog.c, reg-stack.c, regclass.c, regmove.c: Likewise.
* reload.c, reload1.c, reorg.c, sched.c, stmt.c, stupid.c: Likewise.
* unroll.c, varasm.c: Likewise.
* config/alpha/alpha.c, config/alpha/alpha.md: Likewise.

From-SVN: r17357
1998-01-14 15:10:50 -08:00
Jeff Law
1f3d3a3161 integrate.c (get_label_from_map): New function.
* integrate.c (get_label_from_map): New function.
        (expand_inline_function): Use it.  Initialize the label_map to
        NULL_RTX instead of gen_label_rtx.
        (copy_rtx_and_substitute): Use get_label_from_map.
        * integrate.h (get_label_from_map): New function.
        (set_label_from_map): New macro.
        * unroll.c (unroll_loop): Use them.
        (copy_loop_body): Ditto.

From-SVN: r17139
1997-12-18 15:42:41 -07:00
Gavin Koch
efb84aa556 unroll.c (calculate_giv_inc): Handle constant increment found in a MEM with an appropriate REG_EQUAL note.
* unroll.c (calculate_giv_inc): Handle constant increment found in
        a MEM with an appropriate REG_EQUAL note.

From-SVN: r17136
1997-12-18 10:31:01 -07:00
Jeff Law
956d69504d Merge from gcc-2.8
From-SVN: r16987
1997-12-06 17:31:01 -07:00
Jim Wilson
9fb82071ff Better fix for loop unrolling problem.
* unroll.c (find_splittable_givs):  Remove last change.  Handle givs
	with a dest_reg that was created by loop.

From-SVN: r16893
1997-12-02 12:57:41 -08:00
Jeffrey A Law
80c2681c0a unroll.c (find_splittable_givs): Don't split givs with a dest_reg that was created by loop.
* unroll.c (find_splittable_givs): Don't split givs with a dest_reg
        that was created by loop.

From-SVN: r16803
1997-11-27 12:24:06 -07:00
Jeff Law
e9a25f70a0 Update mainline egcs to gcc2 snapshot 971021.
From-SVN: r16278
1997-11-02 14:19:36 -07:00
Jeffrey A Law
37aa45a21d loop.c (loop_number): Delete function.
* loop.c (loop_number): Delete function.  Change all references
        to use uid_loop_num array.
        * loop.h (loop_number): Delete declaration.
        * unroll.c (unroll_loop): Change "loop_number" references to
        use uid_loop_num instead.
Still cleaning up haifa.

From-SVN: r15623
1997-09-21 21:04:36 -06:00
Jeff Law
237a9795cb loop.c (loop_unroll_factor): Move outside #ifdef HAIFA conditional.
* loop.c (loop_unroll_factor): Move outside #ifdef HAIFA
        conditional.
        (loop_unroll_iter): Remove unused variable and all references.
        (loop_optimize): Always allocate and clear space for loop_unroll_factor.
        (insert_bct): Fix minor formatting problems.
        * loop.h (loop_unroll_factor): Move decl outside #ifdef HAIFA.
        (loop_unroll_iter): Removed unused decl.
        * unroll.c (unroll_loop): Remove code to set loop_unroll_iter.
        Always record the unrolling factor.
More haifa cleanup

From-SVN: r15621
1997-09-21 19:49:19 -06:00