diff -Nrcpad gcc-4.6.2/gcc/fortran/ChangeLog gcc-4.6.3/gcc/fortran/ChangeLog *** gcc-4.6.2/gcc/fortran/ChangeLog Wed Oct 26 09:05:06 2011 --- gcc-4.6.3/gcc/fortran/ChangeLog Thu Mar 1 11:55:03 2012 *************** *** 1,3 **** --- 1,163 ---- + 2012-03-01 Release Manager + + * GCC 4.6.3 released. + + 2012-02-29 Paul Thomas + + PR fortran/52386 + * trans-expr.c (fcncall_realloc_result): Dereference the + descriptor if needed. + + 2012-02-23 Tobias Burnus + + PR fortran/52335 + * io.c (gfc_match_open): Remove bogus F2003 DELIM= check. + + 2012-02-09 Jakub Jelinek + + Backported from mainline + 2011-12-15 Jakub Jelinek + + PR debug/51517 + * trans-decl.c (gfc_get_symbol_decl): Don't set DECL_INITAL on span. + (gfc_trans_deferred_vars): Instead add its runtime initialization + here. + + 2012-02-08 Tobias Burnus + + PR fortran/52151 + * trans-expr.c (fcncall_realloc_result): Set also the stride. + + 2012-02-03 Tobias Burnus + + PR fortran/52093 + * simplify.c (gfc_simplify_size): Handle INTRINSIC_PARENTHESES. + + 2012-02-03 Paul Thomas + + PR fortran/52012 + * trans-expr.c (fcncall_realloc_result): Correct calculation of + result offset. If variable shape is correct, retain the bounds, + whatever they are. + + 2012-01-28 Tobias Burnus + + PR fortran/52022 + * trans-expr.c (gfc_conv_procedure_call): Fix passing + of functions, which return allocatables. + + 2012-01-25 Tobias Burnus + + PR fortran/51966 + * resolve.c (resolve_structure_cons): Only create an + array constructors for nonscalars. + + 2012-01-24 Tobias Burnus + + PR fortran/51948 + * check.c (variable_check): Fix checking for + result variables and deeply nested BLOCKs. + + 2012-01-21 Tobias Burnus + + PR fortran/51913 + * interface.c (compare_parameter): Fix CLASS comparison. + + 2012-01-19 Tobias Burnus + + PR fortran/51904 + *expr.c (gfc_build_intrinsic_call): Also set the symtree. + + 2012-01-14 Tobias Burnus + + Backported from mainline + 2012-01-14 Tobias Burnus + + PR fortran/51800 + * resolve.c (build_default_init_expr): Also initialize + nonconstant-length strings with -finit-character=. + + 2012-01-01 Thomas König + + Backport from trunk + PR fortran/51502 + * expr.c (gfc_check_vardef_context): When determining + implicit pure status, also check for variable definition + context. Walk up namespaces until a procedure is + found to reset the implict pure attribute. + * resolve.c (gfc_implicit_pure): Walk up namespaces + until a procedure is found. + + 2011-12-22 Toon Moene + + PR fortran/51310 + * resolve.c (build_default_init_expr): Allow non-allocatable, + non-compile-time-constant-shape arrays to have a default + initializer. + * invoke.texi: Delete the restriction on automatic arrays not + being initialized by -finit-=. + + 2011-12-15 Tobias Burnus + + PR fortran/51550 + PR fortran/47545 + PR fortran/49050 + PR fortran/51075 + * resolve.c (resolve_fl_derived0): Print not-implemented error + for deferred-length character components. + + 2011-12-11 Tobias Burnus + + PR fortran/50923 + * trans-decl.c (generate_local_decl): Set TREE_NO_WARNING only + if the front end has printed a warning. + (gfc_generate_function_code): Fix unset-result warning. + + 2011-12-11 Thomas Koenig + + PR fortran/51338 + Backport from trunk + * dependency.c (are_identical_variables): Handle case where + end fields of substring references are NULL. + + 2011-12-08 Toon Moene + + PR fortran/51310 + * invoke.texi: Itemize the cases for which + -finit-= doesn't work. + + 2011-12-08 Tobias Burnus + + PR fortran/51448 + * fortran/trans-array.c (get_std_lbound): Fix handling of + conversion functions. + + 2011-12-06 Tobias Burnus + + PR fortran/51435 + * expr.c (gfc_has_default_initializer): Fix handling of + DT with initialized pointer components. + + 2011-12-03 Tobias Burnus + + PR fortran/50684 + * check.c (variable_check): Fix intent(in) check. + + 2011-11-25 Tobias Burnus + + PR fortran/50408 + * trans-decl.c (gfc_get_module_backend_decl): Also copy + ts.u.derived from the gsym if the ts.type is BT_CLASS. + (gfc_get_extern_function_decl): Copy also the backend_decl + for the symbol's ts.u.{derived,cl} from the gsym. + * trans-types.c (gfc_copy_dt_decls_ifequal): Directly + return if "from" and "to" are the same. + + 2011-11-24 Tobias Burnus + + PR fortran/51218 + * gfortran.dg/implicit_pure_1.f90: New. + 2011-10-26 Release Manager * GCC 4.6.2 released. diff -Nrcpad gcc-4.6.2/gcc/fortran/check.c gcc-4.6.3/gcc/fortran/check.c *** gcc-4.6.2/gcc/fortran/check.c Sun Jun 19 21:05:18 2011 --- gcc-4.6.3/gcc/fortran/check.c Tue Jan 24 08:35:10 2012 *************** variable_check (gfc_expr *e, int n, bool *** 485,507 **** && (gfc_current_intrinsic_arg[n]->intent == INTENT_OUT || gfc_current_intrinsic_arg[n]->intent == INTENT_INOUT)) { ! gfc_error ("'%s' argument of '%s' intrinsic at %L cannot be INTENT(IN)", ! gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic, ! &e->where); ! return FAILURE; } if (e->expr_type == EXPR_VARIABLE && e->symtree->n.sym->attr.flavor != FL_PARAMETER ! && (allow_proc ! || !e->symtree->n.sym->attr.function ! || (e->symtree->n.sym == e->symtree->n.sym->result ! && (e->symtree->n.sym == gfc_current_ns->proc_name ! || (gfc_current_ns->parent ! && e->symtree->n.sym ! == gfc_current_ns->parent->proc_name))))) return SUCCESS; gfc_error ("'%s' argument of '%s' intrinsic at %L must be a variable", gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic, &e->where); --- 485,531 ---- && (gfc_current_intrinsic_arg[n]->intent == INTENT_OUT || gfc_current_intrinsic_arg[n]->intent == INTENT_INOUT)) { ! gfc_ref *ref; ! bool pointer = e->symtree->n.sym->ts.type == BT_CLASS ! && CLASS_DATA (e->symtree->n.sym) ! ? CLASS_DATA (e->symtree->n.sym)->attr.class_pointer ! : e->symtree->n.sym->attr.pointer; ! ! for (ref = e->ref; ref; ref = ref->next) ! { ! if (pointer && ref->type == REF_COMPONENT) ! break; ! if (ref->type == REF_COMPONENT ! && ((ref->u.c.component->ts.type == BT_CLASS ! && CLASS_DATA (ref->u.c.component)->attr.class_pointer) ! || (ref->u.c.component->ts.type != BT_CLASS ! && ref->u.c.component->attr.pointer))) ! break; ! } ! ! if (!ref) ! { ! gfc_error ("'%s' argument of '%s' intrinsic at %L cannot be " ! "INTENT(IN)", gfc_current_intrinsic_arg[n]->name, ! gfc_current_intrinsic, &e->where); ! return FAILURE; ! } } if (e->expr_type == EXPR_VARIABLE && e->symtree->n.sym->attr.flavor != FL_PARAMETER ! && (allow_proc || !e->symtree->n.sym->attr.function)) return SUCCESS; + if (e->expr_type == EXPR_VARIABLE && e->symtree->n.sym->attr.function + && e->symtree->n.sym == e->symtree->n.sym->result) + { + gfc_namespace *ns; + for (ns = gfc_current_ns; ns; ns = ns->parent) + if (ns->proc_name == e->symtree->n.sym) + return SUCCESS; + } + gfc_error ("'%s' argument of '%s' intrinsic at %L must be a variable", gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic, &e->where); diff -Nrcpad gcc-4.6.2/gcc/fortran/dependency.c gcc-4.6.3/gcc/fortran/dependency.c *** gcc-4.6.2/gcc/fortran/dependency.c Thu May 26 20:49:07 2011 --- gcc-4.6.3/gcc/fortran/dependency.c Sun Dec 11 20:03:43 2011 *************** gfc_are_identical_variables (gfc_expr *e *** 163,171 **** break; case REF_SUBSTRING: ! if (gfc_dep_compare_expr (r1->u.ss.start, r2->u.ss.start) != 0 ! || gfc_dep_compare_expr (r1->u.ss.end, r2->u.ss.end) != 0) return false; break; default: --- 163,181 ---- break; case REF_SUBSTRING: ! if (gfc_dep_compare_expr (r1->u.ss.start, r2->u.ss.start) != 0) ! return false; ! ! /* If both are NULL, the end length compares equal, because we ! are looking at the same variable. This can only happen for ! assumed- or deferred-length character arguments. */ ! ! if (r1->u.ss.end == NULL && r2->u.ss.end == NULL) ! break; ! ! if (gfc_dep_compare_expr (r1->u.ss.end, r2->u.ss.end) != 0) return false; + break; default: diff -Nrcpad gcc-4.6.2/gcc/fortran/expr.c gcc-4.6.3/gcc/fortran/expr.c *** gcc-4.6.2/gcc/fortran/expr.c Sat Oct 15 13:30:07 2011 --- gcc-4.6.3/gcc/fortran/expr.c Thu Jan 19 22:21:43 2012 *************** gfc_has_default_initializer (gfc_symbol *** 3679,3684 **** --- 3679,3686 ---- if (!c->attr.pointer && gfc_has_default_initializer (c->ts.u.derived)) return true; + if (c->attr.pointer && c->initializer) + return true; } else { *************** gfc_has_default_initializer (gfc_symbol *** 3689,3694 **** --- 3691,3697 ---- return false; } + /* Get an expression for a default initializer. */ gfc_expr * *************** gfc_build_intrinsic_call (const char* na *** 4360,4365 **** --- 4363,4373 ---- result->value.function.name = name; result->value.function.isym = isym; + result->symtree = gfc_find_symtree (gfc_current_ns->sym_root, name); + gcc_assert (result->symtree + && (result->symtree->n.sym->attr.flavor == FL_PROCEDURE + || result->symtree->n.sym->attr.flavor == FL_UNKNOWN)); + va_start (ap, numarg); atail = NULL; for (i = 0; i < numarg; ++i) *************** gfc_check_vardef_context (gfc_expr* e, b *** 4520,4528 **** return FAILURE; } ! if (!pointer && gfc_implicit_pure (NULL) && gfc_impure_variable (sym)) ! gfc_current_ns->proc_name->attr.implicit_pure = 0; /* Check variable definition context for associate-names. */ if (!pointer && sym->assoc) { --- 4528,4551 ---- return FAILURE; } ! if (!pointer && context && gfc_implicit_pure (NULL) ! && gfc_impure_variable (sym)) ! { ! gfc_namespace *ns; ! gfc_symbol *sym; + for (ns = gfc_current_ns; ns; ns = ns->parent) + { + sym = ns->proc_name; + if (sym == NULL) + break; + if (sym->attr.flavor == FL_PROCEDURE) + { + sym->attr.implicit_pure = 0; + break; + } + } + } /* Check variable definition context for associate-names. */ if (!pointer && sym->assoc) { diff -Nrcpad gcc-4.6.2/gcc/fortran/gfortran.info gcc-4.6.3/gcc/fortran/gfortran.info *** gcc-4.6.2/gcc/fortran/gfortran.info Wed Oct 26 10:06:38 2011 --- gcc-4.6.3/gcc/fortran/gfortran.info Thu Mar 1 12:38:52 2012 *************** *** 1,5 **** This is doc/gfortran.info, produced by makeinfo version 4.13 from ! /d/gcc-4.6.2/gcc-4.6.2/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.3/gcc-4.6.3/gcc/fortran/gfortran.texi. Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. *************** the other form by either removing `no-' *** 1483,1491 **** real and imaginary parts of local `COMPLEX' variables), `-finit-logical=', and `-finit-character=N' (where N is an ASCII character value) options. These options do not ! initialize components of derived type variables, nor do they ! initialize variables that appear in an `EQUIVALENCE' statement. ! (This limitation may be removed in future releases). Note that the `-finit-real=nan' option initializes `REAL' and `COMPLEX' variables with a quiet NaN. For a signalling NaN use --- 1483,1495 ---- real and imaginary parts of local `COMPLEX' variables), `-finit-logical=', and `-finit-character=N' (where N is an ASCII character value) options. These options do not ! initialize ! * allocatable arrays ! ! * components of derived type variables ! ! * variables that appear in an `EQUIVALENCE' statement. ! (These limitations may be removed in future releases). Note that the `-finit-real=nan' option initializes `REAL' and `COMPLEX' variables with a quiet NaN. For a signalling NaN use *************** look up both forms. *** 16220,16226 **** (line 156) * dU: Preprocessing Options. (line 44) ! * falign-commons: Code Gen Options. (line 314) * fall-intrinsics: Fortran Dialect Options. (line 17) * fbacktrace: Debugging Options. (line 41) --- 16224,16230 ---- (line 156) * dU: Preprocessing Options. (line 44) ! * falign-commons: Code Gen Options. (line 318) * fall-intrinsics: Fortran Dialect Options. (line 17) * fbacktrace: Debugging Options. (line 41) *************** look up both forms. *** 16277,16283 **** * fno-automatic: Code Gen Options. (line 15) * fno-fixed-form: Fortran Dialect Options. (line 11) ! * fno-protect-parens: Code Gen Options. (line 326) * fno-range-check: Runtime Options. (line 21) * fno-underscoring: Code Gen Options. (line 54) * fno-whole-file: Code Gen Options. (line 113) --- 16281,16287 ---- * fno-automatic: Code Gen Options. (line 15) * fno-fixed-form: Fortran Dialect Options. (line 11) ! * fno-protect-parens: Code Gen Options. (line 330) * fno-range-check: Runtime Options. (line 21) * fno-underscoring: Code Gen Options. (line 54) * fno-whole-file: Code Gen Options. (line 113) *************** look up both forms. *** 16288,16294 **** (line 12) * frange-check: Fortran Dialect Options. (line 118) ! * frealloc-lhs: Code Gen Options. (line 334) * frecord-marker=LENGTH: Runtime Options. (line 29) * frecursive: Code Gen Options. (line 285) * frepack-arrays: Code Gen Options. (line 250) --- 16292,16298 ---- (line 12) * frange-check: Fortran Dialect Options. (line 118) ! * frealloc-lhs: Code Gen Options. (line 338) * frecord-marker=LENGTH: Runtime Options. (line 29) * frecursive: Code Gen Options. (line 285) * frepack-arrays: Code Gen Options. (line 250) *************** Keyword Index *** 16421,16427 **** * ALGAMA: LOG_GAMMA. (line 6) * aliasing: Error and Warning Options. (line 69) ! * alignment of COMMON blocks <1>: Code Gen Options. (line 314) * alignment of COMMON blocks: Error and Warning Options. (line 184) * ALL: ALL. (line 6) --- 16425,16431 ---- * ALGAMA: LOG_GAMMA. (line 6) * aliasing: Error and Warning Options. (line 69) ! * alignment of COMMON blocks <1>: Code Gen Options. (line 318) * alignment of COMMON blocks: Error and Warning Options. (line 184) * ALL: ALL. (line 6) *************** Keyword Index *** 17208,17214 **** * RANGE: RANGE. (line 6) * range checking: Code Gen Options. (line 157) * re-association of parenthesized expressions: Code Gen Options. ! (line 326) * read character, stream mode <1>: FGETC. (line 6) * read character, stream mode: FGET. (line 6) * REAL: REAL. (line 6) --- 17212,17218 ---- * RANGE: RANGE. (line 6) * range checking: Code Gen Options. (line 157) * re-association of parenthesized expressions: Code Gen Options. ! (line 330) * read character, stream mode <1>: FGETC. (line 6) * read character, stream mode: FGET. (line 6) * REAL: REAL. (line 6) *************** Keyword Index *** 17220,17226 **** * real number, relative spacing: RRSPACING. (line 6) * real number, scale: SCALE. (line 6) * real number, set exponent: SET_EXPONENT. (line 6) ! * Reallocate the LHS in assignments: Code Gen Options. (line 334) * REALPART: REAL. (line 6) * RECORD: STRUCTURE and RECORD. (line 6) --- 17224,17230 ---- * real number, relative spacing: RRSPACING. (line 6) * real number, scale: SCALE. (line 6) * real number, set exponent: SET_EXPONENT. (line 6) ! * Reallocate the LHS in assignments: Code Gen Options. (line 338) * REALPART: REAL. (line 6) * RECORD: STRUCTURE and RECORD. (line 6) *************** Keyword Index *** 17486,17839 ****  Tag Table: ! Node: Top2124 ! Node: Introduction3502 ! Node: About GNU Fortran4249 ! Node: GNU Fortran and GCC8237 ! Node: Preprocessing and conditional compilation10351 ! Node: GNU Fortran and G7711995 ! Node: Project Status12568 ! Node: Standards15015 ! Node: Varying Length Character Strings15953 ! Node: Invoking GNU Fortran16489 ! Node: Option Summary18212 ! Node: Fortran Dialect Options21914 ! Node: Preprocessing Options28950 ! Node: Error and Warning Options37180 ! Node: Debugging Options45273 ! Node: Directory Options47889 ! Node: Link Options49324 ! Node: Runtime Options49948 ! Node: Code Gen Options52198 ! Node: Environment Variables67524 ! Node: Runtime68129 ! Node: GFORTRAN_STDIN_UNIT69357 ! Node: GFORTRAN_STDOUT_UNIT69724 ! Node: GFORTRAN_STDERR_UNIT70125 ! Node: GFORTRAN_USE_STDERR70523 ! Node: GFORTRAN_TMPDIR70969 ! Node: GFORTRAN_UNBUFFERED_ALL71420 ! Node: GFORTRAN_UNBUFFERED_PRECONNECTED71944 ! Node: GFORTRAN_SHOW_LOCUS72586 ! Node: GFORTRAN_OPTIONAL_PLUS73081 ! Node: GFORTRAN_DEFAULT_RECL73557 ! Node: GFORTRAN_LIST_SEPARATOR74048 ! Node: GFORTRAN_CONVERT_UNIT74657 ! Node: GFORTRAN_ERROR_DUMPCORE77519 ! Node: GFORTRAN_ERROR_BACKTRACE78068 ! Node: Fortran 2003 and 2008 status78620 ! Node: Fortran 2003 status78860 ! Node: Fortran 2008 status83507 ! Node: Compiler Characteristics88161 ! Node: KIND Type Parameters88677 ! Node: Internal representation of LOGICAL variables89927 ! Node: Thread-safety of the runtime library91284 ! Node: Extensions92671 ! Node: Extensions implemented in GNU Fortran93272 ! Node: Old-style kind specifications94630 ! Node: Old-style variable initialization95737 ! Node: Extensions to namelist97049 ! Node: X format descriptor without count field99046 ! Node: Commas in FORMAT specifications99573 ! Node: Missing period in FORMAT specifications100090 ! Node: I/O item lists100652 ! Node: `Q' exponent-letter101041 ! Node: BOZ literal constants101647 ! Node: Real array indices104222 ! Node: Unary operators104519 ! Node: Implicitly convert LOGICAL and INTEGER values104933 ! Node: Hollerith constants support105893 ! Node: Cray pointers107665 ! Node: CONVERT specifier113112 ! Node: OpenMP115110 ! Node: Argument list functions117361 ! Node: Extensions not implemented in GNU Fortran118967 ! Node: STRUCTURE and RECORD119889 ! Node: ENCODE and DECODE statements121946 ! Node: Variable FORMAT expressions123305 ! Node: Alternate complex function syntax124410 ! Node: Mixed-Language Programming124930 ! Node: Interoperability with C125474 ! Node: Intrinsic Types126812 ! Node: Derived Types and struct127327 ! Node: Interoperable Global Variables128683 ! Node: Interoperable Subroutines and Functions129959 ! Node: Working with Pointers133572 ! Node: Further Interoperability of Fortran with C137889 ! Node: GNU Fortran Compiler Directives138871 ! Node: Non-Fortran Main Program141072 ! Node: _gfortran_set_args143214 ! Node: _gfortran_set_options144149 ! Node: _gfortran_set_convert147055 ! Node: _gfortran_set_record_marker147919 ! Node: _gfortran_set_fpe148744 ! Node: _gfortran_set_max_subrecord_length149958 ! Node: Intrinsic Procedures150914 ! Node: Introduction to Intrinsics166145 ! Node: ABORT168497 ! Node: ABS169254 ! Node: ACCESS170871 ! Node: ACHAR172792 ! Node: ACOS173993 ! Node: ACOSH175230 ! Node: ADJUSTL176218 ! Node: ADJUSTR177159 ! Node: AIMAG178106 ! Node: AINT179487 ! Node: ALARM181074 ! Node: ALL182708 ! Node: ALLOCATED184626 ! Node: AND185763 ! Node: ANINT187060 ! Node: ANY188538 ! Node: ASIN190468 ! Node: ASINH191694 ! Node: ASSOCIATED192692 ! Node: ATAN195697 ! Node: ATAN2197116 ! Node: ATANH198751 ! Node: BESSEL_J0199747 ! Node: BESSEL_J1200791 ! Node: BESSEL_JN201843 ! Node: BESSEL_Y0203725 ! Node: BESSEL_Y1204725 ! Node: BESSEL_YN205725 ! Node: BGE207557 ! Node: BGT208246 ! Node: BIT_SIZE208893 ! Node: BLE209714 ! Node: BLT210393 ! Node: BTEST211028 ! Node: C_ASSOCIATED211911 ! Node: C_FUNLOC213120 ! Node: C_F_PROCPOINTER214489 ! Node: C_F_POINTER215990 ! Node: C_LOC217408 ! Node: C_SIZEOF218685 ! Node: CEILING220094 ! Node: CHAR221099 ! Node: CHDIR222303 ! Node: CHMOD223471 ! Node: CMPLX225266 ! Node: COMMAND_ARGUMENT_COUNT226730 ! Node: COMPILER_OPTIONS227644 ! Node: COMPILER_VERSION228657 ! Node: COMPLEX229625 ! Node: CONJG230779 ! Node: COS231859 ! Node: COSH233305 ! Node: COUNT234470 ! Node: CPU_TIME236486 ! Node: CSHIFT237840 ! Node: CTIME239496 ! Node: DATE_AND_TIME241149 ! Node: DBLE243610 ! Node: DCMPLX244403 ! Node: DIGITS245597 ! Node: DIM246563 ! Node: DOT_PRODUCT247821 ! Node: DPROD249477 ! Node: DREAL250394 ! Node: DSHIFTL251060 ! Node: DSHIFTR251853 ! Node: DTIME252647 ! Node: EOSHIFT255450 ! Node: EPSILON257523 ! Node: ERF258249 ! Node: ERFC259023 ! Node: ERFC_SCALED259827 ! Node: ETIME260519 ! Node: EXECUTE_COMMAND_LINE262760 ! Node: EXIT265340 ! Node: EXP266214 ! Node: EXPONENT267487 ! Node: EXTENDS_TYPE_OF268247 ! Node: FDATE269100 ! Node: FGET270582 ! Node: FGETC272400 ! Node: FLOOR274199 ! Node: FLUSH275183 ! Node: FNUM277058 ! Node: FPUT277780 ! Node: FPUTC279405 ! Node: FRACTION281176 ! Node: FREE282077 ! Node: FSEEK282912 ! Node: FSTAT285206 ! Node: FTELL286286 ! Node: GAMMA287264 ! Node: GERROR288305 ! Node: GETARG289024 ! Node: GET_COMMAND290788 ! Node: GET_COMMAND_ARGUMENT292152 ! Node: GETCWD294186 ! Node: GETENV295158 ! Node: GET_ENVIRONMENT_VARIABLE296581 ! Node: GETGID298734 ! Node: GETLOG299271 ! Node: GETPID300131 ! Node: GETUID300861 ! Node: GMTIME301377 ! Node: HOSTNM302866 ! Node: HUGE303784 ! Node: HYPOT304505 ! Node: IACHAR305325 ! Node: IALL306505 ! Node: IAND307982 ! Node: IANY308966 ! Node: IARGC310452 ! Node: IBCLR311473 ! Node: IBITS312134 ! Node: IBSET313049 ! Node: ICHAR313705 ! Node: IDATE315877 ! Node: IEOR316904 ! Node: IERRNO317780 ! Node: IMAGE_INDEX318329 ! Node: INDEX intrinsic319353 ! Node: INT320894 ! Node: INT2322596 ! Node: INT8323361 ! Node: IOR324073 ! Node: IPARITY324925 ! Node: IRAND326449 ! Node: IS_IOSTAT_END327805 ! Node: IS_IOSTAT_EOR328902 ! Node: ISATTY330029 ! Node: ISHFT330812 ! Node: ISHFTC331792 ! Node: ISNAN333008 ! Node: ITIME333756 ! Node: KILL334781 ! Node: KIND335685 ! Node: LBOUND336530 ! Node: LCOBOUND337863 ! Node: LEADZ338993 ! Node: LEN339853 ! Node: LEN_TRIM341134 ! Node: LGE342116 ! Node: LGT343618 ! Node: LINK345085 ! Node: LLE346120 ! Node: LLT347614 ! Node: LNBLNK349074 ! Node: LOC349850 ! Node: LOG350581 ! Node: LOG10351984 ! Node: LOG_GAMMA352958 ! Node: LOGICAL354047 ! Node: LONG354855 ! Node: LSHIFT355611 ! Node: LSTAT356696 ! Node: LTIME357890 ! Node: MALLOC359301 ! Node: MASKL360760 ! Node: MASKR361523 ! Node: MATMUL362289 ! Node: MAX363378 ! Node: MAXEXPONENT364877 ! Node: MAXLOC365693 ! Node: MAXVAL367712 ! Node: MCLOCK369345 ! Node: MCLOCK8370348 ! Node: MERGE371560 ! Node: MERGE_BITS372309 ! Node: MIN373170 ! Node: MINEXPONENT374671 ! Node: MINLOC375301 ! Node: MINVAL377320 ! Node: MOD378972 ! Node: MODULO380579 ! Node: MOVE_ALLOC381793 ! Node: MVBITS382822 ! Node: NEAREST383881 ! Node: NEW_LINE385004 ! Node: NINT385775 ! Node: NORM2387178 ! Node: NOT388316 ! Node: NULL388900 ! Node: NUM_IMAGES389805 ! Node: OR390621 ! Node: PACK391905 ! Node: PARITY393897 ! Node: PERROR395112 ! Node: PRECISION395733 ! Node: POPCNT396619 ! Node: POPPAR397490 ! Node: PRESENT398541 ! Node: PRODUCT399647 ! Node: RADIX401172 ! Node: RAN401994 ! Node: RAND402450 ! Node: RANDOM_NUMBER403782 ! Node: RANDOM_SEED405500 ! Node: RANGE407385 ! Node: REAL408073 ! Node: RENAME409847 ! Node: REPEAT410866 ! Node: RESHAPE411592 ! Node: RRSPACING413061 ! Node: RSHIFT413754 ! Node: SAME_TYPE_AS414892 ! Node: SCALE415722 ! Node: SCAN416502 ! Node: SECNDS418052 ! Node: SECOND419140 ! Node: SELECTED_CHAR_KIND420016 ! Node: SELECTED_INT_KIND421607 ! Node: SELECTED_REAL_KIND422782 ! Node: SET_EXPONENT425448 ! Node: SHAPE426444 ! Node: SHIFTA427859 ! Node: SHIFTL428820 ! Node: SHIFTR429655 ! Node: SIGN430491 ! Node: SIGNAL431775 ! Node: SIN433272 ! Node: SINH434370 ! Node: SIZE435366 ! Node: SIZEOF436674 ! Node: SLEEP438085 ! Node: SPACING438645 ! Node: SPREAD439658 ! Node: SQRT440803 ! Node: SRAND442157 ! Node: STAT443325 ! Node: STORAGE_SIZE446492 ! Node: SUM447372 ! Node: SYMLNK448855 ! Node: SYSTEM449987 ! Node: SYSTEM_CLOCK451238 ! Node: TAN453396 ! Node: TANH454368 ! Node: THIS_IMAGE455525 ! Node: TIME457017 ! Node: TIME8458121 ! Node: TINY459250 ! Node: TRAILZ459850 ! Node: TRANSFER460667 ! Node: TRANSPOSE462701 ! Node: TRIM463388 ! Node: TTYNAM464245 ! Node: UBOUND465160 ! Node: UCOBOUND466550 ! Node: UMASK467682 ! Node: UNLINK468360 ! Node: UNPACK469337 ! Node: VERIFY470625 ! Node: XOR472346 ! Node: Intrinsic Modules473718 ! Node: ISO_FORTRAN_ENV473961 ! Node: ISO_C_BINDING477801 ! Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS481663 ! Node: Contributing482989 ! Node: Contributors483841 ! Node: Projects485508 ! Node: Proposed Extensions486312 ! Node: Copying488323 ! Node: GNU Free Documentation License525887 ! Node: Funding551030 ! Node: Option Index553555 ! Node: Keyword Index566513  End Tag Table --- 17490,17843 ----  Tag Table: ! Node: Top2125 ! Node: Introduction3503 ! Node: About GNU Fortran4250 ! Node: GNU Fortran and GCC8238 ! Node: Preprocessing and conditional compilation10352 ! Node: GNU Fortran and G7711996 ! Node: Project Status12569 ! Node: Standards15016 ! Node: Varying Length Character Strings15954 ! Node: Invoking GNU Fortran16490 ! Node: Option Summary18213 ! Node: Fortran Dialect Options21915 ! Node: Preprocessing Options28951 ! Node: Error and Warning Options37181 ! Node: Debugging Options45274 ! Node: Directory Options47890 ! Node: Link Options49325 ! Node: Runtime Options49949 ! Node: Code Gen Options52199 ! Node: Environment Variables67549 ! Node: Runtime68154 ! Node: GFORTRAN_STDIN_UNIT69382 ! Node: GFORTRAN_STDOUT_UNIT69749 ! Node: GFORTRAN_STDERR_UNIT70150 ! Node: GFORTRAN_USE_STDERR70548 ! Node: GFORTRAN_TMPDIR70994 ! Node: GFORTRAN_UNBUFFERED_ALL71445 ! Node: GFORTRAN_UNBUFFERED_PRECONNECTED71969 ! Node: GFORTRAN_SHOW_LOCUS72611 ! Node: GFORTRAN_OPTIONAL_PLUS73106 ! Node: GFORTRAN_DEFAULT_RECL73582 ! Node: GFORTRAN_LIST_SEPARATOR74073 ! Node: GFORTRAN_CONVERT_UNIT74682 ! Node: GFORTRAN_ERROR_DUMPCORE77544 ! Node: GFORTRAN_ERROR_BACKTRACE78093 ! Node: Fortran 2003 and 2008 status78645 ! Node: Fortran 2003 status78885 ! Node: Fortran 2008 status83532 ! Node: Compiler Characteristics88186 ! Node: KIND Type Parameters88702 ! Node: Internal representation of LOGICAL variables89952 ! Node: Thread-safety of the runtime library91309 ! Node: Extensions92696 ! Node: Extensions implemented in GNU Fortran93297 ! Node: Old-style kind specifications94655 ! Node: Old-style variable initialization95762 ! Node: Extensions to namelist97074 ! Node: X format descriptor without count field99071 ! Node: Commas in FORMAT specifications99598 ! Node: Missing period in FORMAT specifications100115 ! Node: I/O item lists100677 ! Node: `Q' exponent-letter101066 ! Node: BOZ literal constants101672 ! Node: Real array indices104247 ! Node: Unary operators104544 ! Node: Implicitly convert LOGICAL and INTEGER values104958 ! Node: Hollerith constants support105918 ! Node: Cray pointers107690 ! Node: CONVERT specifier113137 ! Node: OpenMP115135 ! Node: Argument list functions117386 ! Node: Extensions not implemented in GNU Fortran118992 ! Node: STRUCTURE and RECORD119914 ! Node: ENCODE and DECODE statements121971 ! Node: Variable FORMAT expressions123330 ! Node: Alternate complex function syntax124435 ! Node: Mixed-Language Programming124955 ! Node: Interoperability with C125499 ! Node: Intrinsic Types126837 ! Node: Derived Types and struct127352 ! Node: Interoperable Global Variables128708 ! Node: Interoperable Subroutines and Functions129984 ! Node: Working with Pointers133597 ! Node: Further Interoperability of Fortran with C137914 ! Node: GNU Fortran Compiler Directives138896 ! Node: Non-Fortran Main Program141097 ! Node: _gfortran_set_args143239 ! Node: _gfortran_set_options144174 ! Node: _gfortran_set_convert147080 ! Node: _gfortran_set_record_marker147944 ! Node: _gfortran_set_fpe148769 ! Node: _gfortran_set_max_subrecord_length149983 ! Node: Intrinsic Procedures150939 ! Node: Introduction to Intrinsics166170 ! Node: ABORT168522 ! Node: ABS169279 ! Node: ACCESS170896 ! Node: ACHAR172817 ! Node: ACOS174018 ! Node: ACOSH175255 ! Node: ADJUSTL176243 ! Node: ADJUSTR177184 ! Node: AIMAG178131 ! Node: AINT179512 ! Node: ALARM181099 ! Node: ALL182733 ! Node: ALLOCATED184651 ! Node: AND185788 ! Node: ANINT187085 ! Node: ANY188563 ! Node: ASIN190493 ! Node: ASINH191719 ! Node: ASSOCIATED192717 ! Node: ATAN195722 ! Node: ATAN2197141 ! Node: ATANH198776 ! Node: BESSEL_J0199772 ! Node: BESSEL_J1200816 ! Node: BESSEL_JN201868 ! Node: BESSEL_Y0203750 ! Node: BESSEL_Y1204750 ! Node: BESSEL_YN205750 ! Node: BGE207582 ! Node: BGT208271 ! Node: BIT_SIZE208918 ! Node: BLE209739 ! Node: BLT210418 ! Node: BTEST211053 ! Node: C_ASSOCIATED211936 ! Node: C_FUNLOC213145 ! Node: C_F_PROCPOINTER214514 ! Node: C_F_POINTER216015 ! Node: C_LOC217433 ! Node: C_SIZEOF218710 ! Node: CEILING220119 ! Node: CHAR221124 ! Node: CHDIR222328 ! Node: CHMOD223496 ! Node: CMPLX225291 ! Node: COMMAND_ARGUMENT_COUNT226755 ! Node: COMPILER_OPTIONS227669 ! Node: COMPILER_VERSION228682 ! Node: COMPLEX229650 ! Node: CONJG230804 ! Node: COS231884 ! Node: COSH233330 ! Node: COUNT234495 ! Node: CPU_TIME236511 ! Node: CSHIFT237865 ! Node: CTIME239521 ! Node: DATE_AND_TIME241174 ! Node: DBLE243635 ! Node: DCMPLX244428 ! Node: DIGITS245622 ! Node: DIM246588 ! Node: DOT_PRODUCT247846 ! Node: DPROD249502 ! Node: DREAL250419 ! Node: DSHIFTL251085 ! Node: DSHIFTR251878 ! Node: DTIME252672 ! Node: EOSHIFT255475 ! Node: EPSILON257548 ! Node: ERF258274 ! Node: ERFC259048 ! Node: ERFC_SCALED259852 ! Node: ETIME260544 ! Node: EXECUTE_COMMAND_LINE262785 ! Node: EXIT265365 ! Node: EXP266239 ! Node: EXPONENT267512 ! Node: EXTENDS_TYPE_OF268272 ! Node: FDATE269125 ! Node: FGET270607 ! Node: FGETC272425 ! Node: FLOOR274224 ! Node: FLUSH275208 ! Node: FNUM277083 ! Node: FPUT277805 ! Node: FPUTC279430 ! Node: FRACTION281201 ! Node: FREE282102 ! Node: FSEEK282937 ! Node: FSTAT285231 ! Node: FTELL286311 ! Node: GAMMA287289 ! Node: GERROR288330 ! Node: GETARG289049 ! Node: GET_COMMAND290813 ! Node: GET_COMMAND_ARGUMENT292177 ! Node: GETCWD294211 ! Node: GETENV295183 ! Node: GET_ENVIRONMENT_VARIABLE296606 ! Node: GETGID298759 ! Node: GETLOG299296 ! Node: GETPID300156 ! Node: GETUID300886 ! Node: GMTIME301402 ! Node: HOSTNM302891 ! Node: HUGE303809 ! Node: HYPOT304530 ! Node: IACHAR305350 ! Node: IALL306530 ! Node: IAND308007 ! Node: IANY308991 ! Node: IARGC310477 ! Node: IBCLR311498 ! Node: IBITS312159 ! Node: IBSET313074 ! Node: ICHAR313730 ! Node: IDATE315902 ! Node: IEOR316929 ! Node: IERRNO317805 ! Node: IMAGE_INDEX318354 ! Node: INDEX intrinsic319378 ! Node: INT320919 ! Node: INT2322621 ! Node: INT8323386 ! Node: IOR324098 ! Node: IPARITY324950 ! Node: IRAND326474 ! Node: IS_IOSTAT_END327830 ! Node: IS_IOSTAT_EOR328927 ! Node: ISATTY330054 ! Node: ISHFT330837 ! Node: ISHFTC331817 ! Node: ISNAN333033 ! Node: ITIME333781 ! Node: KILL334806 ! Node: KIND335710 ! Node: LBOUND336555 ! Node: LCOBOUND337888 ! Node: LEADZ339018 ! Node: LEN339878 ! Node: LEN_TRIM341159 ! Node: LGE342141 ! Node: LGT343643 ! Node: LINK345110 ! Node: LLE346145 ! Node: LLT347639 ! Node: LNBLNK349099 ! Node: LOC349875 ! Node: LOG350606 ! Node: LOG10352009 ! Node: LOG_GAMMA352983 ! Node: LOGICAL354072 ! Node: LONG354880 ! Node: LSHIFT355636 ! Node: LSTAT356721 ! Node: LTIME357915 ! Node: MALLOC359326 ! Node: MASKL360785 ! Node: MASKR361548 ! Node: MATMUL362314 ! Node: MAX363403 ! Node: MAXEXPONENT364902 ! Node: MAXLOC365718 ! Node: MAXVAL367737 ! Node: MCLOCK369370 ! Node: MCLOCK8370373 ! Node: MERGE371585 ! Node: MERGE_BITS372334 ! Node: MIN373195 ! Node: MINEXPONENT374696 ! Node: MINLOC375326 ! Node: MINVAL377345 ! Node: MOD378997 ! Node: MODULO380604 ! Node: MOVE_ALLOC381818 ! Node: MVBITS382847 ! Node: NEAREST383906 ! Node: NEW_LINE385029 ! Node: NINT385800 ! Node: NORM2387203 ! Node: NOT388341 ! Node: NULL388925 ! Node: NUM_IMAGES389830 ! Node: OR390646 ! Node: PACK391930 ! Node: PARITY393922 ! Node: PERROR395137 ! Node: PRECISION395758 ! Node: POPCNT396644 ! Node: POPPAR397515 ! Node: PRESENT398566 ! Node: PRODUCT399672 ! Node: RADIX401197 ! Node: RAN402019 ! Node: RAND402475 ! Node: RANDOM_NUMBER403807 ! Node: RANDOM_SEED405525 ! Node: RANGE407410 ! Node: REAL408098 ! Node: RENAME409872 ! Node: REPEAT410891 ! Node: RESHAPE411617 ! Node: RRSPACING413086 ! Node: RSHIFT413779 ! Node: SAME_TYPE_AS414917 ! Node: SCALE415747 ! Node: SCAN416527 ! Node: SECNDS418077 ! Node: SECOND419165 ! Node: SELECTED_CHAR_KIND420041 ! Node: SELECTED_INT_KIND421632 ! Node: SELECTED_REAL_KIND422807 ! Node: SET_EXPONENT425473 ! Node: SHAPE426469 ! Node: SHIFTA427884 ! Node: SHIFTL428845 ! Node: SHIFTR429680 ! Node: SIGN430516 ! Node: SIGNAL431800 ! Node: SIN433297 ! Node: SINH434395 ! Node: SIZE435391 ! Node: SIZEOF436699 ! Node: SLEEP438110 ! Node: SPACING438670 ! Node: SPREAD439683 ! Node: SQRT440828 ! Node: SRAND442182 ! Node: STAT443350 ! Node: STORAGE_SIZE446517 ! Node: SUM447397 ! Node: SYMLNK448880 ! Node: SYSTEM450012 ! Node: SYSTEM_CLOCK451263 ! Node: TAN453421 ! Node: TANH454393 ! Node: THIS_IMAGE455550 ! Node: TIME457042 ! Node: TIME8458146 ! Node: TINY459275 ! Node: TRAILZ459875 ! Node: TRANSFER460692 ! Node: TRANSPOSE462726 ! Node: TRIM463413 ! Node: TTYNAM464270 ! Node: UBOUND465185 ! Node: UCOBOUND466575 ! Node: UMASK467707 ! Node: UNLINK468385 ! Node: UNPACK469362 ! Node: VERIFY470650 ! Node: XOR472371 ! Node: Intrinsic Modules473743 ! Node: ISO_FORTRAN_ENV473986 ! Node: ISO_C_BINDING477826 ! Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS481688 ! Node: Contributing483014 ! Node: Contributors483866 ! Node: Projects485533 ! Node: Proposed Extensions486337 ! Node: Copying488348 ! Node: GNU Free Documentation License525912 ! Node: Funding551055 ! Node: Option Index553580 ! Node: Keyword Index566538  End Tag Table diff -Nrcpad gcc-4.6.2/gcc/fortran/interface.c gcc-4.6.3/gcc/fortran/interface.c *** gcc-4.6.2/gcc/fortran/interface.c Fri Oct 7 21:01:02 2011 --- gcc-4.6.3/gcc/fortran/interface.c Sat Jan 21 16:11:47 2012 *************** compare_parameter (gfc_symbol *formal, g *** 1535,1541 **** return 0; } ! /* F2003, 12.5.2.5. */ if (formal->ts.type == BT_CLASS && (CLASS_DATA (formal)->attr.class_pointer || CLASS_DATA (formal)->attr.allocatable)) --- 1535,1541 ---- return 0; } ! /* F2008, 12.5.2.5. */ if (formal->ts.type == BT_CLASS && (CLASS_DATA (formal)->attr.class_pointer || CLASS_DATA (formal)->attr.allocatable)) *************** compare_parameter (gfc_symbol *formal, g *** 1547,1554 **** formal->name, &actual->where); return 0; } ! if (CLASS_DATA (actual)->ts.u.derived ! != CLASS_DATA (formal)->ts.u.derived) { if (where) gfc_error ("Actual argument to '%s' at %L must have the same " --- 1547,1554 ---- formal->name, &actual->where); return 0; } ! if (!gfc_compare_derived_types (CLASS_DATA (actual)->ts.u.derived, ! CLASS_DATA (formal)->ts.u.derived)) { if (where) gfc_error ("Actual argument to '%s' at %L must have the same " diff -Nrcpad gcc-4.6.2/gcc/fortran/invoke.texi gcc-4.6.3/gcc/fortran/invoke.texi *** gcc-4.6.2/gcc/fortran/invoke.texi Wed Oct 12 14:12:04 2011 --- gcc-4.6.3/gcc/fortran/invoke.texi Thu Dec 22 19:23:26 2011 *************** initialization options are provided by t *** 1438,1447 **** the real and imaginary parts of local @code{COMPLEX} variables), @option{-finit-logical=@var{}}, and @option{-finit-character=@var{n}} (where @var{n} is an ASCII character ! value) options. These options do not initialize components of derived ! type variables, nor do they initialize variables that appear in an ! @code{EQUIVALENCE} statement. (This limitation may be removed in ! future releases). Note that the @option{-finit-real=nan} option initializes @code{REAL} and @code{COMPLEX} variables with a quiet NaN. For a signalling NaN --- 1438,1453 ---- the real and imaginary parts of local @code{COMPLEX} variables), @option{-finit-logical=@var{}}, and @option{-finit-character=@var{n}} (where @var{n} is an ASCII character ! value) options. These options do not initialize ! @itemize @bullet ! @item ! allocatable arrays ! @item ! components of derived type variables ! @item ! variables that appear in an @code{EQUIVALENCE} statement. ! @end itemize ! (These limitations may be removed in future releases). Note that the @option{-finit-real=nan} option initializes @code{REAL} and @code{COMPLEX} variables with a quiet NaN. For a signalling NaN diff -Nrcpad gcc-4.6.2/gcc/fortran/io.c gcc-4.6.3/gcc/fortran/io.c *** gcc-4.6.2/gcc/fortran/io.c Wed Feb 9 06:02:56 2011 --- gcc-4.6.3/gcc/fortran/io.c Thu Feb 23 22:53:54 2012 *************** gfc_match_open (void) *** 1938,1947 **** /* Checks on the DELIM specifier. */ if (open->delim) { - if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: DELIM= at %C " - "not allowed in Fortran 95") == FAILURE) - goto cleanup; - if (open->delim->expr_type == EXPR_CONSTANT) { static const char *delim[] = { "APOSTROPHE", "QUOTE", "NONE", NULL }; --- 1938,1943 ---- diff -Nrcpad gcc-4.6.2/gcc/fortran/resolve.c gcc-4.6.3/gcc/fortran/resolve.c *** gcc-4.6.2/gcc/fortran/resolve.c Fri Aug 26 22:17:09 2011 --- gcc-4.6.3/gcc/fortran/resolve.c Wed Jan 25 08:11:56 2012 *************** resolve_structure_cons (gfc_expr *expr, *** 1053,1058 **** --- 1053,1059 ---- && comp->ts.u.cl->length->expr_type == EXPR_CONSTANT && cons->expr->ts.u.cl && cons->expr->ts.u.cl->length && cons->expr->ts.u.cl->length->expr_type == EXPR_CONSTANT + && cons->expr->rank != 0 && mpz_cmp (cons->expr->ts.u.cl->length->value.integer, comp->ts.u.cl->length->value.integer) != 0) { *************** resolve_function (gfc_expr *expr) *** 3132,3141 **** "procedure within a PURE procedure", name, &expr->where); t = FAILURE; } - } ! if (!pure_function (expr, &name) && name && gfc_implicit_pure (NULL)) ! gfc_current_ns->proc_name->attr.implicit_pure = 0; /* Functions without the RECURSIVE attribution are not allowed to * call themselves. */ --- 3133,3142 ---- "procedure within a PURE procedure", name, &expr->where); t = FAILURE; } ! if (gfc_implicit_pure (NULL)) ! gfc_current_ns->proc_name->attr.implicit_pure = 0; ! } /* Functions without the RECURSIVE attribution are not allowed to * call themselves. */ *************** pure_subroutine (gfc_code *c, gfc_symbol *** 3195,3200 **** --- 3196,3204 ---- else if (gfc_pure (NULL)) gfc_error ("Subroutine call to '%s' at %L is not PURE", sym->name, &c->loc); + + if (gfc_implicit_pure (NULL)) + gfc_current_ns->proc_name->attr.implicit_pure = 0; } *************** build_default_init_expr (gfc_symbol *sym *** 9687,9693 **** int i; /* These symbols should never have a default initialization. */ ! if ((sym->attr.dimension && !gfc_is_compile_time_shape (sym->as)) || sym->attr.external || sym->attr.dummy || sym->attr.pointer --- 9691,9697 ---- int i; /* These symbols should never have a default initialization. */ ! if (sym->attr.allocatable || sym->attr.external || sym->attr.dummy || sym->attr.pointer *************** build_default_init_expr (gfc_symbol *sym *** 9811,9816 **** --- 9815,9840 ---- gfc_free_expr (init_expr); init_expr = NULL; } + if (!init_expr && gfc_option.flag_init_character == GFC_INIT_CHARACTER_ON + && sym->ts.u.cl->length) + { + gfc_actual_arglist *arg; + init_expr = gfc_get_expr (); + init_expr->where = sym->declared_at; + init_expr->ts = sym->ts; + init_expr->expr_type = EXPR_FUNCTION; + init_expr->value.function.isym = + gfc_intrinsic_function_by_id (GFC_ISYM_REPEAT); + init_expr->value.function.name = "repeat"; + arg = gfc_get_actual_arglist (); + arg->expr = gfc_get_character_expr (sym->ts.kind, &sym->declared_at, + NULL, 1); + arg->expr->value.character.string[0] + = gfc_option.flag_init_character_value; + arg->next = gfc_get_actual_arglist (); + arg->next->expr = gfc_copy_expr (sym->ts.u.cl->length); + init_expr->value.function.actual = arg; + } break; default: *************** apply_default_init_local (gfc_symbol *sy *** 9837,9846 **** if (init == NULL) return; ! /* For saved variables, we don't want to add an initializer at ! function entry, so we just add a static initializer. */ if (sym->attr.save || sym->ns->save_all ! || gfc_option.flag_max_stack_var_size == 0) { /* Don't clobber an existing initializer! */ gcc_assert (sym->value == NULL); --- 9861,9872 ---- if (init == NULL) return; ! /* For saved variables, we don't want to add an initializer at function ! entry, so we just add a static initializer. Note that automatic variables ! are stack allocated even with -fno-automatic. */ if (sym->attr.save || sym->ns->save_all ! || (gfc_option.flag_max_stack_var_size == 0 ! && (!sym->attr.dimension || !is_non_constant_shape_array (sym)))) { /* Don't clobber an existing initializer! */ gcc_assert (sym->value == NULL); *************** resolve_fl_derived0 (gfc_symbol *sym) *** 11394,11399 **** --- 11420,11433 ---- for (c = sym->components; c != NULL; c = c->next) { + /* See PRs 51550, 47545, 48654, 49050, 51075 - and 45170. */ + if (c->ts.type == BT_CHARACTER && c->ts.deferred) + { + gfc_error ("Deferred-length character component '%s' at %L is not " + "yet supported", c->name, &c->loc); + return FAILURE; + } + /* F2008, C442. */ if (c->attr.codimension /* FIXME: c->as check due to PR 43412. */ && (!c->attr.allocatable || (c->as && c->as->type != AS_DEFERRED))) *************** gfc_pure (gfc_symbol *sym) *** 12925,12948 **** int gfc_implicit_pure (gfc_symbol *sym) { ! symbol_attribute attr; if (sym == NULL) { ! /* Check if the current namespace is implicit_pure. */ ! sym = gfc_current_ns->proc_name; ! if (sym == NULL) ! return 0; ! attr = sym->attr; ! if (attr.flavor == FL_PROCEDURE ! && attr.implicit_pure && !attr.pure) ! return 1; ! return 0; } ! ! attr = sym->attr; ! ! return attr.flavor == FL_PROCEDURE && attr.implicit_pure && !attr.pure; } --- 12959,12983 ---- int gfc_implicit_pure (gfc_symbol *sym) { ! gfc_namespace *ns; if (sym == NULL) { ! /* Check if the current procedure is implicit_pure. Walk up ! the procedure list until we find a procedure. */ ! for (ns = gfc_current_ns; ns; ns = ns->parent) ! { ! sym = ns->proc_name; ! if (sym == NULL) ! return 0; ! ! if (sym->attr.flavor == FL_PROCEDURE) ! break; ! } } ! ! return sym->attr.flavor == FL_PROCEDURE && sym->attr.implicit_pure ! && !sym->attr.pure; } diff -Nrcpad gcc-4.6.2/gcc/fortran/simplify.c gcc-4.6.3/gcc/fortran/simplify.c *** gcc-4.6.2/gcc/fortran/simplify.c Tue Feb 15 19:38:51 2011 --- gcc-4.6.3/gcc/fortran/simplify.c Fri Feb 3 20:37:36 2012 *************** gfc_simplify_size (gfc_expr *array, gfc_ *** 5583,5588 **** --- 5583,5589 ---- case INTRINSIC_NOT: case INTRINSIC_UPLUS: case INTRINSIC_UMINUS: + case INTRINSIC_PARENTHESES: replacement = array->value.op.op1; break; diff -Nrcpad gcc-4.6.2/gcc/fortran/trans-array.c gcc-4.6.3/gcc/fortran/trans-array.c *** gcc-4.6.2/gcc/fortran/trans-array.c Wed Aug 3 09:37:11 2011 --- gcc-4.6.3/gcc/fortran/trans-array.c Thu Dec 8 20:54:57 2011 *************** get_std_lbound (gfc_expr *expr, tree des *** 6772,6778 **** gfc_array_index_type, cond, lbound, gfc_index_one_node); } ! else if (expr->expr_type == EXPR_VARIABLE) { tmp = TREE_TYPE (expr->symtree->n.sym->backend_decl); for (ref = expr->ref; ref; ref = ref->next) --- 6772,6787 ---- gfc_array_index_type, cond, lbound, gfc_index_one_node); } ! ! if (expr->expr_type == EXPR_FUNCTION) ! { ! /* A conversion function, so use the argument. */ ! gcc_assert (expr->value.function.isym ! && expr->value.function.isym->conversion); ! expr = expr->value.function.actual->expr; ! } ! ! if (expr->expr_type == EXPR_VARIABLE) { tmp = TREE_TYPE (expr->symtree->n.sym->backend_decl); for (ref = expr->ref; ref; ref = ref->next) *************** get_std_lbound (gfc_expr *expr, tree des *** 6785,6799 **** } return GFC_TYPE_ARRAY_LBOUND(tmp, dim); } - else if (expr->expr_type == EXPR_FUNCTION) - { - /* A conversion function, so use the argument. */ - expr = expr->value.function.actual->expr; - if (expr->expr_type != EXPR_VARIABLE) - return gfc_index_one_node; - desc = TREE_TYPE (expr->symtree->n.sym->backend_decl); - return get_std_lbound (expr, desc, dim, assumed_size); - } return gfc_index_one_node; } --- 6794,6799 ---- diff -Nrcpad gcc-4.6.2/gcc/fortran/trans-decl.c gcc-4.6.3/gcc/fortran/trans-decl.c *** gcc-4.6.2/gcc/fortran/trans-decl.c Fri Oct 7 21:01:02 2011 --- gcc-4.6.3/gcc/fortran/trans-decl.c Thu Feb 9 17:13:50 2012 *************** gfc_get_module_backend_decl (gfc_symbol *** 677,683 **** } else if (s->backend_decl) { ! if (sym->ts.type == BT_DERIVED) gfc_copy_dt_decls_ifequal (s->ts.u.derived, sym->ts.u.derived, true); else if (sym->ts.type == BT_CHARACTER) --- 677,683 ---- } else if (s->backend_decl) { ! if (sym->ts.type == BT_DERIVED || sym->ts.type == BT_CLASS) gfc_copy_dt_decls_ifequal (s->ts.u.derived, sym->ts.u.derived, true); else if (sym->ts.type == BT_CHARACTER) *************** gfc_get_symbol_decl (gfc_symbol * sym) *** 1352,1358 **** gfc_finish_var_decl (span, sym); TREE_STATIC (span) = TREE_STATIC (decl); DECL_ARTIFICIAL (span) = 1; - DECL_INITIAL (span) = build_int_cst (gfc_array_index_type, 0); GFC_DECL_SPAN (decl) = span; GFC_TYPE_ARRAY_SPAN (TREE_TYPE (decl)) = span; --- 1352,1357 ---- *************** gfc_get_extern_function_decl (gfc_symbol *** 1602,1607 **** --- 1601,1611 ---- gfc_find_symbol (sym->name, gsym->ns, 0, &s); if (s && s->backend_decl) { + if (sym->ts.type == BT_DERIVED || sym->ts.type == BT_CLASS) + gfc_copy_dt_decls_ifequal (s->ts.u.derived, sym->ts.u.derived, + true); + else if (sym->ts.type == BT_CHARACTER) + sym->ts.u.cl->backend_decl = s->ts.u.cl->backend_decl; sym->backend_decl = s->backend_decl; return sym->backend_decl; } *************** gfc_trans_deferred_vars (gfc_symbol * pr *** 3389,3394 **** --- 3393,3409 ---- if (sym->assoc) continue; + if (sym->attr.subref_array_pointer + && GFC_DECL_SPAN (sym->backend_decl) + && !TREE_STATIC (GFC_DECL_SPAN (sym->backend_decl))) + { + gfc_init_block (&tmpblock); + gfc_add_modify (&tmpblock, GFC_DECL_SPAN (sym->backend_decl), + build_int_cst (gfc_array_index_type, 0)); + gfc_add_init_cleanup (block, gfc_finish_block (&tmpblock), + NULL_TREE); + } + if (sym->attr.dimension) { /* Assumed-size Cray pointees need to be treated as AS_EXPLICIT. */ *************** generate_local_decl (gfc_symbol * sym) *** 4179,4188 **** "declared INTENT(OUT) but was not set and " "does not have a default initializer", sym->name, &sym->declared_at); } else if (gfc_option.warn_unused_dummy_argument) ! gfc_warning ("Unused dummy argument '%s' at %L", sym->name, &sym->declared_at); } /* Warn for unused variables, but not if they're inside a common --- 4194,4209 ---- "declared INTENT(OUT) but was not set and " "does not have a default initializer", sym->name, &sym->declared_at); + if (sym->backend_decl != NULL_TREE) + TREE_NO_WARNING(sym->backend_decl) = 1; } else if (gfc_option.warn_unused_dummy_argument) ! { ! gfc_warning ("Unused dummy argument '%s' at %L", sym->name, &sym->declared_at); + if (sym->backend_decl != NULL_TREE) + TREE_NO_WARNING(sym->backend_decl) = 1; + } } /* Warn for unused variables, but not if they're inside a common *************** generate_local_decl (gfc_symbol * sym) *** 4227,4237 **** mark the symbol now, as well as in traverse_ns, to prevent getting stuck in a circular dependency. */ sym->mark = 1; - - /* We do not want the middle-end to warn about unused parameters - as this was already done above. */ - if (sym->attr.dummy && sym->backend_decl != NULL_TREE) - TREE_NO_WARNING(sym->backend_decl) = 1; } else if (sym->attr.flavor == FL_PARAMETER) { --- 4248,4253 ---- *************** gfc_generate_function_code (gfc_namespac *** 4846,4856 **** if (result == NULL_TREE) { /* TODO: move to the appropriate place in resolve.c. */ ! if (warn_return_type && !sym->attr.referenced && sym == sym->result) gfc_warning ("Return value of function '%s' at %L not set", sym->name, &sym->declared_at); ! ! TREE_NO_WARNING(sym->backend_decl) = 1; } else gfc_add_expr_to_block (&body, gfc_generate_return ()); --- 4862,4872 ---- if (result == NULL_TREE) { /* TODO: move to the appropriate place in resolve.c. */ ! if (warn_return_type && sym == sym->result) gfc_warning ("Return value of function '%s' at %L not set", sym->name, &sym->declared_at); ! if (warn_return_type) ! TREE_NO_WARNING(sym->backend_decl) = 1; } else gfc_add_expr_to_block (&body, gfc_generate_return ()); diff -Nrcpad gcc-4.6.2/gcc/fortran/trans-expr.c gcc-4.6.3/gcc/fortran/trans-expr.c *** gcc-4.6.2/gcc/fortran/trans-expr.c Sat Oct 15 06:55:28 2011 --- gcc-4.6.3/gcc/fortran/trans-expr.c Wed Feb 29 21:24:05 2012 *************** *** 1,6 **** /* Expression translation Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, ! 2011 Free Software Foundation, Inc. Contributed by Paul Brook and Steven Bosscher --- 1,6 ---- /* Expression translation Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, ! 2011, 2012 Free Software Foundation, Inc. Contributed by Paul Brook and Steven Bosscher *************** gfc_conv_procedure_call (gfc_se * se, gf *** 3064,3070 **** || (fsym->attr.proc_pointer && e->expr_type == EXPR_VARIABLE && gfc_is_proc_ptr_comp (e, NULL)) ! || fsym->attr.allocatable)) { /* Scalar pointer dummy args require an extra level of indirection. The null pointer already contains --- 3064,3071 ---- || (fsym->attr.proc_pointer && e->expr_type == EXPR_VARIABLE && gfc_is_proc_ptr_comp (e, NULL)) ! || (fsym->attr.allocatable ! && fsym->attr.flavor != FL_PROCEDURE))) { /* Scalar pointer dummy args require an extra level of indirection. The null pointer already contains *************** realloc_lhs_loop_for_fcn_call (gfc_se *s *** 5535,5541 **** } ! /* 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, --- 5536,5542 ---- } ! /* 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, *************** fcncall_realloc_result (gfc_se *se, int *** 5549,5603 **** 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; - /* Now reset the bounds from zero based to unity based. */ for (n = 0 ; n < rank; n++) { ! /* Accumulate the offset. */ ! offset = fold_build2_loc (input_location, MINUS_EXPR, ! gfc_array_index_type, ! offset, tmp); ! /* Now do the bounds. */ ! gfc_conv_descriptor_offset_set (&se->post, desc, tmp); ! tmp = gfc_conv_descriptor_ubound_get (desc, gfc_rank_cst[n]); tmp = fold_build2_loc (input_location, PLUS_EXPR, ! gfc_array_index_type, ! tmp, gfc_index_one_node); gfc_conv_descriptor_lbound_set (&se->post, desc, ! gfc_rank_cst[n], ! gfc_index_one_node); gfc_conv_descriptor_ubound_set (&se->post, desc, gfc_rank_cst[n], tmp); ! /* The extent for the next contribution to offset. */ ! tmp = fold_build2_loc (input_location, MINUS_EXPR, ! gfc_array_index_type, ! gfc_conv_descriptor_ubound_get (desc, gfc_rank_cst[n]), ! gfc_conv_descriptor_lbound_get (desc, gfc_rank_cst[n])); ! tmp = fold_build2_loc (input_location, PLUS_EXPR, ! gfc_array_index_type, ! tmp, gfc_index_one_node); } gfc_conv_descriptor_offset_set (&se->post, desc, offset); } --- 5550,5645 ---- tree res_desc; tree tmp; tree offset; + tree zero_cond; 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); + if (POINTER_TYPE_P (TREE_TYPE (desc))) + desc = build_fold_indirect_ref_loc (input_location, desc); + /* 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 data to the lhs descriptor. */ tmp = gfc_conv_descriptor_data_get (desc); + zero_cond = fold_build2_loc (input_location, EQ_EXPR, + boolean_type_node, tmp, + build_int_cst (TREE_TYPE (tmp), 0)); + zero_cond = gfc_evaluate_now (zero_cond, &se->post); tmp = gfc_call_free (fold_convert (pvoid_type_node, tmp)); gfc_add_expr_to_block (&se->post, tmp); + tmp = gfc_conv_descriptor_data_get (res_desc); + gfc_conv_descriptor_data_set (&se->post, desc, tmp); + + /* Check that the shapes are the same between lhs and expression. */ + for (n = 0 ; n < rank; n++) + { + tree tmp1; + tmp = gfc_conv_descriptor_lbound_get (desc, gfc_rank_cst[n]); + tmp1 = gfc_conv_descriptor_lbound_get (res_desc, gfc_rank_cst[n]); + tmp = fold_build2_loc (input_location, MINUS_EXPR, + gfc_array_index_type, tmp, tmp1); + tmp1 = gfc_conv_descriptor_ubound_get (desc, gfc_rank_cst[n]); + tmp = fold_build2_loc (input_location, MINUS_EXPR, + gfc_array_index_type, tmp, tmp1); + tmp1 = gfc_conv_descriptor_ubound_get (res_desc, gfc_rank_cst[n]); + tmp = fold_build2_loc (input_location, PLUS_EXPR, + gfc_array_index_type, tmp, tmp1); + tmp = fold_build2_loc (input_location, NE_EXPR, + boolean_type_node, tmp, + gfc_index_zero_node); + tmp = gfc_evaluate_now (tmp, &se->post); + zero_cond = fold_build2_loc (input_location, TRUTH_OR_EXPR, + boolean_type_node, tmp, + zero_cond); + } + + /* 'zero_cond' being true is equal to lhs not being allocated or the + shapes being different. */ + zero_cond = gfc_evaluate_now (zero_cond, &se->post); + + /* Now reset the bounds returned from the function call to bounds based + on the lhs lbounds, except where the lhs is not allocated or the shapes + of 'variable and 'expr' are different. Set the offset accordingly. */ offset = gfc_index_zero_node; for (n = 0 ; n < rank; n++) { ! tree lbound; ! ! lbound = gfc_conv_descriptor_lbound_get (desc, gfc_rank_cst[n]); ! lbound = fold_build3_loc (input_location, COND_EXPR, ! gfc_array_index_type, zero_cond, ! gfc_index_one_node, lbound); ! lbound = gfc_evaluate_now (lbound, &se->post); ! ! tmp = gfc_conv_descriptor_ubound_get (res_desc, gfc_rank_cst[n]); tmp = fold_build2_loc (input_location, PLUS_EXPR, ! gfc_array_index_type, tmp, lbound); gfc_conv_descriptor_lbound_set (&se->post, desc, ! gfc_rank_cst[n], lbound); gfc_conv_descriptor_ubound_set (&se->post, desc, gfc_rank_cst[n], tmp); ! /* Set stride and accumulate the offset. */ ! tmp = gfc_conv_descriptor_stride_get (res_desc, gfc_rank_cst[n]); ! gfc_conv_descriptor_stride_set (&se->post, desc, ! gfc_rank_cst[n], tmp); ! tmp = fold_build2_loc (input_location, MULT_EXPR, ! gfc_array_index_type, lbound, tmp); ! offset = fold_build2_loc (input_location, MINUS_EXPR, ! gfc_array_index_type, offset, tmp); ! offset = gfc_evaluate_now (offset, &se->post); } + gfc_conv_descriptor_offset_set (&se->post, desc, offset); } diff -Nrcpad gcc-4.6.2/gcc/fortran/trans-types.c gcc-4.6.3/gcc/fortran/trans-types.c *** gcc-4.6.2/gcc/fortran/trans-types.c Thu Jul 28 05:40:21 2011 --- gcc-4.6.3/gcc/fortran/trans-types.c Fri Nov 25 17:18:05 2011 *************** gfc_copy_dt_decls_ifequal (gfc_symbol *f *** 2092,2097 **** --- 2092,2100 ---- gfc_component *to_cm; gfc_component *from_cm; + if (from == to) + return 1; + if (from->backend_decl == NULL || !gfc_compare_derived_types (from, to)) return 0; diff -Nrcpad gcc-4.6.2/libgfortran/ChangeLog gcc-4.6.3/libgfortran/ChangeLog *** gcc-4.6.2/libgfortran/ChangeLog Wed Oct 26 09:07:18 2011 --- gcc-4.6.3/libgfortran/ChangeLog Thu Mar 1 11:53:40 2012 *************** *** 1,3 **** --- 1,11 ---- + 2012-03-01 Release Manager + + * GCC 4.6.3 released. + + 2011-11-20 Andreas Tobler + + * configure: Regenerate. + 2011-10-26 Release Manager * GCC 4.6.2 released. diff -Nrcpad gcc-4.6.2/libgfortran/configure gcc-4.6.3/libgfortran/configure *** gcc-4.6.2/libgfortran/configure Wed Oct 26 09:30:24 2011 --- gcc-4.6.3/libgfortran/configure Thu Mar 1 12:03:46 2012 *************** if test -z "$aix_libpath"; then aix_libp *** 10326,10332 **** ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. ! freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes --- 10326,10332 ---- ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. ! freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes *************** freebsd* | dragonfly*) *** 11242,11248 **** objformat=`/usr/bin/objformat` else case $host_os in ! freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi --- 11242,11248 ---- objformat=`/usr/bin/objformat` else case $host_os in ! freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi *************** freebsd* | dragonfly*) *** 11260,11266 **** esac shlibpath_var=LD_LIBRARY_PATH case $host_os in ! freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) --- 11260,11266 ---- esac shlibpath_var=LD_LIBRARY_PATH case $host_os in ! freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) *************** if test -z "$aix_libpath"; then aix_libp *** 14162,14168 **** ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. ! freebsd2*) archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_FC=yes hardcode_minus_L_FC=yes --- 14162,14168 ---- ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. ! freebsd2.*) archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_FC=yes hardcode_minus_L_FC=yes *************** freebsd* | dragonfly*) *** 14870,14876 **** objformat=`/usr/bin/objformat` else case $host_os in ! freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi --- 14870,14876 ---- objformat=`/usr/bin/objformat` else case $host_os in ! freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi *************** freebsd* | dragonfly*) *** 14888,14894 **** esac shlibpath_var=LD_LIBRARY_PATH case $host_os in ! freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) --- 14888,14894 ---- esac shlibpath_var=LD_LIBRARY_PATH case $host_os in ! freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*)