summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
Commit message (Collapse)AuthorAgeFilesLines
* * 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
* (make_range, case PLUS_EXPR): Normalize an unsignedwilson1996-10-241-1/+9
| | | | | | | range that wraps around 0. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13030 138bc75d-0d04-0410-961f-82ee72b054a4
* (make_range, comparison cases): When making range for unsigned tokenner1996-10-241-6/+11
| | | | | | | merge in, use full range. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13027 138bc75d-0d04-0410-961f-82ee72b054a4
* (exact_real_inverse): Likewise, if no REAL_ARITHMETIC.kenner1996-10-231-5/+106
| | | | | | | | (fold, case RDIV_EXPR): Turn divide by constant into multiplication by the reciprocal, if optimizing and result is exact. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13004 138bc75d-0d04-0410-961f-82ee72b054a4
* * fold-const.c (make_range): Handle NULL operand 0dje1996-10-121-1/+1
| | | | | | | (like in BIND_EXPRs). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12957 138bc75d-0d04-0410-961f-82ee72b054a4
* (range_test): Function deleted.kenner1996-10-091-156/+461
| | | | | | | | | | (range_binop, make_range, build_range_check): New functions. (merge_ranges, fold_range_test): Likewise. (fold_truthop): No longer call range_test. (fold, case TRUTH_{AND,OR}{,IF}_EXPR): Call fold_range_test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12921 138bc75d-0d04-0410-961f-82ee72b054a4
* (const_binop): Add new arg, TYPE, to call to build_complex.kenner1996-09-291-25/+30
| | | | | | | (fold, case CONJ_EXPR, COMPLEX_EXPR): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12865 138bc75d-0d04-0410-961f-82ee72b054a4
* Fix error in comments.kenner1996-09-221-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12773 138bc75d-0d04-0410-961f-82ee72b054a4
* formatting tweaksmrs1996-07-031-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12390 138bc75d-0d04-0410-961f-82ee72b054a4
* (fold): Don't do anything with evaluated SAVE_EXPR.kenner1996-06-061-2/+3
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12185 138bc75d-0d04-0410-961f-82ee72b054a4
* (fold, case EQ_EXPR): When folding VAR++ = CONST, mask the new constkenner1996-05-161-0/+35
| | | | | | | if VAR is a bitfield reference; also for VAR--. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11976 138bc75d-0d04-0410-961f-82ee72b054a4
* (fold): Don't call convert to recreate tree nodesmerrill1996-04-301-1/+1
| | | | | | | we already have. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11908 138bc75d-0d04-0410-961f-82ee72b054a4
* (range_test): Don't convert hi_cst or lo_cst to unsigned when foldingkenner1996-04-141-8/+14
| | | | | | | signed range tests. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11768 138bc75d-0d04-0410-961f-82ee72b054a4
* (fold_convert): Add new arg to REAL_VALUE_FROM_INT.kenner1996-04-141-2/+3
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11766 138bc75d-0d04-0410-961f-82ee72b054a4
* (fold, case BIT_IOR_EXPR): Recognize rotates with variable count.kenner1996-03-251-16/+44
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11614 138bc75d-0d04-0410-961f-82ee72b054a4
* (fold, case *_DIV_EXPR): Ignore SAVE_EXPR if has RTL.kenner1996-03-021-2/+2
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11400 138bc75d-0d04-0410-961f-82ee72b054a4