summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
Commit message (Collapse)AuthorAgeFilesLines
* typo typo fixes fixeslaw1998-05-061-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19601 138bc75d-0d04-0410-961f-82ee72b054a4
* Wed May 6 06:35:38 1998 Robert Lipe <robertl@dgii.com>robertl1998-05-061-0/+1
| | | | | | | | | | | | | | * toplev.h: New file. Protypes for functions in toplev.c. * tree.h, rtl.h: Deleted protos for functions in toplev.c. * c-common.c, c-convert.c, c-decl.c, c-iterate.c, c-lex.c, c-parse.in, c-parse.y, c-pragma.c, c-typeck.c, calls.c, convert.c, dwarf2out.c, except.c, expr.c, final.c, fold-const.c, function.c, hash.c, profile.c, real.c, reg-stack.c, regclass.c, reload.c, reload1.c, stmt.c, stor-layout.c, tlink.c, tree.c, varasm.c: include it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19564 138bc75d-0d04-0410-961f-82ee72b054a4
* * Check in merge from gcc2. See ChangeLog.12 for details.law1998-05-051-22/+40
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19553 138bc75d-0d04-0410-961f-82ee72b054a4
* * fold-const.c (fold_convert): Fix typo.law1998-04-251-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19409 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree.h (sizetype_tab[2], sbitsizetype, ubitsizetype): Merge allrth1998-04-041-2/+2
| | | | | | | | | | of these into a single struct, with additional [us]sizetype entries. * stor-layout.c (set_sizetype): Initialize [us]sizetype. * fold-const.c (size_int_wide): Don't rely on sizetype_tab being an array. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18994 138bc75d-0d04-0410-961f-82ee72b054a4
* * Check in merge from gcc2. See ChangeLog.11 and ChangeLog.12law1998-04-041-12/+12
| | | | | | | | | for details. * haifa-sched.c: Mirror recent changes from gcc2. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18984 138bc75d-0d04-0410-961f-82ee72b054a4
* * fold-const.c optimze_bit_field_compare): Initialize rnbitpos,law1998-04-011-6/+6
| | | | | | | | | | | | | | | rnbitsize, rnmode and rinner. (make_range): Initialize type. (fold): Initialize arg0, arg1 and varop. * function.c (instantiate_virtual_regs_1): Initialize offset, regnoi and regnor. (expand_function_start): Initialize last_ptr. * stor-layout.c (layout_record): Initialize desired_align. (get_best_mode): Initialize unit. * tree.c (copy_node): Initialize length. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18943 138bc75d-0d04-0410-961f-82ee72b054a4
* * varasm.c (make_decl_rtl): Update the DECL_ASSEMBLER_NAME for ammitchel1998-04-011-0/+2
| | | | | | | | | entity in a local scope. * fold-const.c (fold): Call truthvalue_conversion for values which are folded to boolean type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18929 138bc75d-0d04-0410-961f-82ee72b054a4
* * fold-const.c (fold): Replace sign-extension of a zero extendedlaw1998-03-191-0/+7
| | | | | | | value by a single zero extension. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18713 138bc75d-0d04-0410-961f-82ee72b054a4
* Wed Mar 18 13:46:07 1998 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>rth1998-03-181-1/+9
| | | | | | | | * fold-const.c (operand_equal_for_comparison_p): See if equal when nop conversions are removed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18672 138bc75d-0d04-0410-961f-82ee72b054a4
* * fold-const.c (fold_range_test): Always return a value.law1998-03-011-2/+3
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18343 138bc75d-0d04-0410-961f-82ee72b054a4
* * fold-const.c: Include "system.h" to get stdlib.h and stdio.h.law1998-02-171-7/+8
| | | | | | | | | | (lshift_double): Add parentheses around + or - inside shift. (rshift_double): Likewise. (size_int_wide): Explicitly set type of `bit_p' to `int'. * Makefile.in (fold-const.o): Depend on system.h. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18057 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree.c (first_rtl_op): New fn.jason1998-02-161-3/+5
| | | | | | | | | | | | (unsave_expr_now): Use it. * print-tree.c (print_node): Likewise. * tree.c (has_cleanups): New fn. * fold-const.c (fold, case CLEANUP_POINT_EXPR): Use it. Be more conservative about pushing the cleanup point down. * tree.h: Declare them. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18023 138bc75d-0d04-0410-961f-82ee72b054a4
* * varasm.c (output_constant_pool): Bring back 'done' label insidelaw1998-02-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17973 138bc75d-0d04-0410-961f-82ee72b054a4
* * expr.c (get_inner_reference): Use sbitsizetype for type sizes.law1998-02-011-15/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | * fold-const.c (size_int): Replace with (size_int_wide). (make_bit_field_ref): Use bitsize_int for bit position. * stor-layout.c (sizetype): Delete. (sizetype_tab, sbitsizetype, ubitsizetype): Declare. (layout_record, layout_union, layout_type): Use bitsize_int for bit size. (set_sizetype): New function. (make_signed_type, make_unsigned_type): Use it. * c-decl.c (init_decl_processing): Likewise. * tree.h (size_int): Don't delcare, #define. (size_int_wide, sizetype_tab, sbitsize, ubitsize): Declare. (set_sizetype): Declare. (bitsize_int, size_int_2, BITS_PER_UNIT_LOG, sizetype, bitsizetype): Define. * c-typeck.c (c_sizeof, c_sizeof_nowarn, c_size_in_bytes): Convert result to sizetype. (really_start_incremental_init, push_init_level): Set type of constructor_bit_index to sbitsizetype. (push_init_level): Use unsigned arithmetic to determine padding. (output_init_element): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17577 138bc75d-0d04-0410-961f-82ee72b054a4
* * bitmap.c (bitmap_clear): Ensure `inline' is at the beginninglaw1997-12-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17158 138bc75d-0d04-0410-961f-82ee72b054a4
* * tree.c (build_range_type): Allow creation of ranges with no maximum.law1997-12-181-10/+35
| | | | | | | | | | | | | | * dbxout.c (dbxout_range_type): Handle missing TYPE_MAX_VALUE. * dwarf2out.c (add_subscript_info): Likewise. * dwarfout.c (subscript_data_attribute, byte_size_attribute): Likewise. * sdbout.c (plain_type_1): Likewise. * stmt.c (pushcase_range, all_cases_count, node_has_high_bound): Likewise. * fold-const.c (int_const_binop, fold_convert, make_range, fold): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17142 138bc75d-0d04-0410-961f-82ee72b054a4
* Another handful of gcc-2.8 changes (will it ever go out the door?).law1997-12-111-5/+7
| | | | | | | See ChangeLog.11 for details. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17040 138bc75d-0d04-0410-961f-82ee72b054a4
* Merge from gcc-2.8law1997-12-071-3/+3
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@16987 138bc75d-0d04-0410-961f-82ee72b054a4
* * fold-const.c (fold_truthop): Fix bug in last change.amylaar1997-11-141-2/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@16473 138bc75d-0d04-0410-961f-82ee72b054a4
* patch from paul eggert to fix -0.0/0.0 confusion that breaks glibcwilson1997-11-141-2/+2
| | | | | | | | | | | | | | * real.h (REAL_VALUES_IDENTICAL): New macro. * expr.c (is_zeros_p): Don't consider -0.0 to be all zeros. * fold-const.c (operand_equal_p): Don't consider -0.0 to be identical to 0.0. * tree.c (simple_cst_equal): Don't consider -0.0 to have the same tree structure as 0.0. * varasm.c (immed_real_const_1): Use new REAL_VALUES_IDENTICAL macro instead of doing it by hand. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@16472 138bc75d-0d04-0410-961f-82ee72b054a4
* * fold-const.c (fold_truthop): When changing a one-bit comparisonamylaar1997-11-131-2/+19
| | | | | | | | against zero into a comparison against mask, do a proper sign extension. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@16448 138bc75d-0d04-0410-961f-82ee72b054a4
* Update mainline egcs to gcc2 snapshot 971021.law1997-11-021-175/+265
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@16278 138bc75d-0d04-0410-961f-82ee72b054a4
* * fold-const.c (fold): For ((a * C1) / C3) or (((a * C1) + C2) / C3)law1997-10-281-0/+31
| | | | | | | | optimizations, look inside dividend to determine if the expression can be simplified by using EXACT_DIV_EXPR. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@16216 138bc75d-0d04-0410-961f-82ee72b054a4
* * fold-const (fold): Also simplify FLOOR_DIV_EXPR to EXACT_DIV_EXPRlaw1997-10-261-5/+4
| | | | | | | if the dividend is a multiple of the divisor. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@16181 138bc75d-0d04-0410-961f-82ee72b054a4
* * fold-const.c (make_range): Correctly handle cases of convertinglaw1997-09-231-23/+81
| | | | | | | | | | | | | from unsigned to signed type. * fold-const.c (merge_ranges): Make sure that if one range is subset of another, it will always be the second range. Correct (+,-) case to account for this. Brought over from gcc2; fixes sparc bug. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@15678 138bc75d-0d04-0410-961f-82ee72b054a4
* * pa.md (reload_peepholes): Make sure operand is a REG beforelaw1997-08-291-179/+155
| | | | | | | | | | examining REGNO. Allow general registers too. Fixes sporatic c-torture failure. Remove last change to fold-const.c and c-decl.c git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@15000 138bc75d-0d04-0410-961f-82ee72b054a4
* * c-decl.c (grokdeclarator): If array index or size calculationslaw1997-08-271-155/+179
| | | | | | | | | | overflow, issue an error. * fold-const.c (int_const_binop): New static function. (const_binop, size_binop): Call it. Brought over from the fsf. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@14967 138bc75d-0d04-0410-961f-82ee72b054a4
* * version.c: Bump for new snapshot.law1997-08-251-0/+113
| | | | | | | | | | | | | | | | | | | | | | * local-alloc.c (update_equiv_regs): All the target to reject promotion of some REG_EQUAL to REG_EQUIV notes. * pa.h (DONT_RECORD_EQUIVALENCE): Define. Fixes some c-torture failures, also improves generated code. * pa.c (secondary_reload_class): (mem (mem ... )) does not need secondary reloads. Fixes 094.fpppp/twldrv.f abort. * pa.c (hppa_builtin_saveregs): Emit a blockage insn after the store of the argument registers. Fixes c-torture failure. * fold-const.c (multiple_of_p): New function. (fold): Turn some cases of *_DIV_EXPR into EXACT_DIV_EXPR. One of the performance patches from the g77 folks. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@14915 138bc75d-0d04-0410-961f-82ee72b054a4
* (fold_range_test, fold): Avoid making SAVE_EXPR if at top level.kenner1997-07-271-11/+17
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@14541 138bc75d-0d04-0410-961f-82ee72b054a4
* Document force_fit_type as an entry point in the file.dje1997-06-261-3/+7
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@14324 138bc75d-0d04-0410-961f-82ee72b054a4
* xmerrill1997-06-091-6/+13
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@14210 138bc75d-0d04-0410-961f-82ee72b054a4
* (fold, truth_andor): Disable optimization for side effects on RHS.kenner1997-05-081-2/+4
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@14047 138bc75d-0d04-0410-961f-82ee72b054a4
* (operand_equal_p): Constants are not equal if there has been an overflow.kenner1997-04-211-2/+7
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13949 138bc75d-0d04-0410-961f-82ee72b054a4
* (fold): Don't assume a nonexplicit constant cannot equal an explicit one.kenner1997-02-151-1/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13650 138bc75d-0d04-0410-961f-82ee72b054a4
* (const_binop): Don't call size_int if low < 0.kenner1997-02-071-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13617 138bc75d-0d04-0410-961f-82ee72b054a4
* (fold): Don't make COND_EXPR when both expr and one part are comparisons.kenner1997-01-271-2/+4
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13553 138bc75d-0d04-0410-961f-82ee72b054a4
* (operand_equal_p): Rework to consider two expressions that havekenner1997-01-061-33/+57
| | | | | | | | embedded identical SAVE_EXPRs as equivalent; also handle some more cases. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13385 138bc75d-0d04-0410-961f-82ee72b054a4
* (const_binop): Rework to only make constants inkenner1997-01-051-68/+62
| | | | | | | | | one place; always use size_int if small enough and of sizetype. (size_int): Call force_fit_type. (fold): Avoid ever changing type of input tree. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13377 138bc75d-0d04-0410-961f-82ee72b054a4
* (merge_ranges): In (+,-) case, if lower bounds are the same the resultkenner1996-12-071-4/+3
| | | | | | | is always false. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13236 138bc75d-0d04-0410-961f-82ee72b054a4
* (optimize_bit_field_compare, decode_field_reference): Pass new arg tokenner1996-11-161-4/+6
| | | | | | | get_inner_reference. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13188 138bc75d-0d04-0410-961f-82ee72b054a4
* (unextend): Rewrite type conversions to avoid overflow.wilson1996-11-151-3/+13
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13165 138bc75d-0d04-0410-961f-82ee72b054a4
* (operand_equal_p): Do real comparison with REAL_VALUES_EQUAL.kenner1996-11-151-7/+29
| | | | | | | | | | | (make_range): Properly decide when to get TREE_TYPE of arg0. Handle EXP being an INTEGER_CST at end. (fold_range_test): Handle return of 0 from make_range. (fold, case TRUTH_AND_EXPR): Handle first arg of 0. (fold, case TRUTH_OR_EXPR): Handle first arg of 1. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13163 138bc75d-0d04-0410-961f-82ee72b054a4
* (range_binop): Set SNG1 to zero if ARG1 is a not a lower or upperkenner1996-11-151-1/+1
| | | | | | | bound. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13161 138bc75d-0d04-0410-961f-82ee72b054a4
* (merge_ranges): In (+,-) case, treat subset speciallywilson1996-11-121-4/+8
| | | | | | | if lower bounds are the same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13127 138bc75d-0d04-0410-961f-82ee72b054a4
* (const_binop, case *_DIV_EXPR): Don't do special sizetype case if akenner1996-11-071-9/+7
| | | | | | | constant overflows. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13106 138bc75d-0d04-0410-961f-82ee72b054a4
* (make_range): Don't merge unsigned case with range containing upper bound;kenner1996-11-011-15/+24
| | | | | | | | | | instead merge just with zero and convert a range with no upper bound to opposite one with no lower bound. (merge_ranges): In (+,-) case, don't treat subset specially if the upper bounds are the same; fix typo in others case here. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13090 138bc75d-0d04-0410-961f-82ee72b054a4
* * fold-const.c (make_range, case PLUS_EXPR): Correctlaw1996-11-011-3/+9
| | | | | | | normalization of an unsigned range that wraps around zero. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13089 138bc75d-0d04-0410-961f-82ee72b054a4
* (range_binop): Strip NOPs from result and verify it's an INTEGER_CST.kenner1996-10-301-9/+12
| | | | | | | (make_range, case BIT_NOT_EXPR): Fix typo in constant for PLUS_EXPR. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13079 138bc75d-0d04-0410-961f-82ee72b054a4
* * fold-const.c (merge_ranges): Fix thinko/typo.law1996-10-271-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13042 138bc75d-0d04-0410-961f-82ee72b054a4