Commit Graph

795 Commits

Author SHA1 Message Date
Bernd Schmidt
70186b342c combine.c (num_sign_bit_copies): In NEG...
* combine.c (num_sign_bit_copies): In NEG, MULT, DIV and MOD cases,
        when a test can't be performed due to limited width of
        HOST_BITS_PER_WIDE_INT, use the more conservative approximation.
        Fix UDIV case for cases where the first operand has the highest bit
        set.

From-SVN: r24547
1999-01-06 16:33:29 -07:00
Kaveh R. Ghazi
5148a72b33 gansidecl.h: Prepend a "G" to the macro wrapping this file (to distinguish it from the macro...
* gansidecl.h: Prepend a "G" to the macro wrapping this file
        (to distinguish it from the macro wrapping ansidecl.h.)
        Include libiberty's ansidecl.h.  Remove all redundant definitions.
        Define the PROTO() style macros in terms of the PARAMS() ones.
        * calls.c (emit_library_call): Switch on ANSI_PROTOTYPES, not
        __STDC__, when deciding whether to use ANSI variable args.
        (emit_library_call_value): Likewise.
        * cccp.c (error): Likewise.
        (warning): Likewise.
        (error_with_line): Likewise.
        (warning_with_line): Likewise.
        (pedwarn): Likewise.
        (pedwarn_with_line): Likewise.
        (pedwarn_with_file_and_line): Likewise.
        (fatal): Likewise.
        * cexp.y (error): Likewise.
        (pedwarn): Likewise.
        (warning): Likewise.
        * collect2.c (fatal_perror): Likewise.
        (fatal): Likewise.
        (error): Likewise.
        * combine.c (gen_rtx_combine): Likewise.
        * cpperror.c (cpp_message): Likewise.
        (cpp_fatal): Likewise.
        * cpplib.c (cpp_error): Likewise.
        (cpp_warning): Likewise.
        (cpp_pedwarn): Likewise.
        (cpp_error_with_line): Likewise.
        (cpp_warning_with_line): Likewise.
        (cpp_pedwarn_with_line): Likewise.
        (cpp_pedwarn_with_file_and_line): Likewise.
        * cpplib.h: Don't define PARAMS() macro.
        * demangle.h: Likewise.
        * doprint.c (checkit): Switch on ANSI_PROTOTYPES, not __STDC__,
        when deciding whether to use ANSI variable args.
        * emit-rtl.c (gen_rtx): Likewise.
        (gen_rtvec): Likewise.
        * final.c (asm_fprintf): Likewise.
        * fix-header.c (cpp_message): Likewise.
        (fatal): Likewise.
        (cpp_fatal): Likewise.
        * gcc.c (concat): Likewise.
        (fatal): Likewise.
        (error): Likewise.
        * genattr.c (fatal): Likewise.
        * genattrtab.c (attr_rtx): Likewise.
        (attr_printf): Likewise.
        (fatal): Likewise.
        * gencodes.c (fatal): Likewise.
        * genconfig.c (fatal): Likewise.
        * genemit.c (fatal): Likewise.
        * genextract.c (fatal): Likewise.
        * genflags.c (fatal): Likewise.
        * genopinit.c (fatal): Likewise.
        * genoutput.c (fatal): Likewise.
        (error): Likewise.
        * genpeep.c (fatal): Likewise.
        * genrecog.c (fatal): Likewise.
        * halfpic.h: Switch on ANSI_PROTOTYPES, not __STDC__, when
        deciding whether to declare `tree_node' and `rtx_def'.
        * hash.h: Don't define stuff we get from gansidecl.h.
        * mips-tfile.c: Likewise.  Define __proto() in terms of PARAMS().
        (fatal): Switch on ANSI_PROTOTYPES, not __STDC__, when deciding
        whether to use ANSI variable args.
        (error): Likewise.
        * prefix.c (concat): Likewise.
        * scan.h: Likewise.
        * system.h: Likewise.
        * toplev.c (error_with_file_and_line): Likewise.
        (error_with_decl): Likewise.
        (error_for_asm): Likewise.
        (error): Likewise.
        (fatal): Likewise.
        (warning_with_file_and_line): Likewise.
        (warning_with_decl): Likewise.
        (warning_for_asm): Likewise.
        (warning): Likewise.
        (pedwarn): Likewise.
        (pedwarn_with_decl): Likewise.
        (pedwarn_with_file_and_line): Likewise.
        (sorry): Likewise.
        (really_sorry): Likewise.
        * toplev.h: Switch on ANSI_PROTOTYPES, not __STDC__, when deciding
        whether to declare `tree_node' and `rtx_def'.
        * tree.c (build): Switch on ANSI_PROTOTYPES, not __STDC__, when
        deciding whether to use ANSI variable args.
        (build_nt): Likewise.
        (build_parse_node): Likewise.

From-SVN: r23577
1998-11-08 15:10:24 +00:00
Richard Henderson
4f4b36794c combine.c (subst): Process the inputs to a parallel asm_operands only once.
* combine.c (subst): Process the inputs to a parallel asm_operands
        only once.

From-SVN: r23357
1998-10-26 05:35:39 -08:00
Kaveh R. Ghazi
7f7f8214d8 Warning fixes:
* Makefile.in (recog.o): Depend on toplev.h.
        (insn-emit.o): Depend on recog.h.
        (insn-peep.o): Depend on recog.h and insn-config.h.
        * combine.c (simplify_set): Remove unused variable `scratches'.
        * final.c (final_scan_insn): Wrap declaration of variables `vlen'
        and `idx' in macro conditional controlling their use.
        * genemit.c (main): Make the generated output file include
        recog.h.  Don't have it declare `insn_operand_constraint', since
        we get it from recog.h.
        * genpeep.c (main): Make the generated output file include
        insn-config.h and recog.h.
        * recog.c: Include toplev.h.
        (extract_insn): Remove unused variable `p'.
        * regclass.c (fix_register): Add missing braces around initializer
        for `what_option'.
        (allocate_reg_info): Move variable `i' into the scope where it is
        used.  Change its type to `size_t'.

From-SVN: r23307
1998-10-25 12:56:39 +00:00
Bernd Schmidt
8e2f6e35ba combine.c (recog_for_combine): Lose PADDED_SCRATCHES arg.
* combine.c (recog_for_combine): Lose PADDED_SCRATCHES arg.  All
	callers changed.
	(try_combine): Don't update max_scratch.
	* flow.c (max_scratch, num_scratch): Delete variables.
	(life_analysis_1): Don't initialize max_scratch.
	(propagate_block): Don't update max_scratch.
	(mark_set_1): Don't increment num_scratch.
	* regs.h (max_scratch): Delete declaration.

From-SVN: r23172
1998-10-19 03:47:55 -06:00
J"orn Rennecke
972b320cbf combine.c (combine_instructions): When finished, call init_recog.
8
	* combine.c (combine_instructions): When finished, call init_recog.
	* regmove.c (optimize_reg_copy_3): Reject volatile MEMs.

From-SVN: r23094
1998-10-14 14:50:40 -06: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
Jeff Law
6a99221410 combine.c (simplify_rtx): Do not replace TRUNCATE with a SUBREG if truncation is not a no-op.
8
        * combine.c (simplify_rtx): Do not replace TRUNCATE with a SUBREG if
        truncation is not a no-op.

From-SVN: r22835
1998-10-05 03:05:58 -06:00
Richard Henderson
861556b4d9 combine.c (expand_field_assignment): Don't do bitwise operations on MODE_FLOAT; pun to MODE_INT if possible.
* combine.c (expand_field_assignment): Don't do bitwise operations
        on MODE_FLOAT; pun to MODE_INT if possible.

From-SVN: r22826
1998-10-04 16:59:58 -07:00
Richard Henderson
f5c9764010 combine.c (distribute_notes): If an insn is a cc0 user, only delete it if we can also delete the cc0 setter.
* combine.c (distribute_notes): If an insn is a cc0 user, only
        delete it if we can also delete the cc0 setter.

From-SVN: r22489
1998-09-19 17:01:31 -07:00
Jeffrey A Law
0d8e55d8cd combine.c (make_extraction): If no mode is specified for an operand of insv...
* combine.c (make_extraction): If no mode is specified for
        an operand of insv, extv, or extzv, default it to word_mode.
        (simplify_comparison): Similarly.
        * expmed.c (store_bit_field): Similarly.
        (extract_bit_field): Similarly.
        * function.c (fixup_var_regs_1): Similarly.
        * recog.c (validate_replace_rtx_1): Similarly.
        * mips.md (extv, extzv, insv expanders): Default modes for most
        operands.  Handle TARGET_64BIT.
        (movdi_uld, movdi_usd): New patterns.

From-SVN: r22439
1998-09-15 16:47:10 -06:00
Kaveh R. Ghazi
789f983ab1 system.h: Include stdarg.h/varargs.h...
* system.h: Include stdarg.h/varargs.h, make sure they are ordered
        correctly with regards to stdio.h.
        * calls.c: Remove stdarg.h/varargs.h.
        * cccp.c: Likewise.
        * cexp.y: Likewise.
        * combine.c: Likewise.
        * cpperror.c: Likewise.
        * cpplib.c: Likewise.
        * cpplib.h: Likewise.
        * doprint.c: Likewise.
        * emit-rtl.c: Likewise.
        * final.c: Likewise.
        * fix-header.c: Likewise.
        * gcc.c: Likewise.
        * genattr.c: Likewise.
        * genattrtab.c: Likewise.
        * gencodes.c: Likewise.
        * genconfig.c: Likewise.
        * genemit.c: Likewise.
        * genextract.c: Likewise.
        * genflags.c: Likewise.
        * genopinit.c: Likewise.
        * genoutput.c: Likewise.
        * genpeep.c: Likewise.
        * genrecog.c: Likewise.
        * mips-tfile.c: Likewise.
        * prefix.c: Likewise.
        * protoize.c: Likewise.
        * regmove.c: Likewise.
        * toplev.c: Likewise.
        * tree.c: Likewise.
        * cp/errfn.c: Remove stdarg.h/varargs.h.
        * cp/tree.c: Likewise.

From-SVN: r21997
1998-08-26 08:11:47 +00:00
Jeffrey A Law
ec35104c79 combine.c (can_combine_p): Allow combining insns with REG_RETVAL notes.
* combine.c (can_combine_p): Allow combining insns with REG_RETVAL
	notes.
	(try_combine): Allow combining insns with REG_LIBCALL notes.

From-SVN: r21833
1998-08-18 12:29:40 -06:00
Jeffrey A Law
fcc60894b8 combine.c (expand_compound_operation): Fix thinko in code to optimize (zero_extend:DI (subreg:SI (foo:DI) 0)) to foo:DI.
* combine.c (expand_compound_operation): Fix thinko in code to optimize
        (zero_extend:DI (subreg:SI (foo:DI) 0)) to foo:DI.

From-SVN: r20966
1998-07-06 15:45:51 -06:00
Jeffrey A Law
adc05e6ce6 combine.c (simplify_comparison): Do not commute a AND into a paradoxical SUBREG if not WORD_REGISTER_OPERATIONS.
* combine.c (simplify_comparison): Do not commute a AND into
	a paradoxical SUBREG if not WORD_REGISTER_OPERATIONS.

From-SVN: r20934
1998-07-05 17:20:51 -06:00
Alasdair Baird
729a2bc66a * combine.c (simplify_comparison): Apply SUBREG_REG to SUBREGs.
From-SVN: r20887
1998-07-01 18:55:45 -06:00
Jeff Law
9ec36da574 * Merge from gcc2 June 9, 1998 snapshot. See ChangeLog.13 for
details.

From-SVN: r20808
1998-06-29 15:40:49 -06:00
John Carr
9e6a570365 optabs.c: Use gen_rtx_FOO (...) instead of gen_rtx (FOO, ...).
* optabs.c: Use gen_rtx_FOO (...) instead of gen_rtx (FOO, ...).
	* expr.c: Likewise.
	* explow.c: Likewise.
	* combine.c: Likewise.
	* reload1.c: Likewise.
	* gcse.c: Likewise.

From-SVN: r20701
1998-06-24 14:49:51 +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
J"orn Rennecke
b52ce03da5 combine.c (nonzero_bits): For paradoxical subregs, take LOAD_EXTENDED_OP into account.
* combine.c (nonzero_bits): For paradoxical subregs, take
	LOAD_EXTENDED_OP into account.

From-SVN: r19928
1998-05-21 12:35:10 +01:00
Kaveh R. Ghazi
d6f4ec5199 Warning fixes:
* Makefile.in (c-lang.o): Depend on c-tree.h, c-lex.h and toplev.h.
	(c-lex.o): Depend on output.h.
	(c-common.o): Likewise.
	(stmt.o): Likewise.
	(calls.o): Likewise.
	(integrate.o): Depend on toplev.h.
	(regclass.o): Depend on output.h.
	(final.o): Depend on reload.h.
	* c-common.c: Include output.h.
	(check_format_info): Remove unused variable `integral_format'.
	* c-decl.c (print_lang_decl): Mark parameters `file', `node' and
	`indent' with ATTRIBUTE_UNUSED.
	(print_lang_type): Likewise.
	(maybe_build_cleanup): Likewise for parameter `decl'.
	(copy_lang_decl): Likewise for parameter `node'.
	* c-lang.c: Include c-tree.h, c-lex.h and toplev.h.
	(lang_print_xnode): Mark parameters `file', `node' and `indent'
 	with ATTRIBUTE_UNUSED.
	(lookup_interface): Likewise for parameter `arg'.
	(is_class_name): Likewise.
	(maybe_objc_check_decl): Likewise for parameter `decl'.
	(maybe_objc_comptypes): Likewise for parameters `lhs', `rhs' and
	`reflexive'.
	(maybe_objc_method_name): Likewise for parameter `decl'.
	(build_objc_string): Likewise for parameters `len' and `str'.
	* c-lex.c: Include output.h.
	* c-lex.h (position_after_white_space): Correct typo in prototype.
	* c-tree.h (finish_file, c_expand_start_cond, c_expand_start_else,
 	c_expand_end_cond, init_iterators): Add prototypes.
	* caller-save.c (set_reg_live): Mark parameters `reg' and `setter'
	with ATTRIBUTE_UNUSED.
	* calls.c: Include output.h.
	* cccp.c (pipe_closed): Mark parameter `signo' with
 	ATTRIBUTE_UNUSED.
	* combine.c: Move inclusion of expr.h to after insn-config.h.
	* iris6.h (ASM_IDENTIFY_GCC, ASM_IDENTIFY_LANGUAGE): Don't define
	as empty, rather define as ((void)0).
	* sparc.c (sparc_check_64): Add braces around ambiguous `else'.
	Add parentheses around assignment used as truth value.
	* cplus-dem.c (squangle_mop_up): Change return type to void.
	(internal_cplus_demangle): Remove unused parameter `options'.
	All callers changed.
	(cplus_demangle_opname): Remove function wide variable `int i' and
 	replace with `size_t i' at each location where it is used.
	(cplus_demangle_opname): change type of `i' from int to size_t.
	* cppexp.c (right_shift): Mark parameter `pfile' with
	ATTRIBUTE_UNUSED.
	* cpphash.c (cpp_lookup): Likewise.
	(cpp_hash_cleanup): Likewise.
	* cpplib.c (parse_name): Add a prototype and make it static.
	(null_underflow): Mark parameter `pfile' with ATTRIBUTE_UNUSED.
	(null_cleanup): Likewise for parameters `pbuf' and `pfile'.
	(macro_cleanup): Likewise for parameter `pfile'.
	(file_cleanup): Likewise.
	* cpplib.h (cpp_reader_init, cpp_options_init, cpp_start_read,
 	cpp_read_check_assertion, skip_rest_of_line): Add prototypes.
	* crtstuff.c (force_to_data, __CTOR_LIST__, force_to_data,
	__DTOR_END__, __FRAME_END__): Mark with ATTRIBUTE_UNUSED.
	* cse.c (cse_check_loop_start): Mark parameter `set' with
 	ATTRIBUTE_UNUSED.
	* dbxout.c (flag_minimal_debug, have_used_extensions,
	source_label_number): Move inside macro wrapper check against
	defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO).
	* dwarf2out.c (gen_entry_point_die): Hide prototype and definition.
	* except.h (doing_eh): Provide prototype.
	* expr.c: Move inclusion of expr.h to after insn-config.h.
	* final.c: Include reload.h.
	(shorten_branches): Cast the first argument of bzero to char *.
	* fix-header.c (cpp_print_containing_files): Mark parameter
 	`pfile' with ATTRIBUTE_UNUSED.
	(cpp_fatal): Likewise.
	* flow.c (find_basic_blocks_1): Cast the first argument of bzero
	to char *.
	* genattrtab.c (make_length_attrs): Change the type of variable
	`i' from int to size_t.
	(zero_fn): Mark parameter `exp' with ATTRIBUTE_UNUSED.
	(one_fn): Likewise.
	* genextract.c (main): When generating insn-extract.c, mark
	variable `junk' with ATTRIBUTE_UNUSED.
	* gengenrtl.c (gencode): When generating genrtl.c, cast the first
	argument of bzero to char*.
	* integrate.c: Include toplev.h.
	* libgcc2.c: Wrap `struct exception_table' and
	`find_exception_handler' in macro DWARF2_UNWIND_INFO.
	* objc/Make-lang.in (objc-act.o): Depend on toplev.h.
	* objc/objc-act.c: Include toplev.h.
	(lang_print_xnode): Mark parameters `file', `node' and `indent'
	with ATTRIBUTE_UNUSED.
	(finish_protocol): Likewise for parameter `protocol'.
	* output.h (declare_weak): Add prototype.
	(decode_reg_name): Don't wrap with TREE_CODE macro.
	(assemble_alias): Add prototype.
	* regclass.c: Include output.h.
	* reload.h (reloads_conflict): Add prototype.
	* rtl.h (print_rtl_single, mark_elimiation, reg_class_subset_p,
	output_func_start_profiler): Add prototypes.
	* rtlanal.c (reg_set_p_1): Mark parameters `x' and `pat' with
 	ATTRIBUTE_UNUSED.
	* scan-decls.c: Include scan.h.
	* scan.h (recognized_function, recognized_extern): Add prototypes.
	* stmt.c: Include output.h.
	* toplev.c (error_for_asm, warning_for_asm): Remove prototypes.
	(output_lang_identify): Hide prototype and definition.
	(float_signal): Mark parameter `signo' with ATTRIBUTE_UNUSED.
	(pipe_closed): Likewise.
	* toplev.h (count_error, strip_off_ending, error_for_asm,
 	warning_for_asm): Add prototypes.

From-SVN: r19712
1998-05-13 12:40:39 +00:00
Jeff Law
e009aaf31f loop.c (regs_patch_p): Add prototype.
* loop.c (regs_patch_p): Add prototype.
        (add_label_notes, count_nonfixed_reads): Likewise.
        (find_single_use_in_loop): Likewise.
        (express_from): Surround prototype with #ifdef.
        (giv_sort): Similarly.
        * jump.c (mark_modified_reg): Add prototype.
        * haifa-sched.c (is_prisky): Add prototype.
        (queue_to_ready): Likewise.
        * genextract.c (gen_insn): Add prototype.
        * genemit.c (max_operand_1): Add prototype.
        (max_operand_vec, print_code, gen_exp, gen_insn): Likewise.
        (gen_expand, gen_explit, output_add_clobbers): Likewise.
        (output_init_mov_optab): Likewise.
        * genattrtab.c (attr_hash_add_rtx): Add prototype.
        (attr_hash_add_string, write_length_unit_log): Likewise.
        * genattr.c (init_range): Add prototype.
        * combine.c (sets_function_arg_p): Add prototype.

From-SVN: r19251
1998-04-16 17:56:12 -06:00
Jeff Law
80608e2793 combine.c (simplify_rtx, [...]): Respect value of TRULY_NOOP_TRUNCATION.
8
        * combine.c (simplify_rtx, case TRUNCATE): Respect value of
        TRULY_NOOP_TRUNCATION.

From-SVN: r19204
1998-04-14 02:04:21 -06:00
Catherine Moore
d276f2bb0c combine.c (can_combine_p): Include successor in volatile test.
Mon Apr  6 07:17:52 1998  Catherine Moore  <clm@cygnus.com>
        * combine.c (can_combine_p):  Include successor in volatile test.

From-SVN: r19018
1998-04-06 03:49:13 -07: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
Richard Henderson
6f28d3e982 * combine.c (make_compound_operation): Simplify (subreg (*_extend) 0).
From-SVN: r18836
1998-03-25 16:20:08 -08: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
081f5e7e66 Fix more warnings...
* c-lang.c (finish_file): Wrap variable `void_list_node' with macro
        test !ASM_OUTPUT_CONSTRUCTOR || !ASM_OUTPUT_DESTRUCTOR.
        * calls.c (emit_call_1): Wrap variable `already_popped' with macro
        test !ACCUMULATE_OUTGOING_ARGS.
        * collect2.c (write_c_file_glob): Wrap function definition in
        macro test !LD_INIT_SWITCH.
        * combine.c (try_combine): Wrap variables `cc_use' and
        `compare_mode' in macro test EXTRA_CC_MODES.
        * cpplib.c (do_ident): Remove unused variable `len'.
        (skip_if_group): Remove unused variables `at_beg_of_line' and
        `after_ident'.
        (cpp_get_token): Remove unused variable `dummy'.
        * dbxout.c (scope_labelno): Move static variable definition inside
        the one function scope where it is used.
        (dbxout_function_end): Wrap prototype and definition in
        macro test !NO_DBX_FUNCTION_END.
        * dwarf2out.c (add_subscript_info): Wrap variable `dimension_number'
        in macro test !MIPS_DEBUGGING_INFO.
        * expr.c (expand_builtin_setjmp): Move declaration of variable `i'
        into the scope where it is used.  Wrap empty else-statement body
        in braces.
        * fix-header.c: Fix typo in comment.
        (inf_skip_spaces): Cast results of INF_UNGET to (void).
        (check_protection, main): Likewise.
        * flow.c (find_basic_blocks_1): Remove dangling comment text.
        * function.c (contains): Wrap prototype and definition in macro
        test HAVE_prologue || HAVE_epilogue.
        (fixup_var_refs_1): Remove unused variable `width'.
        * gen-protos.c (main): Remove unused variable `optr'.
        * haifa-sched.c (debug_control_flow): Remove unused variable `j'.
        * libgcc2.c (__udiv_w_sdiv): Provide dummy return value of 0.
        (__sjpopnthrow): Remove unused variable `jmpbuf'.
        (__throw): Remove unused variable `val'.
        * protoize.c: Check for a previously existing definition before
        defining *_OK macros.
        * scan-decls.c (scan_decls): Remove unused variable `old_written'.

From-SVN: r18654
1998-03-18 07:18:06 +00:00
Jeffrey A Law
aff48bcaae emit-rtl.c (gen_lowpart_common): Suppress last change if __complex__.
* emit-rtl.c (gen_lowpart_common): Suppress last change if __complex__.
        * emit-rtl.c (hard-reg-set.h): Include.
        (get_lowpart_common): Don't make new REG for hard reg in a
        class that cannot change size.
        * Makefile.in (emit-rtl.o): Depend on hard-reg-set.h.
        * combine.c: Revert previous patch.

Co-Authored-By: Richard Kenner <kenner@vlsi1.ultra.nyu.edu>

From-SVN: r18109
1998-02-18 17:35:51 -07:00
Richard Henderson
15941d29c8 combine.c (simplify_rtx): Obey CLASS_CANNOT_CHANGE_SIZE when simplifying a subreg of a hard reg.
* combine.c (simplify_rtx): Obey CLASS_CANNOT_CHANGE_SIZE when
        simplifying a subreg of a hard reg.
        (expand_compound_operation): Likewise.
        (force_to_mode): Likewise.

From-SVN: r18052
1998-02-17 14:54:24 -07: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
J"orn Rennecke
e3258cef30 * combine.c (can_combine_p): Handle USEs in PARALLELs.
From-SVN: r17899
1998-02-13 02:26:25 +00:00
Jeffrey A Law
b577a8ffce * combine.c (simplify_shift_const): Fix typo in last change.
From-SVN: r17573
1998-01-31 19:31:03 -07:00
John Carr
6e0ef100da combine.c (simplify_shift_const): (lshiftrt (truncate (lshiftrt))) is (truncate (lshiftrt)).
* combine.c (simplify_shift_const):  (lshiftrt (truncate (lshiftrt)))
        is (truncate (lshiftrt)).

From-SVN: r17570
1998-01-31 18:49:32 -07:00
Jeff Law
76d31c6373 rtl.c (read_rtx): Use atol/atoq based upon disposition of HOST_WIDE_INT.
* rtl.c (read_rtx): Use atol/atoq based upon disposition of
        HOST_WIDE_INT.
        * genattrtab.c (write_test_expr): Use HOST_WIDE_INT_PRINT_DEC
        as needed.
        * genemit.c (gen_exp): Likewise.
        * genpeep.c (match_rtx): Likewise.
        * genrecog.c (write_tree_1): Likewise.
        * c-lex.c (yyprint): Use proper format string based upon
        disposition of HOST_BITS_PER_WIDE_INT.
        (yylex): Put casts in right place for args to build_int_2.
        * combine.c: Fix typos in Jan27 changes.

From-SVN: r17544
1998-01-28 16:25:15 -07:00
Jeff Law
b729186a44 c-lex.c: Include <stdlib.h> and <string.h>/<strings.h>.
* c-lex.c: Include <stdlib.h> and <string.h>/<strings.h>.  Add
	prototype for `handle_sysv_pragma', and make it static.  Add
	parentheses around assignment used as truth value.
	* combine.c (combine_instructions): Protect variable `prev' with
	macro HAVE_cc0.
	(can_combine_p): Protect variable `link' with AUTO_INC_DEC.
	(extract_left_shift): Add parentheses around operand of &.
	(merge_outer_ops): Avoid an empty body in an else-statement.
	(gen_rtx_combine): Remove unused variable `i'.
	* sparc/gmon-sol2.c: Include <fcntl.h>.  Make return type of
        function monstartup `void'.  Likewise for internal_mcount.  Add
        `static void' prototype for moncontrol.  Reconcile sprintf format
        vs. args.
	* sparc/sparc.c: Include <stdlib.h> and <string.h>/<strings.h>.
	Make return type of function_arg_slotno explicitly `int'.
	(reg_unused_after): Add	parentheses around assignment used as
	truth value.
	(save_regs): Add explicit braces to avoid ambiguous `else'.
	(function_arg_slotno): Add parentheses around && within ||.
	(function_arg_pass_by_reference): Likewise.
	(sparc_flat_output_function_prologue): Reconcile fprintf format
	vs. args.
	* svr4.h (ASM_OUTPUT_LIMITED_STRING): Add parentheses around
	assignment used as truth value.
	* cplus-dem.c: Include <stdlib.h>.
	(demangle_signature): Avoid an empty body in an else-statement.
	(do_type): Remove unused variable `lvl'.
	* cppexp.c: Don't have <stdlib.h> depend on MULTIBYTE_CHARS.
	Include <string.h>/<strings.h>.
	(cpp_lex): Remove unused variable `namelen'.
	(cpp_lex): Explicitly declare `num_chars' as an int.
	* cpplib.c: Avoid duplicate inclusion of <stdlib.h>, include
	<unistd.h> instead.  Explicitly declare is_system_include
	returning int.
	(make_assertion): Remove unused variable `kt'.
	(cpp_expand_to_buffer): Hide variable `obuf'.
	(output_line_command): Remove unused variables, `line_end',
	`line_cmd_buf' and `len'.
	(macarg): Remove unused variable `arg_start'.
	(special_symbol): Remove unused variable `i'.  Add parentheses
	around assignment used as truth value.
	(do_include):  Remove unused variables `pcfname' and `retried',
	hide `pcf' and `pcfbuflimit'.
	(do_line): Remove unused variable `i'.
	(finclude): Hide variable `missing_newline'.
	(cpp_handle_options): Remove unused variable `j'.
	(read_token_list): Remove unused variable `eofp'.
	(cpp_error_with_line): Remove unused variable `i'.
	(cpp_warning_with_line): Likewise.
	(cpp_pedwarn_with_line): Explicitly declare `column' as int.
	(cpp_error_from_errno): Remove unused variable `i'.
	* cse.c (invalidate): Add parentheses around assignment used as
	truth value.
	(find_best_addr): Move declaration of variable `our_cost' inside
	the conditional macro where its used.
	(fold_rtx): Avoid an empty body in an if-statement.
	(cse_insn): Wrap variables  `this_insn_cc0_mode' and
	`this_insn_cc0' in macro HAVE_cc0.
	* dwarf2out.c: Include <stdlib.h> and <string.h>/<string.h>.
	(ASM_OUTPUT_DWARF_DATA8):  Reconcile format vs. args in fprintf's.
	(output_uleb128): Likewise.
	(output_sleb128): Likewise.
	(output_cfi): Likewise.
	(output_call_frame_info): Remove unused variables `j', `fde_size'
	and `fde_pad'.
	(comp_unit_has_inlines): Hide declaration as per rest of file.
	(size_of_line_prolog): Correct typo in prototype.
	(add_arange): Likewise.
	(output_aranges): Likewise.
	(add_name_and_src_coords_attributes): Likewise.
	(gen_array_type_die): Likewise.
	(gen_inlined_subroutine_die): Likewise.
	(equate_decl_number_to_die): Remove unused variable `i'.
	(print_die): Reconcile format vs. args in fprintf's.
	(print_dwarf_line_table): Likewise.
	(output_die): Likewise.
	(output_line_info): Likewise.
	(add_subscript_info): Avoid an empty body in an else-statement.
	(gen_subprogram_die): Remove unused variable `fp_loc'.
	* dwarfout.c: Explicitly declare `next_pubname_number' as int.
	Protect `ordering_attribute' prototype with USE_ORDERING_ATTRIBUTE
	macro.  Protect `src_coords_attribute' prototype with
	DWARF_DECL_COORDINATES macro.  Hide `output_entry_point_die'
	prototype as in the rest of the file.  Likewise for
	`output_pointer_type_die' and `output_reference_type_die'.  Remove
	prototype for `type_of_for_scope'.
	(output_unsigned_leb128): Reconcile format vs. args in fprintf.
	(type_attribute): Add explicit braces to avoid ambiguous `else'.
	* final.c: Include <stdlib.h> and <string.h>/<strings.h>.
	(shorten_branches): Protect declaration of tmp_length with
	SHORTEN_WITH_ADJUST_INSN_LENGTH and ADJUST_INSN_LENGTH macros.
	(profile_function): Protect declaration of `sval' and `cxt'
	variables with appropriate macros.
	(final_scan_insn): Likewise for `note' variable.  Add explicit
	braces to avoid empty body in an if-statement.
	(output_asm_insn): Move variable `i' inside macro conditional
	where it is used.  Add parentheses around assignment used as truth
	value.
	(asm_fprintf) Likewise, likewise.
	* fix-header.c (main): Remove unused variable `done'.  Protect
	declaration of `i' with FIXPROTO_IGNORE_LIST.
	* pexecute.c: Include <unistd.h>.  Prototype `my_strerror'.
	* print-rtl.c (print_inline_rtx): Explicitly declare the parameter
	`ind'.
	* profile.c: Include <string.h>/<strings.h>.
	(instrument_arcs): Remove unused variables `note', `inverted',
	`zero' and `neg_one'.
	(branch_prob): Avoid empty body in an if-statement.
	* regclass.c: Include <stdlib.h>.
	(reg_alternate_class): Explicitly declare parameter `regno'.
	* regmove.c (regmove_optimize): Remove unused variable `p'.  Add
	parentheses around assignment used as truth value.
	(find_matches):  Remove unused variables `output_operand' and
	`matching_operand'.
	(fixup_match_1): Remove statement with no effect: "if (0) ;".
	* scan.c (sstring_append): Explicitly declare `count' as int.
	(scan_string): Explicitly declare parameter `init' as int.
	* sched.c: Include <stdlib.h>.
	(BLOCKAGE_RANGE): Add parentheses around arithmetic in operand of |.
	(rank_for_schedule): Add parentheses around assignment used as
	truth value.
	(schedule_block): Likewise.
	(regno_use_in): Likewise.
	(schedule_insns): Remove unused variable `i'.
	* toplev.c: Include <stdlib.h> and <string.h>/<strings.h>.
	(v_message_with_decl): Remove unused variable `n'.
	(botch): Explicitly declare parameter `s' as char *.
	(main): Add parentheses around assignment used as truth value.
	* tree.c (make_node): Protect the variable `kind' with the
	GATHER_STATISTICS macro.
	(real_value_from_int_cst): Move variable `e' inside conditional
	macro area where it is used.
	(tree_last): Add parentheses around assignment used as truth value.
	(build1): Protect the variable `kind' with the GATHER_STATISTICS
	macro.
	(print_obstack_statistics): Reconcile format vs. args in fprintf.
	Protect variables `i', `total_nodes', and `total_bytes' with the
	GATHER_STATISTICS macro.
Lots more -W -Wall warnings disappear.

From-SVN: r17516
1998-01-27 15:11:45 -07:00
David S. Miller
0e9ff8854f combine.c (force_to_mode, [...]): Correctly optimize constant offset computations from objects with known...
* combine.c (force_to_mode, nonzero_bits): Correctly optimize
        constant offset computations from objects with known alignment in
        the presence of STACK_BIAS.

From-SVN: r17405
1998-01-17 16:08:03 -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
c85f7c16ad Bring in final gcc-2.8.0 changes.
From-SVN: r17355
1998-01-14 13:57:58 -07:00
Kaveh R. Ghazi
1d300e19b6 bitmap.c (bitmap_clear): Ensure `inline' is at the beginning of the declaration.
* bitmap.c (bitmap_clear): Ensure `inline' is at the beginning
        of the declaration.
        * c-decl.c (finish_decl): Use parentheses around && within ||.
        * rtl.c: Include stdlib.h.
        (read_skip_spaces): Add parentheses around assignments used as
        truth values.
        (read_rtx): Initialize list_rtx.
        * cppexp.c (parse_number): Use || when operands are truth values.
        * alias.c (find_base_value): Add default case.
        (memrefs_conflict): Likewise.
        * combine.c (sets_function_arg_p): Likewise.
        * genemit.c (gen_exp): Likewise.
        * local-alloc.c (contains_replace_regs): Likewise.
        * rtlanal.c (jmp_uses_reg_or_mem): Likewise.
        * fold-const.c (fold_convert): Use "&&" for truth values.
        (fold): Add default case.
        * sdbout.c (sdbout_field_types): Fix typo in declaration.
        (sdbout_one_type): Add default case.
        * alpha.c (alpha_sa_mask): Prototype only if OPEN_VMS.
        (some_operand): Add default case.
        (input_operand): Likewise.
        (signed_comparison_operator): Likewise.
        (divmod_operator): Likewise.
        (alpha_set_memflags_1): Likewise.
        * reload1.c (reload_cse_simplify_operands): Ensure function
        always returns a value.
        * scan-decls.c (scan_decls): Likewise.
        * c-lex.c (skip_white_space): Fix typo in declaraion.
        * c-typeck.c (comp_target_types): Add parentheses around assignment
        used as truth value.
        (print_spelling): Likewise.
        (constructor_implicit, constructor_result): Remove unused variables.
        * collect2.c (scan_library): Protect prototype with
        #ifdef SCAN_LIBRARIES.
        * emit-rtl.c (find_line_note): Fix typo in declaration.
        * final.c (asm_insn_count): Protect prototype with
        #ifdef HAVE_ATTR_length.
        * flow.c (find_auto_inc): Protect prototype with #ifdef AUTO_INC_DEC.
        (try_pre_increment_1, try_pre_increment): Likewise.
        * regclass.c (auto_inc_dec_reg_p): Protect prototype with
        #ifdef FORBIDDEN_INC_DEC_CLASSES.  Make return type explicit.
        * gcov-io.h (__store_long, __write_long, __read_long): Fix
        unsigned/signed comparisons.
        * gcov.c (read_files): Remove unused "first_type" variable.
        (scan _for_source_files): Initialize s_ptr.
        (function_summary): Eliminate "%lf" formatting, use %ld for
        longs.
        (output_data): Initialize branch_probs and last_line_num.
        Eliminate "%lf" formatting, use "%ld" for longs.

Co-Authored-By: Jeffrey A Law <law@cygnus.com>

From-SVN: r17158
1997-12-20 04:31:54 -07:00
Christian Iseli
be3d27d60c * combine.c (force_to_mode): return immediately if operand is a CLOBBER.
From-SVN: r17121
1997-12-16 16:12:32 -07:00
Jeff Law
b472527b0f Another handful of gcc-2.8 changes (will it ever go out the door?).
See ChangeLog.11 for details.

From-SVN: r17040
1997-12-11 09:26:05 -07:00
Jeff Law
f40421ce8c * combine.c (simplify_rtx, case ABS): Do nothing for ASM_OPERANDS.
From-SVN: r17038
1997-12-10 18:13:57 -07:00
Jeff Law
956d69504d Merge from gcc-2.8
From-SVN: r16987
1997-12-06 17:31:01 -07:00
Jim Wilson
ff3467a9eb Fix alpha-linux GNU libc build failures.
* combine.c (try_combine): When setting elim_i2, check whether newi2pat
	sets i2dest.  When calling distribute_notes for i3dest_killed, pass
	elim_i2 and elim_i1.  When setting elim_i1, check if newi2pat
	sets i1dest.

From-SVN: r16334
1997-11-04 18:08:25 -08:00
Jeff Law
08bb4b3b2c Remove last combine patch. rth & jim are working on a new one.
From-SVN: r16304
1997-11-03 14:55:49 -07:00
Richard Henderson
be2053f3dd combine.c (try_combine): Don't elim_i1 when it is used in i2src.
* combine.c (try_combine): Don't elim_i1 when it is used in i2src.

        * combine.c (try_combine): When setting elim_i2, check whether newi2pat
        sets i2dest.  When calling distribute_notes for i3dest_killed, pass
        elim_i2 and elim_i1.

Co-Authored-By: Jim Wilson <wilson@cygnus.com>

From-SVN: r16296
1997-11-02 23:24:36 -07:00
Jeff Law
e9a25f70a0 Update mainline egcs to gcc2 snapshot 971021.
From-SVN: r16278
1997-11-02 14:19:36 -07:00
Richard Henderson
b79ee7eb70 combine.c (can_combine_p): Don't combine with an asm whose output is a hard register.
* combine.c (can_combine_p): Don't combine with an asm whose
        output is a hard register.

From-SVN: r15940
1997-10-16 15:06:43 -07:00
David S. Miller
9524f769a7 combine.c (try_combine): Use NULL_RTX instead of '0' where appropriate in calls to gen_rtx().
* combine.c (try_combine): Use NULL_RTX instead of '0' where
        appropriate in calls to gen_rtx().
        * cse.c (cse_main): Likewise.
        * emit-rtl.c (gen_label_rtx): Likewise.
        * expr.c (init_expr_once): Likewise.
        * haifa-sched.c (flush_pending_lists, sched_analyze_insn,
        sched_analyze, init_rgn_data_dependences,
        compute_block_backward_dependences): Likewise.
        * sched.c (schedule_insns): Likewise.
        * varasm.c (immed_double_const): Likewise.

From-SVN: r15630
1997-09-22 11:41:48 -06:00
Jeffrey A Law
9ae8ffe751 * Integrate alias analysis changes from jfc@mit.edu
* Makefile.in (OBJS): Add alias.o
        (alias.o): Add dependencies.
        * alias.c: New file.
        * sched.c: Remove alias analysis code.  It lives in alias.c now.
        (reg_last_uses_size): Declare.
        (sched_analyze_2): Add new arguments to true_dependence.
        (sched_analyze_insn): Use reg_last_uses_size instead of max_reg.
        (schedule_block): Initialize reg_last_uses_size.
        (schedule_insns): Always call init_alias_analysis.
        * calls.c (expand_call): Note calls to malloc, calloc, and realloc;
        mark return value from such functions as a pointer and keep track of
        them for alias analysis.  If a return value from a function is a
        pointer, mark it as such.
        * combine.c (distribute_notes): Handle REG_NOALIAS.
        * cse.c (struct write_data): Delete.  No longer needed.
        (invalidate): Don't call set_nonvarying_address_components anymore.
        Use true_dependence to decide if an entry should be removed from
        the hash table.
        (invalidate_memory): Remove WRITES argument, simplify appropriately.
        Fix all callers.
        (note_mem_written): Similarly for WRITE_PTR argument.
        (invalidate_from_clobbers): Similarly for W argument.
        (invalidate_for_call): Remove memory elements from the hash table.
        (refers_to_mem_p, cse_rtx_addr_varies_p): Deleted.
        (cse_rtx_varies_p): New function.  Derived from old
        cse_rtx_addr_varies_p.
        (cse_insn): Remove WRITES_MEMORY and INIT variables and all references.
        Don't call note_mem_written anymore.  Stack pushes invalidate the stack
        pointer if PUSH_ROUNDING is defined.  No longer need to call
        cse_rtx_addr_varies_p to decide if a MEM should be invalidated.
        (skipped_writes_memory): Remove variable.
        (invalidate_skipped_set): Simplify and wewrite to use invalidate_memory.
        (invalidate_skipped_block): Simplify for new alias analysis code.
        (cse_set_around_loop): Likewise.
        (cse_main): Call init_alias_analysis.
        * flags.h (flag_alias_check, flag_argument_noalias): Declare.
        * toplev.c (flag_alias_check, flag_argument_noalias): Define.
        (f_options): Add new alias checking arguments.
        (main): Set flag_alias_check when optimizing.
        * local_alloc (validate_equiv_mem_from_store): Add new arguments
        to true_dependence.
        (memref_referenced_p): Likewise.
        * loop.c (NUM_STORES): Increase to 30.
        (prescan_loop): Only non-constant calls set unknown_address_altered.
        (invariant_p): Add new arguments to true_dependence.
        (record_giv): Initialize unrolled and shared fields.
        (emit_iv_add_mult): Call record_base_value as needed.
        * loop.h (struct induction): Add unrolled and shared fields.
        * unroll.c  (unroll_loop): Call record_base_value as needed.
        (copy_loop_body): Likewise.
        (final_biv_value): Likewise.
        (final_giv_value): Likewise.
        (find_splittable_regs): Likewise.  Only create one new pseudo
        if we have multiple address GIVs that were combined with the same
        dst_reg GIV.  Note when a new register is created due to unrolling.
        * rtl.c (reg_note_name): Add REG_NOALIAS.
        * rtl.h (enum reg_note): Similarly.
        (rtx_varies_p, may_trap_p, side_effects_p): Declare.
        (volatile_refs_p, volatile_insn_p, remove_note): Likewise.
        (note_stores, refers_to_regno_p, reg_overlap_mentioned_p): Likewise.
        (true_dependence, read_dependence, anti_dependence): Likewise.
        (output_dependence, init_alias_analysis, end_alias_analysis): Likewise.
        (mark_user_reg, mark_reg_pointer): Likewise.
jfc's alias analysis code.

From-SVN: r14768
1997-08-11 14:07:24 -06:00
Richard Kenner
132d204008 (force_to_mode): Don't do anything for a ASM_OPERANDS insn.
From-SVN: r14287
1997-06-22 06:47:16 -04:00
Michael Meissner
8e08106d3e Use REG_SET macros
From-SVN: r14250
1997-06-16 18:40:41 +00:00
Michael Meissner
b1f21e0aef Use accessor macros to access arrays based on regno; move many of the arrays into a single structure.
From-SVN: r14140
1997-05-30 18:19:19 +00:00
Mike Stump
e3da301da3 reformat a little to match GNU coding standards.
From-SVN: r14023
1997-05-06 22:59:57 +00:00
Jim Wilson
9a893315ea (get_last_value_validate): New argument insn.
Add check for memory reference clobbered by later store.
(record_value_for_reg, get_last_values): Pass in new argument.

From-SVN: r13900
1997-04-14 11:46:37 -07:00
Jim Wilson
24e46fc402 (move_deaths): Handle partial REG_DEAD note for
multi-reg hard register.

From-SVN: r13836
1997-04-03 12:34:07 -08:00
Doug Evans
c9903b4462 combine.c (distribute_notes): Handle REG_BR_PROB and REG_EXEC_COUNT REG_NOTES.
* combine.c (distribute_notes): Handle REG_BR_PROB and REG_EXEC_COUNT
	REG_NOTES.

From-SVN: r13811
1997-03-28 22:34:53 +00:00
Richard Kenner
61b1bece8e Fix typo in comment.
From-SVN: r13792
1997-03-25 14:04:54 -05:00
Jim Wilson
987e845a7f (if_then_else_cond): Call copy_rtx to prevent sharing.
From-SVN: r13736
1997-03-18 13:10:44 -08:00
Richard Kenner
3c99d5ffb6 (simplify_rtx, case SUBREG): Fix direction of test when calling operand_subword...
(simplify_rtx, case SUBREG): Fix direction of test when calling
operand_subword; use inline code intead of subreg_lowpart_p.

From-SVN: r13698
1997-03-10 16:10:20 -05:00
Jeff Law
e30fb98f9b combine.c (simplify_rtx): Do nothing with (truncate:mode) if mode is a partial integer mode.
* combine.c (simplify_rtx): Do nothing with (truncate:mode) if
        mode is a partial integer mode.

From-SVN: r13686
1997-03-03 13:12:07 -07:00
Jeff Law
101c1a3d93 combine.c (find_split_point): Don't turn a SIGN_EXTEND into a series of shifts if...
* combine.c (find_split_point): Don't turn a SIGN_EXTEND into
        a series of shifts if either mode is a partial integer mode.

From-SVN: r13665
1997-02-19 11:18:06 -07:00
Richard Kenner
4d2c432d88 Update comments.
From-SVN: r13636
1997-02-15 08:15:55 -05:00
Richard Kenner
4eb2cb10f6 (find_split_point, case SET): Fix error in last change.
From-SVN: r13579
1997-02-02 06:39:41 -05:00
Ian Lance Taylor
538fe8cddb Add a case where reg_n_refs is cleared
From-SVN: r13561
1997-01-29 20:25:29 +00:00
Richard Kenner
0802d51684 (simplify_rtx): Don't do anything with if_then_else_cond result if both one arm and the input are a comparison.
(simplify_rtx): Don't do anything with if_then_else_cond
result if both one arm and the input are a comparison.
(simplify_{rtx,if_then_else,logical,shift_const}): Don't
test STORE_FLAG_VALUE with #if; properly test for just sign bit.
(num_sign_bit_copies, if_then_else_cond): Likewise.

From-SVN: r13551
1997-01-27 09:04:16 -05:00
Richard Kenner
1a6ec0703b (find_split_point, case SET): If SET_SRC is NE and STORE_FLAG_VALUE is -1, see if we can convert into NEG of shift.
(find_split_point, case SET): If SET_SRC is NE and
STORE_FLAG_VALUE is -1, see if we can convert into NEG of shift.
(force_to_mode, case NE): Make condition stricter.

From-SVN: r13370
1997-01-04 18:48:04 -05:00
Jim Wilson
b3728b0e0e (nonzero_bits): Ifdef out calls to num_sign_bit_copies.
Add dummy define/undef for num_sign_bit_copies.

From-SVN: r13314
1996-12-16 18:25:39 -08:00
Jim Wilson
f77aada2b4 (simplify_comparison): Use mode_width as shift count
only if it is less than or equal to HOST_BITS_PER_WIDE_INT.

From-SVN: r13312
1996-12-16 12:27:35 -08:00
Ian Lance Taylor
f95182a4a9 Check SMALL_REGISTER_CLASSES at runtime
From-SVN: r13302
1996-12-13 01:00:49 +00:00
Richard Kenner
d409668956 (try_combine): When splitting an insn, check for the new I2 setting a
SUBREG.

From-SVN: r13286
1996-12-11 17:46:34 -05:00
Richard Kenner
6d101824da (combinable_i3pat): Bring back to sync with can_combine_p.
From-SVN: r13274
1996-12-10 20:20:59 -05:00
Richard Kenner
59888de215 (try_combine): Properly copy an rtvec.
From-SVN: r13166
1996-11-15 13:36:57 -05:00
Ian Lance Taylor
0f13a42202 Add some optimizations for TRUNCATE and ZERO_EXTEND
From-SVN: r13058
1996-10-29 00:01:53 +00:00
Richard Kenner
ecd4080946 (can_combine_p): When SMALL_REGISTER_CLASSES is defined, avoid
substituting a return register into I3.

From-SVN: r13006
1996-10-23 10:48:36 -04:00
Richard Kenner
e309d4d2f7 (can_combine_p): Even if SMALL_REGISTER_CLASSES, know lifetime not
extended if all_adjacent set.

From-SVN: r12789
1996-09-23 19:28:23 -04:00
Jeff Law
0f47edd345 combine.c (rtx_equal_for_field_assignment_p): Check for get_last_value returning (CLOBBER (CONST_INT 0)).
* combine.c (rtx_equal_for_field_assignment_p): Check for
        get_last_value returning (CLOBBER (CONST_INT 0)).

From-SVN: r12590
1996-08-03 23:26:17 -06:00
Jim Wilson
845fc87500 (undo_all): Clear previous_undos field.
From-SVN: r12544
1996-07-22 16:32:36 -07:00
Mike Stump
0f41302f47 formatting tweaks
From-SVN: r12390
1996-07-03 22:07:53 +00:00
Richard Kenner
241cea859c (previous_num_undos): Deleted variable.
(MAX_UNDO): Deleted macro.
(struct undo): New field, next.
(struct undobuf): Deleted num_undos and undo.
New fields undos, frees, and previous_undos.
(SUBST, SUBST_INT): Rework to allocate memory and chain undo entries.
(combine_instructions): Initialize undobuf.{undos,previous_undos},
not undobuf.num_undo and previous_num_undos.
(try_combine): Likewise.
(undo_all, gen_rtx_combine): Rework to use new data structures.

From-SVN: r12372
1996-06-28 18:32:45 -04:00
Richard Kenner
3aceff0d36 (force_to_mode, case NE): Fix typo and logical error.
(simplify_comparison): Don't swap args if op1 is CONST_INT.

From-SVN: r12339
1996-06-27 19:42:23 -04:00
Richard Kenner
6eb12cef1d (move_deaths): New parameter maybe_kill_insn.
Don't move note if reg killed by maybe_kill_insn.
(try_combine): Pass new arg to move_deaths.

From-SVN: r12311
1996-06-19 17:50:05 -04:00
Richard Kenner
9cc96794cc (try_combine): Don't use split if dest of new I2 is used between I2
and I3.

From-SVN: r12293
1996-06-18 06:37:45 -04:00
Jim Wilson
88306d12bb (set_nonzero_bits_and_sign_copies): Set
reg_sign_bit_copies to one not zero to indicate that the value
is unknown.

From-SVN: r12086
1996-05-23 16:53:39 -07:00
Jim Wilson
ee49a9c7be (nonzero_bits): Don't assume arg pointer has same
alignment as stack pointer.

From-SVN: r12079
1996-05-22 14:41:29 -07:00
Richard Kenner
c5ad722c61 (init_reg_last_arrays, setup_incoming_promotions): Correct prototypes.
From-SVN: r12073
1996-05-22 08:08:17 -04:00
Richard Kenner
1427d6d2bc (insn_cuid): New function.
(INSN_CUID): Sometimes call it.

From-SVN: r11986
1996-05-17 08:54:54 -04:00
Richard Kenner
9dd11dcb09 (make_field_assignment): Allow XOR in final case.
From-SVN: r11820
1996-04-16 16:02:20 -04:00
Richard Kenner
4d9cfc7b05 (expand_field_assignment): Take SUBREG_WORD into account when have STRICT_LOW_PART.
(expand_field_assignment): Take SUBREG_WORD into account when have
STRICT_LOW_PART.
(make_extraction): Make a STRICT_LOW_PART at any low-order word.

From-SVN: r11775
1996-04-15 05:12:16 -04:00
Richard Kenner
7ca919b759 (try_combine): When substituting in output of I2, ensure dest isn't
clobbered in I2.

From-SVN: r11773
1996-04-14 20:42:14 -04:00
Richard Kenner
2dab894ad8 (combine_instructions): In initial scan of insns, handle a REG_INC note's affect on sign bit copies and nonzero bits.
(combine_instructions): In initial scan of insns, handle a REG_INC
note's affect on sign bit copies and nonzero bits.
(set_nonzero_bits_and_sign_copies): Treat a zero SET arg as a CLOBBER.

From-SVN: r11762
1996-04-14 08:20:54 -04:00
Doug Evans
cf54c2cdf2 (make_extraction): In BITS_BIG_ENDIAN correction of POS, need to treat
MEM and REG differently.

From-SVN: r11603
1996-03-23 22:07:00 +00:00
Richard Kenner
bb821298b3 (simplify_if_then_else): Allow for case that condition might no longer
be a condition.

From-SVN: r11555
1996-03-18 19:25:58 -05:00
Doug Evans
76184def9f (find_split_point): Handle NULL return from make_extraction.
(make_field_assignment): Likewise.

From-SVN: r11552
1996-03-17 21:54:11 +00:00
Richard Kenner
9e74dc4154 (make_extraction): Correct typo in force_to_mode call in previous change.
Return 0 if pos+len out of range of want desired mode.

From-SVN: r11544
1996-03-16 18:56:24 -05:00
Richard Kenner
d7cd794fdf (make_extraction): Use proper mode for INNER in all cases.
(simplify_comparison, case ZERO_EXTRACT): For bits big endian and no extzv,
use BITS_PER_WORD.

From-SVN: r11510
1996-03-11 06:49:32 -05:00
Richard Kenner
d4d2b13f31 (force_to_mode, case IOR): Fix typo in commuting IOR and LSHIFTRT.
From-SVN: r11313
1996-02-19 19:02:54 -05:00
Richard Kenner
01c82bbba1 (force_to_mode, num_sign_bit_copies, simplify_comparison): Fix
precedence errors.

From-SVN: r11251
1996-02-13 08:14:11 -05:00
Richard Kenner
b0d71df940 (nonzero_bits, case REG): Ignore REG_POINTER_ALIGNMENT.
Restore old code for SP, but use it for all pointers to defined locations in
the frame.

From-SVN: r11123
1996-01-30 06:48:12 -05:00
Richard Kenner
e11fa86f42 (rtx_equal_for_field_assignment_p): New function.
(make_field_assignment): Use it.
Expand compound operations on both sides of an IOR.
Properly adjust constand in IOR when computing bit position.

From-SVN: r10927
1996-01-01 09:07:38 -05:00
Richard Kenner
91102d5aed (set_nonzero_bits_and_sign_copies): Handle reg even if only set once and in one basic block.
(set_nonzero_bits_and_sign_copies): Handle reg even
if only set once and in one basic block.
(nonzero_bits, case REG): Use REGNO_POINTER_ALIGN instead of
explicit alignment of registers pointing into frame.

From-SVN: r10870
1995-12-27 15:23:44 -05:00
Jim Wilson
f82da7d270 (simplify_rtx, case SUBREG): For SUBREG of a constant,
use <= instead of < when comparing mode sizes.
(force_to_mode, case NOT): Use full mask inside	the NOT operation.

From-SVN: r10814
1995-12-18 18:45:11 -08:00
Jeff Law
041d718079 regclass.c (regclass): Use SECONDARY_RELOAD_CLASS if it's defined to avoid useless work.
* regclass.c (regclass): Use SECONDARY_RELOAD_CLASS if it's
        defined to avoid useless work.

        * combine.c (find_split_point): Try to split SET_DEST
        just like we do for SET_SRC.

From-SVN: r10790
1995-12-17 10:17:23 -07:00
Richard Kenner
393de53f61 (try_combine): When checking for two sets of the same register in a split insn...
(try_combine): When checking for two sets of the same register in a
split insn, also test for setting a ZERO_EXTRACT, STRICT_LOW_PART, or
SUBREG.

From-SVN: r10783
1995-12-17 06:45:16 -05:00
Richard Kenner
5be669c75a (simplify_if_then_else): Convert "a == b ? b : a" to "a".
From-SVN: r10698
1995-12-10 10:06:28 -05:00
Richard Kenner
320dd7a75a (nonzero_bits, case REG): Put POINTERS_EXTEND_UNSIGNED code before stack pointer code.
(nonzero_bits, case REG): Put POINTERS_EXTEND_UNSIGNED code before
stack pointer code.  Return nonzero at end of stack pointer code.

From-SVN: r10600
1995-11-26 14:32:34 -05:00
Doug Evans
6a11342fe7 (force_to_mode): Fix typo in fix to last change.
From-SVN: r10564
1995-11-06 15:26:27 +00:00
Richard Kenner
8cb3db079c (force_to_mode): Put in last change properl.
From-SVN: r10555
1995-11-05 10:57:20 -05:00
Richard Kenner
b69960ac72 (force_to_mode, case ASHIFTRT): Properly handle mask wider than
HOST_WIDE_INT.

From-SVN: r10534
1995-10-27 15:08:26 -04:00
Richard Kenner
a890884916 (distribute_notes): For Oct 19 change, add additional check to verify
that place has a valid INSN_CUID.

From-SVN: r10520
1995-10-26 18:11:32 -04:00
Richard Kenner
9bf22b75fc (force_to_mode, case ASHIFTRT): Verify mode bitsize is within
HOST_BITS_PER_WIDE_INT before shifting by it.

From-SVN: r10513
1995-10-26 08:29:18 -04:00
Richard Kenner
d02089a5f2 (distribute_notes): Delete instructions without side effect that set a
subreg of an unused register.

From-SVN: r10491
1995-10-20 19:14:10 -04:00
Richard Kenner
932d1119f5 (distribute_notes): When search for new place to put REG_DEAD note,
call distribute_links if this new place is between i2 and i3, and i2
uses the register.

From-SVN: r10475
1995-10-19 18:44:41 -04:00
Richard Kenner
15448afcc8 (simplify_rtx): In code that attempts to simplify conditional expressions...
(simplify_rtx): In code that attempts to simplify conditional
expressions, if the result is an NE around another comparison, return
the original expression.

From-SVN: r10428
1995-10-03 13:58:18 -04:00
Richard Kenner
abc95ed36d Fix spelling errors.
From-SVN: r10289
1995-08-28 06:54:22 -04:00
Richard Kenner
fabd69e832 (move_deaths): When have a multi-reg hard register, if don't find a
note, then recur for each individual hard register.

From-SVN: r10225
1995-08-13 21:21:45 -04:00
Richard Kenner
940d9d638b Update FSF address.
From-SVN: r9959
1995-06-15 07:33:25 -04:00
Richard Kenner
60715d0bef (reg_dead_at_p): When scanning backwards, stop at BARRIER.
From-SVN: r9885
1995-06-05 22:43:28 -04:00
Richard Kenner
a29ca9db50 (recog_for_combine): New parm PADDED_SCRATCHES; set it.
(try_combine): Accumulate number of scratches and update max_scratch.
(simplify_set): Add extra parm to recog_for_combine.

From-SVN: r9839
1995-05-29 19:19:51 -04:00
Richard Kenner
ddd5a7c180 Fix typos in comments.
From-SVN: r9711
1995-05-16 08:14:26 -04:00
Richard Kenner
bdaae9a01a (simplify_shift_count, case LSHIFTRT): Don't merge shifts of different
modes if first is any right shift.

From-SVN: r9674
1995-05-13 06:46:49 -04:00
Richard Kenner
f6789c7753 (simplify_shift_const): Don't change SHIFT_MODE for LSHIFTRT either.
From-SVN: r9650
1995-05-12 14:20:43 -04:00
Jim Wilson
bcd49eb7a8 (combine_instrutions): Set subst_prev_insn to zero.
(try_combine, undo_all): Likewise.
(get_last_value): Return zero if subst_prev_insn set.

From-SVN: r9559
1995-05-01 16:43:28 -07:00
Jim Wilson
2ca9ae17a9 (simplify_rtx, case TRUNCATE): Add. Use force_to_mode.
(force_to_mode, case AND): Allow some simplifications when GET_MODE (x)
has more bits than HOST_BITS_PER_WIDE_INT.

From-SVN: r9479
1995-04-26 11:08:54 -07:00
Richard Kenner
0e32506c6b (simplify_logical, case AND): If still an AND, get new values for op0
and op1.

From-SVN: r9424
1995-04-21 07:57:42 -04:00
Jim Wilson
e340018d59 (get_last_value): Ignore BARRIER when scanning backwards.
(move_deaths): New variables before_dead and after_dead.  Set them
to instructions that have valid INSN_CUID values and use in test.

From-SVN: r9397
1995-04-17 13:55:26 -07:00
Jim Wilson
0d9641d106 (subst_prev_insn): New variable.
(try_combine): Set it.
(get_last_value): Use it.

From-SVN: r9396
1995-04-17 13:49:59 -07:00
Richard Kenner
f507a07044 (simplify_set): Don't move a SUBREG to dest if it is changing the size
of a hard reg in CLASS_CANNOT_CHANGE_SIZE.

From-SVN: r9346
1995-04-10 07:57:09 -04:00
Torbjorn Granlund
9fa6d012c0 (force_to_mode, case PLUS): Sign extend masks that are negative in OP_MODE.
(simplify_and_const_int): Sign-extend constants when they have the
most significant bit set for the target.
(merge_outer_ops): Likewise.
(simplify_shift_const): Likewise.

From-SVN: r9310
1995-04-03 23:19:41 +00:00
Richard Kenner
ff0dbdd176 (nonzero_bits, case REG): Check POINTERS_EXTEND_UNSIGNED.
(num_sign_bit_copies, case REG): Likewise.

From-SVN: r9303
1995-04-03 18:11:26 -04:00
Jim Wilson
d6c8056260 (get_last_value): Revert back to use prev_nonnote_insn instead of prev_real_insn.
(get_last_value): Revert back to use prev_nonnote_insn
instead of prev_real_insn.  Modify test that ignores USE insns.

From-SVN: r9268
1995-03-30 15:34:12 -08:00
Jim Wilson
2f99f437c1 (make_compound_operation, AND case): Undo July 7, 1994
change.

From-SVN: r9252
1995-03-29 15:02:10 -08:00
Richard Kenner
64bf47a22d (gen_lowpart_for_combine): Set reg_changes_size, if needed.
From-SVN: r9206
1995-03-18 16:57:49 -05:00
Richard Kenner
8af24e2633 (apply_distributive_law, case SUBREG): Fix typo when checking for
paradoxical SUBREG.

From-SVN: r9189
1995-03-16 15:57:59 -05:00
Jim Wilson
4255220d92 (max_uid_cuid): New static variable.
(INSN_CUID): Call abort if INSN is out of range.
(combine_instructions): Set max_uid_cuid.  Set uid_cuid directly
instead of through INSN_CUID.
(get_last_value): Use prev_real_insn instead of prev_nonnote_insn.
Ignore USE insns generated by combine.

From-SVN: r9169
1995-03-10 12:03:20 -08:00
Doug Evans
ea414472af (simplify_set): Call can_conditionally_move_p.
From-SVN: r8795
1995-01-25 04:09:46 +00:00
Jim Wilson
2aec5b7a12 (num_sign_bit_copies): Can handle paradoxical subreg only
if LOAD_EXTEND_OP is defined to SIGN_EXTEND.

From-SVN: r8787
1995-01-20 18:23:10 -08:00
Richard Kenner
34c8be7241 (simplify_if_then_else): Fix typo: "|" should be "||".
From-SVN: r8731
1995-01-10 19:09:14 -05:00
Ian Lance Taylor
e24b00c81a Always copy flags to new MEM in simplify_shift_const.
From-SVN: r8678
1994-12-21 05:00:26 +00:00
Richard Kenner
e2cce0cf90 (distribute_notes): When output an insn to hold a REG_DEAD note,
update basic_block_head if necessary.

From-SVN: r8658
1994-12-16 06:44:16 -05:00
Richard Kenner
38d8473fbb (distribute_notes): If can't find place for REG_DEAD note, add an INSN
with a USE to hold it.

From-SVN: r8625
1994-12-07 21:57:53 -05:00
Richard Kenner
ca89d290d8 (record_dead_and_set_regs_1): Handle SUBREGs.
From-SVN: r8594
1994-11-30 19:12:38 -05:00
Ian Lance Taylor
f76b9db287 Check target endianness at run time, not compile time
From-SVN: r8470
1994-11-16 21:10:09 +00:00
Jim Wilson
1dc8a823f9 (try_combine): Update split_code after converting MULT
to ASHIFT.

From-SVN: r8403
1994-11-07 16:31:46 -08:00
Richard Kenner
4dca5ec5b8 (can_combine_p): Don't combine into CALL_INSN where DEST is a global
reg.

From-SVN: r8305
1994-10-18 19:10:20 -04:00
Richard Kenner
66415c8b0e (simplify_comparison): Convert comparison to unsigned when stripping
off a ZERO_EXTEND.

From-SVN: r8034
1994-09-07 18:32:03 -04:00
Richard Kenner
6dd49058f5 (simplify_set): Only convert IF_THEN_ELSE to logical expression if
mode of object being compared is result mode.

From-SVN: r8033
1994-09-07 18:11:06 -04:00
Richard Kenner
318b149cf7 (nonzero_bits, cases DIV, MOD, UDIV, UMOD): Declare op0_maybe_minusp
and op1_maybe_minusp as HOST_WIDE_INT.

From-SVN: r8006
1994-08-31 19:17:29 -04:00
Jeff Law
8b2e69e1af * combine.c (simplify_comparison, case GEU): Add missing break.
From-SVN: r8001
1994-08-30 11:56:39 -06:00
Jim Wilson
07d0cbddd4 (distribute_notes...
(distribute_notes, case REG_UNUSED): Ignore notes when
from_insn != i3 only if the notes would remain as REG_UNUSED notes.

From-SVN: r7942
1994-08-18 11:09:33 -07:00
Jim Wilson
17cbf35871 (distribute_notes, case REG_DEAD): Add another
find_reg_fusage call.

From-SVN: r7920
1994-08-14 16:00:43 -07:00
Richard Kenner
1d12df723d (simplify_rtx, case FLOAT_TRUNCATE): Remove redundant float_truncate.
From-SVN: r7906
1994-08-12 14:57:01 -04:00
Richard Kenner
3adde2a5c6 (subst_prev_insn): Remove variable and all uses.
From-SVN: r7852
1994-08-02 18:38:10 -04:00
Richard Kenner
df7d75de69 (try_combine): Don't make a MULT if none of the insns in our input had one.
From-SVN: r7803
1994-07-28 07:11:09 -04:00
Jim Wilson
787745f56c (simplify_rtx): For (not (xor X C)) generate new rtx
instead of modifying old rtx.

From-SVN: r7788
1994-07-21 15:06:05 -07:00
Jim Wilson
90bf80812e (record_dead_and_set_regs_1): Can only handle SUBREG
if the register is smaller or equal to BITS_PER_WORD.

From-SVN: r7749
1994-07-12 10:19:46 -07:00
Ian Lance Taylor
36b8d79271 Only turn IF_THEN_ELSE into AND if MODE_INT.
From-SVN: r7699
1994-07-11 17:17:03 +00:00
Richard Kenner
1c75dfa442 (force_to_mode): OP_MODE must be MODE if MODE and mode of X are of different classes.
(force_to_mode): OP_MODE must be MODE if MODE and mode of X are of different
classes.
(nonzero_bits, num_sign_bit_copies): Say nothing known for floating-point
modes.

From-SVN: r7688
1994-07-08 18:30:49 -04:00
Jim Wilson
9fd5bb6267 (distribute_notes, REG_DEAD case): When check to see
if insn uses register, also call find_regno_fusage.

From-SVN: r7683
1994-07-08 13:55:33 -07:00
Richard Kenner
0c1c8ea679 (gen_unary): Add new arg, OP0_MODE.
All callers changed.

From-SVN: r7678
1994-07-08 11:46:25 -04:00
Doug Evans
aadfb06280 (make_compound_operation, AND case): Do extraction in desired result mode.
From-SVN: r7671
1994-07-07 05:43:18 +00:00
Doug Evans
485eeec425 flow.c (mark_set_1): Record explicit hard registers in their raw mode.
* flow.c (mark_set_1): Record explicit hard registers in their raw mode.
(mark_used_regs): Likewise.
* combine.c (distribute_notes): Likewise.

From-SVN: r7670
1994-07-07 05:38:58 +00:00
Richard Kenner
cd5e8f1fc2 (can_combine_p): Don't check for replacing arg of function here.
(can_combine_p): Do it here.

From-SVN: r7657
1994-07-05 19:12:04 -04:00
Richard Kenner
5af9117152 (try_combine): If I2DEST was used in I2SRC, it isn't unused just
because there is no SET for I2 anymore.

From-SVN: r7653
1994-07-05 16:59:42 -04:00
Doug Evans
094030c93f (simplify_set): Evaluate HAVE_conditional_move at runtime.
From-SVN: r7599
1994-06-29 02:41:26 +00:00
Richard Earnshaw
13018fad5e (distribute_notes, case REG_DEAD): If a call uses a
hard reg, then this is where it dies.

From-SVN: r7569
1994-06-25 10:04:06 +00:00
Richard Kenner
4c9a05bc55 Cast pointer operands to bzero, bcopy, and bcmp to (char *).
From-SVN: r7472
1994-06-14 18:19:28 -04:00
Richard Kenner
180b8e4bf1 (force_to_mode): NEXT_SELECT is true for NEG.
Only exit quickly if X is narrower than MODE and MASK has all bits in X's
mode set.
(force_to_mode, case SUBREG): Don't check for WORD_REGISTER_OPERATIONS.
(force_to_mode, case NEG): Special-case test for low-order bit.

From-SVN: r7384
1994-05-29 16:03:08 -04:00
Richard Kenner
8080be5fdd (try_combine): Don't make complemented NOT for constant out of range.
From-SVN: r7370
1994-05-27 16:42:08 -04:00
Richard Kenner
7e4dc511b0 (simplify_comparison): Narrow comparison for AND's that are ZERO_EXTENDs.
Can widen for all comparisons if inputs are both sign extended.

From-SVN: r7363
1994-05-27 13:36:40 -04:00
Richard Kenner
b7a775b20b (simplify_comparison): Call CANONICALIZE_COMPARISON, if defined.
From-SVN: r7353
1994-05-26 18:48:18 -04:00
Richard Kenner
d5a4ebdc8f (simplify_if_then_else): Don't make (mult (cond)) in simple case;
leave as IF_THEN_ELSE instead.

From-SVN: r7351
1994-05-26 18:03:39 -04:00
Richard Kenner
246e00f2ff (simplify_set): Move call to make_field_assignment to end; if SRC or DEST is a (clobber (const_int 0)), return it.
(simplify_set): Move call to make_field_assignment to end; if SRC or DEST is
a (clobber (const_int 0)), return it.
(force_to_mode): If X is a CALL, just return it.

From-SVN: r7323
1994-05-17 18:51:25 -04:00
Richard Kenner
c0d3ac4db6 (simplify_set): Use rtx_equal_p to compare cc_use and its setter.
(make_extraction): Don't put a subreg around a register if it is already in
the correct mode.

From-SVN: r7322
1994-05-17 18:12:05 -04:00
Richard Kenner
6e2d1486ac (try_combine): Restrict combining on CALL_INSNs.
(distribute_{notes,links}): Look at CALL_INSN_FUNCTION_USAGE.

From-SVN: r7236
1994-05-06 17:44:06 -04:00
Richard Kenner
71923da7f3 (simplify_rtx, case MULT): Don't convert MULT to shift here.
(simplify_logical, case IOR): Convert back to PLUS if valid and it will
combine with another PLUS.
(extract_left_shift): New function.
(make_compound_operation, case ASHIFTRT): Simplify by calling it.
(force_to_mode): Don't ignore if X is a SUBREG.
(force_to_mode, case AND): Try to turn unchecked bits on instead of just off
and see which is cheaper.

From-SVN: r7224
1994-05-06 12:42:40 -04:00
Richard Kenner
87e3e0c1b5 (simplify_rtx, case SUBREG): Don't call force_to_mode.
(simplify_set): Call force_to_mode here.

From-SVN: r7216
1994-05-05 14:37:00 -04:00
Richard Kenner
c448a43e24 (can_combine_p...
(can_combine_p, combinable_i3pat, try_combine): Allow combination
involving hard regs if the hard reg is a user variable.

From-SVN: r7131
1994-04-21 18:27:25 -04:00
Doug Evans
36b878d12c (move_deaths): Record death information of remaining
registers in their intrinsic mode.

From-SVN: r7089
1994-04-20 03:38:46 +00:00
Richard Kenner
45620ed410 No longer handle LSHIFT.
From-SVN: r7020
1994-04-10 08:03:37 -04:00
Richard Kenner
7d171a1e9d (force_to_mode, case ROTATE): Don't assume simplify_binary_operation always returns CONST_INT.
(force_to_mode, case ROTATE): Don't assume simplify_binary_operation always
returns CONST_INT.
(simplify_shift_const, case IOR, PLUS): Likewise.

From-SVN: r7006
1994-04-09 10:55:42 -04:00
Richard Kenner
04fe43855a Include <stdarg.h> instead of "gstdarg.h"; similarly for varargs.
From-SVN: r6922
1994-03-30 17:15:20 -05:00
Richard Kenner
f24ad0e4a8 (try_combine): Remove decls of unused variables.
(subst): Remove decls of unused variables ORIG_CODE.
(simplify_if_then_else): Remove decl of unused variable C2.
(make_compound_operation): Remove decl of unused variable COUNT.
(known_cond): Remove decl of unused variable NEW.
(make_field_assignment): Remove decl of unused variable OURDEST.
(simplify_and_const_int): Remove decls of unused variables.
(simplify_shift_const): Remove decl of unused variable INNER.

From-SVN: r6876
1994-03-25 13:59:11 -05:00
Richard Kenner
4635f74880 (simplify_rtx, case FLOAT_TRUNCATE): Simplify
case of (float_truncate (abs (float_extend X))).

From-SVN: r6857
1994-03-23 17:28:26 -05:00
Richard Kenner
e048778fca (mark_used_regs_combine): Correct typo.
From-SVN: r6831
1994-03-20 06:38:17 -05:00
Richard Kenner
6e25d15912 (newpat_used_regs): New variable.
(mark_used_regs_combine): New function.
(try_combine): Use them.
(reg_dead_at_p): Registers marked in newpat_used_regs must always be
considered to be live.

From-SVN: r6826
1994-03-19 17:13:23 -05:00
Richard Kenner
d18225c493 Use PVPROTO for varargs prototypes.
From-SVN: r6744
1994-03-11 08:01:45 -05:00
Richard Kenner
8079805dec (subst): Split into five functions.
(simplify_{rtx,if_then_else,set,logical}): New functions.

From-SVN: r6703
1994-03-06 14:39:37 -05:00
Richard Kenner
00244e6b17 (if_then_else_cond): Fix typo in narrowing of a SUBREG.
From-SVN: r6624
1994-02-25 09:00:07 -05:00
Richard Kenner
21a64bf134 (simplify_shift_const, case AND): When remaking binary operation, do
it in SHIFT_MODE.

From-SVN: r6552
1994-02-14 19:08:15 -05:00
Richard Kenner
9210df584c (REVERSIBLE_CC_MODE): Add default definition.
(reversible_comparison_p): REVERSIBLE_CC_MODE.

(subst): Always simplify true and false arms if if_then_else_cond succeeds.
(subst, case IF_THEN_ELSE): More canonicalizations; delete some redundant
tests.
(if_then_else_cond): Canonicalize (OP (mult COMP A) (mult REV_COMP B)).
(gen_binary): Simplify (REL_OP (compare X Y) 0) here.

From-SVN: r6540
1994-02-12 08:49:59 -05:00
Richard Kenner
4f90e4a0f7 If __STDC__, include gstdarg and use ANSI form of varargs.
From-SVN: r6514
1994-02-10 08:07:10 -05:00
Richard Kenner
e737355637 (make_extraction): Don't make an extraction that has the potential of
crossing a boundary.

From-SVN: r6462
1994-02-01 18:27:04 -05:00
Richard Kenner
b65c1b5b01 (subst, case SUBREG): Handle paradoxical SUBREG of constant.
(IF_THEN_ELSE): Add missing "else" and check for comparison before
calling reversible_comparison_p.

From-SVN: r6419
1994-01-23 19:40:58 -05:00
Richard Kenner
ad25ba1779 (simplify_comparison): Can remove NOT on both operands if we swap
comparison code.

From-SVN: r6410
1994-01-23 07:00:29 -05:00
Richard Kenner
67232b230e (simplify_comparison): Fix typo in last change.
From-SVN: r6407
1994-01-23 06:18:50 -05:00
Richard Kenner
3a19aabc45 (if_then_else_cond): Don't do anything with COMPARE.
(simplify_comparison): Strip SIGN_EXTEND, NOT, or NEG when both operands
have it.

From-SVN: r6404
1994-01-22 16:50:41 -05:00
Richard Kenner
0c314d1ab0 (num_sign_bit_copies): Ifndef WORD_REGISTER_OPERATIONS, ensure we
don't do the wrong thing if X is narrower than MODE.

From-SVN: r6403
1994-01-22 15:50:06 -05:00
Richard Kenner
abe6e52f23 (added_links_insn): New variable.
(distribute_links): Set it.
(if_then_else_cond): New function.
(try_combine): Return added_links_insn if it is earlier than what we would
otherwise return.
(subst): Generalize (OP X Y) to call if_then_else_cond instead of only
checking for an explicit IF_THEN_ELSE.
(subst, case IF_THEN_ELSE): When converting to a MULT, simplify the MULT
before putting it into OP.
(subst, case AND): Don't make IF_THEN_ELSE here; now made in generic case
earlier.

From-SVN: r6343
1993-12-31 06:44:59 -05:00
Richard Kenner
e3d616e3da (force_to_mode): Add new parm JUST_SELECT; all callers changed.
From-SVN: r6342
1993-12-31 06:27:31 -05:00
Richard Kenner
7e2a0d8ef4 (subst, case MINUS): Allow some FP simplifications if -ffast-math.
(reversible_comparison_p): FP comparisons reversible with -ffast-math.

From-SVN: r6333
1993-12-27 08:47:14 -05:00
Richard Kenner
9e69be8c65 (set_nonzero_bits_and_sign_copies, nonzero_bits): Fix errors in
SHORT_IMMEDIATES_SIGN_EXTEND code.

From-SVN: r6315
1993-12-25 09:28:45 -05:00
Richard Kenner
7bef86801b (subst, case MINUS): Canonicalize (minus A (plus A B)).
From-SVN: r6226
1993-12-13 20:58:37 -05:00
Richard Kenner
c4e861e80b (try_combine, simplify_shift_const): Add initializations for some
uninitialized variables.

From-SVN: r6148
1993-11-23 17:43:26 -05:00
Richard Kenner
2dd484ed8e (force_to_mode): Don't allow sign-extension of constants when we are
narrowing things in an IOR or XOR.

From-SVN: r6117
1993-11-19 18:24:20 -05:00
Richard Stallman
aa988991ba (force_to_mode): Don't do right-shift in a narrower mode.
From-SVN: r6105
1993-11-16 07:20:33 +00:00
Richard Kenner
137e889e24 (subst_prev_insn): New variable.
(try_combine): Set it.
(get_last_value): Use subst_prev_insn if set instead of looking for the first
insn before SUBST_LOW_CUID.

From-SVN: r6063
1993-11-10 21:34:55 -05:00
Richard Stallman
4b2cb4a295 (can_combine_p): Don't combine instructions across a volatile insn.
From-SVN: r5802
1993-10-19 04:42:27 +00:00
Richard Stallman
dfa3449bd4 Include stdio.h after gvarargs.h.
From-SVN: r5767
1993-10-13 00:20:47 +00:00
Richard Kenner
5541136b1b (subst, shift and rotate cases): Test value of SHIFT_COUNT_TRUNCATED
if it is defined.

From-SVN: r5730
1993-10-11 07:38:22 -04:00
Richard Kenner
4c002f291a (force_to_mode, case ASHIFTRT): Verify that result of making a
LSHIFTRT remains a shift.

From-SVN: r5715
1993-10-10 19:18:18 -04:00
Richard Kenner
ff12fdac9b (subst, case SUREG):Only call force_to_mode if both inner and output
modes are MODE_INT.

From-SVN: r5709
1993-10-10 10:57:01 -04:00
Richard Kenner
ceb7983c7c (force_to_mode): Sign-extend constant being truncated.
From-SVN: r5654
1993-10-07 08:14:16 -04:00
Jim Wilson
176c9e6beb (try_combine): New variable i3_subst_into_i2.
Set it for special case of substituting i3 into i2.  Use it near
end to detect when special case succeeded.  Move i2notes to
i3notes for this special case.
(distribute_notes, REG_UNUSED case): Ignore all REG_UNUSED notes
except those from I3.

From-SVN: r5639
1993-10-06 10:46:02 -07:00
Richard Kenner
d81481d3d9 (can_combine_p): Allow an insn with a REG_EQUIV note that reads memory
to be moved past an insn that writes memory.

From-SVN: r5562
1993-10-02 14:10:47 -04:00
Jim Wilson
1347292b88 (force_to_mode, LSHIFTRT case): Avoid shifts larger
than HOST_BITS_PER_WIDE_INT.

From-SVN: r5516
1993-09-28 16:00:13 -07:00
Richard Kenner
8baf60bbb8 (BYTE_LOADS_EXTEND, LOAD_EXTEND): Deleted.
(subst, force_to_mode, nonzero_bits, num_sign_bit_copies): Use new
macros LOAD_EXTEND_OP and WORD_REGISTER_OPERATION instead of
BYTE_LOADS_*_EXTEND and LOAD_EXTEND.

From-SVN: r5473
1993-09-25 08:20:33 -04:00
Doug Evans
6d7096b078 combine.c: (combinable_i3_pat): Don't add REG_DEAD notes for HARD_FRAME_POINTER_REGNUM.
* combine.c: (combinable_i3_pat): Don't add REG_DEAD notes for
HARD_FRAME_POINTER_REGNUM.
(subst, case SUBREG): Don't change register number or mode if it
is HARD_FRAME_POINTER_REGNUM.

From-SVN: r5450
1993-09-24 19:37:25 +00:00
Richard Stallman
ef026f9101 (init_reg_last_arrays): New function.
(combine_instructions): Use it.
(force_to_mode): Narrow mask to fit mode (except VOIDmode).
(record_value_for_reg): When zeroing reg_last_set_value, also
zero reg_last_set_{mode,nonzero_bits,sign_bit_copies}.
(record_dead_and_set_regs): Likewise.

From-SVN: r5430
1993-09-23 06:11:30 +00:00
Richard Kenner
d96023cfa7 (recog_for_combine): Fix typos in previous change.
From-SVN: r5354
1993-09-18 16:52:40 -04:00
Richard Kenner
974f41466f (recog_for_combine): Always reject a PARALLEL containing our special
CLOBBER.

From-SVN: r5348
1993-09-17 18:19:59 -04:00
Jim Wilson
c2f9f64eb2 (make_compound_operation): Handle the case (and (xor/ior (lshift...) (lshift...)) ...).
(make_compound_operation): Handle the case
(and (xor/ior (lshift...) (lshift...)) ...).
(make_field_assignment): In get_pos_from_mask call, only invert
bits in mode mask.

From-SVN: r5237
1993-08-31 15:08:25 -07:00
Richard Kenner
c6965c0fa2 (nonzero_bits): Fix reversed test for when we need to insert extra bits when sizes differ.
(nonzero_bits): Fix reversed test for when we need to insert extra bits when
sizes differ.
(nonzero_bits, case EQ): Always return STORE_FLAG_VALUE when returning integer
mode; remove now-redundant test.

From-SVN: r5221
1993-08-27 18:47:38 -04:00
Jim Wilson
00d4ca1c64 (simplify_shift_const...
(simplify_shift_const, XOR case): When applying
distributive law, use shift_mode and GET_MODE (varop) instead of
result_mode.

From-SVN: r5189
1993-08-19 16:17:58 -07:00
Richard Kenner
423012407e (can_combine_p): Don't reject SUBREG assignments here.
(subst): Instead, do it here, but also allow it in as a nested SUBREG since
the inner one will be eliminated.
(simplify_and_const_int): Convert (and (neg X) (const_int 1)) to a shift
when X is known to be either 0 or 1.

From-SVN: r5187
1993-08-19 16:20:37 -04:00
Richard Kenner
f0343c7490 (try_combine): Don't split a PARALLEL of a SIGN_EXTEND and the object being...
(try_combine): Don't split a PARALLEL of a SIGN_EXTEND and the object
being sign extended if we have made assumptions about the form the
I2DEST.

From-SVN: r5184
1993-08-18 19:30:08 -04:00
Richard Kenner
0840fd91a3 (nonzero_bits): Handle case when BYTE_LOADS_EXTEND is not on and we
are asked for something in a mode wider than it.

From-SVN: r5183
1993-08-18 17:48:33 -04:00
Richard Kenner
e28f57321d (use_crosses_set_p): Check for partially overlapping hard regs.
From-SVN: r5163
1993-08-16 11:16:14 -04:00
Richard Kenner
f085c9cdc4 (combine_instructions): Fix typo on test of basic block number.
From-SVN: r5134
1993-08-11 17:58:31 -04:00
Richard Kenner
312def2eda (num_sign_bit_copies): Properly handle case when MODE is narrower than that of X.
(num_sign_bit_copies): Properly handle case when MODE is narrower than that
of X.
(simplify_shift_const): Remove change of July 26.

From-SVN: r5110
1993-08-08 17:31:39 -04:00
Richard Kenner
6139ff2019 (force_to_mode): Now pass actual AND mask instead of number off;
generalize appropriately.
Move most cases from simplify_and_const_int in.
(simplify_and_const_int): Remove most code from here; call force_to_mode
instead.
(subst, make_extraction, make_compound_operation): Change calls to
force_to_mode.
(make_field_assignment): Likewise.
(simplify_comparison): Add call to force_to_mode when doing a sign bit
comparison.

From-SVN: r5060
1993-08-03 17:31:46 -04:00
Richard Stallman
f5393ab90a (struct undo): Rename rtx' fields to r'.
(undo_all, SUBST, gen_rtx_combine): Corresponding changes.

From-SVN: r5059
1993-08-03 21:27:41 +00:00
Richard Kenner
5109d49f79 (subst): Move simple operations inside IF_THEN_ELSE if the IF_THEN_ELSE is in the second operand as well as the first.
(subst): Move simple operations inside IF_THEN_ELSE if the IF_THEN_ELSE is in
the second operand as well as the first.
(subst, case NEG): Use plus_constant to make a PLUS.
(subst, case MINUS): Simplify (minus 1 (comparison foo bar)).
(subst, case EQ): Add a number of missing cases where comparisons may be
replaced with arithmetic or logical ops.
(subst, case IF_THEN_ELSE): Handle (if_then_else COND (OP Z C1) Z) in a more
general manner.
(simplify_and_const_int): Make AND with gen_binary in case we can simplify it.

From-SVN: r5056
1993-08-02 18:52:56 -04:00
Richard Kenner
0d4d42c365 Remove change of July 21.
(this_basic_block): New variable.
(combine_instructions): Set it.
(try_combine, distribute_links): Use it and basic_block_head to see if
we've gone to a new basic block instead of trying to reproduce
calculation done in flow.

From-SVN: r5044
1993-07-30 06:47:51 -04:00
Richard Stallman
437b3c097d (simplify_shift_const): Inhibit hacks based on
num_sign_bit_copies if shift_mode differs from the mode of varop.

From-SVN: r4994
1993-07-26 22:16:16 +00:00
Jim Wilson
ca5c3ef417 (nonlocal_label_list): New variable.
(combine_instructions): Set it.
(try_combine, distribute_links): CALL_INSN terminates a basic
block if nonlocal_label_list is set.

From-SVN: r4960
1993-07-21 14:44:07 -07:00
Richard Kenner
fe2db4fb68 Add prototypes for static functions.
(subst, case IF_THEN_ELSE): Add missing arg to make_compound_operation.
(make_compound_operation, case ASHIFTRT): Delete extra gen_unary arg.

From-SVN: r4945
1993-07-20 15:06:35 -04:00
Richard Stallman
9c3b4c8be3 Include stdio.h before rtl.h.
From-SVN: r4884
1993-07-09 05:09:25 +00:00
Jim Wilson
34785d0514 (simplify_comparison): Add parentheses to satify gcc.
From-SVN: r4877
1993-07-07 15:03:52 -07:00
Jim Wilson
5c0e109149 (simplify_and_const_int, LSHIFTRT case): Must be at
least as many sign bit copies as bits in mask.

From-SVN: r4868
1993-07-06 14:21:40 -07:00
Richard Kenner
bc0776c620 (subst, case PLUS): Simplify (plus (comp A B) -1), etc.
From-SVN: r4853
1993-07-05 17:56:42 -04:00
Richard Stallman
c070dcf733 comment change.
From-SVN: r4797
1993-06-29 22:05:11 +00:00
Richard Kenner
3ad2180a02 (subst, apply_distributive_law): Use INTEGRAL_MODE_P and FLOAT_MODE_P.
(reversible_comparison_p): Likewise.
Can reverse if MODE_COMPLEX_INT or MODE_PARTIAL_INT.

From-SVN: r4779
1993-06-27 21:19:42 -04:00
Richard Kenner
3e61c21976 (subst, case IF_THEN_ELSE): Install correct version of last change.
From-SVN: r4763
1993-06-27 08:31:48 -04:00
Richard Kenner
224eeff2ea (subst): apply_distributive_law can also handle AND.
(subst, case IF_THEN_ELSE): Make a shift when appropriate.
(simplify_shift_const): If we have an outer operation and made a shift, see if
it can be simplified.

From-SVN: r4748
1993-06-26 11:06:55 -04:00
Richard Stallman
df6f4086b0 (num_sign_bit_copies): At end, return 1 if NONZERO has the high bit set.
From-SVN: r4627
1993-06-04 00:45:44 +00:00
Richard Stallman
239db5fcdd (make_compound_operation, case ASHIFTRT): Fix typo.
Was using C1 where C2 is needed.

From-SVN: r4586
1993-05-28 22:48:32 +00:00
Richard Stallman
6e498949db (simplify_and_const_int, case IOR, XOR, NOT): Don't
create constant wider than mode of VAROP.

From-SVN: r4583
1993-05-28 05:59:04 +00:00
Richard Stallman
097e45d14c (subst): Typo in prev change.
From-SVN: r4557
1993-05-24 08:02:52 +00:00
Richard Stallman
19808e22ca (subst): For subreg-of-constant, don't gen_lowpart
if it's a big-endian machine and constant is multi-word.

From-SVN: r4554
1993-05-24 07:45:54 +00:00
Richard Kenner
9afa3d548e (set_nonzero_bits_and_sign_copies...
(set_nonzero_bits_and_sign_copies, nonzero_bits): If we have a
positive constant that is negative in the mode it is being used in,
treat it as negative.

From-SVN: r4506
1993-05-19 18:09:24 -04:00
Richard Kenner
e8095e803f (set_nonzero_bits_and_sign_copies): Don't record data for a a pseudo that is undefined on entry to a function.
(set_nonzero_bits_and_sign_copies): Don't record data for a a pseudo that is
undefined on entry to a function.
When a pseudo is clobbered, show we don't know anything about it.

From-SVN: r4471
1993-05-15 10:43:42 -04:00
Jeff Law
36a9c2e959 combine.c (combinable_i3pat): Do not make REG_DEAD notes for the stack pointer, frame pointer or arg pointer.
* combine.c (combinable_i3pat): Do not make REG_DEAD notes for
	the stack pointer, frame pointer or arg pointer.

From-SVN: r4345
1993-05-05 17:34:48 -06:00
Richard Kenner
dc3e17add0 (num_sign_bit_copies, case SUBREG): Properly compute the number of
sign bit copies of SUBREGs of promoted objects.

From-SVN: r4341
1993-05-05 17:32:10 -04:00
Jim Wilson
a394b17b08 (distribute_notes, REG_DEAD case): Handle hard
registers which partially overlap the destination of the insn.

From-SVN: r4327
1993-05-04 16:54:16 -07:00
Jim Wilson
c6b3f1f25f (make_extraction): Move BYTES_BIG_ENDIAN != BITS_BIG_ENDIAN offset
correction after the offset calculation.

From-SVN: r4315
1993-05-03 17:16:21 -07:00
Richard Stallman
c141a106c0 (subst, case COMPARE): Use SELECT_CC_MODE even if HAVE_CC0.
From-SVN: r4291
1993-05-01 02:55:05 +00:00
Richard Kenner
adb7a1cbf2 (force_to_mode, simplify_comparison): Cast to unsiged HOST_WIDE_INT
instead of unsigned int.

From-SVN: r4258
1993-04-28 14:55:47 -04:00
Richard Kenner
568356af7b (reg_last_set_label, reg_last_set_table_tick, label_tick): Use int,
not short, for counting labels.
(combine_instructions): Allocate these vars as arrays of ints.

From-SVN: r4175
1993-04-17 17:43:26 -04:00
Richard Kenner
2afabb483c (record_value_for_reg): Properly set SUBST_LOW_CUID for last change;
otherwise won't get best value.

From-SVN: r4099
1993-04-12 15:23:44 -04:00
Richard Stallman
a66a10c707 (can_combine_p): Don't move an UNSPEC_VOLATILE.
From-SVN: r4085
1993-04-11 18:46:06 +00:00
Richard Kenner
0a5cbff6d4 (make_compound_operation, case xSHIFTRT):
Clean up code so more readable and don't restrict to case where C2 >= C1.
Pass correct (inner) code to recursive call.
(make_compound_operation, case SUBREG): Pass the code of our operand
to recursive call, not SUBREG, and make another recursive call after
calling force_to_mode.

From-SVN: r4082
1993-04-11 06:39:54 -04:00
Richard Kenner
55310dadb0 Include hard-reg-set.h.
(reg_nonzero_bits): Should be unsigned.
(reg_last_set_{mode,nonzero_bits,sign_bit_copies}): New variables.
(combine_instructions): Allocate and initialized them.
(nonzero_bits, num_sign_bit_copies, case REG): Use new variables to get
information on regs we've seen before.
(record_value_for_reg): Set new variables for register being modified.
(record_dead_and_set_regs): Invalidate regs clobbered by CALL_INSN.

From-SVN: r4051
1993-04-08 21:44:57 -04:00
Richard Kenner
f67850266f (force_to_mode...
(force_to_mode, case xSHIFT): Don't narrow the mode unless we can be
sure that the shift count is smaller than the size of the mode.

From-SVN: r4050
1993-04-08 21:39:46 -04:00
Richard Kenner
20fdd649e5 (simplify_comparison, case PLUS): Generalize simplification of (eq (plus A B) C).
(simplify_comparison, case PLUS): Generalize simplification
of (eq (plus A B) C).
(simplify_comparison, case MINUS): Add corresponding cases.

From-SVN: r3992
1993-04-03 17:34:45 -05:00
Richard Kenner
dbc131f3cc (record_dead_and_set_regs): Record death of all hard regs when a multi-reg object in hard regs dies.
(record_dead_and_set_regs): Record death of all hard regs when a multi-reg
object in hard regs dies.
(move_deaths): Handle the case when we only have to move part of a
multi-register death note.

From-SVN: r3930
1993-03-30 15:37:29 -05:00
Richard Kenner
9295e6afce (num_sign_bit_copies, case PLUS, case MULT): Replace occurrences of
HOST_BITS_PER_INT with HOST_BITS_PER_WIDE_INT.

From-SVN: r3920
1993-03-29 18:34:54 -05:00
Richard Kenner
280f58bab1 (make_compound_operation): Call recursively in the cases where we find a simplification.
(make_compound_operation): Call recursively in the cases where we find a
simplification.
(make_compound_operation, case SUBREG): If the recursive call changes the rtx
code and this is an appropriate SUBREG, use force_to_mode.

From-SVN: r3800
1993-03-20 07:11:32 -05:00
Richard Kenner
b8a68db6c2 Remove trash character introduced by last patch.
From-SVN: r3576
1993-03-01 17:13:39 -05:00
Richard Kenner
500c518b4d (subst, case NOT): If STORE_FLAG_VALUE==-1, treat an ASHIFTRT of just the sign bit as if it were an LT.
(subst, case NOT): If STORE_FLAG_VALUE==-1, treat an ASHIFTRT of just the
sign bit as if it were an LT.
(subst, case XOR): Likewise for STORE_FLAG_VALUE==1 and an LSHIFTRT.
(simplify_and_const_int, case LSHIFTRT): If shifting a sign bit copy,
start shift at the sign bit.
(simplify_shift_const): Likewise for ASHIFTRT.

(BYTE_LOADS_EXTEND): Fix typo when defining.
(setup_incoming_promotions): Set modes properly.

From-SVN: r3575
1993-03-01 07:32:27 -05:00
Jim Wilson
705c7b3b55 (set_nonzero_bits_and_sign_copies): Fix typo in paradoxical set dest handling.
From-SVN: r3532
1993-02-25 11:38:30 -08:00
Doug Evans
ee791cc341 * make setup_incoming_promotions static
From-SVN: r3468
1993-02-13 00:39:55 +00:00
Richard Kenner
7988fd364a (setup_incoming_promotions): New function.
(combine_instructions): Add calls to setup_incoming_promotions.

From-SVN: r3451
1993-02-09 18:45:34 -05:00
Richard Kenner
d79f08e0b8 (combine_instructions): When calling set_nonzero_bits_and_sign_copies,
set things up so that we can call get_last value; call
record_dead_and_set_regs in loop.
(set_nonzero_bits_and_sign_copies): Handle paradoxical SET.

From-SVN: r3444
1993-02-09 05:45:36 -05:00
Richard Kenner
fc06d7aaee (simplify_and_const_int): Never consider bits outside of MODE.
From-SVN: r3398
1993-01-31 17:44:48 -05:00
Richard Kenner
bef9925b88 (combine_instructions): Initialize undobuf in the event
`gen_rtx_combine' is called before `try_combine'.

From-SVN: r3359
1993-01-26 19:30:38 -05:00
Richard Stallman
d8a8a4da44 (apply_distributive_law): Don't mess with float arith.
From-SVN: r3317
1993-01-24 01:06:11 +00:00
Richard Kenner
441cedbd68 (combine_instructions): Clear reg_last_set_label.
From-SVN: r3275
1993-01-19 08:28:55 -05:00
Richard Kenner
8999a12e46 (make_extraction): Don't use POS < 0 as a flag that POS_RTX is to be used; instead use POS_RTX unless it is nonzero.
(make_extraction): Don't use POS < 0 as a flag that POS_RTX is to be
used; instead use POS_RTX unless it is nonzero.  If POS_RTX is a
constant, set POS and clear POS_RTX.
(make_compound_operation, make_field_assignment): Pass 0 for POS
instead of -1 when POS_RTX is nonzero.

From-SVN: r3178
1993-01-10 11:40:26 -05:00
Richard Kenner
c6dc70d681 (BYTE_LOAD_EXTEND, LOAD_EXTEND): New macros.
(subst, simplify_and_const_int, nonzero_bits, num_sign_bit_copies): Use them.
(subst, case SET): Make a SIGN_EXTEND instead of paradoxical SUBREG if
BYTE_LOADS_SIGN_EXTEND; previously only made ZERO_EXTEND.

From-SVN: r3160
1993-01-08 17:26:25 -05:00
Richard Kenner
951553afd9 Add a few missing HOST_WIDE_INT casts.
Rename references to `significant' bits to be `nonzero' bits;
specifically the following, but also local vars and comments:
(reg_nonzero_bits): Renamed from reg_significant.
(nonzero_bits): Renamed from significant_bits.
(nonzero_sign_valid): Renamed from significant_valid.
(set_nonzero_bits_and_sign_copies): Renamed from set_significant.

From-SVN: r2975
1992-12-28 07:44:42 -05:00
Richard Kenner
3bed814135 (simplify_comparison, case NEG): Replace large block of code with
equivalent call to num_sign_bit_copies.

From-SVN: r2972
1992-12-28 06:08:28 -05:00
Richard Kenner
6e2a4e3cfb (subst, case SET): Call recog_for_combine with OTHER_INSN, not
UNDOBUF.OTHER_INSN.

From-SVN: r2933
1992-12-27 18:29:11 -05:00
Richard Kenner
818b11b942 (subst, comparison cases): Expand any compound operation that is an operand...
(subst, comparison cases): Expand any compound operation that is an
operand; rerun subst on simplified result in one new case.

From-SVN: r2922
1992-12-27 06:52:16 -05:00
Richard Kenner
eae957a8b8 (gen_lowpart_for_combine): Allow MODE to be wider than a word in
restricted circumstances.

From-SVN: r2914
1992-12-26 18:11:20 -05:00
Tom Wood
381ee8af99 (try_combine): Allow for the case where I3 becomes an
unconditional jump when it is the last nonnote insn.

From-SVN: r2881
1992-12-16 10:03:21 +00:00
Jim Wilson
a70c61d9c4 (try_combine): Only use I2DEST as a scratch reg for
a split if it does not overlap any inputs of NEWPAT.

From-SVN: r2857
1992-12-10 12:52:48 -08:00
Richard Kenner
4090a6b33d (get_last_value): Never use value from later insn, even if reg is only
set once.

From-SVN: r2856
1992-12-10 12:45:01 -05:00
Richard Kenner
6752e8d2a4 (num_sign_bit_copies): Return 1 on failure, not 0.
Fix typo in last change; return 1 on failure, not BITWIDTH.

From-SVN: r2827
1992-12-01 10:42:55 -05:00
Richard Stallman
ac49a949d8 (subst, make_field_assignment, num_sign_bit_copies): Protect calls to significant_bits...
(subst, make_field_assignment, num_sign_bit_copies): Protect calls to
significant_bits; unless we only care if the result is a power of two,
don't call if mode size is wider than HOST_BITS_PER_WIDE_INT.
(extended_count, simplify_shift_const, simplify_comparison): Likewise.

From-SVN: r2824
1992-11-30 23:13:16 +00:00
Richard Stallman
d038420ea8 (num_sign_bit_copies): Fix 1-off error in PLUS case.
From-SVN: r2807
1992-11-26 17:06:44 +00:00
Richard Stallman
3e3ea975fc (make_extraction): When making a low part subreg of a reg,
use inner_mode, not is_mode.

(num_sign_bit_copies): Inhibit x-1 special case
when x is a paradoxical subreg.

From-SVN: r2802
1992-11-26 05:34:24 +00:00
Richard Stallman
2233179480 (simplify_comparison, case ASHIFTRT): mode_for_size
returns BLKmode on error, not VOIDmode.

From-SVN: r2761
1992-11-20 19:12:33 +00:00
Richard Stallman
f9e67232ef (simplify_shift_const):
For a subreg, require subreg_lowpart_p and not paradoxical.

From-SVN: r2664
1992-10-31 21:16:47 +00:00
Richard Stallman
6ba17bb091 (make_extraction): Fix paren error in `if' for INNER is reg.
From-SVN: r2652
1992-10-29 20:56:02 +00:00
Richard Stallman
5f96750d14 (can_combine_p): Don't don't substitute an expression
containing a register that will be clobbered in I3.

From-SVN: r2631
1992-10-28 20:15:51 +00:00
Richard Stallman
94b4b17a33 (make_extraction): Use is_mode, not inner_mode,
for BYTES_BIG_ENDIAN adjustment to offset for non-bitfield case.
Update is_mode when stripping subreg from around a mem.

From-SVN: r2556
1992-10-22 13:28:02 +00:00
Tom Wood
696223d7cd (subst): Don't change a conditional branch into a conditional move.
From-SVN: r2426
1992-10-13 10:01:01 +00:00
Richard Kenner
472fbdd1ca (try_combine): Save DEST of NI2PAT before calling recog_for_combine,
which might make it a PARALLEL.

From-SVN: r2411
1992-10-12 16:55:45 -04:00
Richard Kenner
e4ba89beb2 (try_combine): Fix typo in last change involving single_set.
From-SVN: r2409
1992-10-12 11:57:17 -04:00
Richard Kenner
780ed3aef3 (try_combine): Properly call single_set when validating the result of
a define_split.

From-SVN: r2406
1992-10-12 06:30:37 -04:00
Richard Kenner
26ecfc7614 (subst, case SUBREG): Don't make a new REG for stack, frame, or arg
pointer.

From-SVN: r2381
1992-10-09 07:29:23 -04:00
Richard Kenner
c3c2cb3741 (significant_bits, num_sign_bit_copies): Handle SUBREGs made for promoted
variables.

From-SVN: r2215
1992-09-23 19:23:19 -04:00
Richard Stallman
cc4710825d (make_extraction): Make test whether to use AND or
{SIGN,ZERO}_EXTRACT depend on UNSIGNEDP.

From-SVN: r2202
1992-09-21 13:33:38 +00:00
Richard Stallman
e64ff1039c (subst): Set and compare extend_op with 0, not NULL.
From-SVN: r2196
1992-09-21 03:08:45 +00:00
Richard Kenner
22609cbf24 (try_combine): Always call set_significant on new patterns, so don't call
just in split case.

(subst): Move sign extension inside arithmetic when we have a constant
computation inside another computation.

From-SVN: r2194
1992-09-20 20:05:40 -04:00
Richard Kenner
457816e2e2 (subst, simplify_and_const_int, significant_bits): Treat BYTE_LOADS_SIGN_EXTEND just like BYTE_LOADS_ZERO_EXTEND.
(subst, simplify_and_const_int, significant_bits): Treat
BYTE_LOADS_SIGN_EXTEND just like BYTE_LOADS_ZERO_EXTEND.
(num_sign_bit_copies, case MEM): New case for BYTE_LOADS_SIGN_EXTEND.
(num_sign_bit_copies, case SUBREG): Handle just like significant_bits.

From-SVN: r2189
1992-09-20 05:51:37 -04:00
Richard Kenner
1a26b032d0 (try_combine): When removing REG_UNUSED note, update reg_n_deaths.
Likewise, when making new REG_DEAD notes for distribute_notes.
(remove_death, move_deaths): Update reg_n_deaths.
(distribute_notes): When placing second REG_DEAD or REG_UNUSED note or
ignoring such a note, update reg_n_deaths.

(simplify_comparison, case ASHIFT): Fix typo.

(try_combine): The insns made by a DEFINE_SPLIT might contain a PARALLEL and
the call to recog_for_combine might add it.


(combine_instructions): Clear significant_valid at end of combine pass for
a function.
(find_split_point, case MEM): See if first operand of the PLUS that makes
up an address is complex.
(subst): Add missing arg to recursive calls when IF_THEN_ELSE is an arg
of an operator.
(subst, case IF_THEN_ELSE): Generalize code to propagate comparison result
into arms by using known_cond.
If an arm is the first operand of the comparison, make it the true arm.
Remove unneeded comparison when arms are identical.
Try to convert IF_THEN_ELSE to ABS, (neg (abs X)), [US]MIN, [US]MAX.
Convert (if_then_else (ne A 0) (OP X C) X) to (OP X (mult A C)).
(subst, case SET): If we don't have conditional moves, convert IF_THEN_ELSE
into logical operations.
(subst, case AND): Always make conditional moves, even if we don't support
them on the machine.
(known_cond, extended_count): New functions.
(gen_binary): For commutative operations, put constant last.

From-SVN: r2182
1992-09-19 15:53:26 -04:00
Richard Kenner
8888fada84 (try_combine): Make change missing from last modification to splitting
code.

From-SVN: r2059
1992-09-05 22:55:22 -04:00
Richard Kenner
d0dcc580cf (make_compound_operation...
(make_compound_operation, case ASHIFTRT): Add new code to
handle (ashiftrt (neg (ashift FOO C1) C2)) just like we currently
handle (ashiftrt (OP (ashiftrt FOO C1) C2) C2).

From-SVN: r2028
1992-09-02 06:37:38 -04:00
Richard Kenner
5874448344 (subst): When moving operation inside IF_THEN_ELSE, make a new rtx
instead of using SUBST due to sharing.

(simplify_comparison): Correct test for sign extension when trying to
widen comparison.

From-SVN: r1938
1992-08-24 06:48:59 -04:00
Richard Kenner
eeb43d32db (subst): Move up test for too many restarts.
If we restart, clear OP0_MODE since we don't know it.

From-SVN: r1926
1992-08-21 07:52:57 -04:00
Richard Kenner
f8d97cf472 Put include of stdio.h after GCC header files (for i860-stardent-sysv4).
From-SVN: r1905
1992-08-20 05:58:18 -04:00
Richard Kenner
53e33d9533 (subst, case AND): Only make IF_THEN_ELSE if conditional moves exist.
From-SVN: r1903
1992-08-19 21:33:19 -04:00
Richard Kenner
fe0cf571ec Correctly apply last change.
From-SVN: r1895
1992-08-19 07:32:24 -04:00
Richard Kenner
a687e8971c (simplify_comparison): Add a few more cases where we can do the
comparison in a wider mode.

(distribute_notes, REG_EQUAL): Don't put back a note with a
non-constant expression since it may no longer be valid.

From-SVN: r1894
1992-08-19 07:07:22 -04:00
Richard Stallman
89f1c7f257 (simplify_comparison): Rearrange conditional in SUBREG case.
From-SVN: r1886
1992-08-18 16:59:12 +00:00
Richard Kenner
7c046e4eb2 (struct undo, struct undo_int): Replace non-portable usage with some unions.
(SUBST, SUBST_INT, undo_all, gen_rtx_combine): Make consistent with
new definitions.

From-SVN: r1870
1992-08-17 07:35:04 -04:00
Richard Kenner
2fc9c644a4 (get_last_value): Don't go past a CODE_LABEL when searching for a
value.

From-SVN: r1857
1992-08-15 06:35:08 -04:00
Richard Kenner
d0ab8cd3f3 (reg_sign_bit_copies): New variable.
(combine_instructions): Initialize it.
(set_significant): Set it.
(try_combine): Set subst_low_cuid immediately before calling `subst' to
the INSN_CUID of the lowest insn involved in the call.   Change XOR with
out-of-range constant to (not (xor ...)).
Call both split_insns and find_split_point; pass extra parm to
find_split_point.
Record I2DEST's value if I2 now sets it; similarly for I1DEST.
(find_split_point): Add new arg INSN.
If AND'ing with a large single-bit constant and we only care about
equality with zero, replace with bit extraction.
Make two shifts for ZERO_EXTRACTs unless very narrow.
(subst): Move RESTART label earlier.
If we have a simple operation applied to IF_THEN_ELSE, move the operation
inside the two arms.
(subst, case SUBREG): Use force_to_mode.
(subst, case NOT): Change (not (xor X C)) to (xor X ~C).
(subst, case NEG): Remove (neg (abs X)); redundant.
Convert (neg (xor A 1)) to (plus A -1) if A is known to be 0 or 1.
(subst, case IF_THEN_ELSE): Simplify if an arm contains a register being
tested by substiting the known value.
Put constant integer in last arm if can reverse comparison.
(subst, case SET): Use gen_lowpart_for_combine.
(subst, case AND): Make IF_THEN_ELSE when appropriate.
(subst, case IOR): (ior A C) can sometimes be just C.
(subst, case XOR): Go back and restart when canonicalizing.
(subst, case ABS): Use num_sign_bit_copies.
(make_extraction): Call force_to_mode.
(make_compound_operation): Look at optabs rather that explicitly checking
for operations and assuming we have SImode.
Handle (ashiftrt (OP (ashift foo C1) C3) C2).
(force_to_mode): Only change mode of arithmetic if optab says we have
operation in that mode.
Remove unneeded ASHIFTRT; add handling for IF_THEN_ELSE.
(significant_bits, case NEG): Call num_sign_bit_copies.
(significant_bits, case ABS, case [US]{MIN,MAX}, IF_THEN_ELSE): New.
(num_sign_bit_copies): New function.
(simplify_shift_const): Remove ASHIFTRT if value is known -1 or 0.
Use num_sign_bit_copies to simplify (ashiftrt (ashift ...) ...)
and (ashiftrt (neg ...) ...).
Remove now redundant case when VAROP is a PLUS.
(simplify_comparison): If A is known to be -1 or 0, A != -1 is A == 0.
Simplify unsigned tests that really check the sign bit.
(simplify_comparison, case ASHIFTRT): Convert to LSHIFTRT if equality
comparison with zero.
(get_last_value): Check if the desired register is set in the
insn before the one whose INSN_CUID is subst_low_cuid.

From-SVN: r1746
1992-08-02 21:35:35 -04:00
Richard Kenner
58c8c59349 entered into RCS
From-SVN: r1731
1992-07-31 08:13:38 -04:00
Richard Kenner
510dd77e95 *** empty log message ***
From-SVN: r1730
1992-07-31 08:11:54 -04:00
Richard Kenner
df62f951d0 *** empty log message ***
From-SVN: r1611
1992-07-17 05:52:19 -04:00
Richard Kenner
60654f77ca *** empty log message ***
From-SVN: r1589
1992-07-15 06:46:46 -04:00
Charles Hannum
5f4f0e2294 *** empty log message ***
From-SVN: r1471
1992-07-06 20:04:00 +00:00
Richard Kenner
c767f54b88 *** empty log message ***
From-SVN: r1442
1992-07-05 14:02:06 -04:00
Richard Kenner
cc8765963d *** empty log message ***
From-SVN: r1428
1992-07-04 13:59:44 -04:00
Richard Kenner
02f4ada4da *** empty log message ***
From-SVN: r1316
1992-06-27 15:45:24 -04:00
Richard Kenner
42495ca044 *** empty log message ***
From-SVN: r1296
1992-06-26 07:06:07 -04:00
Richard Stallman
f72aed244a *** empty log message ***
From-SVN: r1263
1992-06-24 03:59:40 +00:00
Richard Kenner
77fa0940a0 *** empty log message ***
From-SVN: r1223
1992-06-20 06:51:46 -04:00
Richard Stallman
9797b9e8f0 *** empty log message ***
From-SVN: r1142
1992-06-02 21:35:27 +00:00
Richard Kenner
3f508ecac8 *** empty log message ***
From-SVN: r1128
1992-05-30 07:09:16 -04:00
Richard Kenner
4803a34aa2 *** empty log message ***
From-SVN: r1057
1992-05-22 17:22:42 -04:00
Jim Wilson
2b4bd1bc30 *** empty log message ***
From-SVN: r1023
1992-05-19 17:20:55 -07:00
Richard Stallman
754731823f *** empty log message ***
From-SVN: r997
1992-05-16 18:14:50 +00:00
Richard Kenner
28f6d3af8c *** empty log message ***
From-SVN: r864
1992-05-01 06:32:59 -04:00
Jim Wilson
bec2e35957 *** empty log message ***
From-SVN: r839
1992-04-27 09:44:10 -07:00
Richard Kenner
a4bde0b117 *** empty log message ***
From-SVN: r764
1992-04-17 15:32:22 -04:00
Richard Kenner
916f14f12b *** empty log message ***
From-SVN: r727
1992-04-11 20:30:30 -04:00
Richard Kenner
a7c9930489 *** empty log message ***
From-SVN: r689
1992-04-05 13:14:56 -04:00
Richard Stallman
5089e22e27 *** empty log message ***
From-SVN: r579
1992-03-23 19:42:32 +00:00
Richard Kenner
dfbe1b2f1f *** empty log message ***
From-SVN: r405
1992-03-06 18:32:19 -05:00
Richard Stallman
230d793d15 Initial revision
From-SVN: r357
1992-02-22 07:32:57 +00:00