summaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
Commit message (Collapse)AuthorAgeFilesLines
* fortran/tobi2005-04-061-5/+6
| | | | | | | | | | | * expr.c (gfc_check_assign): Don't allow NULL as rhs in a non-pointer assignment. testsuite/ * gfortran.dg/pr15754.f90: Change annotations to dg-error. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@97740 138bc75d-0d04-0410-961f-82ee72b054a4
* * expr.c (gfc_copy_shape_excluding): Change && to ||.kargl2005-03-041-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95891 138bc75d-0d04-0410-961f-82ee72b054a4
* * gfortran.h (gfc_expr): Move 'operator', 'op1', 'op2', and 'uop'tobi2005-02-231-46/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | fields into new struct 'op' inside the 'value' union. * arith.c (eval_intrinsic): Adapt all users. * dependency.c (gfc_check_dependency): Likewise. * dump-parse-tree.c (gfc_show_expr): Likewise. * expr.c (gfc_get_expr): Don't clear removed fields. (free_expr0, gfc_copy_expr, gfc_type_convert_binary, gfc_is_constant_expr, simplify_intrinsic_op, check_init_expr, check_intrinsic_op): Adapt to new field names. * interface.c (gfc_extend_expr): Likewise. Also explicitly nullify 'esym' and 'isym' fields of new function call. * iresolve.c (gfc_resolve_dot_product, gfc_resolve_matmul): Adapt to renamed structure fields. * matchexp.c (build_node, match_level_1, match_expr): Likewise. * module.c (mio_expr): Likewise. * resolve.c (resolve_operator): Likewise. (gfc_find_forall_index): Likewise. Only look through operands if dealing with EXPR_OP * trans-array.c (gfc_walk_op_expr): Adapt to renamed fields. * trans-expr.c (gfc_conv_unary_op, gfc_conv_power_op, gfc_conv_concat_op, gfc_conv_expr_op): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95471 138bc75d-0d04-0410-961f-82ee72b054a4
* * expr.c (gfc_type_convert_binary): Typo in comment.kargl2005-02-201-1/+1
| | | | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95307 138bc75d-0d04-0410-961f-82ee72b054a4
* fortran/tobi2005-02-081-11/+7
| | | | | | | | | | | | | | | | | * expr.c (gfc_copy_expr): Don't copy 'op1' and 'op2' for EXPR_SUBSTRING. (gfc_is_constant_expr): Check 'ref' to determine if substring reference is constant. (gfc_simplify_expr): Simplify 'ref' instead of 'op1' and 'op2'. (check_init_expr, check_restricted): Check 'ref' instead of 'op1' and 'op2'. * module.c (mio_expr): Read / write 'ref' instead of 'op1' and 'op2'. testsuite/ * gfortran.dg/substr_1.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94735 138bc75d-0d04-0410-961f-82ee72b054a4
* 2005-01-29 Steven G. Kargl <kargls@comcast.net>pbrook2005-01-291-0/+3
| | | | | | | | | | PR fortran/19589 * expr.c (gfc_check_assign): Check for conformance of logical operands testsuite/ * gfortran.dg/logical_data_1.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94409 138bc75d-0d04-0410-961f-82ee72b054a4
* * arith.c, array.c, check.c, decl.c, expr.c, f95-lang.c,kazu2005-01-181-1/+1
| | | | | | | | | | gfortran.h, interface.c, intrinsic.c, io.c, iresolve.c, match.c, matchexp.c, misc.c, module.c, options.c, parse.c, scanner.c, simplify.c, symbol.c, trans-array.c, trans-expr.c, trans-io.c, trans-stmt.c, trans.c: Update copyright. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@93830 138bc75d-0d04-0410-961f-82ee72b054a4
* * arith.c: Add system.h; remove string.hrth2005-01-031-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * decl.c: Ditto * matchexp.c: Ditto * parse.c: Ditto * resolve.c: Ditto * st.c: Ditto * check.c: Remove stdlib.h and stdarg.h * error.c: Remove stdlib.h, stdarg.h, stdio.h, string.h * expr.c: Add system.h; remove stdarg.h, stdio.h, and string.h * f95-lang.c: Add system.h; remove stdio.h * interface.c: Add system.h; remove stdlib.h and string.h * intrinsic.c: Remove stdarg.h, stdio.h, and string.h * io.c: Remove string.h * simplify.c: Ditto * match.c: Remove stdarg.h and string.h * misc.c: Update copyright; add system.h; remove stdlib.h, string.h, and sys/stat.h * module.c: Add system.h; remove string.h, stdio.h, errno.h, unistd.h, and time.h * option.c: Remove string.h and stdlib.h * primary.c: Ditto * scanner.c: Update copyright; add system.h; remove stdlib.h, stdio.h, string.h, and strings.h * symbol.c: Add system.h; remove stdlib.h, stdio.h, and string.h * trans-array.c: Remove stdio.h and gmp.h * trans-const.c: Ditto * trans-expr.c: Ditto * trans-io.c: Ditto * trans-stmt.c: Ditto * trans.c: Ditto * trans-intrinsic.c: Remove stdio.h and string.h git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92866 138bc75d-0d04-0410-961f-82ee72b054a4
* * arith.c, array.c, decl.c, expr.c, f95-lang.c, gfortran.h,kazu2004-11-081-1/+1
| | | | | | | | | | gfortranspec.c, interface.c, intrinsic.c, iresolve.c, match.c, module.c, parse.c, parse.h, primary.c, resolve.c, scanner.c, trans-array.c, trans-array.h, trans-expr.c, trans-intrinsic.c, trans-io.c, trans-stmt.c, trans.h: Fix comment formatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90266 138bc75d-0d04-0410-961f-82ee72b054a4
* fortran/tobi2004-08-291-0/+27
| | | | | | | | | | | | | | | | | | | | | | | PR fortran/13910 * decl.c (free_variable, free_value, gfc_free_data, var_list, var_element, top_var_list, match_data_constant, top_val_list, gfc_match_data): Move here from match.c. (match_old_style_init): New function. (variable_decl): Match old-style initialization. * expr.c (gfc_get_variable_expr): New function. * gfortran.h (gfc_get_variable_expr): Add prototype. * gfortran.texi: Start documentation for supported extensions. * match.c: Remove the functions moved to decl.c. * match.h (gfc_match_data): Move prototype to under decl.c. * symbol.c (gfc_find_sym_tree, gfc_find_symbol): Add/correct comments. testsuite/ PR fortran/13910 * gfortran.dg/oldstyle_1.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86729 138bc75d-0d04-0410-961f-82ee72b054a4
* * gfortran.h (gfc_default_*_kind): Remove prototypes, add externtobi2004-08-271-2/+2
| | | | | | | | | | | | | | | variable declaration of same name. * arith.c, check.c, decl.c, dump_parse_tree.c, expr.c, intrinsic.c, io.c, iresolve.c, match.c, options.c, primary.c, resolve.c, simplify.c, symbol.c, trans-const.c, trans-io.c: Replace all calls to gfc_default_*_kind with variable accesses. * trans-types.c: Same as above. (gfc_default_*_kind_1): Rename to gfc_default_*_kind, remove static qualifier. Replace all occurences. (gfc_default_*_kind): Remove functions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86662 138bc75d-0d04-0410-961f-82ee72b054a4
* fortran/tobi2004-08-251-0/+9
| | | | | | | | | | | | * expr.c (gfc_check_assign): Add comment. Add new warning. * trans-expr.c (gfc_conv_function_call): Correctly dereference result of pointer valued function when not in pointer assignment. testsuite/ * gfortran.dg/assignment_1.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86585 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-08-08 Victor Leikehman <lei@il.ibm.com>pbrook2004-08-081-0/+44
| | | | | | | | | | | | | | * simplify.c (gfc_simplify_shape): Bugfix. * expr.c (gfc_copy_shape_excluding): New function. * gfortran.h (gfc_get_shape): Bugfix. (gfc_copy_shape_excluding): Added declaration. * iresolve.c (gfc_resolve_all, gfc_resolve_any, gfc_resolve_count, gfc_resolve_cshift, gfc_resolve_eoshift, gfc_resolve_lbound, gfc_resolve_ubound, gfc_resolve_transpose): Added compile time resolution of shape. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85685 138bc75d-0d04-0410-961f-82ee72b054a4
* 2004-08-06 Steven G. Kargl <kargls@comcast.net>pbrook2004-08-061-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * arith.c: Add #define for model numbers. Remove global GMP variables. (natural_logarithm,common_logarithm,exponential,sine, cosine,arctangent,hypercos,hypersine ): Remove. (gfc_mpfr_to_mpz,gfc_set_model_kind,gfc_set_model): New functions. (arctangent2,gfc_arith_init_1,gfc_arith_done_1 gfc_check_real_range, gfc_constant_result, gfc_range_check, gfc_arith_uminus,gfc_arith_plus, gfc_arith_minus, gfc_arith_times, gfc_arith_divide,complex_reciprocal,complex_pow_ui, gfc_arith_power,gfc_compare_expr,compare_complex,gfc_convert_real, gfc_convert_complex,gfc_int2real,gfc_int2complex, gfc_real2int,gfc_real2real,gfc_real2complex, gfc_complex2int,gfc_complex2real,gfc_complex2complex): Convert GMP to MPFR, use new functions. * arith.h: Remove extern global variables. (natural_logarithm,common_logarithm,exponential, sine, cosine, arctangent,hypercos,hypersine): Remove prototypes. (arctangent2): Update prototype from GMP to MPFR. (gfc_mpfr_to_mpz, gfc_set_model_kind,gfc_set_model): Add prototypes. * dump-parse-tree.c (gfc_show_expr): Convert GMP to MPFR. * expr.c (free_expr0,gfc_copy_expr): Convert GMP to MPFR. * gfortran.h (GFC_REAL_BITS): Remove. (arith): Add ARITH_NAN. Include mpfr.h. Define GFC_RND_MODE. Rename GCC_GFORTRAN_H GFC_GFC_H. (gfc_expr): Convert GMP to MPFR. * module.c: Add arith.h, correct type in comment. (mio_gmp_real): Convert GMP to MPFR. (mio_expr): Use gfc_set_model_kind(). * primary.c: Update copyright date with 2004. (match_real_constant,match_const_complex_part): Convert GMP to MPFR. * simplify.c: Remove global GMP variables (gfc_simplify_abs,gfc_simplify_acos,gfc_simplify_aimag, gfc_simplify_aint,gfc_simplify_dint,gfc_simplify_anint, gfc_simplify_dnint,gfc_simplify_asin,gfc_simplify_atan, gfc_simplify_atan2,gfc_simplify_ceiling,simplify_cmplx, gfc_simplify_conjg,gfc_simplify_cos,gfc_simplify_cosh, gfc_simplify_dim,gfc_simplify_dprod,gfc_simplify_epsilon, gfc_simplify_exp,gfc_simplify_exponent,gfc_simplify_floor, gfc_simplify_fraction,gfc_simplify_huge,gfc_simplify_int, gfc_simplify_ifix,gfc_simplify_idint,gfc_simplify_log, gfc_simplify_log10,simplify_min_max,gfc_simplify_mod, gfc_simplify_modulo,gfc_simplify_nearest,simplify_nint, gfc_simplify_rrspacing,gfc_simplify_scale, gfc_simplify_set_exponent,gfc_simplify_sign,gfc_simplify_sin, gfc_simplify_sinh,gfc_simplify_spacing,gfc_simplify_sqrt, gfc_simplify_tan,gfc_simplify_tanh,gfc_simplify_tiny, gfc_simplify_init_1,gfc_simplify_done_1): Convert GMP to MPFR. Use new functions. * trans-const.c (gfc_conv_mpfr_to_tree): Rename from gfc_conv_mpf_to_tree. Convert it to use MPFR (gfc_conv_constant_to_tree): Use it. * trans-const.h: Update prototype for gfc_conv_mpfr_to_tree(). * trans-intrinsic.c: Add arith.h, remove gmp.h (gfc_conv_intrinsic_aint,gfc_conv_intrinsic_mod): Convert GMP to MPFR. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85652 138bc75d-0d04-0410-961f-82ee72b054a4
* * expr.c (gfc_check_assign_symbol): Handle pointer assignments.pbrook2004-07-121-2/+5
| | | | | | | | | | | | | | | * trans-array.c (gfc_trans_auto_array_allocation): Remove initialization code. * trans-common.c (create_common): Use gfc_conv_initializer. * trans-decl.c (gfc_get_symbol_decl): Use gfc_conv_initializer. * trans-expr.c (gfc_conv_initializer): New function. (gfc_conv_structure): Use it. * trans.h (gfc_conv_initializer): Add prototype. testsuite/ * gfortran.dg/pointer_init_1.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84542 138bc75d-0d04-0410-961f-82ee72b054a4
* PR fortran/16433tobi2004-07-111-1/+6
| | | | | | | * gfortran.dg/pr16433.f: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84519 138bc75d-0d04-0410-961f-82ee72b054a4
* * expr.c (gfc_check_pointer_assign): Verify that rank of the LHStobi2004-07-101-28/+31
| | | | | | | and RHS match. Return early if the RHS is NULL(). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84458 138bc75d-0d04-0410-961f-82ee72b054a4
* fortran/tobi2004-06-291-4/+13
| | | | | | | | | | | | | PR fortran/15963 * expr.c (check_intrinsic_op): Allow comparison of characters. Make logic easier. testsuite/ PR fortran/15963 * gfortran.fortran-torture/execute/initialization_1.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83859 138bc75d-0d04-0410-961f-82ee72b054a4
* * gfortran.h (gfc_current_locus, gfc_set_locus): Remove.tobi2004-05-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (gfc_current_locus): Declare new global variable. * scanner.c (gfc_current_locus, gfc_set_locus): Remove. (gfc_current_locus1): Rename ... (gfc_current_locus): ... to this. (gfc_at_eof, gfc_at_bol, gfc_at_eol, gfc_advance_line, next_char, skip_fixed_comments, skip_free_comments, gfc_next_char_literal, gfc_peek_char, gfc_gobble_whitespace, gfc_new_file): Use gfc_current_locus instead of gfc_current_locus1, gfc_set_locus() and gfc_current_locus(), respectively. * array.c (match_subscript, gfc_match_array_ref, match_array_list, match_array_cons_element, gfc_match_array_constructor): Read/modify gfc_current_locus instead of calling gfc_set_locus() and gfc_current_locus(). * decl.c (gfc_match_null, variable_decl, gfc_match_kind_spec, match_attr_spec, gfc_match_function_decl, gfc_match_end, attr_decl1, gfc_match_save): Likewise. * error.c (error_print, gfc_internal_error): Likewise. * expr.c (gfc_int_expr, gfc_default_logical_kind): Likewise. * interface.c (gfc_add_interface): Likewise. * io.c (gfc_match_format, match_dt_format, match_dt_element, match_io_iterator, match_io): Likewise. * match.c (gfc_match_space, gfc_match_eos, gfc_match_small_literal_int, gfc_match_st_label, gfc_match_strings, gfc_match_name, gfc_match_iterator, gfc_match_char, gfc_match, gfc_match_assignment, gfc_match_pointer_assignment, gfc_match_if, gfc_match_do, gfc_match_nullify, gfc_match_call, match_implicit_range, gfc_match_implicit, gfc_match_data, match_case_selector, gfc_match_case, match_forall_iterator): Likewise. * matchexp.c (gfc_match_defined_op_name, next_operator, match_level_1, match_mult_operand, match_ext_mult_operand, match_add_operand, match_ext_add_operand, match_level_2, match_level_3, match_level_4, match_and_operand, match_or_operand, match_equiv_operand, match_level_5, gfc_match_expr): Likewise. * module.c (gfc_match_use, mio_array_ref, mio_expr): Likewise. * parse.c (match_word, decode_statement, next_free, next_fixed, add_statement, verify_st_order, parse_if_block, gfc_parse_file): Likewise. * primary.c (match_digits, match_integer_constant, match_boz_constant, match_real_constant, match_substring, next_string_char, match_charkind_name, match_string_constant, match_logical_constant, match_const_complex_part, match_complex_constant, match_actual_arg, match_keyword_arg, gfc_match_actual_arglist, gfc_match_structure_constructor, gfc_match_rvalue, gfc_match_variable): Likewise. * st.c (gfc_get_code): Likewise. * symbol.c (check_conflict, check_used, check_done, duplicate_attr, add_flavor, gfc_add_procedure, gfc_add_intent, gfc_add_access, gfc_add_explicit_interface, gfc_add_type, gfc_add_component, gfc_reference_st_label, gfc_new_symbol): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82320 138bc75d-0d04-0410-961f-82ee72b054a4
* * expr.c (check_inquiry): Remove bogus tests.pbrook2004-05-231-9/+0
| | | | | | | | testsuite/ * gfortran.fortran-torture/compile/inquiry_1.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82177 138bc75d-0d04-0410-961f-82ee72b054a4
* PR fortran/13773pbrook2004-05-231-89/+7
| | | | | | | | | * expr.c (restricted_args): Remove redundant checks/argument. (external_spec_function): Update to match. (restricted_intrinsic): Rewrite. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82166 138bc75d-0d04-0410-961f-82ee72b054a4
* PR fortran/13930pbrook2004-05-181-0/+43
| | | | | | | | | | | | | | | * decl.c (add_init_expr_to_sym): Remove incorrect check. (default_initializer): Move to expr.c. (variable_decl): Don't assign default initializer to variables. * expr.c (gfc_default_initializer): Move to here. * gfortran.h (gfc_default_initializer): Add prototype. * resolve.c (resolve_symbol): Check for illegal initializers. Assign default initializer. testsuite/ * gfortran.fortran-torture/execute/der_init_4.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81966 138bc75d-0d04-0410-961f-82ee72b054a4
* * Make-lang.in, arith.c, arith.h, array.c, bbt.c, check.c,tobi2004-05-141-13/+14
| | | | | | | | | | | | | | | | | | decl.c, dependency.c, dependency.h, dump-parse-tree.c, error.c, expr.c, f95-lang.c, gfortran.h, interface.c, intrinsic.c, intrinsic.h, io.c, iresolve.c, lang-specs.h, match.c, match.h, matchexp.c, misc.c, module.c, options.c, parse.c, parse.h, primary.c, resolve.c, scanner.c, simplify.c, st.c, symbol.c, trans-array.c, trans-array.h, trans-common.c, trans-const.c, trans-const.h, trans-decl.c, trans-expr.c, trans-intrinsic.c, trans-io.c, trans-stmt.c, trans-stmt.h, trans-types.c, trans-types.h, trans.c, trans.h: Update copyright years and boilerplate. * data.c: Likewise, also removed two whitespace-only lines. * gfortranspec.c, lang.opt: Update copyright years. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81839 138bc75d-0d04-0410-961f-82ee72b054a4
* Merge tree-ssa-20020619-branch into mainline.dnovillo2004-05-131-0/+1954
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81764 138bc75d-0d04-0410-961f-82ee72b054a4