Paul Thomas [Sun, 3 Feb 2019 18:23:25 +0000 (18:23 +0000)]
backport: re PR fortran/88393 ([OOP] Segfault with type-bound assignment)
2019-02-03 Paul Thomas <pault@gcc.gnu.org>
Backport from trunk
PR fortran/88393
* trans-expr.c (gfc_conv_procedure_call): For derived entities,
passed in parentheses to class formals, invert the order of
copying allocatable components to taking the _data of the
class expression.
2019-02-03 Paul Thomas <pault@gcc.gnu.org>
Backport from trunk
PR fortran/88393
* gfortran.dg/alloc_comp_assign_16.f03 : New test.
Thomas Koenig [Sat, 2 Feb 2019 17:07:40 +0000 (17:07 +0000)]
re PR fortran/88298 (Bogus conversion warning for CSHIFT with -fno-range-check -m64)
2019-02-02 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/88298
Backport from trunk
* arith.c (gfc_int2int): Do not warn if src->do_not_warn is set.
* gfortran.h (gfc_expr): Add flag do_not_warn.
* intrinsic.c (gfc_convert_type_warn): Set expr->do_not_warn if
no warning is desired.
2019-02-02 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/88298
Backport from trunk
* gfortran.dg/warn_conversion_10.f90: New test.
Thomas Koenig [Sat, 2 Feb 2019 16:57:39 +0000 (16:57 +0000)]
re PR fortran/57048 (Handling of C_PTR and C_FUNPTR leads to reject valid)
2019-02-02 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/57048
Backport from trunk
* interface.c (gfc_compare_types): If a derived type and an
integer both have a derived type, and they are identical,
this is a C binding type and compares equal.
2019-02-02 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/57048
Backport from trunk
* gfortran.dg/c_funptr_1.f90: New file.
* gfortran.dg/c_funptr_1_mod.f90: New file.
PR rtl-optimization/89115
* opts.c (default_options_optimization): Reduce
PARAM_MAX_DSE_ACTIVE_LOCAL_STORES by a factor of 10 at -O1.
Make PARAM_LOOP_INVARIANT_MAX_BBS_IN_LOOP reduction relative
to the default.
Kewen Lin [Wed, 30 Jan 2019 08:18:05 +0000 (08:18 +0000)]
backport: [multiple changes]
2019-01-30 Kewen Lin <linkw@gcc.gnu.org>
Backport from mainline.
gcc/
2019-01-17 Kewen Lin <linkw@gcc.gnu.org>
* doc/extend.texi: Add four new prototypes for vec_ld and seven new
prototypes for vec_st.
* config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add entries
for scalar address type variants of altivec_vec_ld/altivec_vec_st,
mainly on signed/unsigned long long and double.
gcc/testsuite/
2019-01-20 Kewen Lin <linkw@gcc.gnu.org>
* gcc.target/powerpc/altivec_vld_vst_addr.c: Remove, split into
altivec_vld_vst_addr-1.c and altivec_vld_vst_addr-2.c.
* gcc.target/powerpc/altivec_vld_vst_addr-1.c: New test.
* gcc.target/powerpc/altivec_vld_vst_addr-2.c: Ditto.
2019-01-17 Kewen Lin <linkw@gcc.gnu.org>
* gcc.target/powerpc/altivec_vld_vst_addr.c: New test.
Paul Thomas [Sun, 27 Jan 2019 18:53:47 +0000 (18:53 +0000)]
Backport PRs 56386, 58906, 77385, 80260, 82077
2019-01-27 Paul Thomas <pault@gcc.gnu.org>
Backport from trunk
PR fortran/56386
PR fortran/58906
PR fortran/77385
PR fortran/80260
PR fortran/82077
* resolve.c (resolve_variable): Fix up expressions with array
associate names, where the parser did not detect that this is
array and there was no array part_ref in the expression.
* trans-expr.c (gfc_find_and_cut_at_last_class_ref): base_expr
should be a copy of e and not the initialization expr.
2019-01-27 Paul Thomas <pault@gcc.gnu.org>
Backport from trunk
PR fortran/56386
PR fortran/58906
PR fortran/77385
* gfortran.dg/associate_44.f90 : New test.
PR fortran/80260
* gfortran.dg/select_type_45.f90 : New test.
PR fortran/82077
* gfortran.dg/select_type_46.f90 : New test.
Uros Bizjak [Sun, 27 Jan 2019 17:42:58 +0000 (18:42 +0100)]
re PR rtl-optimization/88948 (ICE in elimination_costs_in_insn, at reload1.c:3640 since r264148)
PR target/88948
* rtl.h (prepare_copy_insn): New prototype.
* gcse.c (prepare_copy_insn): New function, split out from
process_insert_insn.
(process_insert_insn): Use prepare_copy_insn.
* store-motion.c (replace_store_insn): Use prepare_copy_insn
instead of gen_move_insn.
testsuite/ChangeLog:
PR target/88948
* gcc.target/i386/pr88948.c: New test.
Eric Botcazou [Sat, 26 Jan 2019 16:03:42 +0000 (16:03 +0000)]
trans.c (gnat_to_gnu): Use DECL_SIZE_UNIT instead of TYPE_SIZE_UNIT for the size to be assigned by a...
* gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Use
DECL_SIZE_UNIT instead of TYPE_SIZE_UNIT for the size to be assigned
by a call to memset if the LHS is a DECL.
Eric Botcazou [Sat, 26 Jan 2019 11:36:05 +0000 (11:36 +0000)]
decl.c (annotate_value): Use test on the sign bit instead of on the sign of the value.
* gcc-interface/decl.c (annotate_value) <INTEGER_CST>: Use test on
the sign bit instead of on the sign of the value.
<PLUS_EXPR>: Turn addition of negative constant into subtraction.
<BIT_AND_EXPR>: Simplify.
Joseph Myers [Wed, 16 Jan 2019 21:40:33 +0000 (21:40 +0000)]
Fix diagnostics for never-defined inline and nested functions (PR c/88720, PR c/88726).
Bugs 88720 and 88726 report issues where a function is declared inline
in an inner scope, resulting in spurious diagnostics about it being
declared but never defined when that scope is left (possibly in some
cases also wrongly referring to the function as a nested function).
These are regressions that were introduced with the support for C99
inline semantics in 4.3 (they don't appear with 4.2; it's possible
some aspects of the bugs might have been introduced later than 4.3).
For the case of functions being wrongly referred to as nested,
DECL_EXTERNAL was not the right condition for a function being
non-nested; TREE_PUBLIC is appropriate for the case of non-nested
functions with external linkage, while !b->nested means this is the
outermost scope in which the function was declared and so avoids
catching the case of a file-scope static being redeclared inline
inside a function.
For the non-nested, external-linkage case, the code attempts to avoid
duplicate diagnostics by diagnosing only when scope != external_scope,
but actually scope == external_scope is more appropriate, as it's only
when the file and external scopes are popped that the code can
actually tell whether a function ended up being defined, and all such
functions will appear in the (GCC-internal) external scope.
Bootstrapped with no regressions on x86_64-pc-linux-gnu.
gcc/c:
Backport from mainline
2019-01-07 Joseph Myers <joseph@codesourcery.com>
PR c/88720
PR c/88726
* c-decl.c (pop_scope): Use TREE_PUBLIC and b->nested to determine
whether a function is nested, not DECL_EXTERNAL. Diagnose inline
functions declared but never defined only for external scope, not
for other scopes.
gcc/testsuite:
Backport from mainline
2019-01-07 Joseph Myers <joseph@codesourcery.com>
PR c/88720
PR c/88726
* gcc.dg/inline-40.c, gcc.dg/inline-41.c: New tests.
Jerry DeLisle [Mon, 14 Jan 2019 01:12:27 +0000 (01:12 +0000)]
re PR libfortran/88776 (Namelist read from stdin: loss of data)
2019-01-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/88776
* io/list_read.c (namelist_read): Use nml_err_ret path on read error
not based on stdin_unit.
* io/open.c (newunit): Free format buffer if the unit specified is for
stdin, stdout, or stderr.
Eric Botcazou [Wed, 9 Jan 2019 14:41:55 +0000 (14:41 +0000)]
re PR target/84010 (problematic TLS code generation on 64-bit SPARC)
PR target/84010
* config/sparc/sparc.c (sparc_legitimize_tls_address): Only use Pmode
consistently in TLS address generation and adjust code to the renaming
of patterns. Mark calls to __tls_get_addr as const.
* config/sparc/sparc.md (tgd_hi22): Turn into...
(tgd_hi22<P:mode>): ...this and use Pmode throughout.
(tgd_lo10): Turn into...
(tgd_lo10<P:mode>): ...this and use Pmode throughout.
(tgd_add32): Merge into...
(tgd_add64): Likewise.
(tgd_add<P:mode>): ...this and use Pmode throughout.
(tldm_hi22): Turn into...
(tldm_hi22<P:mode>): ...this and use Pmode throughout.
(tldm_lo10): Turn into...
(tldm_lo10<P:mode>): ...this and use Pmode throughout.
(tldm_add32): Merge into...
(tldm_add64): Likewise.
(tldm_add<P:mode>): ...this and use Pmode throughout.
(tldm_call32): Merge into...
(tldm_call64): Likewise.
(tldm_call<P:mode>): ...this and use Pmode throughout.
(tldo_hix22): Turn into...
(tldo_hix22<P:mode>): ...this and use Pmode throughout.
(tldo_lox10): Turn into...
(tldo_lox10<P:mode>): ...this and use Pmode throughout.
(tldo_add32): Merge into...
(tldo_add64): Likewise.
(tldo_add<P:mode>): ...this and use Pmode throughout.
(tie_hi22): Turn into...
(tie_hi22<P:mode>): ...this and use Pmode throughout.
(tie_lo10): Turn into...
(tie_lo10<P:mode>): ...this and use Pmode throughout.
(tie_ld64): Use DImode throughout.
(tie_add32): Merge into...
(tie_add64): Likewise.
(tie_add<P:mode>): ...this and use Pmode throughout.
(tle_hix22_sp32): Merge into...
(tle_hix22_sp64): Likewise.
(tle_hix22<P:mode>): ...this and use Pmode throughout.
(tle_lox22_sp32): Merge into...
(tle_lox22_sp64): Likewise.
(tle_lox22<P:mode>): ...this and use Pmode throughout.
(*tldo_ldub_sp32): Merge into...
(*tldo_ldub_sp64): Likewise.
(*tldo_ldub<P:mode>): ...this and use Pmode throughout.
(*tldo_ldub1_sp32): Merge into...
(*tldo_ldub1_sp64): Likewise.
(*tldo_ldub1<P:mode>): ...this and use Pmode throughout.
(*tldo_ldub2_sp32): Merge into...
(*tldo_ldub2_sp64): Likewise.
(*tldo_ldub2<P:mode>): ...this and use Pmode throughout.
(*tldo_ldsb1_sp32): Merge into...
(*tldo_ldsb1_sp64): Likewise.
(*tldo_ldsb1<P:mode>): ...this and use Pmode throughout.
(*tldo_ldsb2_sp32): Merge into...
(*tldo_ldsb2_sp64): Likewise.
(*tldo_ldsb2<P:mode>): ...this and use Pmode throughout.
(*tldo_ldub3_sp64): Use DImode throughout.
(*tldo_ldsb3_sp64): Likewise.
(*tldo_lduh_sp32): Merge into...
(*tldo_lduh_sp64): Likewise.
(*tldo_lduh<P:mode>): ...this and use Pmode throughout.
(*tldo_lduh1_sp32): Merge into...
(*tldo_lduh1_sp64): Likewise.
(*tldo_lduh1<P:mode>): ...this and use Pmode throughout.
(*tldo_ldsh1_sp32): Merge into...
(*tldo_ldsh1_sp64): Likewise.
(*tldo_ldsh1<P:mode>): ...this and use Pmode throughout.
(*tldo_lduh2_sp64): Use DImode throughout.
(*tldo_ldsh2_sp64): Likewise.
(*tldo_lduw_sp32): Merge into...
(*tldo_lduw_sp64): Likewise.
(*tldo_lduw<P:mode>): ...this and use Pmode throughout.
(*tldo_lduw1_sp64): Use DImode throughout.
(*tldo_ldsw1_sp64): Likewise.
(*tldo_ldx_sp64): Likewise.
(*tldo_stb_sp32): Merge into...
(*tldo_stb_sp64): Likewise.
(*tldo_stb<P:mode>): ...this and use Pmode throughout.
(*tldo_sth_sp32): Merge into...
(*tldo_sth_sp64): Likewise.
(*tldo_sth<P:mode>): ...this and use Pmode throughout.
(*tldo_stw_sp32): Merge into...
(*tldo_stw_sp64): Likewise.
(*tldo_stw<P:mode>): ...this and use Pmode throughout.
(*tldo_stx_sp64): Use DImode throughout.
Co-Authored-By: James Clarke <jrtc27@jrtc27.com>
From-SVN: r267773
Eric Botcazou [Wed, 9 Jan 2019 08:25:55 +0000 (08:25 +0000)]
invoke.texi (-Os): Add reference to -finline-functions.
* doc/invoke.texi (-Os): Add reference to -finline-functions.
(-finline-small-functions): Add references to -O3 and -Os.
(-findirect-inlining): Likewise.
(-finline-functions): Add references to -Os, -fprofile-use and
-fauto-profile.
Paul Thomas [Sat, 29 Dec 2018 18:21:39 +0000 (18:21 +0000)]
re PR fortran/82550 (program using submodules fails to link)
2018-12-29 Paul Thomas <pault@gcc.gnu.org>
PR fortran/82550
* trans_decl.c (gfc_get_symbol_decl): Procedure symbols that
have the 'used_in_submodule' attribute should be processed by
'gfc_get_extern_function_decl'.
2018-12-29 Paul Thomas <pault@gcc.gnu.org>
PR fortran/82550
* gfortran.dg/submodule_30.f08 : New test.
Iain Sandoe [Mon, 24 Dec 2018 12:20:18 +0000 (12:20 +0000)]
fix Darwin target/81685
2018-12-24 Iain Sandoe <iain@sandoe.co.uk>
Backport from mainline
2018-08-15 Iain Sandoe <iain@sandoe.co.uk>
PR target/81685
* config/darwin.h: (DEBUG_STR_OFFSETS_SECTION, DEBUG_LOCLISTS_SECTION,
DEBUG_RNGLISTS_SECTION) new macros. (DEBUG_PUBNAMES_SECTION,
DEBUG_PUBTYPES_SECTION) update to include GNU variant.
Steven G. Kargl [Sat, 22 Dec 2018 23:23:02 +0000 (23:23 +0000)]
re PR fortran/85798 (ICE in get_array_index, at fortran/data.c:69)
2018-12-22 Steven G . Kargl <kargl@gcc.gnu.org>
PR fortran/85798
* decl.c (gfc_match_data): If a component of a derived type entity
appears in data statement, check that does not have the allocatable
attribute.
2018-12-22 Steven G . Kargl <kargl@gcc.gnu.org>
PR fortran/85798
* gfortran.dg/pr85798.f90: New test.
Uros Bizjak [Fri, 21 Dec 2018 18:11:04 +0000 (19:11 +0100)]
backport: re PR target/88418 (ICE in extract_insn, at recog.c:2305 (error: unrecognizable insn))
Backport from mainline
2018-12-10 Uros Bizjak <ubizjak@gmail.com>
PR target/88418
* config/i386/i386.c (ix86_expand_sse_cmp): For vector modes,
check operand 1 with vector_operand predicate.
(ix86_expand_sse_movcc): For vector modes, check op_true with
vector_operand, not nonimmediate_operand.
testsuite/ChangeLog:
Backport from mainline
2018-12-10 Uros Bizjak <ubizjak@gmail.com>
PR target/88418
* gcc.target/i386/pr88418.c: New test.
Bill Schmidt [Wed, 19 Dec 2018 18:34:25 +0000 (18:34 +0000)]
backport: extend.texi (PowerPC Altivec/VSX Built-in Functions): Describe when a typedef name can be used as the type specifier for a vector type...
2018-12-19 Bill Schmidt <wschmidt@linux.ibm.com>
Backport from mainline
2018-12-18 Bill Schmidt <wschmidt@linux.ibm.com>
* doc/extend.texi (PowerPC Altivec/VSX Built-in Functions):
Describe when a typedef name can be used as the type specifier for
a vector type, and when it cannot.