aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
AgeCommit message (Collapse)AuthorFilesLines
2020-06-19Daily bump.GCC Administrator1-0/+5
2020-06-18OpenMP/Fortran: Reject allocatable components in map clauseTobias Burnus1-0/+7
gcc/fortran/ChangeLog: * openmp.c (resolve_omp_clauses): Reject vars with allocatable components in OpenMP map clauses. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/map-alloc-comp-1.f90: New test.
2020-06-17Daily bump.GCC Administrator1-0/+17
2020-06-16OpenACC/Fortran: permit 'routine' inside PURETobias Burnus2-13/+23
gcc/fortran/ChangeLog * parse.c (decode_oacc_directive): Permit 'acc routine' also inside pure procedures. * openmp.c (gfc_match_oacc_routine): Inside pure procedures do not permit gang, worker or vector clauses. libgomp/ChangeLog: * testsuite/libgomp.oacc-fortran/routine-10.f90: New test. gcc/testsuite/ChangeLog: * gfortran.dg/goacc/pure-elemental-procedures-2.f90: New test. Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>
2020-06-16OpenMP/Fortran: Permit impure ELEMENTAL in omp directivesTobias Burnus1-2/+1
OpenMP since 4.5 permits IMPURE ELEMENTAL in directives and the code already only checked for PURE. – Followup for -fopenmp-simd. gcc/fortran/ChangeLog: * parse.c (decode_omp_directive): Remove "or ELEMENTAL" from "in PURE" error message also for -fopenmp-simd. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/pr79154-simd.f90: New test.
2020-06-16OpenMP/Fortran: Permit impure ELEMENTAL in omp directivesTobias Burnus1-2/+2
OpenMP since 4.5 permits IMPURE ELEMENTAL in directives and the code already only checked for PURE. gcc/fortran/ChangeLog: * parse.c (decode_omp_directive): Remove "or ELEMENTAL" from "in PURE" error message. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/pr79154-1.f90: Update dg-*; add an impure elemental example. * gfortran.dg/gomp/pr79154-2.f90: Likewise.
2020-06-15Daily bump.GCC Administrator1-0/+27
2020-06-14Avoid crash when global symbol table is empty with -fdump-fortran-global.Thomas Koenig1-1/+4
This just avoids a crash with -fdump-fortran-global when the global symbol table is empty. This is strictly a developer's option, no user impact. gcc/fortran/ChangeLog: 2020-06-14 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/42122 * dump-parse-tree.c (gfc_dump_global_symbols): If the symroot is empty, just output "empty".
2020-06-14PR fortran/95088 - Buffer overflows with PDTs, submodules and long symbolsHarald Anlauf1-11/+3
With PDTs (parameterized derived types) and submodules, name mangling results in variably long internal symbols. Instead of using a fixed-size intermediate buffer, which is actually not really needed, just use a pointer to strings. 2020-06-14 Harald Anlauf <anlauf@gmx.de> gcc/fortran/ PR fortran/95088 * class.c (get_unique_type_string): Replace use of fixed size buffer by internally passing a pointer to strings.
2020-06-14Always use locations from get and put arguments for error messages.Thomas Koenig1-2/+2
A simple and obvios patch - the error location was taken from a variable that was not initialized for optional variables. gcc/fortran/ChangeLog: * check.c (gfc_check_random_seed): Always use locations from get and put arguments for error messages. gcc/testsuite/ChangeLog: * gfortran.dg/random_seed_4.f90: New test.
2020-06-14When avoiding double deallocation, look at namespace, expression and component.Thomas Koenig3-6/+42
Our finalization handling is a mess. Really, we should get to try and get this fixed for gcc 11. In the meantime, here is a patch which fixes a regression I introduced when fixing a regression with a memory leak. The important thing here is to realize that we do not need to finalize (and deallocate) multiple times for the same expression and the same component in the same namespace. It might cause code size regressions, but better big code than wrong code... gcc/fortran/ChangeLog: PR fortran/94109 * class.c (finalize_component): Return early if finalization has already happened for expression and component within namespace. * gfortran.h (gfc_was_finalized): New type. (gfc_namespace): Add member was_finalzed. (gfc_expr): Remove finalized. * symbol.c (gfc_free_namespace): Free was_finalized. gcc/testsuite/ChangeLog: PR fortran/94109 * gfortran.dg/finalize_34.f90: Adjust free counts. * gfortran.dg/finalize_36.f90: New test.
2020-06-12Daily bump.GCC Administrator1-0/+46
2020-06-11PR fortran/95611 - ICE in access_attr_decl, at fortran/decl.c:9075Harald Anlauf1-1/+1
When reporting a duplicate access specification of an operator, refer to the proper symbol. 2020-06-11 Harald Anlauf <anlauf@gmx.de> gcc/fortran/ PR fortran/95611 * decl.c (access_attr_decl): Use correct symbol in error message. Co-Authored-By: Steven G. Kargl <kargl@gcc.gnu.org>
2020-06-11PR fortran/95544 - Fix ICE in NULL() argument to intrinsicsHarald Anlauf3-12/+31
Fortran 2018: An argument to an intrinsic procedure other than ASSOCIATED, NULL, or PRESENT shall be a data object. An EXPR_NULL is not a data object. Add checks for intrinsics. 2020-06-11 Steven G. Kargl <kargl@gcc.gnu.org> Harald Anlauf <anlauf@gmx.de> gcc/fortran/ PR fortran/95544 * check.c (invalid_null_arg): Rename to gfc_invalid_null_arg. (gfc_check_associated, gfc_check_kind, gfc_check_merge) (gfc_check_shape, gfc_check_size, gfc_check_spread) (gfc_check_transfer): Adjust. (gfc_check_len_lentrim, gfc_check_trim): Check for NULL() argument. * gfortran.h: Declare gfc_invalid_null_arg (). * intrinsic.c (check_arglist): Check for NULL() argument.
2020-06-11PR fortran/95503 - Fix ICE in gfc_is_simply_contiguous, at fortran/expr.c:5844Harald Anlauf1-1/+3
The check for assigning a pointer that cannot be determined to be simply contiguous at compile time to a contiguous pointer does not need to be invoked if the lhs of the assignment is known to have conflicting attributes. 2020-06-11 Harald Anlauf <anlauf@gmx.de> gcc/fortran/ PR fortran/95503 * expr.c (gfc_check_pointer_assign): Skip contiguity check of rhs of pointer assignment if lhs cannot be simply contiguous. gcc/testsuite/ PR fortran/95503 * gfortran.dg/pr95503.f90: New test.
2020-06-11PR95331 - Unlimited polymorphic arrays have wrong bounds.José Rui Faustino de Sousa1-4/+9
When iterating over a class array use the bounds provided by the transformed descriptor (in sym->backend_decl) instead of the original bounds of the array (in the descriptor passed in the class _data) which are passed in se->expr. The patch partially depends on the patch for PR52351 and PR85868, but does not seems to break anything by itself. gcc/fortran/ChangeLog: 2020-06-11 José Rui Faustino de Sousa <jrfsousa@gmail.com> PR fortran/95331 * trans-array.c (gfc_conv_array_ref): For class array dummy arguments use the transformed descriptor in sym->backend_decl instead of the original descriptor. gcc/testsuite/ChangeLog: 2020-06-11 José Rui Faustino de Sousa <jrfsousa@gmail.com> PR fortran/95331 * gfortran.dg/PR95331.f90: New test.
2020-06-11Wrong array section bounds when passing to an intent-in pointer dummy.José Rui Faustino de Sousa1-103/+26
Add code to allow for the creation a new descriptor for array sections with the correct one based indexing. Rework the generated descriptors indexing (hopefully) fixing the wrong offsets generated. gcc/fortran/ChangeLog: 2020-06-11 José Rui Faustino de Sousa <jrfsousa@gmail.com> PR fortran/52351 PR fortran/85868 * trans-array.c (gfc_conv_expr_descriptor): Enable the creation of a new descriptor with the correct one based indexing for array sections. Rework array descriptor indexing offset calculation. gcc/testsuite/ChangeLog: 2020-06-11 José Rui Faustino de Sousa <jrfsousa@gmail.com> PR fortran/52351 PR fortran/85868 * gfortran.dg/coarray_lib_comm_1.f90: Adjust match test for the newly generated descriptor. * gfortran.dg/PR85868A.f90: New test. * gfortran.dg/PR85868B.f90: New test.
2020-06-11Patch to Bug 94022 - Array slices of assumed-size arrays.José Rui Faustino de Sousa1-0/+2
Make sure that when passing array sections of assumed-size arrays to procedures expecting an assumed-rank array the upper bound of the last dimension of the array section does not get improperly reset to -1 to mark it has an assumed size array. gcc/fortran/ChangeLog: 2020-06-11 José Rui Faustino de Sousa <jrfsousa@gmail.com> PR fortran/94022 * trans-expr.c (gfc_conv_procedure_call): In the case of assumed-size arrays ensure that the reference is to a full array. gcc/testsuite/ChangeLog: 2020-06-11 José Rui Faustino de Sousa <jrfsousa@gmail.com> PR fortran/94022 * gfortran.dg/PR94022.f90: New test.
2020-06-08Daily bump.GCC Administrator1-0/+12
2020-06-07PR fortran/95091 - Buffer overflows with submodules and long symbolsHarald Anlauf1-1/+1
Add cast to fix bootstrap error with -Werror=sign-compare. gcc/fortran/ PR fortran/95091 * class.c (gfc_hash_value): Add cast.
2020-06-07PR fortran/95091 - Buffer overflows with submodules and long symbolsHarald Anlauf1-5/+8
With submodules, name mangling results in long internal symbols. This requires adjustment of the sizes of temporaries to avoid buffer overflows. 2020-06-07 Harald Anlauf <anlauf@gmx.de> gcc/fortran/ PR fortran/95091 * class.c (get_unique_type_string, gfc_hash_value): Enlarge buffers, and check whether the strings returned by get_unique_type_string() fit.
2020-06-06Daily bump.GCC Administrator1-0/+16
2020-06-05PR fortran/95530, PR fortran/95537 - Buffer overflows with long symbolsHarald Anlauf3-4/+14
The testcases for PR95090 and PR95106 trigger buffer overflows with long symbols that were found with an instrumented compiler. Enlarge the affected buffers, and add checks that the buffers will suffice. 2020-06-05 Harald Anlauf <anlauf@gmx.de> gcc/fortran/ PR fortran/95530 PR fortran/95537 * decl.c (gfc_match_decl_type_spec): Enlarge buffer, and enhance string copy to detect buffer overflow. * gfortran.h (gfc_common_head): Enlarge buffer. * trans-common.c (finish_equivalences): Enhance string copy to detect buffer overflow.
2020-06-05fortran/95509 - fix spellcheck-operator.f90 regressionTom Tromey1-1/+1
My earlier patch to add case handling to the spell checker caused a Fortran regression. I believe I must have misread the test results. This patch fixes the problem by changing the cutoff. I chose this value because the previous patch effectively multiplied the result of get_edit_distance by 2 (unless a case change is involved). gcc/fortran/ChangeLog: PR fortran/95509 * misc.c (gfc_closest_fuzzy_match): Update cutoff value computation.
2020-06-05Daily bump.GCC Administrator1-0/+7
2020-06-04PR fortran/95500 - Segfault compiling extra interface on intrinsicHarald Anlauf1-0/+1
Converting an expression so that it can be passed by reference could result in a NULL pointer dereference. 2020-06-04 Steven G. Kargl <kargl@gcc.gnu.org> Harald Anlauf <anlauf@gmx.de> gcc/fortran/ PR fortran/95500 * trans-expr.c (gfc_conv_expr_reference): Do not dereference NULL pointer. gcc/testsuite/ PR fortran/95500 * gfortran.dg/pr95500.f90: New test.
2020-06-04Daily bump.GCC Administrator1-0/+14
2020-06-03Simple patch only add assumed-rank to the list of possible attributes.José Rui Faustino de Sousa1-1/+2
gcc/fortran/ChangeLog: 2020-06-03 José Rui Faustino de Sousa <jrfsousa@gmail.com> PR fortran/95214 PR fortran/66833 PR fortran/67938 * trans-expr.c (gfc_maybe_dereference_var): Add assumed-rank to character dummy arguments list of possible attributes. gcc/testsuite/ChangeLog: 2020-06-03 José Rui Faustino de Sousa <jrfsousa@gmail.com> PR fortran/95214 PR fortran/66833 PR fortran/67938 * gfortran.dg/PR95214.f90: New test.
2020-06-03[OpenMP] Fix mapping of artificial variables (PR94874)Tobias Burnus3-1/+27
gcc/c-family/ChangeLog: * c-common.h (c_omp_predetermined_mapping): Declare. * c-omp.c (c_omp_predetermined_mapping): New. gcc/c/ChangeLog: * c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redefine. gcc/cp/ChangeLog: * cp-gimplify.c (cxx_omp_predetermined_mapping): New. * cp-objcp-common.h (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redfine. * cp-tree.h (cxx_omp_predetermined_mapping): Declare. gcc/fortran/ChangeLog: * f95-lang.c (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Redefine. * trans-openmp.c (gfc_omp_predetermined_mapping): New. * trans.h (gfc_omp_predetermined_mapping): Declare. gcc/ChangeLog: * gimplify.c (omp_notice_variable): Use new hook. * langhooks-def.h (lhd_omp_predetermined_mapping): Declare. (LANG_HOOKS_OMP_PREDETERMINED_MAPPING): Define (LANG_HOOKS_DECLS): Add it. * langhooks.c (lhd_omp_predetermined_sharing): Remove bogus unused attr. (lhd_omp_predetermined_mapping): New. * langhooks.h (struct lang_hooks_for_decls): Add new hook. gcc/testsuite/ChangeLog 2020-06-03 Thomas Schwinge <thomas@codesourcery.com> Tobias Burnus <tobias@codesourcery.com> PR middle-end/94874 * c-c++-common/gomp/pr94874.c: New.
2020-06-01Daily bump.GCC Administrator1-0/+8
2020-05-31Finalization depends on the expression, not on the component.Thomas Koenig2-3/+6
This patch fixes a 8/9/10/11 regression, where finalized types were not finalized (and deallocated), which led to memory leaks. gcc/fortran/ChangeLog: 2020-05-24 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/94361 * class.c (finalize_component): Use expr->finalized instead of comp->finalized. * gfortran.h (gfc_component): Remove finalized member. (gfc_expr): Add it here instead. gcc/testsuite/ChangeLog: 2020-05-24 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/94361 * gfortran.dg/finalize_28.f90: Adjusted free counts. * gfortran.dg/finalize_33.f90: Likewise. * gfortran.dg/finalize_34.f90: Likewise. * gfortran.dg/finalize_35.f90: New test.
2020-05-31Daily bump.GCC Administrator1-0/+12
2020-05-30PR fortran/95373 - ICE in build_reference_type, at tree.c:7942Harald Anlauf1-22/+21
The use of KIND, LEN, RE, and IM inquiry references for applicable intrinsic types is valid only for suffienctly new Fortran standards. Add appropriate checks in the appropriate place. 2020-05-30 Harald Anlauf <anlauf@gmx.de> gcc/fortran/ PR fortran/95373 * primary.c (is_inquiry_ref): Move validity check of inquiry references against selected Fortran standard from here... (gfc_match_varspec) ...to here. gcc/testsuite/ PR fortran/95373 * gfortran.dg/pr95373_1.f90: Adjust error messages. * gfortran.dg/pr95373_2.f90: Adjust error message.
2020-05-30PR fortran/95090 - ICE: identifier overflowHarald Anlauf1-1/+8
Implement buffer overrun check for temporary that holds mangled names. 2020-05-30 Harald Anlauf <anlauf@gmx.de> gcc/fortran/ PR fortran/95090 * class.c (get_unique_type_string): Use buffer overrun check.
2020-05-30Daily bump.GCC Administrator1-0/+8
2020-05-29PR fortran/95090 - ICE: identifier overflowHarald Anlauf1-4/+7
The initial fix for this PR uncovered several latent issues with further too small string buffers which showed up only when testing on i686. Provide sufficiently large temporaries. 2020-05-29 Harald Anlauf <anlauf@gmx.de> gcc/fortran/ PR fortran/95090 * class.c (get_unique_type_string): Enlarge temporary for name-mangling. Use strncpy to prevent buffer overrun. (get_unique_hashed_string): Enlarge temporary. (gfc_hash_value): Enlarge temporary for name-mangling.
2020-05-29Daily bump.GCC Administrator1-0/+17
2020-05-28PR fortran/95373 - ICE in build_reference_type, at tree.c:7942Harald Anlauf1-0/+22
The use of KIND, LEN, RE, and IM inquiry references for applicable intrinsic types is valid only for suffienctly new Fortran standards. Add appropriate check. 2020-05-28 Harald Anlauf <anlauf@gmx.de> gcc/fortran/ PR fortran/95373 * primary.c (is_inquiry_ref): Check validity of inquiry references against selected Fortran standard. gcc/testsuite/ PR fortran/95373 * gfortran.dg/pr95373_1.f90: New test. * gfortran.dg/pr95373_2.f90: New test.
2020-05-28Fortran : "type is( real(kind(1.)) )" spurious syntax error PR94397Mark Eggleston1-1/+4
Based on a patch in the comments of the PR. That patch fixed this problem but caused the test cases for PR93484 to fail. It has been changed to reduce initialisation expressions if the expression is not EXPR_VARIABLE and not EXPR_CONSTANT. 2020-05-28 Steven G. Kargl <kargl@gcc.gnu.org> Mark Eggleston <markeggleston@gcc.gnu.org> gcc/fortran/ PR fortran/94397 * match.c (gfc_match_type_spec): New variable ok initialised to true. Set ok with the return value of gfc_reduce_init_expr called only if the expression is not EXPR_CONSTANT and is not EXPR_VARIABLE. Add !ok to the check for type not being integer or the rank being greater than zero. 2020-05-28 Mark Eggleston <markeggleston@gcc.gnu.org> gcc/testsuite/ PR fortran/94397 * gfortran.dg/pr94397.F90: New test.
2020-05-28Daily bump.GCC Administrator1-0/+16
2020-05-27PR fortran/95090 - ICE: identifier overflowHarald Anlauf1-1/+2
For long module name, derive type and component name, the generated name-mangled symbol did not fit into a buffer when coarrays were enabled. Provide sufficiently large temporary. 2020-05-27 Harald Anlauf <anlauf@gmx.de> gcc/fortran/ PR fortran/95090 * iresolve.c (gfc_get_string): Enlarge temporary for name-mangling. gcc/testsuite/ PR fortran/95090 * gfortran.dg/pr95090.f90: New test.
2020-05-27Fortran : ICE in gfc_trans_label_assign PR50392Mark Eggleston1-3/+8
A function may contain an assigned goto. If the the return variable is an integer a statement can be assigned to it. Prior to this fix this resulted in an ICE. 2020-05-27 Tobias Burnus <tobias@codesourcery.com> gcc/fortran/ PR fortran/50392 * trans-decl.c (gfc_get_symbol_decl): Remove unnecessary block delimiters. Add auxiliary variables if a label is assigned to a return variable. (gfc_gat_fake_result): If the symbol has an assign attribute set declaration from the symbol's backend declaration. 2020-05-27 Mark Eggleston <markeggleston@gnu.gcc.org> gcc/testsuite/ PR fortran/50392 * gfortran.dg/pr50392.f: New test.
2020-05-27Daily bump.GCC Administrator1-0/+11
2020-05-26PR fortran/95089 - ICE in gfc_get_derived_type, at fortran/trans-types.c:2843Harald Anlauf1-2/+3
For long module name, derive type and component name, the generated name-mangled symbol did not fit into a buffer when coarrays were enabled. Provide sufficiently large temporary. 2020-05-26 Harald Anlauf <anlauf@gmx.de> gcc/fortran/ PR fortran/95089 * trans-types.c (gfc_get_derived_type): Enlarge temporary to hold mangled name "_caf_symbol". gcc/testsuite/ PR fortran/95089 * gfortran.dg/pr95089.f90: New test.
2020-05-26revamp dump and aux output namesAlexandre Oliva1-2/+2
This patch simplifies (!!!) the logic governing the naming of dump files and auxiliary output files in the driver, in the compiler, and in the LTO wrapper. No changes are made to the naming of primary outputs, there are often ways to restore past behavior, and a number of inconsistencies are fixed. Some internal options are removed (-auxbase and -auxbase-strip), sensible existing uses of -dumpdir and -dumpbase options remain unchanged, additional useful cases are added, making for what is still admittedly quite complex. Extensive documentation and testcases provide numerous examples, from normal to corner cases. The most visible changes are: - aux and dump files now always go in the same directory, that defaults to the directory of the primary output, but that can be overridden with -dumpdir, -save-temps=*, or, preserving past behavior, with a -dumpbase with a directory component. - driver and compiler now have the same notion of naming of auxiliary outputs, e.g. .dwo files will no longer be in one location while the debug info suggests they are elsewhere, and -save-temps and .dwo auxiliary outputs now go in the same location as .su, .ci and coverage data, with consistent naming. - explicitly-specified primary output names guide not only the location of aux and dump outputs: the output base name is also used in their base name, as a prefix when also linking (e.g. foo.c bar.c -o foobar creates foobar-foo.dwo and foobar-bar.dwo with -gsplit-dwarf), or as the base name instead of the input name (foo.c -c -o whatever.o creates whatever.su rather than foo.su with -fstack-usage). The preference for the input file base name, quite useful for our testsuite, can be restored with -dumpbase "". When compiling and linking tests in the testsuite with additional inputs, we now use this flag. Files named in dejagnu board ldflags, libs, and ldscripts are now quoted in the gcc testsuite with -Wl, so that they are not counted as additional inputs by the compiler driver. - naming a -dumpbase when compiling multiple sources used to cause dumps from later compiles to overwrite those of earlier ones; it is now used as a prefix when compiling multiple sources, like an executable name above. - the dumpbase, explicitly specified or computed from output or input names, now also governs the naming of aux outputs; since aux outputs usually replaced the suffix from the input name, while dump outputs append their own additional suffixes, a -dumpbase-ext option is introduced to enable a chosen suffix to be dropped from dumpbase to form aux output names. - LTO dump and aux outputs were quite a mess, sometimes leaking temporary output names into -save-temps output names, sometimes conversely generating desirable aux outputs in temporary locations. They now obey the same logic of compiler aux and dump outputs, landing in the expected location and taking the linker output name or an explicit dumpbase overrider into account. - Naming of -fdump-final-insns outputs now follows the dump file naming logic for the .gkd files, and the .gk dump files generated in the second -fcompare-debug compilation get the .gk inserted before the suffix that -dumpbase-ext drops in aux outputs. gcc/ChangeLog: * common.opt (aux_base_name): Define. (dumpbase, dumpdir): Mark as Driver options. (-dumpbase, -dumpdir): Likewise. (dumpbase-ext, -dumpbase-ext): New. (auxbase, auxbase-strip): Drop. * doc/invoke.texi (-dumpbase, -dumpbase-ext, -dumpdir): Document. (-o): Introduce the notion of primary output, mention it influences auxiliary and dump output names as well, add examples. (-save-temps): Adjust, move examples into -dump*. (-save-temps=cwd, -save-temps=obj): Likewise. (-fdump-final-insns): Adjust. * dwarf2out.c (gen_producer_string): Drop auxbase and auxbase_strip; add dumpbase_ext. * gcc.c (enum save_temps): Add SAVE_TEMPS_DUMP. (save_temps_prefix, save_temps_length): Drop. (save_temps_overrides_dumpdir): New. (dumpdir, dumpbase, dumpbase_ext): New. (dumpdir_length, dumpdir_trailing_dash_added): New. (outbase, outbase_length): New. (The Specs Language): Introduce %". Adjust %b and %B. (ASM_FINAL_SPEC): Use %b.dwo for an aux output name always. Precede object file with %w when it's the primary output. (cpp_debug_options): Do not pass on incoming -dumpdir, -dumpbase and -dumpbase-ext options; recompute them with %:dumps. (cc1_options): Drop auxbase with and without compare-debug; use cpp_debug_options instead of dumpbase. Mark asm output with %w when it's the primary output. (static_spec_functions): Drop %:compare-debug-auxbase-opt and %:replace-exception. Add %:dumps. (driver_handle_option): Implement -save-temps=*/-dumpdir mutual overriding logic. Save dumpdir, dumpbase and dumpbase-ext options. Do not save output_file in save_temps_prefix. (adds_single_suffix_p): New. (single_input_file_index): New. (process_command): Combine output dir, output base name, and dumpbase into dumpdir and outbase. (set_collect_gcc_options): Pass a possibly-adjusted -dumpdir. (do_spec_1): Optionally dumpdir instead of save_temps_prefix, and outbase instead of input_basename in %b, %B and in -save-temps aux files. Handle empty argument %". (driver::maybe_run_linker): Adjust dumpdir and auxbase. (compare_debug_dump_opt_spec_function): Adjust gkd dump file naming. Spec-quote the computed -fdump-final-insns file name. (debug_auxbase_opt): Drop. (compare_debug_self_opt_spec_function): Drop auxbase-strip computation. (compare_debug_auxbase_opt_spec_function): Drop. (not_actual_file_p): New. (replace_extension_spec_func): Drop. (dumps_spec_func): New. (convert_white_space): Split-out parts into... (quote_string, whitespace_to_convert_p): ... these. New. (quote_spec_char_p, quote_spec, quote_spec_arg): New. (driver::finalize): Release and reset new variables; drop removed ones. * lto-wrapper.c (HAVE_TARGET_EXECUTABLE_SUFFIX): Define if... (TARGET_EXECUTABLE_SUFFIX): ... is defined; define this to the empty string otherwise. (DUMPBASE_SUFFIX): Drop leading period. (debug_objcopy): Use concat. (run_gcc): Recognize -save-temps=* as -save-temps too. Obey -dumpdir. Pass on empty dumpdir and dumpbase with a directory component. Simplify temp file names. * opts.c (finish_options): Drop aux base name handling. (common_handle_option): Drop auxbase-strip handling. * toplev.c (print_switch_values): Drop auxbase, add dumpbase-ext. (process_options): Derive aux_base_name from dump_base_name and dump_base_ext. (lang_dependent_init): Compute dump_base_ext along with dump_base_name. Disable stack usage and callgraph-info during lto generation and compare-debug recompilation. gcc/fortran/ChangeLog: * options.c (gfc_get_option_string): Drop auxbase, add dumpbase_ext. gcc/ada/ChangeLog: * gcc-interface/lang-specs.h: Drop auxbase and auxbase-strip. Use %:dumps instead of -dumpbase. Add %w for implicit .s primary output. * switch.adb (Is_Internal_GCC_Switch): Recognize dumpdir and dumpbase-ext. Drop auxbase and auxbase-strip. lto-plugin/ChangeLog: * lto-plugin.c (skip_in_suffix): New. (exec_lto_wrapper): Use skip_in_suffix and concat to build non-temporary output names. (onload): Look for -dumpdir in COLLECT_GCC_OPTIONS, and override link_output_name with it. contrib/ChangeLog: * compare-debug: Adjust for .gkd files named as dump files, with the source suffix rather than the object suffix. gcc/testsuite/ChangeLog: * gcc.misc-tests/outputs.exp: New. * gcc.misc-tests/outputs-0.c: New. * gcc.misc-tests/outputs-1.c: New. * gcc.misc-tests/outputs-2.c: New. * lib/gcc-defs.exp (gcc_adjusted_linker_flags): New. (gcc_adjust_linker_flags): New. (dg-additional-files-options): Call it. Pass -dumpbase "" when there are additional sources. * lib/profopt.exp (profopt-execute): Pass the executable suffix with -dumpbase-ext. * lib/scandump.exp (dump-base): Mention -dumpbase "" use. * lib/scanltranstree.exp: Adjust dump suffix expectation. * lib/scanwpaipa.exp: Likewise.
2020-05-24PR fortran/95106 - truncation of long symbol names with EQUIVALENCEHarald Anlauf2-2/+9
For long module names, the generated name-mangled symbol was truncated, leading to bogus warnings about COMMON block mismatches. Provide sufficiently large temporaries. gcc/fortran/ 2020-05-24 Harald Anlauf <anlauf@gmx.de> PR fortran/95106 * trans-common.c (gfc_sym_mangled_common_id): Enlarge temporaries for name-mangling. gcc/testsuite/ 2020-05-24 Harald Anlauf <anlauf@gmx.de> PR fortran/95106 * gfortran.dg/equiv_11.f90: New test.
2020-05-23Fixes a hang on an invalid ID in a WAIT statement.Thomas Koenig2-0/+7
gcc/fortran/ChangeLog: 2020-05-23 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/95191 * libgfortran.h (libgfortran_error_codes): Add LIBERROR_BAD_WAIT_ID. libgfortran/ChangeLog: 2020-05-23 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/95191 * io/async.c (async_wait_id): Generate error if ID is higher than the highest current ID. * runtime/error.c (translate_error): Handle LIBERROR_BAD_WAIT_ID. libgomp/ChangeLog: 2020-05-23 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/95191 * testsuite/libgomp.fortran/async_io_9.f90: New test.
2020-05-20Fortran : ProcPtr function results: 'ppr@' in error message PR39695Mark Eggleston3-4/+20
The value 'ppr@' is set in the name of result symbol, the actual name of the symbol is in the procedure name symbol pointed to by the result symbol's namespace (ns). When reporting errors for symbols that have the proc_pointer attribute check whether the result attribute is set and set the name accordingly. 2020-05-20 Mark Eggleston <markeggleston@gcc.gnu.org> gcc/fortran/ PR fortran/39695 * resolve.c (resolve_fl_procedure): Set name depending on whether the result attribute is set. For PROCEDURE/RESULT conflict use the name in sym->ns->proc_name->name. * symbol.c (gfc_add_type): Add check for function and result attributes use sym->ns->proc_name->name if both are set. Where the symbol cannot have a type use the name in sym->ns->proc_name->name. 2020-05-20 Mark Eggleston <markeggleston@gcc.gnu.org> gcc/testsuite/ PR fortran/39695 * gfortran.dg/pr39695_1.f90: New test. * gfortran.dg/pr39695_2.f90: New test. * gfortran.dg/pr39695_3.f90: New test. * gfortran.dg/pr39695_4.f90: New test.
2020-05-18PR fortran/95053 - division by zero constantsHarald Anlauf3-33/+27
Partially revert the fix for PR93499. Replace by checks for valid expressions in the declaration of array shape and PDT KIND and LEN expressions at a later stage. gcc/fortran/ 2020-05-18 Harald Anlauf <anlauf@gmx.de> PR fortran/95053 * arith.c (gfc_divide): Revert hunk introduced by patch for PR93499. * decl.c (variable_decl): Generate error for array shape not being an INTEGER constant. (gfc_get_pdt_instance): Generate error if KIND or LEN expressions in declaration of a PDT instance do not simplify to INTEGER constants. gcc/testsuite/ 2020-05-18 Harald Anlauf <anlauf@gmx.de> PR fortran/95053 * gfortran.dg/dec_structure_23.f90: Adjust to new error messages. * gfortran.dg/pr93499.f90: Adjust to new error messages. * gfortran.dg/pr95053_2.f90: New test. * gfortran.dg/pr95053_3.f90: New test.
2020-05-15[Fortran] OpenMP 5 – permit more sharing clauses for SIMD (PR94690)Tobias Burnus2-11/+12
gcc/fortran/ PR fortran/94690 * openmp.c (resolve_omp_do): Permit more clauses for SIMD iteration variables. gcc/testsuite/ PR fortran/94690 * gfortran.dg/gomp/openmp-simd-4.f90: New test.