aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2020-06-05[Ada] Replace ? by ?? in Error_Msg_NArnaud Charlet1-1/+1
2020-06-05 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_prag.adb (Validate_Compile_Time_Warning_Or_Error): Use ??.
2020-06-05[Ada] Update comments wrt Ada 83 handlingArnaud Charlet1-1/+3
2020-06-05 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * cstand.adb (Create_Standard): Update comments.
2020-06-05[Ada] Support 'Reduce under -gnatXArnaud Charlet4-2/+14
2020-06-05 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * scng.adb (Scan): Fix typo to take into account all future versions of Ada. * sem_attr.ads (Attribute_Impl_Def): Add Attribute_Reduce for now. * sem_attr.adb (Analyze_Attribute): Only allow 'Reduce under -gnatX. * snames.ads-tmpl (Name_Reduce): Update comment.
2020-06-05[Ada] Add note about gnatcov reliance on thunk namesThomas Quinot1-0/+5
2020-06-05 Thomas Quinot <quinot@adacore.com> gcc/ada/ * exp_disp.adb (Expand_Interface_Thunk): Add comment about gnatcov reliance on specific name used for thunks.
2020-06-05[Ada] Subtype inherits Atomic flag from base typeEd Schonberg1-0/+9
2020-06-05 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch3.adb (Analyze_Subtype_Declaration): For scalar types, and for subtype declarations without a constraint, subtype inherits Atomic flag from base type.
2020-06-05[Ada] Fix punctuation in description of Enum_Rep attributePiotr Trojanek2-3/+3
2020-06-05 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * doc/gnat_rm/implementation_defined_attributes.rst (Enum_Rep): Remove extra colon. * gnat_rm.texi: Regenerate.
2020-06-05[Ada] Make the Has_Dynamic_Range_Check flag obsoleteEric Botcazou5-22/+45
2020-06-05 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * atree.adb (New_Copy): Clear Has_Dynamic_Range_Check on subexpression nodes. * checks.adb (Append_Range_Checks): Assert that the node doesn't have the Has_Dynamic_Range_Check flag set. (Insert_Range_Checks): Likewise. * exp_ch3.adb (Expand_N_Subtype_Indication): Do not apply range checks for a full type or object declaration. * sem_ch3.ads: Move with and use clauses for Nlists to... (Process_Range_Expr_In_Decl): Change default to No_List for the Check_List parameter. * sem_ch3.adb: ...here. (Process_Range_Expr_In_Decl): Likewise. When the insertion node is a declaration, only insert on the list if is present when the declaration involves discriminants, and only insert on the node when there is no list otherwise.
2020-06-05[Ada] Do not create an empty list of nodes that confuses GNATprovePiotr Trojanek1-5/+6
2020-06-05 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sem_aggr.adb (Resolve_Record_Aggregate): Create the N_Aggregate node with its Expressions field set to No_List and not to an empty list.
2020-06-05[Ada] Optimize Normalize_PathnameDmitriy Anisimkov1-122/+136
2020-06-05 Dmitriy Anisimkov <anisimko@adacore.com> gcc/ada/ * libgnat/s-os_lib.adb (Is_Dirsep): Moved from Build_Path to package level to reuse. (Normalize_Pathname.Final_Value): Reduce 2 'if' statements to one. (Normalize_Pathname.Fill_Directory): New procedure instead of function Get_Directory. Remove slash to backslash conversion and drive letter uppercasing on Windows.
2020-06-05[Ada] Spurious assert failure in Walk_Library_ItemsArnaud Charlet1-1/+3
2020-06-05 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem.adb (Assert_Done): Relax check for main unit, as it was overzealous in the case of the main unit itself.
2020-06-05[Ada] Use Is_Incomplete_Type instead of a low-level Ekind testPiotr Trojanek3-3/+3
2020-06-05 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * exp_ch3.adb, sem_ch8.adb, sem_util.adb: Use Is_Incomplete_Type to make the code easier to read.
2020-06-05[Ada] Simplify iteration over componentsPiotr Trojanek2-74/+67
2020-06-05 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * einfo.adb: Minor reformatting. * sem_util.adb (Has_Full_Default_Initialization, Is_Partially_Initialized_Type, Caller_Known_Size_Record, Large_Max_Size_Mutable): Iterate with First_Component/Next_Component; rename Ent to Comp.
2020-06-05[Ada] Fix incorrect initialization for array of non-standard enumeration typeEric Botcazou3-6/+24
2020-06-05 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Use Expr_Rep_Value instead of Expr_Value to obtain the equivalent integer value. * sem_eval.ads (Expr_Value): Document more supported cases. * sem_eval.adb (Expr_Rep_Value): Copy missing cases from Exp_Value.
2020-06-05[Ada] Put_Image attribute: Rtsfind cleanupsBob Duff2-117/+109
2020-06-05 Bob Duff <duff@adacore.com> gcc/ada/ * rtsfind.adb, rtsfind.ads: Move subtypes of RTU_Id into package body, because they are not needed by clients. Change "Child_" to "Descendant", because grandchildren and great grandchildren are involved. Replace all the repetitive comments with a single concise one. Change the parent subtypes to be more consistent; use the most specific parent.
2020-06-05[Ada] Move routine for detecting special Text_IO packages from GNATprovePiotr Trojanek2-0/+37
2020-06-05 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * rtsfind.ads, rtsfind.adb (Is_Text_IO_Special_Package): Moved from the GNATprove backend to the frontend.
2020-06-05[Ada] Add comment about function only used in CodePeerYannick Moy1-0/+1
2020-06-05 Yannick Moy <moy@adacore.com> gcc/ada/ * sem_util.ads: Add comment about function only used in CodePeer.
2020-06-05[Ada] Spurious error on address clause in task bodyEd Schonberg1-0/+18
2020-06-05 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch9.adb, (Analyze_Task_Body): After analying the task body, indicate that all local variables have no delayed aspects. This prevents improper later calls to Check_Aspect_At_End_Of_Declarations, that would happen when the constructed task_procedure body (generated during expansion) is analyzed. The legality of aspect specifications that may appear on local declarations has already been established, and it is in general not possible to recheck them properly during expansion, when visibility may not be fully established.
2020-06-05[Ada] Add missing Global contract to Ada.Containers.Functional_VectorsPiotr Trojanek1-1/+2
2020-06-05 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * libgnat/a-cofuve.ads (First): Add Global contract.
2020-06-05[Ada] AI12-0207 Convention of anonymous access typesArnaud Charlet1-17/+29
2020-06-05 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_prag.adb (Set_Convention_From_Pragma): Set the convention of anonymous access array components.
2020-06-05[Ada] AI12-0336 Meaning of Time_OffsetArnaud Charlet3-7/+19
2020-06-05 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnat/a-calfor.ads, libgnat/a-catizo.ads, libgnat/a-catizo.adb (Local_Time_Offset, Local_Image): New. (UTC_Time_Offset): Now a renaming of Local_Time_Offset.
2020-06-05[Ada] Fix assertion failure on double rederivation of private typeEric Botcazou1-19/+45
2020-06-05 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * sem_ch3.adb (Available_Full_View): New function returning either the full or the underlying full view. (Build_Full_Derivation): Add guard for the full view. (Copy_And_Build): Retrieve the underlying full view, if any, also if deriving a completion. (Build_Derived_Private_Type): Use Available_Full_View throughout to decide whether a full derivation must be done.
2020-06-05[Ada] Put_Image attributeBob Duff7-42/+21
2020-06-05 Bob Duff <duff@adacore.com> gcc/ada/ * exp_attr.adb, exp_ch11.adb, exp_imgv.adb, exp_tss.ads, par-ch4.adb, sem_attr.adb, sem_util.ads: Misc cleanup.
2020-06-05[Ada] AI12-0144 Make Discrete_Random more flexibleArnaud Charlet2-0/+17
2020-06-05 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnat/a-nudira.ads, libgnat/a-nudira.adb (Random): New function.
2020-06-05[Ada] AI12-0237 Getting the representation of an enumeration valueArnaud Charlet2-32/+13
2020-06-05 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_attr.ads (Attribute_Impl_Def): Remove Enum_Rep/Val. * sem_attr.adb (Attribute_20): New, move Enum_Rep/Val here. (Analyze_Attribute): Take Attribute_20 into account.
2020-06-05[Ada] AI12-0318 No_IO should apply to Ada.DirectoriesArnaud Charlet1-0/+1
2020-06-05 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * restrict.ads (Unit_Array): Add a-direct.
2020-06-05[Ada] AI12-0235 System.Storage_Pools should be pureArnaud Charlet1-3/+4
2020-06-05 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnat/s-stopoo.ads: Mark package Pure and leave room for Nonblocking once this aspect is supported.
2020-06-05[Ada] Add No_Truncation flag on view conversion for GNAT-LLVMEric Botcazou1-0/+6
2020-06-05 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference) <Valid_Scalars>: Set the No_Truncation flag on the unchecked conversion built for scalar types.
2020-06-05[Ada] Assertion_Policy (Ignore) ignores invariantsBob Duff4-42/+19
2020-06-05 Bob Duff <duff@adacore.com> gcc/ada/ * einfo.adb, einfo.ads, exp_util.adb: Remove Invariants_Ignored flag. * sem_prag.adb (Invariant): Instead of setting a flag to be checked elsewhere, remove the pragma as soon as it is analyzed and checked for legality.
2020-06-05[Ada] Rename parameter of routines in ChecksEric Botcazou2-138/+132
2020-06-05 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * checks.ads (Apply_Length_Check): Rename Ck_Node parameter to Expr. (Apply_Range_Check): Likewise. (Get_Range_Checks): Likewise. * checks.adb (Apply_Float_Conversion_Check): Likewise. (Apply_Selected_Length_Checks): Likewise. (Apply_Selected_Range_Checks): Likewise. (Guard_Access): Likewise. (Selected_Length_Checks): Likewise. Also avoid shadowing in child procedures. (Selected_Range_Checks): Likewise.
2020-06-05[Ada] Minor wording changes wrt Ada 202xArnaud Charlet7-14/+16
2020-06-05 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * par-ch3.adb, par-ch4.adb, scng.adb, sem_aggr.adb, sem_ch10.adb, sem_ch12.adb, sem_prag.adb: Update wording: change Ada_2020 to Ada 2020 in comments and mention -gnat2020 instead of -gnatX switch.
2020-06-05d: Merge upstream dmd 6d5bffa54Iain Buclaw18-61/+52
Removes an unused parameter from Condition::include(), all callers have been updated in the front-end. Reviewed-on: https://github.com/dlang/dmd/pull/11229 gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 6d5bffa54. * d-builtins.cc (maybe_set_builtin_1): Update call to Condition::include(). * decl.cc (DeclVisitor::visit(AttribDeclaration *)): Likewise. * types.cc (layout_aggregate_members): Likewise.
2020-06-05tree-optimization/95539 - fix SLP_TREE_REPRESENTATIVE vs. dr_infoRichard Biener3-5/+45
This fixes a disconnect between the stmt_info used for dr_info analysis and the one in SLP_TREE_REPRESENTATIVE with a temporary workaround. 2020-06-05 Richard Biener <rguenther@suse.de> PR tree-optimization/95539 * tree-vect-data-refs.c (vect_slp_analyze_and_verify_instance_alignment): Use SLP_TREE_REPRESENTATIVE for the data-ref check. * tree-vect-stmts.c (vectorizable_load): Reset stmt_info back to the first scalar stmt rather than the SLP_TREE_REPRESENTATIVE to match previous behavior. * gcc.dg/vect/pr95539.c: New testcase.
2020-06-05expand: Simplify removing subregs when expanding a copy [PR95254]Fei Yang3-1/+94
In rtl expand, if we have a copy that matches one of the following patterns: (set (subreg:M1 (reg:M2 ...)) (subreg:M1 (reg:M2 ...))) (set (subreg:M1 (reg:M2 ...)) (mem:M1 ADDR)) (set (mem:M1 ADDR) (subreg:M1 (reg:M2 ...))) (set (subreg:M1 (reg:M2 ...)) (constant C)) where mode M1 is equal in size to M2, try to detect whether the mode change involves an implicit round trip through memory. If so, see if we can avoid that by removing the subregs and doing the move in mode M2 instead. 2020-06-05 Felix Yang <felix.yang@huawei.com> gcc/ PR target/95254 * expr.c (emit_move_insn): Check src and dest of the copy to see if one or both of them are subregs, try to remove the subregs when innermode and outermode are equal in size and the mode change involves an implicit round trip through memory. gcc/testsuite/ PR target/95254 * gcc.target/aarch64/pr95254.c: New test. * gcc.target/i386/pr67609.c: Check "movq\t%xmm0" instead of "movdqa".
2020-06-05ix86: Improve __builtin_c[lt]z followed by extension [PR95535]Jakub Jelinek3-0/+194
In January I've added patterns to optimize SImode -> DImode sign or zero extension of __builtin_popcount, this patch does the same for __builtin_c[lt]z. Like most other instructions, the [tl]zcntl instructions clear the upper 32 bits of the destination register and as the instructions only result in values 0 to 32 inclusive, both sign and zero extensions behave the same. 2020-06-05 Jakub Jelinek <jakub@redhat.com> PR target/95535 * config/i386/i386.md (*ctzsi2_zext, *clzsi2_lzcnt_zext): New define_insn_and_split patterns. (*ctzsi2_zext_falsedep, *clzsi2_lzcnt_zext_falsedep): New define_insn patterns. * gcc.target/i386/pr95535-1.c: New test. * gcc.target/i386/pr95535-2.c: New test.
2020-06-05Add new/delete to struct occurenceJonathan Wakely2-26/+45
This adds an example how to use new/delete operators to pool allocated objects. 2020-06-04 Jonathan Wakely <jwakely@redhat.com> * alloc-pool.h (object_allocator::remove_raw): New. * tree-ssa-math-opts.c (struct occurrence): Use NSMDI. (occurrence::occurrence): Add. (occurrence::~occurrence): Likewise. (occurrence::new): Likewise. (occurrence::delete): Likewise. (occ_new): Remove. (insert_bb): Use new occurence (...) instead of occ_new. (register_division_in): Likewise. (free_bb): Use delete occ instead of manually removing from the pool.
2020-06-05middle-end/95493 - bogus MEM_ATTRS for variable array accessRichard Biener3-55/+73
The following patch avoids keeping the inherited MEM_ATTRS when set_mem_attributes_minus_bitpos is called with a variable ARRAY_REF. The inherited ones may not reflect the correct offset and neither does the updated alias-set match the inherited MEM_EXPR. This all ends up confusing path-based alias-analysis, causing wrong-code. The fix is to stop not adopting a MEM_EXPR for certain kinds of expressions and instead handle everything we can. There's still the constant kind trees case which I'm too lazy to look into right now. I did refrain from adding SSA_NAME there and instead avoided calling set_mem_attributes_minus_bitpos when debug expression expansion ended up expanding a SSA definition RHS which should already have taken care of setting the appropriate MEM_ATTRS. 2020-06-04 Richard Biener <rguenther@suse.de> PR middle-end/95493 * cfgexpand.c (expand_debug_expr): Avoid calling set_mem_attributes_minus_bitpos when we were expanding an SSA name. * emit-rtl.c (set_mem_attributes_minus_bitpos): Remove ARRAY_REF special-casing, add CONSTRUCTOR to the set of special-cases we do not want MEM_EXPRs for. Assert we end up with reasonable MEM_EXPRs. * g++.dg/torture/pr95493.C: New testcase.
2020-06-05Fix bitmask conflict between PTA_AVX512VP2INTERSECT and PTA_WAITPKG in ↵Cui,Lili1-1/+1
gcc/config/i386/i386.h 2020-06-05 Lili Cui <lili.cui@intel.com> gcc/ChangeLog: PR target/95525 * config/i386/i386.h (PTA_WAITPKG): Change bitmask value.
2020-06-05Daily bump.GCC Administrator8-1/+748
2020-06-04Implement a solution for PR middle-end/10138 and PR middle-end/95136.Martin Sebor43-316/+1566
PR middle-end/10138 - warn for uninitialized arrays passed as const arguments PR middle-end/95136 - missing -Wuninitialized on an array access with a variable offset gcc/c-family/ChangeLog: PR middle-end/10138 PR middle-end/95136 * c-attribs.c (append_access_attrs): Handle attr_access::none. (handle_access_attribute): Same. gcc/ChangeLog: PR middle-end/10138 PR middle-end/95136 * attribs.c (init_attr_rdwr_indices): Move function here. * attribs.h (rdwr_access_hash, rdwr_map): Define. (attr_access): Add 'none'. (init_attr_rdwr_indices): Declared function. * builtins.c (warn_for_access)): New function. (check_access): Call it. * builtins.h (checK-access): Add an optional argument. * calls.c (rdwr_access_hash, rdwr_map): Move to attribs.h. (init_attr_rdwr_indices): Declare extern. (append_attrname): Handle attr_access::none. (maybe_warn_rdwr_sizes): Same. (initialize_argument_information): Update comments. * doc/extend.texi (attribute access): Document 'none'. * tree-ssa-uninit.c (struct wlimits): New. (maybe_warn_operand): New function. (maybe_warn_pass_by_reference): Same. (warn_uninitialized_vars): Refactor code into maybe_warn_operand. Also call for function calls. (pass_late_warn_uninitialized::execute): Adjust comments. (execute_early_warn_uninitialized): Same. gcc/testsuite/ChangeLog: PR middle-end/10138 PR middle-end/95136 * c-c++-common/Wsizeof-pointer-memaccess1.c: Prune out valid Wuninitialized. * c-c++-common/uninit-pr51010.c: Adjust expected warning format. * c-c++-common/goacc/uninit-dim-clause.c: Same. * c-c++-common/goacc/uninit-firstprivate-clause.c: Same. * c-c++-common/goacc/uninit-if-clause.c: Same. * c-c++-common/gomp/pr70550-1.c: Same. * c-c++-common/gomp/pr70550-2.c: Adjust. * g++.dg/20090107-1.C: Same. * g++.dg/20090121-1.C: Same. * g++.dg/ext/attr-access.C: Avoid -Wuninitialized. * gcc.dg/tree-ssa/forwprop-6.c: Prune out -Wuninitialized. * gcc.dg/Warray-bounds-52.c: Prune out valid -Wuninitialized. * gcc.dg/Warray-bounds-53.c: Same. * gcc.dg/Warray-bounds-54.c: Same. * gcc.dg/Wstringop-overflow-33.c: New test. * gcc.dg/attr-access-none.c: New test. * gcc.dg/attr-access-read-only.c: Adjust. * gcc.dg/attr-access-read-write.c: Same. * gcc.dg/attr-access-write-only.c: Same. * gcc.dg/pr71581.c: Adjust text of expected warning. * gcc.dg/uninit-15.c: Same. * gcc.dg/uninit-32.c: New test. * gcc.dg/uninit-33.c: New test. * gcc.dg/uninit-34.c: New test. * gcc.dg/uninit-36.c: New test. * gcc.dg/uninit-B-O0.c: Adjust text of expected warning. * gcc.dg/uninit-I-O0.c: Same. * gcc.dg/uninit-pr19430-O0.c: Same. * gcc.dg/uninit-pr19430.c: Same. * gcc.dg/uninit-pr95136.c: New test. * gfortran.dg/assignment_4.f90: Expect -Wuninitialized. * gfortran.dg/goacc/uninit-dim-clause.f95: Adjust text of expected warning. * gfortran.dg/goacc/uninit-firstprivate-clause.f95 * gfortran.dg/goacc/uninit-if-clause.f95 * gfortran.dg/pr66545_2.f90
2020-06-04d: Merge upstream dmd 48d704f08Iain Buclaw66-1476/+1503
Updates the Array interface in dmd/root/array.h to use a DArray<TYPE> internally. Splits out BitArray into a separate header. Reviewed-on: https://github.com/dlang/dmd/pull/11219 gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 48d704f08. * d-attribs.cc (build_attributes): Use new field name. * d-builtins.cc (build_frontend_type): Likewise. (maybe_set_builtin_1): Likewise. (d_maybe_set_builtin): Likewise. * d-codegen.cc (build_interface_binfo): Likewise. (identity_compare_p): Likewise. (lower_struct_comparison): Likewise. (build_struct_comparison): Likewise. (d_build_call): Likewise. (build_frame_type): Likewise. (build_closure): Likewise. * d-compiler.cc (Compiler::paintAsType): Likewise. (Compiler::loadModule): Likewise. * d-incpath.cc (add_globalpaths): Likewise. (add_filepaths): Likewise. (add_import_paths): Likewise. * d-lang.cc (deps_write): Likewise. (d_parse_file): Likewise. * decl.cc (gcc_attribute_p): Likewise. (base_vtable_offset): Likewise. (get_vtable_decl): Likewise. (build_class_instance): Likewise. * expr.cc (class ExprVisitor): Likewise. * modules.cc (layout_moduleinfo_fields): Likewise. (layout_moduleinfo): Likewise. (build_module_tree): Likewise. * toir.cc (class IRVisitor): Likewise. * typeinfo.cc (class TypeInfoVisitor): Likewise. (layout_classinfo_interfaces): Likewise. * types.cc (layout_aggregate_members): Likewise. (layout_aggregate_type): Likewise.
2020-06-04d: Merge upstream dmd 47ed0330fIain Buclaw128-128/+129
Updates the copyright years of the front-end sources. Reviewed-on: https://github.com/dlang/dmd/pull/11221 gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 47ed0330f.
2020-06-04c++: Fix complex constexpr virtual cases [PR93310].Jason Merrill4-42/+54
The code in constexpr for looking up the actual type of the object and then getting the virtual function from there broke for both of these tests: for 16, it assumed incorrectly that the DECL_VINDEX would apply to the most derived type's vtable; for 17, it failed to consider that during construction the base subobject is treated as being of the base type. Fixed by just doing constant evaluation of the expression that looks up the function in the vtable. This means that a virtual call will involve loading the vptr, so we will reject some calls through non-constexpr variables that we previously accepted, but this seems appropriate to me. None of our testcases were affected. gcc/cp/ChangeLog: PR c++/93310 * constexpr.c (cxx_eval_constant_expression) [OBJ_TYPE_REF]: Evaluate OBJ_TYPE_REF_EXPR. gcc/testsuite/ChangeLog: PR c++/93310 * g++.dg/cpp2a/constexpr-virtual16.C: New test. * g++.dg/cpp2a/constexpr-virtual17.C: New test. * g++.dg/cpp2a/constexpr-new12.C: Adjust diagnostic.
2020-06-04c++: Fix FE devirt with diamond inheritance [PR95158]Jason Merrill4-11/+59
This started breaking in GCC 8 because of the fix for PR15272; after that change, we (correctly) remember the lookup from template parsing time that found Base::foo through the non-dependent MiddleB base, and so we overlook the overrider in MiddleA. But given that, the devirtualization condition from the fix for PR59031 is insufficient; we know that d has to be a Derived, and we found Base::foo in Base, but forcing a non-virtual call gets the wrong function. Fixed by removing the PR59031 code that the PR67184 patch moved to build_over_call, and instead looking up the overrider in BINFO_VIRTUALS. gcc/cp/ChangeLog: PR c++/95158 * class.c (lookup_vfn_in_binfo): New. * call.c (build_over_call): Use it. * cp-tree.h (resolves_to_fixed_type_p): Add default argument. (lookup_vfn_in_binfo): Declare. gcc/testsuite/ChangeLog: PR c++/95158 * g++.dg/template/virtual5.C: New test.
2020-06-04PR fortran/95500 - Segfault compiling extra interface on intrinsicHarald Anlauf2-0/+16
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-04coroutines: Fix missed ramp function return copy elision [PR95346].Iain Sandoe2-25/+73
Confusingly, "get_return_object ()" can do two things: - Firstly it can provide the return object for the ramp function (as the name suggests). - Secondly if the type of the ramp function is different from that of the get_return_object call, this is used as a single parameter to a CTOR for the ramp's return type. In the first case we can rely on finish_return_stmt () to do the necessary processing for copy elision. In the second case, we should have passed a prvalue to the CTOR as per the standard comment, but I had omitted the rvalue () call. Fixed thus. gcc/cp/ChangeLog: PR c++/95346 * coroutines.cc (morph_fn_to_coro): Ensure that the get- return-object is constructed correctly; When it is not the final return value, pass it to the CTOR of the return type as an rvalue, per the standard comment. gcc/testsuite/ChangeLog: PR c++/95346 * g++.dg/coroutines/pr95346.C: New test.
2020-06-04Add test for PR95464.c.Vladimir N. Makarov1-0/+64
2020-06-04 Vladimir Makarov <vmakarov@redhat.com> PR middle-end/95464 * gcc.target/i386/pr95464.c: New.
2020-06-04d: Split up d-frontend.cc into multiple parts.Iain Buclaw5-420/+516
gcc/d/ChangeLog: * Make-lang.in (D_OBJS): Add d-compiler.o, d-ctfloat.o, d-port.o. * d-frontend.cc (Port::memicmp): Move to d-port.cc. (Port::strupr): Likewise. (Port::isFloat32LiteralOutOfRange): Likewise. (Port::isFloat64LiteralOutOfRange): Likewise. (Port::readwordLE): Likewise. (Port::readwordBE): Likewise. (Port::readlongLE): Likewise. (Port::readlongBE): Likewise. (Port::valcpy): Likewise. (CTFloat::fabs): Move to d-ctfloat.cc. (CTFloat::ldexp): Likewise. (CTFloat::isIdentical): Likewise. (CTFloat::isNaN): Likewise. (CTFloat::isSNaN): Likewise. (CTFloat::isInfinity): Likewise. (CTFloat::parse): Likewise. (CTFloat::sprint): Likewise. (CTFloat::hash): Likewise. (Compiler::genCmain): Move to d-compiler.cc. (Compiler::paintAsType): Likewise. (Compiler::loadModule): Likewise. * d-compiler.cc: New file. * d-ctfloat.cc: New file. * d-port.cc: New file.
2020-06-04Add processing STRICT_LOW_PART for matched reloads.Vladimir N. Makarov2-2/+7
2020-06-04 Vladimir Makarov <vmakarov@redhat.com> PR middle-end/95464 * lra.c (lra_emit_move): Add processing STRICT_LOW_PART. * lra-constraints.c (match_reload): Use STRICT_LOW_PART in output reload if the original insn has it too.
2020-06-04aarch64: PR target/95526: Fix gimplification of varargsRichard Biener1-0/+1
This patch fixes a latent bug exposed by eb72dc663e9070b281be83a80f6f838a3a878822 in the aarch64 backend that was causing wrong codegen and several testsuite failures. See the discussion on the bug for details. Bootstrapped and regtested on aarch64-linux-gnu. Cleaned up several failing tests and no new fails introduced. 2020-06-04 Richard Biener <rguenther@suse.de> gcc/: * config/aarch64/aarch64.c (aarch64_gimplify_va_arg_expr): Ensure that tmp_ha is marked TREE_ADDRESSABLE.
2020-06-04ipa-sra: Do not remove statements necessary because of non-call EH (PR 95113)Martin Jambor5-16/+60
PR 95113 revealed that when reasoning about which parameters are dead, IPA-SRA does not perform the same check related to non-call exceptions as tree DCE. It most certainly should and so this patch moves the condition used in tree-ssa-dce.c into a separate predicate (in tree-eh.c) and uses it from both places. gcc/ChangeLog: 2020-05-27 Martin Jambor <mjambor@suse.cz> PR ipa/95113 * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Move non-call exceptions check to... * tree-eh.c (stmt_unremovable_because_of_non_call_eh_p): ...this new function. * tree-eh.h (stmt_unremovable_because_of_non_call_eh_p): Declare it. * ipa-sra.c (isra_track_scalar_value_uses): Use it. New parameter fun. gcc/testsuite/ChangeLog: 2020-05-27 Martin Jambor <mjambor@suse.cz> PR ipa/95113 * gcc.dg/ipa/pr95113.c: New test.