aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2020-06-08[Ada] Fix handling of 'Enum_Rep and renamingsArnaud Charlet2-17/+6
2020-06-08 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_eval.adb (Eval_Type_Conversion): Fix handling of enumeration to integer conversions. * exp_attr.adb (Expand_N_Attribute_Reference [Attribute_Enum_Rep]): Remove special casing for first-level renaming, best left to the general folding mechanism via Eval_Type_Conversion.
2020-06-08[Ada] Remove the Has_Dynamic_Range_Check flagEric Botcazou9-150/+28
2020-06-08 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * atree.adb (New_Copy): Do not clear Has_Dynamic_Range_Check. * checks.ads (Append_Range_Checks): Remove Flag_Node parameter. (Insert_Range_Checks): Likewise and remove default value of Static_Loc parameter. * checks.adb (Append_Range_Checks): Remove Flag_Node parameter. Do not test and set Has_Dynamic_Range_Check. (Insert_Range_Checks): Likewise and remove default value of Static_Loc parameter. * csinfo.adb (CSinfo): Remove 'L' from [NEUB]_Fields pattern and do not handle Has_Dynamic_Range_Check. * exp_ch5.adb (Expand_N_Assignment_Statement): Remove argument in call to Insert_Range_Checks. * sem_ch3.adb (Analyze_Subtype_Declaration): Do not fiddle with Has_Dynamic_Range_Check. (Process_Range_Expr_In_Decl): Remove argument in calls to Insert_Range_Checks and Append_Range_Checks. * sinfo.ads (Has_Dynamic_Range_Check): Delete. (Set_Has_Dynamic_Range_Check): Likewise. * sinfo.adb (Has_Dynamic_Range_Check): Delete. (Set_Has_Dynamic_Range_Check): Likewise. * treepr.adb (Print_Node): Do not print Has_Dynamic_Range_Check.
2020-06-08[Ada] Implement AI12-0290 (Simple_Barriers restriction)Steve Baird3-68/+106
2020-06-08 Steve Baird <baird@adacore.com> gcc/ada/ * sem_ch13.ads: Export new function All_Membership_Choices_Static. * sem_ch13.adb: Implement new function All_Membership_Choices_Static. This involves moving the functions Is_Static_Choice and All_Membership_Choices_Static, which were previously declared within the function Is_Predicate_Static, out to library level so that they can be called by the new function. The already-exisiting code in Is_Predicate_Static which became the body of All_Membership_Choices_Static is replaced with a call to the new function in order to avoid duplication. * exp_ch9.adb (Is_Pure_Barrier): Several changes needed to implement rules of AI12-0290 and RM D.7's definition of "pure-barrier-eligible". These changes include adding a call to the new function Sem_13.All_Membership_Choices_Static, as per the "see 4.9" in RM D.7(1.6/5).
2020-06-08[Ada] Issue with unnesting of 'First/Last and renamingRichard Kenner1-11/+16
2020-06-08 Richard Kenner <kenner@adacore.com> gcc/ada/ * exp_unst.adb (Visit_Node): When visiting array attribute nodes, in addition to checking the type of Get_Referenced_Object of the prefix, also check the actual type of the prefix.
2020-06-08[Ada] Implement predicate checks on qualified expressions (AI12-0100)Gary Dismukes5-40/+61
2020-06-08 Gary Dismukes <dismukes@adacore.com> gcc/ada/ * checks.adb (Apply_Predicate_Check): Refine test for being in a subprogram body to account for no Corresponding_Body case, avoiding blowups arising due to other changes here. * exp_ch4.adb (Expand_N_Qualified_Expression): Apply predicate checks, if any, after constraint checks are applied. * sem_eval.ads (Check_Expression_Against_Static_Predicate): Add Check_Failure_Is_Error formal for conditionalizing warning vs. error messages. * sem_eval.adb (Check_Expression_Against_Static_Predicate): Issue an error message rather than a warning when the new Check_Failure_Is_Error formal is True. In the nonstatic or Dynamic_Predicate case where the predicate is known to fail, emit the check to ensure that folded cases get checks applied. * sem_res.adb (Resolve_Qualified_Expression): Call Check_Expression_Against_Static_Predicate, passing True for Check_Failure_Is_Error, to ensure we reject static predicate violations. Remove code that was conditionally calling Apply_Predicate_Check, which is no longer needed, and that check procedure shouldn't be called from a resolution routine in any case. Also remove associated comment about preventing infinite recursion and consistency with Resolve_Type_Conversion, since that handling was already similarly removed from Resolve_Type_Convesion at some point. (Resolve_Type_Conversion): Add passing of True for Check_Failure_Is_Error parameter on call to Check_Expression_Against_Static_Predicate, to ensure that static conversion cases that violate a predicate are rejected as errors.
2020-06-08[Ada] Restore Snames.Name_SPARK as it used in the GNATprove backendPiotr Trojanek1-0/+1
2020-06-08 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * snames.ads-tmpl (Name_SPARK): Restore after being deleted.
2020-06-08[Ada] Remove processing of SPARK_05 restrictionArnaud Charlet31-2587/+36
2020-06-08 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * exp_aggr.adb, exp_ch6.adb, par-ch11.adb, par-ch6.adb, par-ch7.adb, par-prag.adb, restrict.adb, restrict.ads, scans.ads, scng.adb, sem_aggr.adb, sem_attr.adb, sem_ch11.adb, sem_ch12.adb, sem_ch3.adb, sem_ch3.ads, sem_ch4.adb, sem_ch5.adb, sem_ch6.adb, sem_ch7.adb, sem_ch8.adb, sem_ch9.adb, sem_res.adb, sem_util.adb, sem_util.ads, snames.ads-tmpl, gnatbind.adb, libgnat/s-rident.ads, doc/gnat_rm/standard_and_implementation_defined_restrictions.rst: Remove processing of SPARK_05 restriction. * gnat_rm.texi: Regenerate. * opt.ads: Remove processing of old checksum which is now handled by gprbuild directly.
2020-06-08[Ada] AI12-0287 Legality Rules for null exclusions in renaming are too fierceArnaud Charlet2-19/+25
2020-06-08 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_ch12.adb (Instantiate_Object): Relax rules related to null exclusions and generic objects. Handle all anonymous types consistently and not just E_Anonymous_Access_Type. * sem_ch8.adb (Analyze_Object_Renaming): Change wording so that it applies to both renamings and instantiations to avoid confusion.
2020-06-08[Ada] Ada.Text_IO: fix typoArnaud Charlet1-1/+1
2020-06-08 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnat/a-textio.ads (File_Mode): Fix typo in comment.
2020-06-08[Ada] Do not warn on partial access to atomic object with address clauseEric Botcazou1-7/+9
2020-06-08 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * sem_res.adb (Resolve_Indexed_Component): Do not give a warning for a nonatomic component of an atomic array which is subject to an address clause in Ada 2020 mode. (Resolve_Selected_Component): Likewise for an atomic record.
2020-06-08[Ada] Add gnatname use for multiple units files supportPhilippe Gil2-32/+22
2020-06-08 Philippe Gil <gil@adacore.com> gcc/ada/ * doc/gnat_ugn/the_gnat_compilation_model.rst: in "Handling Files with Multiple Units" part documents gnatname use for unmodified files handling and gnatchop use for files refactoring. * gnat_ugn.texi: Regenerate.
2020-06-08[Ada] Update doc on Enum_Rep/Enum_ValArnaud Charlet2-0/+12
2020-06-08 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * doc/gnat_rm/implementation_defined_attributes.rst: Enum_Rep/Enum_Val are standard Ada 202x attributes. * gnat_rm.texi: Regenerate.
2020-06-08[Ada] Better code generation for nested aggregatesJavier Miranda1-5/+0
2020-06-08 Javier Miranda <miranda@adacore.com> gcc/ada/ * exp_aggr.adb (Safe_Component): Remove code that considers as unsafe components that are aggregates; such removal allows the frontend to proceed and evaluate if they are safe by means of invoking Safe_Aggregate.
2020-06-08[Ada] Reuse standard expansion of 'First and 'Last in GNATprove modePiotr Trojanek1-0/+7
2020-06-08 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Apply standard expansion to attributes First and Last.
2020-06-08[Ada] Reuse Get_Index_Subtype in the special expander for GNATprovePiotr Trojanek4-59/+37
2020-06-08 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * exp_attr.adb, exp_util.ads, exp_util.adb (Get_Index_Subtype): Move from the body of Exp_Attr to Exp_Util and expose from the spec. * exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Replace duplicated code with a call to Get_Index_Subtype.
2020-06-08[Ada] AI12-0226 Make objects more consistentArnaud Charlet2-110/+53
2020-06-08 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_ch8.adb (Analyze_Object_Renaming): Simplify code by moving many special cases to Is_Object_Reference and removing others by only checking renamings coming from sources. * sem_util.adb (Is_Object_Reference): Update for AI12-0226 and add more regular handling of 'Priority. Remove special cases no longer needed now that we are only checking renamings coming from sources.
2020-06-08[Ada] Silence spurious warning on instances of formal vectorsClaire Dross1-0/+4
2020-06-08 Claire Dross <dross@adacore.com> gcc/ada/ * libgnat/a-cofove.adb (Insert_Space): The computation of Index generates a spurious compiler warning about a value not being in range for a statically dead branch. Silence it using pragma Warnings.
2020-06-08[Ada] gnatbind: Deterministic No_Entry_Calls_In_Elaboration_Code messagesBob Duff3-79/+198
2020-06-08 Bob Duff <duff@adacore.com> gcc/ada/ * bindo-graphs.adb (function Add_Edge): Rename Add_Edge_With_Return to Add_Edge; we can tell it returns because it's a function, and overloading seems appropriate in this case. If Activates_Task=True, and we're not going to add a new edge because an existing Pred-->Succ edge already exists, then set Activates_Task to True on the preexisting edge. This ensures that the message: info: use pragma Restrictions (No_Entry_Calls_In_Elaboration_Code) appears when appropriate, no matter in what order the edges happened to be processed. (procedure Add_Edge): Remove redundant assertions. (Activates_Task): Other kinds of edges can have Activates_Task=True. For example, if we had a With_Edge and then an Invocation_Edge with Activates_Task=True, then the With_Edge has Activates_Task set to True. (Add_Edge_Kind_Check): New procedure to prevent other bugs of this nature. For example, if we were to sometimes call Add_Edge for a Spec_Before_Body_Edge followed by Add_Edge for a With_Edge, and sometimes in the other order, that would cause a similar bug to what we're fixing here. (Set_Is_Recorded_Edge): Val parameter is not used. Get rid of it. (Set_Activates_Task): New procedure to set the Activates_Task flag. * bindo-graphs.ads (Library_Graph_Edge_Kind): Reorder the enumeration literals to facilitate Add_Edge_Kind_Check. * ali.adb (Known_ALI_Lines): The comment about "still available" was wrong. Fix that by erasing the comment, and encoding the relevant information in real code. Take advantage of Ada's full coverage rules by removing "others =>". Also DRY.
2020-06-08[Ada] Ada_2020: shared variable control aspects on formal derived typesEd Schonberg2-2/+12
2020-06-08 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * par-ch12.adb (P_Formal_Derived_Type_Definition): Handle properly formal derived types that include aspect specifications, so that the "with" keyword appears twice in the formal type declaration. * sem_ch13.adb (Has_Generic_Parent): Return true if the type itself is a generic formal.
2020-06-08[Ada] Fix socket timeout correction for Windows Server 2019 caseDmitriy Anisimkov1-4/+6
2020-06-08 Dmitriy Anisimkov <anisimko@adacore.com> gcc/ada/ * socket.c (__gnat_minus_500ms): Remove IsWindowsVersionOrGreater from condition.
2020-06-08[Ada] Add Depends contracts to Delete procedures of formal containersClaire Dross5-15/+20
2020-06-08 Claire Dross <dross@adacore.com> gcc/ada/ * libgnat/a-cfdlli.ads, libgnat/a-cfhama.ads, libgnat/a-cfhase.ads, libgnat/a-cforma.ads, libgnat/a-cforse.ads (Delete): Add Depends contract.
2020-06-08[Ada] AI12-0309 Missing checks for pragma SuppressArnaud Charlet2-1/+5
2020-06-08 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * snames.ads-tmpl (Name_Program_Error_Check, Name_Tasking_Check): New constants. * types.ads (Program_Error_Check, Tasking_Check): New constants. (All_Checks): Update accordingly.
2020-06-08Daily bump.GCC Administrator5-1/+96
2020-06-08d: Merge upstream dmd 73d8e2fec.Iain Buclaw24-139/+138
Renames the enum PROTKIND to Prot::Kind, updates all uses of the original enum accordingly. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 73d8e2fec. * decl.cc (get_symbol_decl): Use new Prot::Kind enum. * modules.cc (get_internal_fn): Likewise.
2020-06-07i386: Improve expansion of __builtin_parityUros Bizjak8-53/+270
GCC currently hides the shift and xor reduction inside a backend specific UNSPEC PARITY, making it invisible to the RTL optimizers until very late during compilation. It is normally reasonable for the middle-end to maintain wider mode representations for as long as possible and split them later, but this only helps if the semantics are visible at the RTL-level (to combine and other passes), but UNSPECs are black boxes, so in this case splitting early (during RTL expansion) is a better strategy. It turns out that that popcount instruction on modern x86_64 processors has (almost) made the integer parity flag in the x86 ALU completely obsolete, especially as POPCOUNT's integer semantics are a much better fit to RTL. The one remaining case where these transistors are useful is where __builtin_parity is immediately tested by a conditional branch, and therefore the result is wanted in a flags register rather than as an integer. This case is captured by two peephole2 optimizations in the attached patch. 2020-06-07 Roger Sayle <roger@nextmovesoftware.com> gcc/ChangeLog: * config/i386/i386.md (paritydi2, paritysi2): Expand reduction via shift and xor to an USPEC PARITY matching a parityhi2_cmp. (paritydi2_cmp, paritysi2_cmp): Delete these define_insn_and_split. (parityhi2, parityqi2): New expanders. (parityhi2_cmp): Implement set parity flag with xorb insn. (parityqi2_cmp): Implement set parity flag with testb insn. New peephole2s to use these insns (UNSPEC PARITY) when appropriate. gcc/testsuite/ChangeLog: * gcc.target/i386/parity-3.c: New test. * gcc.target/i386/parity-4.c: Likewise. * gcc.target/i386/parity-5.c: Likewise. * gcc.target/i386/parity-6.c: Likewise. * gcc.target/i386/parity-7.c: Likewise. * gcc.target/i386/parity-8.c: Likewise. * gcc.target/i386/parity-9.c: Likewise.
2020-06-07d: Merge upstream dmd 108ca1bcd.Iain Buclaw29-75/+75
Renames OutBuffer::peekString to OutBuffer::peekChars, and OutBuffer::extractString to OutBuffer::extractChars. All callers have been updated as appropriate. Reviewed-on: https://github.com/dlang/dmd/pull/11247 gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 108ca1bcd. * d-diagnostic.cc (expand_d_format): Adjust to use extractChars(). * d-frontend.cc (Loc::toChars): Likewise. * d-lang.cc (deps_write): Likewise. (d_parse_file): Likewise. * decl.cc (d_mangle_decl): Likewise. * intrinsics.cc (maybe_set_intrinsic): Likewise.
2020-06-07d: Merge upstream dmd b0df0e982Iain Buclaw34-323/+369
Adds a struct ParameterList to encapulate parameter and vararg information in the front-end. Reviewed-on: https://github.com/dlang/dmd/pull/11226 gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd b0df0e982. * d-builtins.cc (build_frontend_type): Use VarArg for varargs_p. * d-codegen.cc (declaration_type): Call TypeFunction::create with argument VARARGnone. (parameter_type): Likewise. (d_build_call): Use new field names and member functions. * d-target.cc (Target::cppParameterType): Call TypeFunction::create with argument VARARGnone. * types.cc (TypeVisitor::visit (TypeFunction *): Use new field names and member functions.
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-07d: Merge upstream dmd 1831b24ff.Iain Buclaw5-19/+13
Converts some global and param fields from pointers to value types. Reviewed-on: https://github.com/dlang/dmd/pull/11245 gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 1831b24ff. * d-lang.cc (d_init_options): Remove initialization of updated fields. (d_handle_option): Adjust for new field types.
2020-06-07PR fortran/95091 - Buffer overflows with submodules and long symbolsHarald Anlauf2-5/+27
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-07d: Merge upstream dmd cef1e7991.Iain Buclaw10-52/+70
Adds a DString type, a struct that has a compatible layout with D strings. Many parameters in the Global struct have been switched over to this type, and users of these params have been adjust to use the length or ptr field as appropriate. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd cef1e7991. * d-lang.cc (d_parse_file): Adjust for new field types.
2020-06-07rs6000: allow cunroll to grow size according to -funroll-loop or -fpeel-loopsguojiufu1-0/+5
Previously, flag_unroll_loops was turned on at -O2 implicitly. This also turned on cunroll with allowance size increasing, and cunroll will unroll/peel the loop even the loop is complex like code in PR95018. With this patch, size growth for cunroll is allowed only for if -funroll-loops or -fpeel-loops or -O3 is specified explicitly. gcc/ChangeLog 2020-06-07 Jiufu Guo <guojiufu@linux.ibm.com> PR target/95018 * config/rs6000/rs6000.c (rs6000_option_override_internal): Override flag_cunroll_grow_size.
2020-06-07Introduce flag_cunroll_grow_size for cunrollguojiufu3-3/+11
Currently GIMPLE complete unroller(cunroll) is checking flag_unroll_loops and flag_peel_loops to see if allow size growth. Beside affects curnoll, flag_unroll_loops also controls RTL unroler. To have more freedom to control cunroll and RTL unroller, this patch introduces flag_cunroll_grow_size. With this patch, we can control cunroll and RTL unroller indepently. gcc/ChangeLog 2020-06-07 Jiufu Guo <guojiufu@linux.ibm.com> * common.opt (flag_cunroll_grow_size): New flag. * toplev.c (process_options): Set flag_cunroll_grow_size. * tree-ssa-loop-ivcanon.c (pass_complete_unroll::execute): Use flag_cunroll_grow_size.
2020-06-07Added test case for a PR which has been fixed in the meantime.Thomas Koenig1-0/+20
gcc/testsuite/ChangeLog: PR tree-optimization/50439 * gfortran.dg/loop_interchange_2.f: New test.
2020-06-07Daily bump.GCC Administrator3-1/+17
2020-06-06Fix ICE in ODR enum streaming [PR95548]Jan Hubicka2-11/+56
gcc/ChangeLog: 2020-06-06 Jan Hubicka <hubicka@ucw.cz> PR lto/95548 * ipa-devirt.c (struct odr_enum_val): Turn values to wide_int. (ipa_odr_summary_write): Update streaming. (ipa_odr_read_section): Update streaming. gcc/testsuite/ChangeLog: 2020-06-06 Jan Hubicka <hubicka@ucw.cz> * g++.dg/torture/pr95548.C: New test.
2020-06-05[PR95456] avoid memcpy (_, NULL, 0) in gcc.cAlexandre Oliva1-7/+7
Some newly-added code in gcc.c might call memcpy with a NULL source pointer and zero-length inputs. Avoid such calls by rearranging the code a little. for gcc/ChangeLog PR driver/95456 * gcc.c (do_spec_1): Don't call memcpy (_, NULL, 0).
2020-06-06Daily bump.GCC Administrator9-1/+442
2020-06-05d: Merge upstream dmd 740f3d1ea.Iain Buclaw7-41/+55
Backports the conversion of the parameter fields debugids and versionids to Identifiers. The idea is that Identifiers should be used instead of C strings where ever possible. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 740f3d1ea. * d-lang.cc (d_handle_option): Use new fields to save debug and version levels passed over command-line. (d_post_options): Add them to front-end here.
2020-06-05Temporarily remove an unintentionally commited test.Martin Sebor1-108/+0
gcc/testsuite/ChangeLog: * g++.dg/warn/Wnonnull5.C: Temporarily remove.
2020-06-05c++: Make braced-init-list as template arg work with aggr init [PR95369]Marek Polacek2-1/+33
Barry pointed out to me that our braced-init-list as a template-argument extension doesn't work as expected when we aggregate-initialize. Since aggregate list-initialization is a user-defined conversion sequence, we allow it as part of a converted constant expression. Co-authored-by: Jason Merrill <jason@redhat.com> gcc/cp/ChangeLog: PR c++/95369 * call.c (build_converted_constant_expr_internal): Allow list-initialization. gcc/testsuite/ChangeLog: PR c++/95369 * g++.dg/cpp2a/nontype-class38.C: New test.
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-05coroutines: co_returns are statements, not expressions.Iain Sandoe1-2/+2
This corrects an error in the CO_RETURN_EXPR tree class. gcc/cp/ChangeLog: * cp-tree.def (CO_RETURN_EXPR): Correct the class to use tcc_statement.
2020-06-05diagnostics: Consistently add fixit hint for implicit builtin declarationMark Wielaard5-4/+79
There are two warnings that might trigger when a builtin function is used but not declared yet. Both called through implicitly_declare in c-decl. The first in implicit_decl_warning does warn for builtins, but does not add a fixit hint for them (only for non-builtins when a header is suggested through lookup_name_fuzzy). This warning is guarded by -Wimplicit-function-declaration. The second warning, which does include a fixit hint if possible, is given when the implicit builtin declaration has an incompatible signature. This second warning cannot be disabled. This setup means that you only get a fixit-hint for usage of builtin functions where the implicit signature is different than the actual signature of the builtin. No fixit hints with header suggestions are ever generated for builtins like abs, isdigit or putchar. It seems more consistent to always generate a fixit-hint if possible for the -Wimplicit-function-declaration warning. And for the second warning to make it depend on -Wbuiltin-declaration-mismatch like other warnings about builtin declaration mismatches. Include a new test to show we get fixit-hints for abs, isdigit and putchar now. Some small tweaks to existing tests to show the effect of -Wno-builtin-declaration-mismatch with this change. And a testcase to show that #pragma GCC diagnostic ignored now works. gcc/c/ChangeLog: * c-decl.c (implicit_decl_warning): When warned and olddecl is an undeclared builtin, then add a fixit header hint, if found. (implicitly_declare): Add OPT_Wbuiltin_declaration_mismatch to warning_at about implicit builtin declaration type mismatch. gcc/testsuite/ChangeLog: * gcc.dg/missing-header-fixit-3.c: Add -Wno-implicit-function-declaration. * gcc.dg/missing-header-fixit-4.c: Add new expected output. * gcc.dg/missing-header-fixit-5.c: New testcase. * gcc.dg/Wbuiltin-declaration-mismatch-ignore.c: Likewise.
2020-06-05d: Merge upstream dmd f5638c7b8.Iain Buclaw9-71/+87
Adds a CHECKENABLE enum, uses it for all contract parameters for consistency in state checking. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd f5638c7b8. * d-builtins.cc (d_init_versions): Use new CHECKENABLE enum. * d-codegen.cc (array_bounds_check): Likewise. (build_frame_type): Likewise. (get_frameinfo): Likewise. * d-lang.cc (d_init_options): Likewise. (d_init_options_struct): Don't initialize x_flag_bounds_check. (d_handle_option): Use new CHECKENABLE enum. (d_post_options): Likewise. Set flag_bounds_check here. * expr.cc (ExprVisitor::visit(AssertExp *)): Use new CHECKENABLE enum.
2020-06-05c++: Fix pretty-print of pointer minus integer.Jason Merrill3-2/+22
For whatever reason, GCC internally represents a pointer minus an integer as a pointer plus a very large unsigned integer. But exposing that to users is unsightly, and it's easy enough to show the real value. gcc/cp/ChangeLog: * error.c (dump_binary_op): Handle negative operand to POINTER_PLUS_EXPR. gcc/c-family/ChangeLog: * c-pretty-print.c (pp_c_additive_expression): Handle negative operand to POINTER_PLUS_EXPR. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/constexpr-ptrsub2.C: New test.
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-05[OpenACC 'exit data'] Strip 'GOMP_MAP_STRUCT' mappingsThomas Schwinge2-1/+29
These are not itself necessary for OpenACC 'exit data' directives, and are skipped over (now) in libgomp. We might as well not emit them to start with, in line with the equivalent OpenMP directive. We keep the no-op handling in libgomp for the reason of backward compatibility. gcc/ * gimplify.c (gimplify_adjust_omp_clauses): Remove 'GOMP_MAP_STRUCT' mapping from OpenACC 'exit data' directives. gcc/testsuite/ * c-c++-common/goacc/struct-enter-exit-data-1.c: New file. libgomp/ * oacc-mem.c (goacc_exit_data_internal) <GOMP_MAP_STRUCT>: Explain special handling. Co-Authored-By: Julian Brown <julian@codesourcery.com>
2020-06-05d: Merge upstream dmd 56f0a65c4.Iain Buclaw27-270/+269
Updates the Target interface, removing static from all members, so all field accesses and member function calls go through a single global 'target'. Information relating to extern ABI are now in TargetC, TargetCPP, and TargetObjC for each supported language respectively. Reviewed-on: https://github.com/dlang/dmd/pull/11228 gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 56f0a65c4. * d-builtins.cc (build_frontend_type): Remove static. (d_build_builtins_module): Use target.va_listType() to get front-end type for va_list. (d_init_builtins): Move creation of va_list to Target::va_listType. * d-codegen.cc (build_interface_binfo): Use new target global. (build_vindex_ref): Likewise. (identity_compare_p): Likewise. * d-ctfloat.cc (CTFloat::parse): Likewise. * d-lang.cc (d_init): Likewise. * d-port.cc (Port::isFloat32LiteralOutOfRange): Likewise. (Port::isFloat64LiteralOutOfRange): Likewise. * d-target.cc (define_float_constants): Initialize constants through a reference, instead of setting globals. (Target::_init): Initialize new fields instead of setting globals. (Target::va_listType): Build front-end type from va_list_type_node. (Target::toCppMangle): Renamed to ... (TargetCPP::toMangle): ... this. (Target::cppTypeInfoMangle): Renamed to ... (TargetCPP::typeInfoMangle): ... this. (Target::cppTypeMangle): Renamed to ... (TargetCPP::typeMangle): this. (Target::cppParameterType): Renamed to ... (TargetCPP::parameterType): ... this. Use target.va_listType() to get front-end type for va_list. (Target::cppFundamentalType): Renamed to ... (TargetCPP::fundamentalType): ... this. * d-tree.h (build_frontend_type): Declare. * decl.cc (base_vtable_offset): Use new target global. * typeinfo.cc (layout_classinfo_interfaces): Likewise. (layout_cpp_typeinfo): Likewise. * types.cc (valist_array_p): Use target.va_listType() to get front-end type for va_list. (layout_aggregate_type): Use new target global.
2020-06-05Adjust text of expected warnings to g:b825a22890740f341eae566af27e18e528cd29a7.Martin Sebor7-8/+116
gcc/testsuite/ChangeLog: * c-c++-common/goacc/uninit-use-device-clause.c: Adjust. * c-c++-common/pr59223.c: Same. * g++.dg/warn/Wnonnull5.C: Same. * gcc.dg/pr59924.c: Same. * gcc.dg/ubsan/pr81981.c: Same. * gcc.dg/ubsan/pr89284.c: Same. * gfortran.dg/goacc/uninit-use-device-clause.f95: Same.