diff -Nrcpad gcc-4.6.0/gcc/fortran/ChangeLog gcc-4.6.1/gcc/fortran/ChangeLog *** gcc-4.6.0/gcc/fortran/ChangeLog Fri Mar 25 16:54:10 2011 --- gcc-4.6.1/gcc/fortran/ChangeLog Mon Jun 27 10:02:19 2011 *************** *** 1,3 **** --- 1,170 ---- + 2011-06-27 Release Manager + + * GCC 4.6.1 released. + + 2011-06-21 Janus Weil + + PR fortran/49112 + * class.c (gfc_find_derived_vtab): Make vtab and default initialization + symbols SAVE_IMPLICIT. + + 2011-06-19 Janus Weil + + PR fortran/47601 + * module.c (mio_component_ref): Handle components of extended types. + * symbol.c (gfc_find_component): Return if sym is NULL. + + PR fortran/48699 + * check.c (gfc_check_move_alloc): If 'TO' argument is polymorphic, + make sure the vtab is present. + + PR fortran/49074 + * interface.c (gfc_extend_assign): Propagate the locus from the + assignment to the type-bound procedure call. + + PR fortran/49417 + * module.c (mio_component): Make sure the 'class_ok' attribute is set + for use-associated CLASS components. + * parse.c (parse_derived): Check for 'class_ok' attribute. + * resolve.c (resolve_fl_derived): Ditto. + + 2011-06-17 Tobias Burnus + + PR fortran/49324 + * trans-expr.c (gfc_trans_assignment_1): Tell + gfc_trans_scalar_assign to also deep-copy RHS nonvariables + with allocatable components. + * trans-array.c (gfc_conv_expr_descriptor): Ditto. + + 2011-06-06 Asher Langton + + PR fortran/49268 + * trans-decl.c (gfc_trans_deferred_vars): Treat assumed-size Cray + pointees as AS_EXPLICIT. + + 2011-06-02 Steven G. Kargl + + PR fortran/49265 + * decl.c (gfc_match_modproc): Allow for a double colon in a module + procedure statement. + * parse.c ( decode_statement): Deal with whitespace around :: in + gfc_match_modproc. + + 2011-05-31 Thomas Koenig + + Backport from trunk + PR fortran/45786 + * interface.c (gfc_equivalent_op): New function. + (gfc_check_interface): Use gfc_equivalent_op instead + of switch statement. + * decl.c (access_attr_decl): Also set access to an + equivalent operator. + + 2011-05-26 Paul Thomas + Thomas Koenig + + PR fortran/48955 + * trans-expr.c (gfc_trans_assignment_1): GFC_REVERSE_NOT_SET + changed to GFC_ENABLE_REVERSE. + * trans-array.c (gfc_init_loopinfo): GFC_CANNOT_REVERSE changed + to GFC_INHIBIT_REVERSE. + * gfortran.h : Enum gfc_reverse is now GFC_ENABLE_REVERSE, + GFC_FORWARD_SET, GFC_REVERSE_SET and GFC_INHIBIT_REVERSE. + * dependency.c (gfc_dep_resolver): Change names for elements of + gfc_reverse as necessary. Change the logic so that forward + dependences are remembered as well as backward ones. When both + have appeared, force a temporary. + + 2011-05-11 Tobias Burnus + + PR fortran/48889 + * expr.c (gfc_is_constant_expr): Use e->value.function.esym + instead of e->symtree->n.sym, if available. + + 2011-05-04 Steven G. Kargl + + PR fortran/48720 + * gfortran.texi: Document the 'Q' exponent-letter extension. + * invoke.texi: Document -Wreal-q-constant. + * lang.opt: Add -Wreal-q-constant option. + * gfortran.h: Add warn_real_q_constant to option struct. + * primary.c (match_real_constant): Use it. Accept 'Q' as + exponent-letter for REAL(16) real-literal-constant with a + fallback to REAL(10) or error if REAL(10) is not available. + * options.c (gfc_init_options, set_Wall) Set it. + (gfc_handle_option): Handle new option. + + 2011-04-30 Paul Thomas + + PR fortran/48462 + PR fortran/48746 + * trans-expr.c ( arrayfunc_assign_needs_temporary): Need a temp + if automatic reallocation on assignement is active, the lhs is a + target and the rhs an intrinsic function. + (realloc_lhs_bounds_for_intrinsic_call): Rename as next. + (fcncall_realloc_result): Renamed version of above function. + Free the original descriptor data after the function call.Set the bounds and the + offset so that the lbounds are one. + (gfc_trans_arrayfunc_assign): Call renamed function. + + 2011-04-29 Tobias Burnus + + PR fortran/48810 + * resolve.c (resolve_typebound_generic_call): Don't check access + flags of the specific function. + + PR fortran/48800 + * resolve.c (resolve_formal_arglist): Don't change AS_DEFERRED + to AS_ASSUMED_SHAPE for function results. + (resolve_fl_var_and_proc): Print also for function results with + AS_DEFERRED an error, if they are not a pointer or allocatable. + (resolve_types): Make sure arguments of procedures in interface + blocks are resolved. + + 2011-04-28 Tobias Burnus + + PR fortran/48112 + * resolve.c (resolve_fl_var_and_proc): Print diagnostic of + function results only once. + (resolve_symbol): Always resolve function results. + + PR fortran/48279 + * expr.c (gfc_check_vardef_context): Fix handling of generic + EXPR_FUNCTION. + * interface.c (check_interface0): Reject internal functions + in generic interfaces, unless -std=gnu. + + 2011-04-28 Tobias Burnus + + PR fortran/48788 + * resolve.c (resolve_global_procedure): Error recovery - + avoid segfault for (non)character-returning functions. + + 2011-04-26 Tobias Burnus + + PR fortran/48588 + * parse.c (resolve_all_program_units): Skip modules. + (translate_all_program_units): Handle modules. + (gfc_parse_file): Defer code generation for modules. + * module.c (fix_mio_expr): Commit created symbol. + + 2011-04-13 Paul Thomas + + PR fortran/48360 + PR fortran/48456 + * trans-array.c (get_std_lbound): For derived type variables + return array valued component lbound. + + 2011-04-05 Duncan Sands + + * f95-lang.c (build_builtin_fntypes): Swap frexp parameter types. + + 2011-04-04 Janus Weil + + PR fortran/48291 + * class.c (get_unique_hashed_string): Adjust maximum allowable length + for unique type string. + 2011-03-25 Release Manager * GCC 4.6.0 released. diff -Nrcpad gcc-4.6.0/gcc/fortran/check.c gcc-4.6.1/gcc/fortran/check.c *** gcc-4.6.0/gcc/fortran/check.c Sat Jan 29 17:36:18 2011 --- gcc-4.6.1/gcc/fortran/check.c Sun Jun 19 21:05:18 2011 *************** gfc_check_move_alloc (gfc_expr *from, gf *** 2582,2587 **** --- 2582,2591 ---- return FAILURE; } + /* CLASS arguments: Make sure the vtab is present. */ + if (to->ts.type == BT_CLASS) + gfc_find_derived_vtab (from->ts.u.derived); + return SUCCESS; } diff -Nrcpad gcc-4.6.0/gcc/fortran/class.c gcc-4.6.1/gcc/fortran/class.c *** gcc-4.6.0/gcc/fortran/class.c Wed Feb 16 20:51:56 2011 --- gcc-4.6.1/gcc/fortran/class.c Tue Jun 21 12:20:28 2011 *************** get_unique_hashed_string (char *string, *** 137,145 **** { char tmp[2*GFC_MAX_SYMBOL_LEN+2]; get_unique_type_string (&tmp[0], derived); ! /* If string is too long, use hash value in hex representation ! (allow for extra decoration, cf. gfc_build_class_symbol)*/ ! if (strlen (tmp) > GFC_MAX_SYMBOL_LEN - 10) { int h = gfc_hash_value (derived); sprintf (string, "%X", h); --- 137,145 ---- { char tmp[2*GFC_MAX_SYMBOL_LEN+2]; get_unique_type_string (&tmp[0], derived); ! /* If string is too long, use hash value in hex representation (allow for ! extra decoration, cf. gfc_build_class_symbol & gfc_find_derived_vtab). */ ! if (strlen (tmp) > GFC_MAX_SYMBOL_LEN - 11) { int h = gfc_hash_value (derived); sprintf (string, "%X", h); *************** gfc_find_derived_vtab (gfc_symbol *deriv *** 428,434 **** &gfc_current_locus) == FAILURE) goto cleanup; vtab->attr.target = 1; ! vtab->attr.save = SAVE_EXPLICIT; vtab->attr.vtab = 1; vtab->attr.access = ACCESS_PUBLIC; gfc_set_sym_referenced (vtab); --- 428,434 ---- &gfc_current_locus) == FAILURE) goto cleanup; vtab->attr.target = 1; ! vtab->attr.save = SAVE_IMPLICIT; vtab->attr.vtab = 1; vtab->attr.access = ACCESS_PUBLIC; gfc_set_sym_referenced (vtab); *************** gfc_find_derived_vtab (gfc_symbol *deriv *** 516,522 **** sprintf (name, "__def_init_%s", tname); gfc_get_symbol (name, ns, &def_init); def_init->attr.target = 1; ! def_init->attr.save = SAVE_EXPLICIT; def_init->attr.access = ACCESS_PUBLIC; def_init->attr.flavor = FL_VARIABLE; gfc_set_sym_referenced (def_init); --- 516,522 ---- sprintf (name, "__def_init_%s", tname); gfc_get_symbol (name, ns, &def_init); def_init->attr.target = 1; ! def_init->attr.save = SAVE_IMPLICIT; def_init->attr.access = ACCESS_PUBLIC; def_init->attr.flavor = FL_VARIABLE; gfc_set_sym_referenced (def_init); diff -Nrcpad gcc-4.6.0/gcc/fortran/decl.c gcc-4.6.1/gcc/fortran/decl.c *** gcc-4.6.0/gcc/fortran/decl.c Wed Feb 16 20:51:56 2011 --- gcc-4.6.1/gcc/fortran/decl.c Thu Jun 2 19:53:02 2011 *************** access_attr_decl (gfc_statement st) *** 6467,6474 **** --- 6467,6485 ---- case INTERFACE_INTRINSIC_OP: if (gfc_current_ns->operator_access[op] == ACCESS_UNKNOWN) { + gfc_intrinsic_op other_op; + gfc_current_ns->operator_access[op] = (st == ST_PUBLIC) ? ACCESS_PUBLIC : ACCESS_PRIVATE; + + /* Handle the case if there is another op with the same + function, for INTRINSIC_EQ vs. INTRINSIC_EQ_OS and so on. */ + other_op = gfc_equivalent_op (op); + + if (other_op != INTRINSIC_NONE) + gfc_current_ns->operator_access[other_op] = + (st == ST_PUBLIC) ? ACCESS_PUBLIC : ACCESS_PRIVATE; + } else { *************** gfc_match_modproc (void) *** 6994,6999 **** --- 7005,7011 ---- char name[GFC_MAX_SYMBOL_LEN + 1]; gfc_symbol *sym; match m; + locus old_locus; gfc_namespace *module_ns; gfc_interface *old_interface_head, *interface; *************** gfc_match_modproc (void) *** 7022,7031 **** end up with a syntax error and need to recover. */ old_interface_head = gfc_current_interface_head (); for (;;) { - locus old_locus = gfc_current_locus; bool last = false; m = gfc_match_name (name); if (m == MATCH_NO) --- 7034,7056 ---- end up with a syntax error and need to recover. */ old_interface_head = gfc_current_interface_head (); + /* Check if the F2008 optional double colon appears. */ + gfc_gobble_whitespace (); + old_locus = gfc_current_locus; + if (gfc_match ("::") == MATCH_YES) + { + if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: double colon in " + "MODULE PROCEDURE statement at %L", &old_locus) + == FAILURE) + return MATCH_ERROR; + } + else + gfc_current_locus = old_locus; + for (;;) { bool last = false; + old_locus = gfc_current_locus; m = gfc_match_name (name); if (m == MATCH_NO) *************** gfc_match_modproc (void) *** 7037,7042 **** --- 7062,7068 ---- current namespace. */ if (gfc_match_eos () == MATCH_YES) last = true; + if (!last && gfc_match_char (',') != MATCH_YES) goto syntax; diff -Nrcpad gcc-4.6.0/gcc/fortran/dependency.c gcc-4.6.1/gcc/fortran/dependency.c *** gcc-4.6.0/gcc/fortran/dependency.c Fri Dec 3 10:35:12 2010 --- gcc-4.6.1/gcc/fortran/dependency.c Thu May 26 20:49:07 2011 *************** gfc_dep_resolver (gfc_ref *lref, gfc_ref *** 1793,1799 **** /* Now deal with the loop reversal logic: This only works on ranges and is activated by setting ! reverse[n] == GFC_CAN_REVERSE The ability to reverse or not is set by previous conditions in this dimension. If reversal is not activated, the value GFC_DEP_BACKWARD is reset to GFC_DEP_OVERLAP. */ --- 1793,1799 ---- /* Now deal with the loop reversal logic: This only works on ranges and is activated by setting ! reverse[n] == GFC_ENABLE_REVERSE The ability to reverse or not is set by previous conditions in this dimension. If reversal is not activated, the value GFC_DEP_BACKWARD is reset to GFC_DEP_OVERLAP. */ *************** gfc_dep_resolver (gfc_ref *lref, gfc_ref *** 1801,1825 **** && lref->u.ar.dimen_type[n] == DIMEN_RANGE) { /* Set reverse if backward dependence and not inhibited. */ ! if (reverse && reverse[n] != GFC_CANNOT_REVERSE) reverse[n] = (this_dep == GFC_DEP_BACKWARD) ? GFC_REVERSE_SET : reverse[n]; ! /* Inhibit loop reversal if dependence not compatible. */ ! if (reverse && reverse[n] != GFC_REVERSE_NOT_SET ! && this_dep != GFC_DEP_EQUAL ! && this_dep != GFC_DEP_BACKWARD ! && this_dep != GFC_DEP_NODEP) { ! reverse[n] = GFC_CANNOT_REVERSE; ! if (this_dep != GFC_DEP_FORWARD) ! this_dep = GFC_DEP_OVERLAP; } /* If no intention of reversing or reversing is explicitly inhibited, convert backward dependence to overlap. */ ! if (this_dep == GFC_DEP_BACKWARD ! && (reverse == NULL || reverse[n] == GFC_CANNOT_REVERSE)) this_dep = GFC_DEP_OVERLAP; } --- 1801,1834 ---- && lref->u.ar.dimen_type[n] == DIMEN_RANGE) { /* Set reverse if backward dependence and not inhibited. */ ! if (reverse && reverse[n] == GFC_ENABLE_REVERSE) reverse[n] = (this_dep == GFC_DEP_BACKWARD) ? GFC_REVERSE_SET : reverse[n]; ! /* Set forward if forward dependence and not inhibited. */ ! if (reverse && reverse[n] == GFC_ENABLE_REVERSE) ! reverse[n] = (this_dep == GFC_DEP_FORWARD) ? ! GFC_FORWARD_SET : reverse[n]; ! ! /* Flag up overlap if dependence not compatible with ! the overall state of the expression. */ ! if (reverse && reverse[n] == GFC_REVERSE_SET ! && this_dep == GFC_DEP_FORWARD) { ! reverse[n] = GFC_INHIBIT_REVERSE; ! this_dep = GFC_DEP_OVERLAP; ! } ! else if (reverse && reverse[n] == GFC_FORWARD_SET ! && this_dep == GFC_DEP_BACKWARD) ! { ! reverse[n] = GFC_INHIBIT_REVERSE; ! this_dep = GFC_DEP_OVERLAP; } /* If no intention of reversing or reversing is explicitly inhibited, convert backward dependence to overlap. */ ! if ((reverse == NULL && this_dep == GFC_DEP_BACKWARD) ! || (reverse != NULL && reverse[n] == GFC_INHIBIT_REVERSE)) this_dep = GFC_DEP_OVERLAP; } diff -Nrcpad gcc-4.6.0/gcc/fortran/expr.c gcc-4.6.1/gcc/fortran/expr.c *** gcc-4.6.0/gcc/fortran/expr.c Sun Mar 6 20:15:38 2011 --- gcc-4.6.1/gcc/fortran/expr.c Wed May 11 20:31:14 2011 *************** gfc_is_constant_expr (gfc_expr *e) *** 894,899 **** --- 894,902 ---- case EXPR_FUNCTION: case EXPR_PPC: case EXPR_COMPCALL: + gcc_assert (e->symtree || e->value.function.esym + || e->value.function.isym); + /* Call to intrinsic with at least one argument. */ if (e->value.function.isym && e->value.function.actual) { *************** gfc_is_constant_expr (gfc_expr *e) *** 902,914 **** return 0; } - /* Make sure we have a symbol. */ - gcc_assert (e->symtree); - - sym = e->symtree->n.sym; - /* Specification functions are constant. */ /* F95, 7.1.6.2; F2003, 7.1.7 */ if (sym && sym->attr.function && sym->attr.pure --- 905,918 ---- return 0; } /* Specification functions are constant. */ /* F95, 7.1.6.2; F2003, 7.1.7 */ + sym = NULL; + if (e->symtree) + sym = e->symtree->n.sym; + if (e->value.function.esym) + sym = e->value.function.esym; + if (sym && sym->attr.function && sym->attr.pure *************** gfc_build_intrinsic_call (const char* na *** 4367,4381 **** gfc_try gfc_check_vardef_context (gfc_expr* e, bool pointer, const char* context) { ! gfc_symbol* sym; bool is_pointer; bool check_intentin; bool ptr_component; symbol_attribute attr; gfc_ref* ref; if (!pointer && e->expr_type == EXPR_FUNCTION ! && e->symtree->n.sym->result->attr.pointer) { if (!(gfc_option.allow_std & GFC_STD_F2008)) { --- 4371,4396 ---- gfc_try gfc_check_vardef_context (gfc_expr* e, bool pointer, const char* context) { ! gfc_symbol* sym = NULL; bool is_pointer; bool check_intentin; bool ptr_component; symbol_attribute attr; gfc_ref* ref; + if (e->expr_type == EXPR_VARIABLE) + { + gcc_assert (e->symtree); + sym = e->symtree->n.sym; + } + else if (e->expr_type == EXPR_FUNCTION) + { + gcc_assert (e->symtree); + sym = e->value.function.esym ? e->value.function.esym : e->symtree->n.sym; + } + if (!pointer && e->expr_type == EXPR_FUNCTION ! && sym->result->attr.pointer) { if (!(gfc_option.allow_std & GFC_STD_F2008)) { *************** gfc_check_vardef_context (gfc_expr* e, b *** 4393,4401 **** return FAILURE; } - gcc_assert (e->symtree); - sym = e->symtree->n.sym; - if (!pointer && sym->attr.flavor == FL_PARAMETER) { if (context) --- 4408,4413 ---- diff -Nrcpad gcc-4.6.0/gcc/fortran/f95-lang.c gcc-4.6.1/gcc/fortran/f95-lang.c *** gcc-4.6.0/gcc/fortran/f95-lang.c Thu Feb 24 09:53:26 2011 --- gcc-4.6.1/gcc/fortran/f95-lang.c Tue Apr 5 08:13:16 2011 *************** build_builtin_fntypes (tree *fntype, tre *** 695,704 **** type, integer_type_node, NULL_TREE); /* type (*) (void) */ fntype[3] = build_function_type_list (type, NULL_TREE); ! /* type (*) (&int, type) */ ! fntype[4] = build_function_type_list (type, build_pointer_type (integer_type_node), - type, NULL_TREE); /* type (*) (int, type) */ fntype[5] = build_function_type_list (type, --- 695,703 ---- type, integer_type_node, NULL_TREE); /* type (*) (void) */ fntype[3] = build_function_type_list (type, NULL_TREE); ! /* type (*) (type, &int) */ ! fntype[4] = build_function_type_list (type, type, build_pointer_type (integer_type_node), NULL_TREE); /* type (*) (int, type) */ fntype[5] = build_function_type_list (type, diff -Nrcpad gcc-4.6.0/gcc/fortran/gfortran.h gcc-4.6.1/gcc/fortran/gfortran.h *** gcc-4.6.0/gcc/fortran/gfortran.h Fri Feb 18 19:52:16 2011 --- gcc-4.6.1/gcc/fortran/gfortran.h Tue May 31 21:37:01 2011 *************** gfc_fcoarray; *** 578,587 **** typedef enum { ! GFC_REVERSE_NOT_SET, GFC_REVERSE_SET, ! GFC_CAN_REVERSE, ! GFC_CANNOT_REVERSE } gfc_reverse; --- 578,587 ---- typedef enum { ! GFC_ENABLE_REVERSE, ! GFC_FORWARD_SET, GFC_REVERSE_SET, ! GFC_INHIBIT_REVERSE } gfc_reverse; *************** typedef struct *** 2190,2195 **** --- 2190,2196 ---- int warn_character_truncation; int warn_array_temp; int warn_align_commons; + int warn_real_q_constant; int warn_unused_dummy_argument; int max_errors; *************** gfc_symtree* gfc_find_sym_in_symtree (gf *** 2815,2820 **** --- 2816,2822 ---- bool gfc_arglist_matches_symbol (gfc_actual_arglist**, gfc_symbol*); bool gfc_check_operator_interface (gfc_symbol*, gfc_intrinsic_op, locus); int gfc_has_vector_subscript (gfc_expr*); + gfc_intrinsic_op gfc_equivalent_op (gfc_intrinsic_op); /* io.c */ extern gfc_st_label format_asterisk; diff -Nrcpad gcc-4.6.0/gcc/fortran/gfortran.info gcc-4.6.1/gcc/fortran/gfortran.info *** gcc-4.6.0/gcc/fortran/gfortran.info Fri Mar 25 17:42:55 2011 --- gcc-4.6.1/gcc/fortran/gfortran.info Mon Jun 27 10:49:28 2011 *************** *** 1,5 **** This is doc/gfortran.info, produced by makeinfo version 4.13 from ! /d/gcc-4.6.0/gcc-4.6.0/gcc/fortran/gfortran.texi. Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. --- 1,5 ---- This is doc/gfortran.info, produced by makeinfo version 4.13 from ! /d/gcc-4.6.1/gcc-4.6.1/gcc/fortran/gfortran.texi. Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. *************** produced by GNU Fortran: *** 885,891 **** recommend avoiding and that we believe are easy to avoid. This currently includes `-Waliasing', `-Wampersand', `-Wconversion', `-Wsurprising', `-Wintrinsics-std', `-Wno-tabs', ! `-Wintrinsic-shadow', `-Wline-truncation', and `-Wunused'. `-Waliasing' Warn about possible aliasing of dummy arguments. Specifically, it --- 885,892 ---- recommend avoiding and that we believe are easy to avoid. This currently includes `-Waliasing', `-Wampersand', `-Wconversion', `-Wsurprising', `-Wintrinsics-std', `-Wno-tabs', ! `-Wintrinsic-shadow', `-Wline-truncation', `-Wreal-q-constant' and ! `-Wunused'. `-Waliasing' Warn about possible aliasing of dummy arguments. Specifically, it *************** produced by GNU Fortran: *** 947,952 **** --- 948,957 ---- `-fall-intrinsics' can be used to never trigger this behavior and always link to the intrinsic regardless of the selected standard. + `-Wreal-q-constant' + Produce a warning if a real-literal-constant contains a `q' + exponent-letter. + `-Wsurprising' Produce a warning when "suspicious" code constructs are encountered. While technically legal these usually indicate that *************** without warning. *** 2166,2171 **** --- 2171,2177 ---- * Missing period in FORMAT specifications:: * I/O item lists:: * BOZ literal constants:: + * `Q' exponent-letter:: * Real array indices:: * Unary operators:: * Implicitly convert LOGICAL and INTEGER values:: *************** To support legacy codes, GNU Fortran all *** 2341,2349 **** statements, to start with a comma.  ! File: gfortran.info, Node: BOZ literal constants, Next: Real array indices, Prev: I/O item lists, Up: Extensions implemented in GNU Fortran ! 6.1.8 BOZ literal constants --------------------------- Besides decimal constants, Fortran also supports binary (`b'), octal --- 2347,2368 ---- statements, to start with a comma.  ! File: gfortran.info, Node: `Q' exponent-letter, Next: Real array indices, Prev: BOZ literal constants, Up: Extensions implemented in GNU Fortran ! 6.1.8 `Q' exponent-letter ! ------------------------- ! ! GNU Fortran accepts real literal constants with an exponent-letter of ! `Q', for example, `1.23Q45'. The constant is interpreted as a ! `REAL(16)' entity on targets that suppports this type. If the target ! does not support `REAL(16)' but has a `REAL(10)' type, then the ! real-literal-constant will be interpreted as a `REAL(10)' entity. In ! the absence of `REAL(16)' and `REAL(10)', an error will occur. ! !  ! File: gfortran.info, Node: BOZ literal constants, Next: `Q' exponent-letter, Prev: I/O item lists, Up: Extensions implemented in GNU Fortran ! ! 6.1.9 BOZ literal constants --------------------------- Besides decimal constants, Fortran also supports binary (`b'), octal *************** used as a workaround for legacy code tha *** 2388,2397 **** manner.  ! File: gfortran.info, Node: Real array indices, Next: Unary operators, Prev: BOZ literal constants, Up: Extensions implemented in GNU Fortran ! 6.1.9 Real array indices ! ------------------------ As an extension, GNU Fortran allows the use of `REAL' expressions or variables as array indices. --- 2407,2416 ---- manner.  ! File: gfortran.info, Node: Real array indices, Next: Unary operators, Prev: `Q' exponent-letter, Up: Extensions implemented in GNU Fortran ! 6.1.10 Real array indices ! ------------------------- As an extension, GNU Fortran allows the use of `REAL' expressions or variables as array indices. *************** variables as array indices. *** 2399,2405 ****  File: gfortran.info, Node: Unary operators, Next: Implicitly convert LOGICAL and INTEGER values, Prev: Real array indices, Up: Extensions implemented in GNU Fortran ! 6.1.10 Unary operators ---------------------- As an extension, GNU Fortran allows unary plus and unary minus operators --- 2418,2424 ----  File: gfortran.info, Node: Unary operators, Next: Implicitly convert LOGICAL and INTEGER values, Prev: Real array indices, Up: Extensions implemented in GNU Fortran ! 6.1.11 Unary operators ---------------------- As an extension, GNU Fortran allows unary plus and unary minus operators *************** the need for parenthesis. *** 2411,2417 ****  File: gfortran.info, Node: Implicitly convert LOGICAL and INTEGER values, Next: Hollerith constants support, Prev: Unary operators, Up: Extensions implemented in GNU Fortran ! 6.1.11 Implicitly convert `LOGICAL' and `INTEGER' values -------------------------------------------------------- As an extension for backwards compatibility with other compilers, GNU --- 2430,2436 ----  File: gfortran.info, Node: Implicitly convert LOGICAL and INTEGER values, Next: Hollerith constants support, Prev: Unary operators, Up: Extensions implemented in GNU Fortran ! 6.1.12 Implicitly convert `LOGICAL' and `INTEGER' values -------------------------------------------------------- As an extension for backwards compatibility with other compilers, GNU *************** interpreted as `.TRUE.'. *** 2434,2440 ****  File: gfortran.info, Node: Hollerith constants support, Next: Cray pointers, Prev: Implicitly convert LOGICAL and INTEGER values, Up: Extensions implemented in GNU Fortran ! 6.1.12 Hollerith constants support ---------------------------------- GNU Fortran supports Hollerith constants in assignments, function --- 2453,2459 ----  File: gfortran.info, Node: Hollerith constants support, Next: Cray pointers, Prev: Implicitly convert LOGICAL and INTEGER values, Up: Extensions implemented in GNU Fortran ! 6.1.13 Hollerith constants support ---------------------------------- GNU Fortran supports Hollerith constants in assignments, function *************** obtained by using the `TRANSFER' stateme *** 2470,2476 ****  File: gfortran.info, Node: Cray pointers, Next: CONVERT specifier, Prev: Hollerith constants support, Up: Extensions implemented in GNU Fortran ! 6.1.13 Cray pointers -------------------- Cray pointers are part of a non-standard extension that provides a --- 2489,2495 ----  File: gfortran.info, Node: Cray pointers, Next: CONVERT specifier, Prev: Hollerith constants support, Up: Extensions implemented in GNU Fortran ! 6.1.14 Cray pointers -------------------- Cray pointers are part of a non-standard extension that provides a *************** will not change the base address of the *** 2584,2590 ****  File: gfortran.info, Node: CONVERT specifier, Next: OpenMP, Prev: Cray pointers, Up: Extensions implemented in GNU Fortran ! 6.1.14 `CONVERT' specifier -------------------------- GNU Fortran allows the conversion of unformatted data between little- --- 2603,2609 ----  File: gfortran.info, Node: CONVERT specifier, Next: OpenMP, Prev: Cray pointers, Up: Extensions implemented in GNU Fortran ! 6.1.15 `CONVERT' specifier -------------------------- GNU Fortran allows the conversion of unformatted data between little- *************** you, it is best if you use this only for *** 2631,2637 ****  File: gfortran.info, Node: OpenMP, Next: Argument list functions, Prev: CONVERT specifier, Up: Extensions implemented in GNU Fortran ! 6.1.15 OpenMP ------------- OpenMP (Open Multi-Processing) is an application programming interface --- 2650,2656 ----  File: gfortran.info, Node: OpenMP, Next: Argument list functions, Prev: CONVERT specifier, Up: Extensions implemented in GNU Fortran ! 6.1.16 OpenMP ------------- OpenMP (Open Multi-Processing) is an application programming interface *************** OpenMP Application Program Interface v2. *** 2683,2689 ****  File: gfortran.info, Node: Argument list functions, Prev: OpenMP, Up: Extensions implemented in GNU Fortran ! 6.1.16 Argument list functions `%VAL', `%REF' and `%LOC' -------------------------------------------------------- GNU Fortran supports argument list functions `%VAL', `%REF' and `%LOC' --- 2702,2708 ----  File: gfortran.info, Node: Argument list functions, Prev: OpenMP, Up: Extensions implemented in GNU Fortran ! 6.1.17 Argument list functions `%VAL', `%REF' and `%LOC' -------------------------------------------------------- GNU Fortran supports argument list functions `%VAL', `%REF' and `%LOC' *************** look up both forms. *** 16310,16352 **** * undef: Preprocessing Options. (line 110) * Waliasing: Error and Warning Options. ! (line 68) * Walign-commons: Error and Warning Options. ! (line 179) * Wall: Error and Warning Options. (line 61) * Wampersand: Error and Warning Options. ! (line 85) * Warray-temporaries: Error and Warning Options. ! (line 93) * Wcharacter-truncation: Error and Warning Options. ! (line 98) * Wconversion: Error and Warning Options. ! (line 104) * Wconversion-extra: Error and Warning Options. ! (line 108) * Werror: Error and Warning Options. ! (line 185) * Wimplicit-interface: Error and Warning Options. ! (line 111) * Wimplicit-procedure: Error and Warning Options. ! (line 117) * Wintrinsic-shadow: Error and Warning Options. ! (line 162) * Wintrinsics-std: Error and Warning Options. ! (line 121) * Wline-truncation: Error and Warning Options. ! (line 101) * Wsurprising: Error and Warning Options. ! (line 128) * Wtabs: Error and Warning Options. ! (line 150) * Wunderflow: Error and Warning Options. ! (line 158) * Wunused-dummy-argument: Error and Warning Options. ! (line 168) * Wunused-parameter: Error and Warning Options. ! (line 172)  File: gfortran.info, Node: Keyword Index, Prev: Option Index, Up: Top --- 16329,16373 ---- * undef: Preprocessing Options. (line 110) * Waliasing: Error and Warning Options. ! (line 69) * Walign-commons: Error and Warning Options. ! (line 184) * Wall: Error and Warning Options. (line 61) * Wampersand: Error and Warning Options. ! (line 86) * Warray-temporaries: Error and Warning Options. ! (line 94) * Wcharacter-truncation: Error and Warning Options. ! (line 99) * Wconversion: Error and Warning Options. ! (line 105) * Wconversion-extra: Error and Warning Options. ! (line 109) * Werror: Error and Warning Options. ! (line 190) * Wimplicit-interface: Error and Warning Options. ! (line 112) * Wimplicit-procedure: Error and Warning Options. ! (line 118) * Wintrinsic-shadow: Error and Warning Options. ! (line 167) * Wintrinsics-std: Error and Warning Options. ! (line 122) * Wline-truncation: Error and Warning Options. ! (line 102) ! * Wreal-q-constant: Error and Warning Options. ! (line 129) * Wsurprising: Error and Warning Options. ! (line 133) * Wtabs: Error and Warning Options. ! (line 155) * Wunderflow: Error and Warning Options. ! (line 163) * Wunused-dummy-argument: Error and Warning Options. ! (line 173) * Wunused-parameter: Error and Warning Options. ! (line 177)  File: gfortran.info, Node: Keyword Index, Prev: Option Index, Up: Top *************** Keyword Index *** 16366,16372 **** * %VAL: Argument list functions. (line 6) * &: Error and Warning Options. ! (line 85) * [...]: Fortran 2003 status. (line 68) * _gfortran_set_args: _gfortran_set_args. (line 6) * _gfortran_set_convert: _gfortran_set_convert. --- 16387,16393 ---- * %VAL: Argument list functions. (line 6) * &: Error and Warning Options. ! (line 86) * [...]: Fortran 2003 status. (line 68) * _gfortran_set_args: _gfortran_set_args. (line 6) * _gfortran_set_convert: _gfortran_set_convert. *************** Keyword Index *** 16395,16404 **** * ALARM: ALARM. (line 6) * ALGAMA: LOG_GAMMA. (line 6) * aliasing: Error and Warning Options. ! (line 68) * alignment of COMMON blocks <1>: Code Gen Options. (line 310) * alignment of COMMON blocks: Error and Warning Options. ! (line 179) * ALL: ALL. (line 6) * all warnings: Error and Warning Options. (line 61) --- 16416,16425 ---- * ALARM: ALARM. (line 6) * ALGAMA: LOG_GAMMA. (line 6) * aliasing: Error and Warning Options. ! (line 69) * alignment of COMMON blocks <1>: Code Gen Options. (line 310) * alignment of COMMON blocks: Error and Warning Options. ! (line 184) * ALL: ALL. (line 6) * all warnings: Error and Warning Options. (line 61) *************** Keyword Index *** 16633,16639 **** * Contributing: Contributing. (line 6) * Contributors: Contributors. (line 6) * conversion: Error and Warning Options. ! (line 104) * conversion, to character: CHAR. (line 6) * conversion, to complex <1>: DCMPLX. (line 6) * conversion, to complex <2>: COMPLEX. (line 6) --- 16654,16660 ---- * Contributing: Contributing. (line 6) * Contributors: Contributors. (line 6) * conversion: Error and Warning Options. ! (line 105) * conversion, to character: CHAR. (line 6) * conversion, to complex <1>: DCMPLX. (line 6) * conversion, to complex <2>: COMPLEX. (line 6) *************** Keyword Index *** 16746,16752 **** * DTANH: TANH. (line 6) * DTIME: DTIME. (line 6) * dummy argument, unused: Error and Warning Options. ! (line 168) * elapsed time <1>: SECOND. (line 6) * elapsed time <2>: SECNDS. (line 6) * elapsed time: DTIME. (line 6) --- 16767,16773 ---- * DTANH: TANH. (line 6) * DTIME: DTIME. (line 6) * dummy argument, unused: Error and Warning Options. ! (line 173) * elapsed time <1>: SECOND. (line 6) * elapsed time <2>: SECNDS. (line 6) * elapsed time: DTIME. (line 6) *************** Keyword Index *** 16924,16930 **** * Interoperability: Mixed-Language Programming. (line 6) * intrinsic: Error and Warning Options. ! (line 162) * intrinsic Modules: Intrinsic Modules. (line 6) * intrinsic procedures: Intrinsic Procedures. (line 6) --- 16945,16951 ---- * Interoperability: Mixed-Language Programming. (line 6) * intrinsic: Error and Warning Options. ! (line 167) * intrinsic Modules: Intrinsic Modules. (line 6) * intrinsic procedures: Intrinsic Procedures. (line 6) *************** Keyword Index *** 17167,17172 **** --- 17188,17194 ---- * program termination: EXIT. (line 6) * program termination, with core dump: ABORT. (line 6) * PROTECTED statement: Fortran 2003 status. (line 104) + * Q exponent-letter: Q exponent-letter. (line 6) * RADIX: RADIX. (line 6) * radix, real: SELECTED_REAL_KIND. (line 6) * RAN: RAN. (line 6) *************** Keyword Index *** 17330,17336 **** * system, working directory: CHDIR. (line 6) * SYSTEM_CLOCK: SYSTEM_CLOCK. (line 6) * tabulators: Error and Warning Options. ! (line 150) * TAN: TAN. (line 6) * tangent: TAN. (line 6) * tangent, hyperbolic: TANH. (line 6) --- 17352,17358 ---- * system, working directory: CHDIR. (line 6) * SYSTEM_CLOCK: SYSTEM_CLOCK. (line 6) * tabulators: Error and Warning Options. ! (line 155) * TAN: TAN. (line 6) * tangent: TAN. (line 6) * tangent, hyperbolic: TANH. (line 6) *************** Keyword Index *** 17383,17396 **** * UCOBOUND: UCOBOUND. (line 6) * UMASK: UMASK. (line 6) * underflow: Error and Warning Options. ! (line 158) * underscore: Code Gen Options. (line 54) * UNLINK: UNLINK. (line 6) * UNPACK: UNPACK. (line 6) * unused dummy argument: Error and Warning Options. ! (line 168) * unused parameter: Error and Warning Options. ! (line 172) * USE, INTRINSIC statement: Fortran 2003 status. (line 118) * user id: GETUID. (line 6) * VALUE statement: Fortran 2003 status. (line 106) --- 17405,17418 ---- * UCOBOUND: UCOBOUND. (line 6) * UMASK: UMASK. (line 6) * underflow: Error and Warning Options. ! (line 163) * underscore: Code Gen Options. (line 54) * UNLINK: UNLINK. (line 6) * UNPACK: UNPACK. (line 6) * unused dummy argument: Error and Warning Options. ! (line 173) * unused parameter: Error and Warning Options. ! (line 177) * USE, INTRINSIC statement: Fortran 2003 status. (line 118) * user id: GETUID. (line 6) * VALUE statement: Fortran 2003 status. (line 106) *************** Keyword Index *** 17403,17447 **** * version of the compiler: COMPILER_VERSION. (line 6) * VOLATILE statement: Fortran 2003 status. (line 108) * warnings, aliasing: Error and Warning Options. ! (line 68) * warnings, alignment of COMMON blocks: Error and Warning Options. ! (line 179) * warnings, all: Error and Warning Options. (line 61) * warnings, ampersand: Error and Warning Options. ! (line 85) * warnings, array temporaries: Error and Warning Options. ! (line 93) * warnings, character truncation: Error and Warning Options. ! (line 98) * warnings, conversion: Error and Warning Options. ! (line 104) * warnings, implicit interface: Error and Warning Options. ! (line 111) * warnings, implicit procedure: Error and Warning Options. ! (line 117) * warnings, intrinsic: Error and Warning Options. ! (line 162) * warnings, intrinsics of other standards: Error and Warning Options. ! (line 121) * warnings, line truncation: Error and Warning Options. ! (line 101) * warnings, non-standard intrinsics: Error and Warning Options. ! (line 121) * warnings, suppressing: Error and Warning Options. (line 6) * warnings, suspicious code: Error and Warning Options. ! (line 128) * warnings, tabs: Error and Warning Options. ! (line 150) * warnings, to errors: Error and Warning Options. ! (line 185) * warnings, underflow: Error and Warning Options. ! (line 158) * warnings, unused dummy argument: Error and Warning Options. ! (line 168) * warnings, unused parameter: Error and Warning Options. ! (line 172) * write character, stream mode <1>: FPUTC. (line 6) * write character, stream mode: FPUT. (line 6) * XOR: XOR. (line 6) --- 17425,17471 ---- * version of the compiler: COMPILER_VERSION. (line 6) * VOLATILE statement: Fortran 2003 status. (line 108) * warnings, aliasing: Error and Warning Options. ! (line 69) * warnings, alignment of COMMON blocks: Error and Warning Options. ! (line 184) * warnings, all: Error and Warning Options. (line 61) * warnings, ampersand: Error and Warning Options. ! (line 86) * warnings, array temporaries: Error and Warning Options. ! (line 94) * warnings, character truncation: Error and Warning Options. ! (line 99) * warnings, conversion: Error and Warning Options. ! (line 105) * warnings, implicit interface: Error and Warning Options. ! (line 112) * warnings, implicit procedure: Error and Warning Options. ! (line 118) * warnings, intrinsic: Error and Warning Options. ! (line 167) * warnings, intrinsics of other standards: Error and Warning Options. ! (line 122) * warnings, line truncation: Error and Warning Options. ! (line 102) * warnings, non-standard intrinsics: Error and Warning Options. ! (line 122) ! * warnings, q exponent-letter: Error and Warning Options. ! (line 129) * warnings, suppressing: Error and Warning Options. (line 6) * warnings, suspicious code: Error and Warning Options. ! (line 133) * warnings, tabs: Error and Warning Options. ! (line 155) * warnings, to errors: Error and Warning Options. ! (line 190) * warnings, underflow: Error and Warning Options. ! (line 163) * warnings, unused dummy argument: Error and Warning Options. ! (line 173) * warnings, unused parameter: Error and Warning Options. ! (line 177) * write character, stream mode <1>: FPUTC. (line 6) * write character, stream mode: FPUT. (line 6) * XOR: XOR. (line 6) *************** Node: Option Summary18212 *** 17472,17810 **** Node: Fortran Dialect Options21911 Node: Preprocessing Options28947 Node: Error and Warning Options37177 ! Node: Debugging Options45137 ! Node: Directory Options47753 ! Node: Link Options49188 ! Node: Runtime Options49812 ! Node: Code Gen Options52062 ! Node: Environment Variables67333 ! Node: Runtime67938 ! Node: GFORTRAN_STDIN_UNIT69166 ! Node: GFORTRAN_STDOUT_UNIT69533 ! Node: GFORTRAN_STDERR_UNIT69934 ! Node: GFORTRAN_USE_STDERR70332 ! Node: GFORTRAN_TMPDIR70778 ! Node: GFORTRAN_UNBUFFERED_ALL71229 ! Node: GFORTRAN_UNBUFFERED_PRECONNECTED71753 ! Node: GFORTRAN_SHOW_LOCUS72395 ! Node: GFORTRAN_OPTIONAL_PLUS72890 ! Node: GFORTRAN_DEFAULT_RECL73366 ! Node: GFORTRAN_LIST_SEPARATOR73857 ! Node: GFORTRAN_CONVERT_UNIT74466 ! Node: GFORTRAN_ERROR_DUMPCORE77328 ! Node: GFORTRAN_ERROR_BACKTRACE77877 ! Node: Fortran 2003 and 2008 status78429 ! Node: Fortran 2003 status78669 ! Node: Fortran 2008 status83316 ! Node: Compiler Characteristics87970 ! Node: KIND Type Parameters88486 ! Node: Internal representation of LOGICAL variables89736 ! Node: Thread-safety of the runtime library91093 ! Node: Extensions92480 ! Node: Extensions implemented in GNU Fortran93081 ! Node: Old-style kind specifications94415 ! Node: Old-style variable initialization95522 ! Node: Extensions to namelist96834 ! Node: X format descriptor without count field98831 ! Node: Commas in FORMAT specifications99358 ! Node: Missing period in FORMAT specifications99875 ! Node: I/O item lists100437 ! Node: BOZ literal constants100826 ! Node: Real array indices103400 ! Node: Unary operators103697 ! Node: Implicitly convert LOGICAL and INTEGER values104111 ! Node: Hollerith constants support105071 ! Node: Cray pointers106843 ! Node: CONVERT specifier112290 ! Node: OpenMP114288 ! Node: Argument list functions116539 ! Node: Extensions not implemented in GNU Fortran118145 ! Node: STRUCTURE and RECORD119067 ! Node: ENCODE and DECODE statements121124 ! Node: Variable FORMAT expressions122483 ! Node: Alternate complex function syntax123588 ! Node: Mixed-Language Programming124108 ! Node: Interoperability with C124652 ! Node: Intrinsic Types125990 ! Node: Derived Types and struct126505 ! Node: Interoperable Global Variables127861 ! Node: Interoperable Subroutines and Functions129137 ! Node: Working with Pointers132750 ! Node: Further Interoperability of Fortran with C137067 ! Node: GNU Fortran Compiler Directives138049 ! Node: Non-Fortran Main Program140250 ! Node: _gfortran_set_args142392 ! Node: _gfortran_set_options143327 ! Node: _gfortran_set_convert146233 ! Node: _gfortran_set_record_marker147097 ! Node: _gfortran_set_fpe147922 ! Node: _gfortran_set_max_subrecord_length149136 ! Node: Intrinsic Procedures150092 ! Node: Introduction to Intrinsics165323 ! Node: ABORT167675 ! Node: ABS168432 ! Node: ACCESS170049 ! Node: ACHAR171970 ! Node: ACOS173171 ! Node: ACOSH174408 ! Node: ADJUSTL175396 ! Node: ADJUSTR176337 ! Node: AIMAG177284 ! Node: AINT178665 ! Node: ALARM180252 ! Node: ALL181886 ! Node: ALLOCATED183804 ! Node: AND184941 ! Node: ANINT186238 ! Node: ANY187716 ! Node: ASIN189646 ! Node: ASINH190872 ! Node: ASSOCIATED191870 ! Node: ATAN194875 ! Node: ATAN2196294 ! Node: ATANH197929 ! Node: BESSEL_J0198925 ! Node: BESSEL_J1199969 ! Node: BESSEL_JN201021 ! Node: BESSEL_Y0202903 ! Node: BESSEL_Y1203903 ! Node: BESSEL_YN204903 ! Node: BGE206735 ! Node: BGT207424 ! Node: BIT_SIZE208071 ! Node: BLE208892 ! Node: BLT209571 ! Node: BTEST210206 ! Node: C_ASSOCIATED211089 ! Node: C_FUNLOC212298 ! Node: C_F_PROCPOINTER213667 ! Node: C_F_POINTER215168 ! Node: C_LOC216586 ! Node: C_SIZEOF217863 ! Node: CEILING219272 ! Node: CHAR220277 ! Node: CHDIR221481 ! Node: CHMOD222649 ! Node: CMPLX224444 ! Node: COMMAND_ARGUMENT_COUNT225908 ! Node: COMPILER_OPTIONS226822 ! Node: COMPILER_VERSION227835 ! Node: COMPLEX228803 ! Node: CONJG229957 ! Node: COS231037 ! Node: COSH232483 ! Node: COUNT233648 ! Node: CPU_TIME235664 ! Node: CSHIFT237018 ! Node: CTIME238674 ! Node: DATE_AND_TIME240327 ! Node: DBLE242788 ! Node: DCMPLX243581 ! Node: DIGITS244775 ! Node: DIM245741 ! Node: DOT_PRODUCT246999 ! Node: DPROD248655 ! Node: DREAL249572 ! Node: DSHIFTL250238 ! Node: DSHIFTR251031 ! Node: DTIME251825 ! Node: EOSHIFT254628 ! Node: EPSILON256701 ! Node: ERF257427 ! Node: ERFC258201 ! Node: ERFC_SCALED259005 ! Node: ETIME259697 ! Node: EXECUTE_COMMAND_LINE261938 ! Node: EXIT264518 ! Node: EXP265392 ! Node: EXPONENT266665 ! Node: EXTENDS_TYPE_OF267425 ! Node: FDATE268278 ! Node: FGET269760 ! Node: FGETC271578 ! Node: FLOOR273377 ! Node: FLUSH274361 ! Node: FNUM276236 ! Node: FPUT276958 ! Node: FPUTC278583 ! Node: FRACTION280354 ! Node: FREE281255 ! Node: FSEEK282090 ! Node: FSTAT284384 ! Node: FTELL285464 ! Node: GAMMA286442 ! Node: GERROR287483 ! Node: GETARG288202 ! Node: GET_COMMAND289966 ! Node: GET_COMMAND_ARGUMENT291330 ! Node: GETCWD293364 ! Node: GETENV294336 ! Node: GET_ENVIRONMENT_VARIABLE295759 ! Node: GETGID297912 ! Node: GETLOG298449 ! Node: GETPID299309 ! Node: GETUID300039 ! Node: GMTIME300555 ! Node: HOSTNM302044 ! Node: HUGE302962 ! Node: HYPOT303683 ! Node: IACHAR304503 ! Node: IALL305683 ! Node: IAND307160 ! Node: IANY308144 ! Node: IARGC309630 ! Node: IBCLR310651 ! Node: IBITS311312 ! Node: IBSET312227 ! Node: ICHAR312883 ! Node: IDATE315055 ! Node: IEOR316082 ! Node: IERRNO316958 ! Node: IMAGE_INDEX317507 ! Node: INDEX intrinsic318531 ! Node: INT320072 ! Node: INT2321774 ! Node: INT8322539 ! Node: IOR323251 ! Node: IPARITY324103 ! Node: IRAND325627 ! Node: IS_IOSTAT_END326983 ! Node: IS_IOSTAT_EOR328080 ! Node: ISATTY329207 ! Node: ISHFT329990 ! Node: ISHFTC330970 ! Node: ISNAN332186 ! Node: ITIME332934 ! Node: KILL333959 ! Node: KIND334863 ! Node: LBOUND335708 ! Node: LCOBOUND337041 ! Node: LEADZ338171 ! Node: LEN339031 ! Node: LEN_TRIM340312 ! Node: LGE341294 ! Node: LGT342796 ! Node: LINK344263 ! Node: LLE345298 ! Node: LLT346792 ! Node: LNBLNK348252 ! Node: LOC349028 ! Node: LOG349759 ! Node: LOG10351162 ! Node: LOG_GAMMA352136 ! Node: LOGICAL353225 ! Node: LONG354033 ! Node: LSHIFT354789 ! Node: LSTAT355874 ! Node: LTIME357068 ! Node: MALLOC358479 ! Node: MASKL359938 ! Node: MASKR360701 ! Node: MATMUL361467 ! Node: MAX362556 ! Node: MAXEXPONENT364055 ! Node: MAXLOC364871 ! Node: MAXVAL366890 ! Node: MCLOCK368523 ! Node: MCLOCK8369526 ! Node: MERGE370738 ! Node: MERGE_BITS371487 ! Node: MIN372348 ! Node: MINEXPONENT373849 ! Node: MINLOC374479 ! Node: MINVAL376498 ! Node: MOD378150 ! Node: MODULO379757 ! Node: MOVE_ALLOC380971 ! Node: MVBITS382000 ! Node: NEAREST383059 ! Node: NEW_LINE384182 ! Node: NINT384953 ! Node: NORM2386356 ! Node: NOT387494 ! Node: NULL388078 ! Node: NUM_IMAGES388983 ! Node: OR389799 ! Node: PACK391083 ! Node: PARITY393075 ! Node: PERROR394290 ! Node: PRECISION394911 ! Node: POPCNT395797 ! Node: POPPAR396668 ! Node: PRESENT397719 ! Node: PRODUCT398825 ! Node: RADIX400350 ! Node: RAN401172 ! Node: RAND401628 ! Node: RANDOM_NUMBER402960 ! Node: RANDOM_SEED404678 ! Node: RANGE406563 ! Node: REAL407251 ! Node: RENAME409025 ! Node: REPEAT410044 ! Node: RESHAPE410770 ! Node: RRSPACING412239 ! Node: RSHIFT412932 ! Node: SAME_TYPE_AS414070 ! Node: SCALE414900 ! Node: SCAN415680 ! Node: SECNDS417230 ! Node: SECOND418318 ! Node: SELECTED_CHAR_KIND419194 ! Node: SELECTED_INT_KIND420785 ! Node: SELECTED_REAL_KIND421960 ! Node: SET_EXPONENT424626 ! Node: SHAPE425622 ! Node: SHIFTA427037 ! Node: SHIFTL427998 ! Node: SHIFTR428833 ! Node: SIGN429669 ! Node: SIGNAL430953 ! Node: SIN432450 ! Node: SINH433548 ! Node: SIZE434544 ! Node: SIZEOF435852 ! Node: SLEEP437263 ! Node: SPACING437823 ! Node: SPREAD438836 ! Node: SQRT439981 ! Node: SRAND441335 ! Node: STAT442503 ! Node: STORAGE_SIZE445670 ! Node: SUM446550 ! Node: SYMLNK448033 ! Node: SYSTEM449165 ! Node: SYSTEM_CLOCK450416 ! Node: TAN452574 ! Node: TANH453546 ! Node: THIS_IMAGE454703 ! Node: TIME456195 ! Node: TIME8457299 ! Node: TINY458428 ! Node: TRAILZ459028 ! Node: TRANSFER459845 ! Node: TRANSPOSE461879 ! Node: TRIM462566 ! Node: TTYNAM463423 ! Node: UBOUND464338 ! Node: UCOBOUND465728 ! Node: UMASK466860 ! Node: UNLINK467538 ! Node: UNPACK468515 ! Node: VERIFY469803 ! Node: XOR471524 ! Node: Intrinsic Modules472896 ! Node: ISO_FORTRAN_ENV473139 ! Node: ISO_C_BINDING476979 ! Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS480841 ! Node: Contributing482167 ! Node: Contributors483019 ! Node: Projects484686 ! Node: Proposed Extensions485490 ! Node: Copying487501 ! Node: GNU Free Documentation License525065 ! Node: Funding550208 ! Node: Option Index552733 ! Node: Keyword Index565550  End Tag Table --- 17496,17835 ---- Node: Fortran Dialect Options21911 Node: Preprocessing Options28947 Node: Error and Warning Options37177 ! Node: Debugging Options45270 ! Node: Directory Options47886 ! Node: Link Options49321 ! Node: Runtime Options49945 ! Node: Code Gen Options52195 ! Node: Environment Variables67466 ! Node: Runtime68071 ! Node: GFORTRAN_STDIN_UNIT69299 ! Node: GFORTRAN_STDOUT_UNIT69666 ! Node: GFORTRAN_STDERR_UNIT70067 ! Node: GFORTRAN_USE_STDERR70465 ! Node: GFORTRAN_TMPDIR70911 ! Node: GFORTRAN_UNBUFFERED_ALL71362 ! Node: GFORTRAN_UNBUFFERED_PRECONNECTED71886 ! Node: GFORTRAN_SHOW_LOCUS72528 ! Node: GFORTRAN_OPTIONAL_PLUS73023 ! Node: GFORTRAN_DEFAULT_RECL73499 ! Node: GFORTRAN_LIST_SEPARATOR73990 ! Node: GFORTRAN_CONVERT_UNIT74599 ! Node: GFORTRAN_ERROR_DUMPCORE77461 ! Node: GFORTRAN_ERROR_BACKTRACE78010 ! Node: Fortran 2003 and 2008 status78562 ! Node: Fortran 2003 status78802 ! Node: Fortran 2008 status83449 ! Node: Compiler Characteristics88103 ! Node: KIND Type Parameters88619 ! Node: Internal representation of LOGICAL variables89869 ! Node: Thread-safety of the runtime library91226 ! Node: Extensions92613 ! Node: Extensions implemented in GNU Fortran93214 ! Node: Old-style kind specifications94572 ! Node: Old-style variable initialization95679 ! Node: Extensions to namelist96991 ! Node: X format descriptor without count field98988 ! Node: Commas in FORMAT specifications99515 ! Node: Missing period in FORMAT specifications100032 ! Node: I/O item lists100594 ! Node: `Q' exponent-letter100983 ! Node: BOZ literal constants101589 ! Node: Real array indices104164 ! Node: Unary operators104461 ! Node: Implicitly convert LOGICAL and INTEGER values104875 ! Node: Hollerith constants support105835 ! Node: Cray pointers107607 ! Node: CONVERT specifier113054 ! Node: OpenMP115052 ! Node: Argument list functions117303 ! Node: Extensions not implemented in GNU Fortran118909 ! Node: STRUCTURE and RECORD119831 ! Node: ENCODE and DECODE statements121888 ! Node: Variable FORMAT expressions123247 ! Node: Alternate complex function syntax124352 ! Node: Mixed-Language Programming124872 ! Node: Interoperability with C125416 ! Node: Intrinsic Types126754 ! Node: Derived Types and struct127269 ! Node: Interoperable Global Variables128625 ! Node: Interoperable Subroutines and Functions129901 ! Node: Working with Pointers133514 ! Node: Further Interoperability of Fortran with C137831 ! Node: GNU Fortran Compiler Directives138813 ! Node: Non-Fortran Main Program141014 ! Node: _gfortran_set_args143156 ! Node: _gfortran_set_options144091 ! Node: _gfortran_set_convert146997 ! Node: _gfortran_set_record_marker147861 ! Node: _gfortran_set_fpe148686 ! Node: _gfortran_set_max_subrecord_length149900 ! Node: Intrinsic Procedures150856 ! Node: Introduction to Intrinsics166087 ! Node: ABORT168439 ! Node: ABS169196 ! Node: ACCESS170813 ! Node: ACHAR172734 ! Node: ACOS173935 ! Node: ACOSH175172 ! Node: ADJUSTL176160 ! Node: ADJUSTR177101 ! Node: AIMAG178048 ! Node: AINT179429 ! Node: ALARM181016 ! Node: ALL182650 ! Node: ALLOCATED184568 ! Node: AND185705 ! Node: ANINT187002 ! Node: ANY188480 ! Node: ASIN190410 ! Node: ASINH191636 ! Node: ASSOCIATED192634 ! Node: ATAN195639 ! Node: ATAN2197058 ! Node: ATANH198693 ! Node: BESSEL_J0199689 ! Node: BESSEL_J1200733 ! Node: BESSEL_JN201785 ! Node: BESSEL_Y0203667 ! Node: BESSEL_Y1204667 ! Node: BESSEL_YN205667 ! Node: BGE207499 ! Node: BGT208188 ! Node: BIT_SIZE208835 ! Node: BLE209656 ! Node: BLT210335 ! Node: BTEST210970 ! Node: C_ASSOCIATED211853 ! Node: C_FUNLOC213062 ! Node: C_F_PROCPOINTER214431 ! Node: C_F_POINTER215932 ! Node: C_LOC217350 ! Node: C_SIZEOF218627 ! Node: CEILING220036 ! Node: CHAR221041 ! Node: CHDIR222245 ! Node: CHMOD223413 ! Node: CMPLX225208 ! Node: COMMAND_ARGUMENT_COUNT226672 ! Node: COMPILER_OPTIONS227586 ! Node: COMPILER_VERSION228599 ! Node: COMPLEX229567 ! Node: CONJG230721 ! Node: COS231801 ! Node: COSH233247 ! Node: COUNT234412 ! Node: CPU_TIME236428 ! Node: CSHIFT237782 ! Node: CTIME239438 ! Node: DATE_AND_TIME241091 ! Node: DBLE243552 ! Node: DCMPLX244345 ! Node: DIGITS245539 ! Node: DIM246505 ! Node: DOT_PRODUCT247763 ! Node: DPROD249419 ! Node: DREAL250336 ! Node: DSHIFTL251002 ! Node: DSHIFTR251795 ! Node: DTIME252589 ! Node: EOSHIFT255392 ! Node: EPSILON257465 ! Node: ERF258191 ! Node: ERFC258965 ! Node: ERFC_SCALED259769 ! Node: ETIME260461 ! Node: EXECUTE_COMMAND_LINE262702 ! Node: EXIT265282 ! Node: EXP266156 ! Node: EXPONENT267429 ! Node: EXTENDS_TYPE_OF268189 ! Node: FDATE269042 ! Node: FGET270524 ! Node: FGETC272342 ! Node: FLOOR274141 ! Node: FLUSH275125 ! Node: FNUM277000 ! Node: FPUT277722 ! Node: FPUTC279347 ! Node: FRACTION281118 ! Node: FREE282019 ! Node: FSEEK282854 ! Node: FSTAT285148 ! Node: FTELL286228 ! Node: GAMMA287206 ! Node: GERROR288247 ! Node: GETARG288966 ! Node: GET_COMMAND290730 ! Node: GET_COMMAND_ARGUMENT292094 ! Node: GETCWD294128 ! Node: GETENV295100 ! Node: GET_ENVIRONMENT_VARIABLE296523 ! Node: GETGID298676 ! Node: GETLOG299213 ! Node: GETPID300073 ! Node: GETUID300803 ! Node: GMTIME301319 ! Node: HOSTNM302808 ! Node: HUGE303726 ! Node: HYPOT304447 ! Node: IACHAR305267 ! Node: IALL306447 ! Node: IAND307924 ! Node: IANY308908 ! Node: IARGC310394 ! Node: IBCLR311415 ! Node: IBITS312076 ! Node: IBSET312991 ! Node: ICHAR313647 ! Node: IDATE315819 ! Node: IEOR316846 ! Node: IERRNO317722 ! Node: IMAGE_INDEX318271 ! Node: INDEX intrinsic319295 ! Node: INT320836 ! Node: INT2322538 ! Node: INT8323303 ! Node: IOR324015 ! Node: IPARITY324867 ! Node: IRAND326391 ! Node: IS_IOSTAT_END327747 ! Node: IS_IOSTAT_EOR328844 ! Node: ISATTY329971 ! Node: ISHFT330754 ! Node: ISHFTC331734 ! Node: ISNAN332950 ! Node: ITIME333698 ! Node: KILL334723 ! Node: KIND335627 ! Node: LBOUND336472 ! Node: LCOBOUND337805 ! Node: LEADZ338935 ! Node: LEN339795 ! Node: LEN_TRIM341076 ! Node: LGE342058 ! Node: LGT343560 ! Node: LINK345027 ! Node: LLE346062 ! Node: LLT347556 ! Node: LNBLNK349016 ! Node: LOC349792 ! Node: LOG350523 ! Node: LOG10351926 ! Node: LOG_GAMMA352900 ! Node: LOGICAL353989 ! Node: LONG354797 ! Node: LSHIFT355553 ! Node: LSTAT356638 ! Node: LTIME357832 ! Node: MALLOC359243 ! Node: MASKL360702 ! Node: MASKR361465 ! Node: MATMUL362231 ! Node: MAX363320 ! Node: MAXEXPONENT364819 ! Node: MAXLOC365635 ! Node: MAXVAL367654 ! Node: MCLOCK369287 ! Node: MCLOCK8370290 ! Node: MERGE371502 ! Node: MERGE_BITS372251 ! Node: MIN373112 ! Node: MINEXPONENT374613 ! Node: MINLOC375243 ! Node: MINVAL377262 ! Node: MOD378914 ! Node: MODULO380521 ! Node: MOVE_ALLOC381735 ! Node: MVBITS382764 ! Node: NEAREST383823 ! Node: NEW_LINE384946 ! Node: NINT385717 ! Node: NORM2387120 ! Node: NOT388258 ! Node: NULL388842 ! Node: NUM_IMAGES389747 ! Node: OR390563 ! Node: PACK391847 ! Node: PARITY393839 ! Node: PERROR395054 ! Node: PRECISION395675 ! Node: POPCNT396561 ! Node: POPPAR397432 ! Node: PRESENT398483 ! Node: PRODUCT399589 ! Node: RADIX401114 ! Node: RAN401936 ! Node: RAND402392 ! Node: RANDOM_NUMBER403724 ! Node: RANDOM_SEED405442 ! Node: RANGE407327 ! Node: REAL408015 ! Node: RENAME409789 ! Node: REPEAT410808 ! Node: RESHAPE411534 ! Node: RRSPACING413003 ! Node: RSHIFT413696 ! Node: SAME_TYPE_AS414834 ! Node: SCALE415664 ! Node: SCAN416444 ! Node: SECNDS417994 ! Node: SECOND419082 ! Node: SELECTED_CHAR_KIND419958 ! Node: SELECTED_INT_KIND421549 ! Node: SELECTED_REAL_KIND422724 ! Node: SET_EXPONENT425390 ! Node: SHAPE426386 ! Node: SHIFTA427801 ! Node: SHIFTL428762 ! Node: SHIFTR429597 ! Node: SIGN430433 ! Node: SIGNAL431717 ! Node: SIN433214 ! Node: SINH434312 ! Node: SIZE435308 ! Node: SIZEOF436616 ! Node: SLEEP438027 ! Node: SPACING438587 ! Node: SPREAD439600 ! Node: SQRT440745 ! Node: SRAND442099 ! Node: STAT443267 ! Node: STORAGE_SIZE446434 ! Node: SUM447314 ! Node: SYMLNK448797 ! Node: SYSTEM449929 ! Node: SYSTEM_CLOCK451180 ! Node: TAN453338 ! Node: TANH454310 ! Node: THIS_IMAGE455467 ! Node: TIME456959 ! Node: TIME8458063 ! Node: TINY459192 ! Node: TRAILZ459792 ! Node: TRANSFER460609 ! Node: TRANSPOSE462643 ! Node: TRIM463330 ! Node: TTYNAM464187 ! Node: UBOUND465102 ! Node: UCOBOUND466492 ! Node: UMASK467624 ! Node: UNLINK468302 ! Node: UNPACK469279 ! Node: VERIFY470567 ! Node: XOR472288 ! Node: Intrinsic Modules473660 ! Node: ISO_FORTRAN_ENV473903 ! Node: ISO_C_BINDING477743 ! Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS481605 ! Node: Contributing482931 ! Node: Contributors483783 ! Node: Projects485450 ! Node: Proposed Extensions486254 ! Node: Copying488265 ! Node: GNU Free Documentation License525829 ! Node: Funding550972 ! Node: Option Index553497 ! Node: Keyword Index566455  End Tag Table diff -Nrcpad gcc-4.6.0/gcc/fortran/gfortran.texi gcc-4.6.1/gcc/fortran/gfortran.texi *** gcc-4.6.0/gcc/fortran/gfortran.texi Mon Feb 7 19:19:51 2011 --- gcc-4.6.1/gcc/fortran/gfortran.texi Wed May 4 19:18:01 2011 *************** without warning. *** 1237,1242 **** --- 1237,1243 ---- * Missing period in FORMAT specifications:: * I/O item lists:: * BOZ literal constants:: + * @code{Q} exponent-letter:: * Real array indices:: * Unary operators:: * Implicitly convert LOGICAL and INTEGER values:: *************** To support legacy codes, GNU Fortran all *** 1427,1432 **** --- 1428,1445 ---- of the @code{READ} statement, and the output item lists of the @code{WRITE} and @code{PRINT} statements, to start with a comma. + @node @code{Q} exponent-letter + @subsection @code{Q} exponent-letter + @cindex @code{Q} exponent-letter + + GNU Fortran accepts real literal constants with an exponent-letter + of @code{Q}, for example, @code{1.23Q45}. The constant is interpreted + as a @code{REAL(16)} entity on targets that suppports this type. If + the target does not support @code{REAL(16)} but has a @code{REAL(10)} + type, then the real-literal-constant will be interpreted as a + @code{REAL(10)} entity. In the absence of @code{REAL(16)} and + @code{REAL(10)}, an error will occur. + @node BOZ literal constants @subsection BOZ literal constants @cindex BOZ literal constants diff -Nrcpad gcc-4.6.0/gcc/fortran/interface.c gcc-4.6.1/gcc/fortran/interface.c *** gcc-4.6.0/gcc/fortran/interface.c Wed Feb 16 20:51:56 2011 --- gcc-4.6.1/gcc/fortran/interface.c Sun Jun 19 21:05:18 2011 *************** check_interface0 (gfc_interface *p, cons *** 1128,1133 **** --- 1128,1139 ---- " or all FUNCTIONs", interface_name, &p->sym->declared_at); return 1; } + + if (p->sym->attr.proc == PROC_INTERNAL + && gfc_notify_std (GFC_STD_GNU, "Extension: Internal procedure '%s' " + "in %s at %L", p->sym->name, interface_name, + &p->sym->declared_at) == FAILURE) + return 1; } p = psave; *************** check_uop_interfaces (gfc_user_op *uop) *** 1258,1263 **** --- 1264,1317 ---- } } + /* Given an intrinsic op, return an equivalent op if one exists, + or INTRINSIC_NONE otherwise. */ + + gfc_intrinsic_op + gfc_equivalent_op (gfc_intrinsic_op op) + { + switch(op) + { + case INTRINSIC_EQ: + return INTRINSIC_EQ_OS; + + case INTRINSIC_EQ_OS: + return INTRINSIC_EQ; + + case INTRINSIC_NE: + return INTRINSIC_NE_OS; + + case INTRINSIC_NE_OS: + return INTRINSIC_NE; + + case INTRINSIC_GT: + return INTRINSIC_GT_OS; + + case INTRINSIC_GT_OS: + return INTRINSIC_GT; + + case INTRINSIC_GE: + return INTRINSIC_GE_OS; + + case INTRINSIC_GE_OS: + return INTRINSIC_GE; + + case INTRINSIC_LT: + return INTRINSIC_LT_OS; + + case INTRINSIC_LT_OS: + return INTRINSIC_LT; + + case INTRINSIC_LE: + return INTRINSIC_LE_OS; + + case INTRINSIC_LE_OS: + return INTRINSIC_LE; + + default: + return INTRINSIC_NONE; + } + } /* For the namespace, check generic, user operator and intrinsic operator interfaces for consistency and to remove duplicate *************** gfc_check_interfaces (gfc_namespace *ns) *** 1298,1372 **** for (ns2 = ns; ns2; ns2 = ns2->parent) { if (check_interface1 (ns->op[i], ns2->op[i], 0, interface_name, true)) goto done; ! switch (i) ! { ! case INTRINSIC_EQ: ! if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_EQ_OS], ! 0, interface_name, true)) goto done; ! break; ! ! case INTRINSIC_EQ_OS: ! if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_EQ], ! 0, interface_name, true)) goto done; ! break; ! ! case INTRINSIC_NE: ! if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_NE_OS], ! 0, interface_name, true)) goto done; ! break; ! ! case INTRINSIC_NE_OS: ! if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_NE], ! 0, interface_name, true)) goto done; ! break; ! ! case INTRINSIC_GT: ! if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_GT_OS], ! 0, interface_name, true)) goto done; ! break; ! ! case INTRINSIC_GT_OS: ! if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_GT], ! 0, interface_name, true)) goto done; ! break; ! ! case INTRINSIC_GE: ! if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_GE_OS], ! 0, interface_name, true)) goto done; ! break; ! ! case INTRINSIC_GE_OS: ! if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_GE], ! 0, interface_name, true)) goto done; ! break; ! ! case INTRINSIC_LT: ! if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_LT_OS], ! 0, interface_name, true)) goto done; ! break; ! ! case INTRINSIC_LT_OS: ! if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_LT], ! 0, interface_name, true)) goto done; ! break; ! ! case INTRINSIC_LE: ! if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_LE_OS], ! 0, interface_name, true)) goto done; ! break; ! ! case INTRINSIC_LE_OS: ! if (check_interface1 (ns->op[i], ns2->op[INTRINSIC_LE], ! 0, interface_name, true)) goto done; ! break; ! ! default: ! break; ! } } } --- 1352,1370 ---- for (ns2 = ns; ns2; ns2 = ns2->parent) { + gfc_intrinsic_op other_op; + if (check_interface1 (ns->op[i], ns2->op[i], 0, interface_name, true)) goto done; ! /* i should be gfc_intrinsic_op, but has to be int with this cast ! here for stupid C++ compatibility rules. */ ! other_op = gfc_equivalent_op ((gfc_intrinsic_op) i); ! if (other_op != INTRINSIC_NONE ! && check_interface1 (ns->op[i], ns2->op[other_op], ! 0, interface_name, true)) ! goto done; } } *************** gfc_extend_assign (gfc_code *c, gfc_name *** 3234,3239 **** --- 3232,3238 ---- c->expr1 = gfc_get_expr (); build_compcall_for_operator (c->expr1, actual, tb_base, tbo, gname); c->expr1->value.compcall.assign = 1; + c->expr1->where = c->loc; c->expr2 = NULL; c->op = EXEC_COMPCALL; diff -Nrcpad gcc-4.6.0/gcc/fortran/invoke.texi gcc-4.6.1/gcc/fortran/invoke.texi *** gcc-4.6.0/gcc/fortran/invoke.texi Thu Mar 3 04:14:29 2011 --- gcc-4.6.1/gcc/fortran/invoke.texi Wed May 4 19:18:01 2011 *************** we recommend avoiding and that we believ *** 692,698 **** This currently includes @option{-Waliasing}, @option{-Wampersand}, @option{-Wconversion}, @option{-Wsurprising}, @option{-Wintrinsics-std}, @option{-Wno-tabs}, @option{-Wintrinsic-shadow}, @option{-Wline-truncation}, ! and @option{-Wunused}. @item -Waliasing @opindex @code{Waliasing} --- 692,698 ---- This currently includes @option{-Waliasing}, @option{-Wampersand}, @option{-Wconversion}, @option{-Wsurprising}, @option{-Wintrinsics-std}, @option{-Wno-tabs}, @option{-Wintrinsic-shadow}, @option{-Wline-truncation}, ! @option{-Wreal-q-constant} and @option{-Wunused}. @item -Waliasing @opindex @code{Waliasing} *************** it as @code{EXTERNAL} procedure because *** 780,785 **** --- 780,791 ---- be used to never trigger this behavior and always link to the intrinsic regardless of the selected standard. + @item -Wreal-q-constant + @opindex @code{Wreal-q-constant} + @cindex warnings, @code{q} exponent-letter + Produce a warning if a real-literal-constant contains a @code{q} + exponent-letter. + @item -Wsurprising @opindex @code{Wsurprising} @cindex warnings, suspicious code diff -Nrcpad gcc-4.6.0/gcc/fortran/lang.opt gcc-4.6.1/gcc/fortran/lang.opt *** gcc-4.6.0/gcc/fortran/lang.opt Sun Nov 28 13:47:26 2010 --- gcc-4.6.1/gcc/fortran/lang.opt Wed May 4 19:18:01 2011 *************** Wintrinsics-std *** 238,243 **** --- 238,247 ---- Fortran Warning Warn on intrinsics not part of the selected standard + Wreal-q-constant + Fortran Warning + Warn about real-literal-constants with 'q' exponent-letter + Wreturn-type Fortran Warning ; Documented in C diff -Nrcpad gcc-4.6.0/gcc/fortran/module.c gcc-4.6.1/gcc/fortran/module.c *** gcc-4.6.0/gcc/fortran/module.c Fri Mar 11 14:13:49 2011 --- gcc-4.6.1/gcc/fortran/module.c Sun Jun 19 21:05:18 2011 *************** mio_component_ref (gfc_component **cp, g *** 2351,2364 **** if (sym->components != NULL && p->u.pointer == NULL) { /* Symbol already loaded, so search by name. */ ! for (q = sym->components; q; q = q->next) ! if (strcmp (q->name, name) == 0) ! break; ! ! if (q == NULL) ! gfc_internal_error ("mio_component_ref(): Component not found"); ! associate_integer_pointer (p, q); } /* Make sure this symbol will eventually be loaded. */ --- 2351,2360 ---- if (sym->components != NULL && p->u.pointer == NULL) { /* Symbol already loaded, so search by name. */ ! q = gfc_find_component (sym, name, true, true); ! if (q) ! associate_integer_pointer (p, q); } /* Make sure this symbol will eventually be loaded. */ *************** mio_component (gfc_component *c, int vty *** 2402,2407 **** --- 2398,2405 ---- mio_array_spec (&c->as); mio_symbol_attribute (&c->attr); + if (c->ts.type == BT_CLASS) + c->attr.class_ok = 1; c->attr.access = MIO_NAME (gfc_access) (c->attr.access, access_types); if (!vtype) *************** fix_mio_expr (gfc_expr *e) *** 3011,3016 **** --- 3009,3015 ---- sym->attr.flavor = FL_PROCEDURE; sym->attr.generic = 1; e->symtree = gfc_find_symtree (gfc_current_ns->sym_root, fname); + gfc_commit_symbol (sym); } } diff -Nrcpad gcc-4.6.0/gcc/fortran/options.c gcc-4.6.1/gcc/fortran/options.c *** gcc-4.6.0/gcc/fortran/options.c Thu Jan 27 07:02:58 2011 --- gcc-4.6.1/gcc/fortran/options.c Wed May 4 19:18:01 2011 *************** gfc_init_options (unsigned int decoded_o *** 107,112 **** --- 107,113 ---- gfc_option.warn_intrinsic_shadow = 0; gfc_option.warn_intrinsics_std = 0; gfc_option.warn_align_commons = 1; + gfc_option.warn_real_q_constant = 0; gfc_option.warn_unused_dummy_argument = 0; gfc_option.max_errors = 25; *************** set_Wall (int setting) *** 445,450 **** --- 446,452 ---- gfc_option.warn_intrinsic_shadow = setting; gfc_option.warn_intrinsics_std = setting; gfc_option.warn_character_truncation = setting; + gfc_option.warn_real_q_constant = setting; gfc_option.warn_unused_dummy_argument = setting; warn_unused = setting; *************** gfc_handle_option (size_t scode, const c *** 643,648 **** --- 645,654 ---- gfc_option.warn_align_commons = value; break; + case OPT_Wreal_q_constant: + gfc_option.warn_real_q_constant = value; + break; + case OPT_Wunused_dummy_argument: gfc_option.warn_unused_dummy_argument = value; break; diff -Nrcpad gcc-4.6.0/gcc/fortran/parse.c gcc-4.6.1/gcc/fortran/parse.c *** gcc-4.6.0/gcc/fortran/parse.c Mon Feb 14 22:17:44 2011 --- gcc-4.6.1/gcc/fortran/parse.c Sun Jun 19 21:05:18 2011 *************** decode_statement (void) *** 399,405 **** break; case 'm': ! match ("module% procedure% ", gfc_match_modproc, ST_MODULE_PROC); match ("module", gfc_match_module, ST_MODULE); break; --- 399,405 ---- break; case 'm': ! match ("module% procedure", gfc_match_modproc, ST_MODULE_PROC); match ("module", gfc_match_module, ST_MODULE); break; *************** endType: *** 2108,2120 **** { /* Look for allocatable components. */ if (c->attr.allocatable ! || (c->ts.type == BT_CLASS && CLASS_DATA (c)->attr.allocatable) || (c->ts.type == BT_DERIVED && c->ts.u.derived->attr.alloc_comp)) sym->attr.alloc_comp = 1; /* Look for pointer components. */ if (c->attr.pointer ! || (c->ts.type == BT_CLASS && CLASS_DATA (c)->attr.class_pointer) || (c->ts.type == BT_DERIVED && c->ts.u.derived->attr.pointer_comp)) sym->attr.pointer_comp = 1; --- 2108,2122 ---- { /* Look for allocatable components. */ if (c->attr.allocatable ! || (c->ts.type == BT_CLASS && c->attr.class_ok ! && CLASS_DATA (c)->attr.allocatable) || (c->ts.type == BT_DERIVED && c->ts.u.derived->attr.alloc_comp)) sym->attr.alloc_comp = 1; /* Look for pointer components. */ if (c->attr.pointer ! || (c->ts.type == BT_CLASS && c->attr.class_ok ! && CLASS_DATA (c)->attr.class_pointer) || (c->ts.type == BT_DERIVED && c->ts.u.derived->attr.pointer_comp)) sym->attr.pointer_comp = 1; *************** resolve_all_program_units (gfc_namespace *** 4191,4196 **** --- 4193,4202 ---- gfc_current_ns = gfc_global_ns_list; for (; gfc_current_ns; gfc_current_ns = gfc_current_ns->sibling) { + if (gfc_current_ns->proc_name + && gfc_current_ns->proc_name->attr.flavor == FL_MODULE) + continue; /* Already resolved. */ + if (gfc_current_ns->proc_name) gfc_current_locus = gfc_current_ns->proc_name->declared_at; gfc_resolve (gfc_current_ns); *************** translate_all_program_units (gfc_namespa *** 4231,4238 **** --- 4237,4264 ---- gfc_current_ns = gfc_global_ns_list; gfc_get_errors (NULL, &errors); + /* We first translate all modules to make sure that later parts + of the program can use the decl. Then we translate the nonmodules. */ + for (; !errors && gfc_current_ns; gfc_current_ns = gfc_current_ns->sibling) { + if (!gfc_current_ns->proc_name + || gfc_current_ns->proc_name->attr.flavor != FL_MODULE) + continue; + + gfc_current_locus = gfc_current_ns->proc_name->declared_at; + gfc_derived_types = gfc_current_ns->derived_types; + gfc_generate_module_code (gfc_current_ns); + gfc_current_ns->translated = 1; + } + + gfc_current_ns = gfc_global_ns_list; + for (; !errors && gfc_current_ns; gfc_current_ns = gfc_current_ns->sibling) + { + if (gfc_current_ns->proc_name + && gfc_current_ns->proc_name->attr.flavor == FL_MODULE) + continue; + gfc_current_locus = gfc_current_ns->proc_name->declared_at; gfc_derived_types = gfc_current_ns->derived_types; gfc_generate_code (gfc_current_ns); *************** translate_all_program_units (gfc_namespa *** 4243,4249 **** gfc_current_ns = gfc_global_ns_list; for (;gfc_current_ns;) { ! gfc_namespace *ns = gfc_current_ns->sibling; gfc_derived_types = gfc_current_ns->derived_types; gfc_done_2 (); gfc_current_ns = ns; --- 4269,4284 ---- gfc_current_ns = gfc_global_ns_list; for (;gfc_current_ns;) { ! gfc_namespace *ns; ! ! if (gfc_current_ns->proc_name ! && gfc_current_ns->proc_name->attr.flavor == FL_MODULE) ! { ! gfc_current_ns = gfc_current_ns->sibling; ! continue; ! } ! ! ns = gfc_current_ns->sibling; gfc_derived_types = gfc_current_ns->derived_types; gfc_done_2 (); gfc_current_ns = ns; *************** loop: *** 4375,4390 **** if (s.state == COMP_MODULE) { gfc_dump_module (s.sym->name, errors_before == errors); - if (errors == 0) - gfc_generate_module_code (gfc_current_ns); - pop_state (); if (!gfc_option.flag_whole_file) ! gfc_done_2 (); else { gfc_current_ns->derived_types = gfc_derived_types; gfc_derived_types = NULL; ! gfc_current_ns = NULL; } } else --- 4410,4427 ---- if (s.state == COMP_MODULE) { gfc_dump_module (s.sym->name, errors_before == errors); if (!gfc_option.flag_whole_file) ! { ! if (errors == 0) ! gfc_generate_module_code (gfc_current_ns); ! pop_state (); ! gfc_done_2 (); ! } else { gfc_current_ns->derived_types = gfc_derived_types; gfc_derived_types = NULL; ! goto prog_units; } } else *************** prog_units: *** 4429,4438 **** = gfc_option.dump_fortran_original ? gfc_global_ns_list : NULL; for (; gfc_current_ns; gfc_current_ns = gfc_current_ns->sibling) ! { ! gfc_dump_parse_tree (gfc_current_ns, stdout); ! fputs ("------------------------------------------\n\n", stdout); ! } /* Do the translation. */ translate_all_program_units (gfc_global_ns_list); --- 4466,4477 ---- = gfc_option.dump_fortran_original ? gfc_global_ns_list : NULL; for (; gfc_current_ns; gfc_current_ns = gfc_current_ns->sibling) ! if (!gfc_current_ns->proc_name ! || gfc_current_ns->proc_name->attr.flavor != FL_MODULE) ! { ! gfc_dump_parse_tree (gfc_current_ns, stdout); ! fputs ("------------------------------------------\n\n", stdout); ! } /* Do the translation. */ translate_all_program_units (gfc_global_ns_list); diff -Nrcpad gcc-4.6.0/gcc/fortran/primary.c gcc-4.6.1/gcc/fortran/primary.c *** gcc-4.6.0/gcc/fortran/primary.c Fri Feb 18 22:34:34 2011 --- gcc-4.6.1/gcc/fortran/primary.c Wed May 4 19:18:01 2011 *************** match_real_constant (gfc_expr **result, *** 541,546 **** --- 541,557 ---- goto done; exp_char = c; + + if (c == 'q') + { + if (gfc_notify_std (GFC_STD_GNU, "Extension: exponent-letter 'q' in " + "real-literal-constant at %C") == FAILURE) + return MATCH_ERROR; + else if (gfc_option.warn_real_q_constant) + gfc_warning("Extension: exponent-letter 'q' in real-literal-constant " + "at %C"); + } + /* Scan exponent. */ c = gfc_next_ascii_char (); count++; *************** done: *** 616,621 **** --- 627,656 ---- kind = gfc_default_double_kind; break; + case 'q': + if (kind != -2) + { + gfc_error ("Real number at %C has a 'q' exponent and an explicit " + "kind"); + goto cleanup; + } + + /* The maximum possible real kind type parameter is 16. First, try + that for the kind, then fallback to trying kind=10 (Intel 80 bit) + extended precision. If neither value works, just given up. */ + kind = 16; + if (gfc_validate_kind (BT_REAL, kind, true) < 0) + { + kind = 10; + if (gfc_validate_kind (BT_REAL, kind, true) < 0) + { + gfc_error ("Invalid exponent-letter 'q' in " + "real-literal-constant at %C"); + goto cleanup; + } + } + break; + default: if (kind == -2) kind = gfc_default_real_kind; diff -Nrcpad gcc-4.6.0/gcc/fortran/resolve.c gcc-4.6.1/gcc/fortran/resolve.c *** gcc-4.6.0/gcc/fortran/resolve.c Fri Feb 18 12:23:56 2011 --- gcc-4.6.1/gcc/fortran/resolve.c Sun Jun 19 21:05:18 2011 *************** resolve_formal_arglist (gfc_symbol *proc *** 315,321 **** shape until we know if it has the pointer or allocatable attributes. */ if (sym->as && sym->as->rank > 0 && sym->as->type == AS_DEFERRED ! && !(sym->attr.pointer || sym->attr.allocatable)) { sym->as->type = AS_ASSUMED_SHAPE; for (i = 0; i < sym->as->rank; i++) --- 315,322 ---- shape until we know if it has the pointer or allocatable attributes. */ if (sym->as && sym->as->rank > 0 && sym->as->type == AS_DEFERRED ! && !(sym->attr.pointer || sym->attr.allocatable) ! && sym->attr.flavor != FL_PROCEDURE) { sym->as->type = AS_ASSUMED_SHAPE; for (i = 0; i < sym->as->rank; i++) *************** resolve_global_procedure (gfc_symbol *sy *** 2187,2193 **** /* F2003, 12.3.1.1 (3c); F2008, 12.4.2.2 (3c) */ if (sym->ts.type == BT_CHARACTER && sym->attr.if_source != IFSRC_IFBODY ! && def_sym->ts.u.cl->length != NULL) { gfc_charlen *cl = sym->ts.u.cl; --- 2188,2194 ---- /* F2003, 12.3.1.1 (3c); F2008, 12.4.2.2 (3c) */ if (sym->ts.type == BT_CHARACTER && sym->attr.if_source != IFSRC_IFBODY ! && def_sym->ts.type == BT_CHARACTER && def_sym->ts.u.cl->length != NULL) { gfc_charlen *cl = sym->ts.u.cl; *************** success: *** 5674,5680 **** /* Make sure that we have the right specific instance for the name. */ derived = get_declared_from_expr (NULL, NULL, e); ! st = gfc_find_typebound_proc (derived, NULL, genname, false, &e->where); if (st) e->value.compcall.tbp = st->n.tb; --- 5675,5681 ---- /* Make sure that we have the right specific instance for the name. */ derived = get_declared_from_expr (NULL, NULL, e); ! st = gfc_find_typebound_proc (derived, NULL, genname, true, &e->where); if (st) e->value.compcall.tbp = st->n.tb; *************** apply_default_init_local (gfc_symbol *sy *** 9858,9863 **** --- 9859,9869 ---- static gfc_try resolve_fl_var_and_proc (gfc_symbol *sym, int mp_flag) { + /* Avoid double diagnostics for function result symbols. */ + if ((sym->result || sym->attr.result) && !sym->attr.dummy + && (sym->ns != gfc_current_ns)) + return SUCCESS; + /* Constraints on deferred shape variable. */ if (sym->as == NULL || sym->as->type != AS_DEFERRED) { *************** resolve_fl_var_and_proc (gfc_symbol *sym *** 9885,9891 **** else { if (!mp_flag && !sym->attr.allocatable && !sym->attr.pointer ! && !sym->attr.dummy && sym->ts.type != BT_CLASS && !sym->assoc) { gfc_error ("Array '%s' at %L cannot have a deferred shape", sym->name, &sym->declared_at); --- 9891,9897 ---- else { if (!mp_flag && !sym->attr.allocatable && !sym->attr.pointer ! && sym->ts.type != BT_CLASS && !sym->assoc) { gfc_error ("Array '%s' at %L cannot have a deferred shape", sym->name, &sym->declared_at); *************** resolve_fl_derived (gfc_symbol *sym) *** 11698,11704 **** return FAILURE; } ! if (c->ts.type == BT_CLASS && CLASS_DATA (c)->attr.class_pointer && CLASS_DATA (c)->ts.u.derived->components == NULL && !CLASS_DATA (c)->ts.u.derived->attr.zero_comp) { --- 11704,11711 ---- return FAILURE; } ! if (c->ts.type == BT_CLASS && c->attr.class_ok ! && CLASS_DATA (c)->attr.class_pointer && CLASS_DATA (c)->ts.u.derived->components == NULL && !CLASS_DATA (c)->ts.u.derived->attr.zero_comp) { *************** resolve_fl_derived (gfc_symbol *sym) *** 11709,11717 **** } /* C437. */ ! if (c->ts.type == BT_CLASS ! && !(CLASS_DATA (c)->attr.class_pointer ! || CLASS_DATA (c)->attr.allocatable)) { gfc_error ("Component '%s' with CLASS at %L must be allocatable " "or pointer", c->name, &c->loc); --- 11716,11725 ---- } /* C437. */ ! if (c->ts.type == BT_CLASS && c->attr.flavor != FL_PROCEDURE ! && (!c->attr.class_ok ! || !(CLASS_DATA (c)->attr.class_pointer ! || CLASS_DATA (c)->attr.allocatable))) { gfc_error ("Component '%s' with CLASS at %L must be allocatable " "or pointer", c->name, &c->loc); *************** resolve_symbol (gfc_symbol *sym) *** 11946,11956 **** gfc_namespace *ns; gfc_component *c; - /* Avoid double resolution of function result symbols. */ - if ((sym->result || sym->attr.result) && !sym->attr.dummy - && (sym->ns != gfc_current_ns)) - return; - if (sym->attr.flavor == FL_UNKNOWN) { --- 11954,11959 ---- *************** resolve_types (gfc_namespace *ns) *** 13505,13510 **** --- 13508,13517 ---- resolve_contained_functions (ns); + if (ns->proc_name && ns->proc_name->attr.flavor == FL_PROCEDURE + && ns->proc_name->attr.if_source == IFSRC_IFBODY) + resolve_formal_arglist (ns->proc_name); + gfc_traverse_ns (ns, resolve_bind_c_derived_types); for (cl = ns->cl_list; cl; cl = cl->next) diff -Nrcpad gcc-4.6.0/gcc/fortran/symbol.c gcc-4.6.1/gcc/fortran/symbol.c *** gcc-4.6.0/gcc/fortran/symbol.c Wed Jan 26 10:12:47 2011 --- gcc-4.6.1/gcc/fortran/symbol.c Sun Jun 19 21:05:18 2011 *************** gfc_find_component (gfc_symbol *sym, con *** 1996,2002 **** { gfc_component *p; ! if (name == NULL) return NULL; sym = gfc_use_derived (sym); --- 1996,2002 ---- { gfc_component *p; ! if (name == NULL || sym == NULL) return NULL; sym = gfc_use_derived (sym); diff -Nrcpad gcc-4.6.0/gcc/fortran/trans-array.c gcc-4.6.1/gcc/fortran/trans-array.c *** gcc-4.6.0/gcc/fortran/trans-array.c Wed Feb 23 22:38:27 2011 --- gcc-4.6.1/gcc/fortran/trans-array.c Fri Jun 17 06:11:31 2011 *************** gfc_init_loopinfo (gfc_loopinfo * loop) *** 2223,2229 **** for (n = 0; n < GFC_MAX_DIMENSIONS; n++) { loop->order[n] = n; ! loop->reverse[n] = GFC_CANNOT_REVERSE; } loop->ss = gfc_ss_terminator; --- 2223,2229 ---- for (n = 0; n < GFC_MAX_DIMENSIONS; n++) { loop->order[n] = n; ! loop->reverse[n] = GFC_INHIBIT_REVERSE; } loop->ss = gfc_ss_terminator; *************** gfc_conv_expr_descriptor (gfc_se * se, g *** 5669,5675 **** lse.string_length = rse.string_length; tmp = gfc_trans_scalar_assign (&lse, &rse, expr->ts, true, ! expr->expr_type == EXPR_VARIABLE, true); gfc_add_expr_to_block (&block, tmp); /* Finish the copying loops. */ --- 5669,5676 ---- lse.string_length = rse.string_length; tmp = gfc_trans_scalar_assign (&lse, &rse, expr->ts, true, ! expr->expr_type == EXPR_VARIABLE ! || expr->expr_type == EXPR_ARRAY, true); gfc_add_expr_to_block (&block, tmp); /* Finish the copying loops. */ *************** get_std_lbound (gfc_expr *expr, tree des *** 6707,6712 **** --- 6708,6715 ---- tree stride; tree cond, cond1, cond3, cond4; tree tmp; + gfc_ref *ref; + if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (desc))) { tmp = gfc_rank_cst[dim]; *************** get_std_lbound (gfc_expr *expr, tree des *** 6740,6745 **** --- 6743,6756 ---- else if (expr->expr_type == EXPR_VARIABLE) { tmp = TREE_TYPE (expr->symtree->n.sym->backend_decl); + for (ref = expr->ref; ref; ref = ref->next) + { + if (ref->type == REF_COMPONENT + && ref->u.c.component->as + && ref->next + && ref->next->u.ar.type == AR_FULL) + tmp = TREE_TYPE (ref->u.c.component->backend_decl); + } return GFC_TYPE_ARRAY_LBOUND(tmp, dim); } else if (expr->expr_type == EXPR_FUNCTION) diff -Nrcpad gcc-4.6.0/gcc/fortran/trans-decl.c gcc-4.6.1/gcc/fortran/trans-decl.c *** gcc-4.6.0/gcc/fortran/trans-decl.c Tue Feb 22 20:33:45 2011 --- gcc-4.6.1/gcc/fortran/trans-decl.c Mon Jun 6 18:17:26 2011 *************** gfc_trans_deferred_vars (gfc_symbol * pr *** 3388,3394 **** if (sym->attr.dimension) { ! switch (sym->as->type) { case AS_EXPLICIT: if (sym->attr.dummy || sym->attr.result) --- 3388,3398 ---- if (sym->attr.dimension) { ! /* Assumed-size Cray pointees need to be treated as AS_EXPLICIT. */ ! array_type tmp = sym->as->type; ! if (tmp == AS_ASSUMED_SIZE && sym->as->cp_was_assumed) ! tmp = AS_EXPLICIT; ! switch (tmp) { case AS_EXPLICIT: if (sym->attr.dummy || sym->attr.result) diff -Nrcpad gcc-4.6.0/gcc/fortran/trans-expr.c gcc-4.6.1/gcc/fortran/trans-expr.c *** gcc-4.6.0/gcc/fortran/trans-expr.c Sat Mar 12 16:58:33 2011 --- gcc-4.6.1/gcc/fortran/trans-expr.c Fri Jun 17 06:11:31 2011 *************** arrayfunc_assign_needs_temporary (gfc_ex *** 5444,5452 **** return true; /* If we have reached here with an intrinsic function, we do not ! need a temporary. */ if (expr2->value.function.isym) ! return false; /* If the LHS is a dummy, we need a temporary if it is not INTENT(OUT). */ --- 5444,5455 ---- return true; /* If we have reached here with an intrinsic function, we do not ! need a temporary except in the particular case that reallocation ! on assignment is active and the lhs is allocatable and a target. */ if (expr2->value.function.isym) ! return (gfc_option.flag_realloc_lhs ! && sym->attr.allocatable ! && sym->attr.target); /* If the LHS is a dummy, we need a temporary if it is not INTENT(OUT). */ *************** realloc_lhs_loop_for_fcn_call (gfc_se *s *** 5528,5550 **** } static void ! realloc_lhs_bounds_for_intrinsic_call (gfc_se *se, int rank) { tree desc; tree tmp; tree offset; int n; ! /* Use the allocation done by the library. */ desc = build_fold_indirect_ref_loc (input_location, se->expr); - tmp = gfc_conv_descriptor_data_get (desc); - tmp = gfc_call_free (fold_convert (pvoid_type_node, tmp)); - gfc_add_expr_to_block (&se->pre, tmp); - gfc_conv_descriptor_data_set (&se->pre, desc, null_pointer_node); /* Unallocated, the descriptor does not have a dtype. */ tmp = gfc_conv_descriptor_dtype (desc); gfc_add_modify (&se->pre, tmp, gfc_get_dtype (TREE_TYPE (desc))); offset = gfc_index_zero_node; tmp = gfc_index_one_node; --- 5531,5568 ---- } + /* For Assignment to a reallocatable lhs from intrinsic functions, + replace the se.expr (ie. the result) with a temporary descriptor. + Null the data field so that the library allocates space for the + result. Free the data of the original descriptor after the function, + in case it appears in an argument expression and transfer the + result to the original descriptor. */ + static void ! fcncall_realloc_result (gfc_se *se, int rank) { tree desc; + tree res_desc; tree tmp; tree offset; int n; ! /* Use the allocation done by the library. Substitute the lhs ! descriptor with a copy, whose data field is nulled.*/ desc = build_fold_indirect_ref_loc (input_location, se->expr); /* Unallocated, the descriptor does not have a dtype. */ tmp = gfc_conv_descriptor_dtype (desc); gfc_add_modify (&se->pre, tmp, gfc_get_dtype (TREE_TYPE (desc))); + res_desc = gfc_evaluate_now (desc, &se->pre); + gfc_conv_descriptor_data_set (&se->pre, res_desc, null_pointer_node); + se->expr = gfc_build_addr_expr (TREE_TYPE (se->expr), res_desc); + + /* Free the lhs after the function call and copy the result to + the lhs descriptor. */ + tmp = gfc_conv_descriptor_data_get (desc); + tmp = gfc_call_free (fold_convert (pvoid_type_node, tmp)); + gfc_add_expr_to_block (&se->post, tmp); + gfc_add_modify (&se->post, desc, res_desc); offset = gfc_index_zero_node; tmp = gfc_index_one_node; *************** realloc_lhs_bounds_for_intrinsic_call (g *** 5580,5586 **** } - /* Try to translate array(:) = func (...), where func is a transformational array function, without using a temporary. Returns NULL if this isn't the case. */ --- 5598,5603 ---- *************** gfc_trans_arrayfunc_assign (gfc_expr * e *** 5645,5651 **** ss->is_alloc_lhs = 1; } else ! realloc_lhs_bounds_for_intrinsic_call (&se, expr1->rank); } gfc_conv_function_expr (&se, expr2); --- 5662,5668 ---- ss->is_alloc_lhs = 1; } else ! fcncall_realloc_result (&se, expr1->rank); } gfc_conv_function_expr (&se, expr2); *************** gfc_trans_assignment_1 (gfc_expr * expr1 *** 6050,6057 **** /* Calculate the bounds of the scalarization. */ gfc_conv_ss_startstride (&loop); /* Enable loop reversal. */ ! for (n = 0; n < loop.dimen; n++) ! loop.reverse[n] = GFC_REVERSE_NOT_SET; /* Resolve any data dependencies in the statement. */ gfc_conv_resolve_dependencies (&loop, lss, rss); /* Setup the scalarizing loops. */ --- 6067,6074 ---- /* Calculate the bounds of the scalarization. */ gfc_conv_ss_startstride (&loop); /* Enable loop reversal. */ ! for (n = 0; n < GFC_MAX_DIMENSIONS; n++) ! loop.reverse[n] = GFC_ENABLE_REVERSE; /* Resolve any data dependencies in the statement. */ gfc_conv_resolve_dependencies (&loop, lss, rss); /* Setup the scalarizing loops. */ *************** gfc_trans_assignment_1 (gfc_expr * expr1 *** 6130,6137 **** tmp = gfc_trans_scalar_assign (&lse, &rse, expr1->ts, l_is_temp || init_flag, ! expr_is_variable (expr2) || scalar_to_array, ! dealloc); gfc_add_expr_to_block (&body, tmp); if (lss == gfc_ss_terminator) --- 6147,6154 ---- tmp = gfc_trans_scalar_assign (&lse, &rse, expr1->ts, l_is_temp || init_flag, ! expr_is_variable (expr2) || scalar_to_array ! || expr2->expr_type == EXPR_ARRAY, dealloc); gfc_add_expr_to_block (&body, tmp); if (lss == gfc_ss_terminator) diff -Nrcpad gcc-4.6.0/libgfortran/ChangeLog gcc-4.6.1/libgfortran/ChangeLog *** gcc-4.6.0/libgfortran/ChangeLog Fri Mar 25 16:56:18 2011 --- gcc-4.6.1/libgfortran/ChangeLog Mon Jun 27 10:04:28 2011 *************** *** 1,3 **** --- 1,32 ---- + 2011-06-27 Release Manager + + * GCC 4.6.1 released. + + 2011-04-30 Jerry DeLisle + + Backport from mainline: + PR libgfortran/48030 + * io/read.c (read_x): Re-implement using fbuf_getc. + + 2011-04-18 Janne Blomqvist + + PR libfortran/47571 + * configure: Regenerated. + * config.h.in: Regenerated. + * acinclude.m4: Add alpha*-dec-osf* to gthread blacklist. + * configure.ac: Use separate symbol for clock_gettime in librt. + * intrinsics/system_clock.c: Use weakrefs only when needed and + supported. + + 2011-03-28 Rainer Orth + + Backport from mainline: + 2011-03-21 Rainer Orth + + PR bootstrap/48135 + * configure.ac (gfortran_use_symver): Handle --disable-symvers. + * configure: Regenerate. + 2011-03-25 Release Manager * GCC 4.6.0 released. diff -Nrcpad gcc-4.6.0/libgfortran/acinclude.m4 gcc-4.6.1/libgfortran/acinclude.m4 *** gcc-4.6.0/libgfortran/acinclude.m4 Fri Feb 25 17:56:04 2011 --- gcc-4.6.1/libgfortran/acinclude.m4 Mon Apr 18 15:49:16 2011 *************** AC_DEFUN([LIBGFOR_GTHREAD_WEAK], [ *** 108,114 **** [Define to 1 if the target supports #pragma weak]) fi case "$host" in ! *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* ) AC_DEFINE(GTHREAD_USE_WEAK, 0, [Define to 0 if the target shouldn't use #pragma weak]) ;; --- 108,114 ---- [Define to 1 if the target supports #pragma weak]) fi case "$host" in ! *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | alpha*-dec-osf* ) AC_DEFINE(GTHREAD_USE_WEAK, 0, [Define to 0 if the target shouldn't use #pragma weak]) ;; diff -Nrcpad gcc-4.6.0/libgfortran/config.h.in gcc-4.6.1/libgfortran/config.h.in *** gcc-4.6.0/libgfortran/config.h.in Thu Feb 24 21:51:39 2011 --- gcc-4.6.1/libgfortran/config.h.in Mon Apr 18 15:49:16 2011 *************** *** 210,215 **** --- 210,218 ---- /* Define to 1 if you have the `clock_gettime' function. */ #undef HAVE_CLOCK_GETTIME + /* Define to 1 if you have the `clock_gettime' function in librt. */ + #undef HAVE_CLOCK_GETTIME_LIBRT + /* libm includes clog */ #undef HAVE_CLOG diff -Nrcpad gcc-4.6.0/libgfortran/configure gcc-4.6.1/libgfortran/configure *** gcc-4.6.0/libgfortran/configure Fri Mar 25 17:07:00 2011 --- gcc-4.6.1/libgfortran/configure Mon Jun 27 10:13:01 2011 *************** enable_intermodule *** 757,762 **** --- 757,763 ---- enable_maintainer_mode enable_multilib enable_dependency_tracking + enable_symvers enable_shared enable_static with_pic *************** Optional Features: *** 1406,1411 **** --- 1407,1413 ---- --enable-multilib build many library versions (default) --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors + --disable-symvers disable symbol versioning for libgfortran --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] *************** fi *** 5564,5577 **** # Check for symbol versioning (copied from libssp). { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether symbol versioning is supported" >&5 $as_echo_n "checking whether symbol versioning is supported... " >&6; } ! save_LDFLAGS="$LDFLAGS" ! LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map" ! cat > conftest.map <conftest.$ac_ext --- 5566,5587 ---- # Check for symbol versioning (copied from libssp). { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether symbol versioning is supported" >&5 $as_echo_n "checking whether symbol versioning is supported... " >&6; } ! # Check whether --enable-symvers was given. ! if test "${enable_symvers+set}" = set; then : ! enableval=$enable_symvers; gfortran_use_symver=$enableval ! else ! gfortran_use_symver=yes ! fi ! ! if test "x$gfortran_use_symver" = xyes; then ! save_LDFLAGS="$LDFLAGS" ! LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map" ! cat > conftest.map <conftest.$ac_ext *************** else *** 5592,5609 **** fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ! if test x$gfortran_use_symver = xno; then ! case "$target_os" in ! solaris2*) ! LDFLAGS="$save_LDFLAGS" ! LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map" ! # Sun ld cannot handle wildcards and treats all entries as undefined. ! cat > conftest.map <conftest.$ac_ext --- 5602,5619 ---- fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ! if test x$gfortran_use_symver = xno; then ! case "$target_os" in ! solaris2*) ! LDFLAGS="$save_LDFLAGS" ! LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map" ! # Sun ld cannot handle wildcards and treats all entries as undefined. ! cat > conftest.map <conftest.$ac_ext *************** else *** 5624,5633 **** fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ! ;; ! esac fi - LDFLAGS="$save_LDFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gfortran_use_symver" >&5 $as_echo "$gfortran_use_symver" >&6; } if test "x$gfortran_use_symver" != xno; then --- 5634,5644 ---- fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ! ;; ! esac ! fi ! LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gfortran_use_symver" >&5 $as_echo "$gfortran_use_symver" >&6; } if test "x$gfortran_use_symver" != xno; then *************** else *** 12101,12107 **** lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF ! #line 12104 "configure" #include "confdefs.h" #if HAVE_DLFCN_H --- 12112,12118 ---- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF ! #line 12115 "configure" #include "confdefs.h" #if HAVE_DLFCN_H *************** else *** 12207,12213 **** lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF ! #line 12210 "configure" #include "confdefs.h" #if HAVE_DLFCN_H --- 12218,12224 ---- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF ! #line 12221 "configure" #include "confdefs.h" #if HAVE_DLFCN_H *************** $as_echo "#define HAVE_FEENABLEEXCEPT 1" *** 25303,25312 **** fi ! # At least for glibc, clock_gettime is in librt. But don't pull that ! # in if it still doesn't give us the function we want. ! # This test is copied from libgomp, and modified to not link in -lrt ! # as libgfortran calls clock_gettime via a weak reference. if test $ac_cv_func_clock_gettime = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 $as_echo_n "checking for clock_gettime in -lrt... " >&6; } --- 25314,25324 ---- fi ! # At least for glibc and Tru64, clock_gettime is in librt. But don't ! # pull that in if it still doesn't give us the function we want. This ! # test is copied from libgomp, and modified to not link in -lrt as ! # libgfortran calls clock_gettime via a weak reference if it's found ! # in librt. if test $ac_cv_func_clock_gettime = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 $as_echo_n "checking for clock_gettime in -lrt... " >&6; } *************** fi *** 25349,25355 **** $as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } if test "x$ac_cv_lib_rt_clock_gettime" = x""yes; then : ! $as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h fi --- 25361,25367 ---- $as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } if test "x$ac_cv_lib_rt_clock_gettime" = x""yes; then : ! $as_echo "#define HAVE_CLOCK_GETTIME_LIBRT 1" >>confdefs.h fi *************** $as_echo "#define SUPPORTS_WEAK 1" >>con *** 25687,25693 **** fi case "$host" in ! *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* ) $as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h --- 25699,25705 ---- fi case "$host" in ! *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | alpha*-dec-osf* ) $as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h diff -Nrcpad gcc-4.6.0/libgfortran/configure.ac gcc-4.6.1/libgfortran/configure.ac *** gcc-4.6.0/libgfortran/configure.ac Thu Feb 24 21:51:39 2011 --- gcc-4.6.1/libgfortran/configure.ac Mon Apr 18 15:49:16 2011 *************** AC_SUBST(CFLAGS) *** 144,173 **** # Check for symbol versioning (copied from libssp). AC_MSG_CHECKING([whether symbol versioning is supported]) ! save_LDFLAGS="$LDFLAGS" ! LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map" ! cat > conftest.map < conftest.map < conftest.map < conftest.map <u.p.current_unit->pad_status == PAD_NO || is_internal_unit (dtp)) && dtp->u.p.current_unit->bytes_left < n) --- 1117,1123 ---- void read_x (st_parameter_dt *dtp, int n) { ! int length, q, q2; if ((dtp->u.p.current_unit->pad_status == PAD_NO || is_internal_unit (dtp)) && dtp->u.p.current_unit->bytes_left < n) *************** read_x (st_parameter_dt *dtp, int n) *** 1131,1137 **** if (is_internal_unit (dtp)) { ! p = mem_alloc_r (dtp->u.p.current_unit->s, &length); if (unlikely (length < n)) n = length; goto done; --- 1130,1136 ---- if (is_internal_unit (dtp)) { ! mem_alloc_r (dtp->u.p.current_unit->s, &length); if (unlikely (length < n)) n = length; goto done; *************** read_x (st_parameter_dt *dtp, int n) *** 1140,1194 **** if (dtp->u.p.sf_seen_eor) return; - p = fbuf_read (dtp->u.p.current_unit, &length); - if (p == NULL) - { - hit_eof (dtp); - return; - } - - if (length == 0 && dtp->u.p.item_count == 1) - { - if (dtp->u.p.current_unit->pad_status == PAD_NO) - { - hit_eof (dtp); - return; - } - else - return; - } - n = 0; while (n < length) { ! q = *p; ! if (q == '\n' || q == '\r') { /* Unexpected end of line. Set the position. */ - fbuf_seek (dtp->u.p.current_unit, n + 1 ,SEEK_CUR); dtp->u.p.sf_seen_eor = 1; /* If we encounter a CR, it might be a CRLF. */ if (q == '\r') /* Probably a CRLF */ { ! /* See if there is an LF. Use fbuf_read rather then fbuf_getc so ! the position is not advanced unless it really is an LF. */ ! int readlen = 1; ! p = fbuf_read (dtp->u.p.current_unit, &readlen); ! if (*p == '\n' && readlen == 1) ! { ! dtp->u.p.sf_seen_eor = 2; ! fbuf_seek (dtp->u.p.current_unit, 1 ,SEEK_CUR); ! } } goto done; } n++; - p++; } - fbuf_seek (dtp->u.p.current_unit, n, SEEK_CUR); - done: if ((dtp->common.flags & IOPARM_DT_HAS_SIZE) != 0) dtp->u.p.size_used += (GFC_IO_INT) n; --- 1139,1175 ---- if (dtp->u.p.sf_seen_eor) return; n = 0; while (n < length) { ! q = fbuf_getc (dtp->u.p.current_unit); ! if (q == EOF) ! break; ! else if (q == '\n' || q == '\r') { /* Unexpected end of line. Set the position. */ dtp->u.p.sf_seen_eor = 1; + /* If we see an EOR during non-advancing I/O, we need to skip + the rest of the I/O statement. Set the corresponding flag. */ + if (dtp->u.p.advance_status == ADVANCE_NO || dtp->u.p.seen_dollar) + dtp->u.p.eor_condition = 1; + /* If we encounter a CR, it might be a CRLF. */ if (q == '\r') /* Probably a CRLF */ { ! /* See if there is an LF. */ ! q2 = fbuf_getc (dtp->u.p.current_unit); ! if (q2 == '\n') ! dtp->u.p.sf_seen_eor = 2; ! else if (q2 != EOF) /* Oops, seek back. */ ! fbuf_seek (dtp->u.p.current_unit, -1, SEEK_CUR); } goto done; } n++; } done: if ((dtp->common.flags & IOPARM_DT_HAS_SIZE) != 0) dtp->u.p.size_used += (GFC_IO_INT) n;