aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-06-15[Ada] Improve error message on premature usage of subtypesArnaud Charlet1-30/+30
2020-06-15 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_ch8.adb (Premature_Usage): Add support for subtype references and replace set of if-then-else by a case statement.
2020-06-15[Ada] Do expect task discriminants in Global and Depends contractsPiotr Trojanek1-2/+16
2020-06-15 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sem_prag.adb (Analyze_Depends_In_Decl_Part, Analyze_Global_In_Decl_Part): Bring back task discriminants for analysis of the Global/Depends contracts; add comments.
2020-06-15[Ada] Implement AI12-0343 Return Statement ChecksEric Botcazou7-225/+231
2020-06-15 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * einfo.ads (Return_Applies_To): Document special usage for E_Block. * einfo.adb (Write_Field8_Name): Write it for E_Block too. * exp_ch4.adb (Expand_N_Type_Conversion): Remove implementation of the check prescribed by AI05-0073. * exp_ch6.adb (Apply_CW_Accessibility_Check): New procedure to apply the check prescribed by AI95-344 extracted from... (Expand_N_Extended_Return_Statement): Apply the check prescribed by AI95-344 to the expression, if present. Suppress only access checks when analyzing the rewritten result. (Expand_Simple_Function_Return): ...here. Rename local variable. Call Apply_CW_Accessibility_Check to apply the check prescribed by AI95-344, but do not do it for the simple return statement generated by the expansion of an extended return statement. Apply the check prescribed by AI05-0073 to all functions returning anonymous access type designating a specific tagged type, but not if the expression was null or tag checks are suppressed for the type, and use Not In operator rather than comparing the tags explicitly. * sem.adb (Analyze): Handle all Suppress values. * sem_ch6.adb (Analyze_Function_Return): Do not explicitly apply predicate checks in the case of an extended return statement. Do not apply an implicit conversion to the anonymous access result type in the case of the simple return statement generated by the expansion of an extended return statement. (New_Overloaded_Entity): Small comment tweak. * treepr.adb (Print_Node): Fix typo in flag string.
2020-06-15[Ada] T'Image calls T'Put_ImageBob Duff8-28/+151
2020-06-15 Bob Duff <duff@adacore.com> gcc/ada/ * exp_put_image.ads, exp_put_image.adb (Image_Should_Call_Put_Image): New function to determine whether the call to Put_Image should be generated. (Build_Image_Call): New procedure to generate the call to Put_Image. * exp_imgv.adb (Expand_Image_Attribute): Use underlying types to bypass privacy (only in Ada 2020). If Image_Should_Call_Put_Image is True (which happens only in Ada 2020), then call Build_Image_Call. * rtsfind.ads, rtsfind.adb: Add the necessary declarations in Ada.Strings.Text_Output.Buffers. * sem_attr.adb (Check_Image_Type): Enable the Ada 2020 case. * libgnat/a-stoufo.ads, libgnat/a-stoufo.adb: Use the less restrictive type that allows newline characters.
2020-06-15[Ada] Minor editorial changes in commentsGary Dismukes2-4/+4
2020-06-15 Gary Dismukes <dismukes@adacore.com> gcc/ada/ * exp_ch9.ads (Build_Master_Declaration): Add commas. * exp_ch9.adb (Build_Master_Entity): Spelling fix ("build" => "built"). (Build_Task_Activation_Call): Fix word order.
2020-06-15[Ada] Allow uninitialized values on Big_Positive/NaturalArnaud Charlet1-2/+6
2020-06-15 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnat/a-nbnbin.ads (Big_Positive, Big_Natural): Fix predicate.
2020-06-15[Ada] Fix analysis of Relaxed_Initialization for bodies-as-specsPiotr Trojanek2-11/+24
2020-06-15 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sem_ch13.adb (Analyze_Aspect_Relaxed_Initialization): Fix dealing with scopes on subprogram bodies that act as specs. * sem_util.adb (Has_Relaxed_Initialization): Fix trivial mistake.
2020-06-15[Ada] Crash in tagged type constructor with task componentsJavier Miranda14-100/+299
2020-06-15 Javier Miranda <miranda@adacore.com> gcc/ada/ * restrict.ads (Set_Global_No_Tasking, Global_No_Tasking): New subprograms. * restrict.adb (Set_Global_No_Tasking, Global_No_Tasking): New subprograms. * sem_ch3.adb (Access_Definition): Do not skip building masters since they may be required for BIP calls. (Analyze_Subtype_Declaration): Propagate attribute Is_Limited_Record in class-wide subtypes and subtypes with cloned subtype attribute; propagate attribute Is_Limited_Interface. * sem_ch6.adb (Check_Anonymous_Return): Do not skip building masters since they may be required for BIP calls. Use Build_Master_Declaration to declare the _master variable. (Create_Extra_Formals): Add decoration of Has_Master_Entity when the _master formal is added. * exp_ch3.adb (Init_Formals): Adding formal to decorate it with attribute Has_Master_Entity when the _master formal is added. (Build_Master): Do not skip building masters since they may be required for BIP calls. (Expand_N_Object_Declaration): Ensure activation chain and master entity for objects initialized with BIP function calls. * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings): Adding support to detect and save restriction No_Tasking when set in the run-time package System or in a global configuration pragmas file. * sem_util.adb (Current_Entity_In_Scope): Overload this subprogram to allow searching for an entity by its Name. * sem_util.ads (Current_Entity_In_Scope): Update comment. * exp_ch4.adb (Expand_N_Allocator): Do not skip building masters since they may be required for BIP calls. * exp_ch6.ads (Might_Have_Tasks): New subprogram. * exp_ch6.adb (Make_Build_In_Place_Call_In_Allocator): Add support for BIP calls returning objects that may have tasks. (Make_Build_In_Place_Call_In_Allocator): Build the activation chain if the result might have tasks. (Make_Build_In_Place_Iface_Call_In_Allocator): Build the class wide master for the result type. (Might_Have_Tasks): New subprogram. (Needs_BIP_Task_Actuals): Returns False when restriction No_Tasking is globally set. * exp_ch9.ads (Build_Master_Declaration): New subprogram. * exp_ch9.adb (Build_Activation_Chain_Entity): No action performed when restriction No_Tasking is globally set. (Build_Class_Wide_Master): No action performed when restriction No_Tasking is globally set; use Build_Master_Declaration to declare the _master variable. (Build_Master_Declaration): New subprogram. (Build_Master_Entity): No action performed when restriction No_Tasking is globally set; added support to handle transient scopes and _finalizer routines. (Build_Master_Renaming): No action performed when restriction No_Tasking is globally set. (Build_Task_Activation_Call): Skip generating the call when the chain is an ignored ghost entity. (Find_Master_Scope): Generalize the code that detects transient scopes with master entity. * einfo.ads (Has_Nested_Subprogram): Minor comment reformatting.
2020-06-15[Ada] Missing errors on aspect checkingArnaud Charlet3-98/+164
2020-06-15 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_attr.adb (Eval_Attribute): Protect against previous errors. * sem_ch13.adb (Analyze_Aspect_Default_Value): Remove redundant error checking, handling in Analyze_Aspect_Specifications. (Analyze_Aspect_Specifications): Refine error messages on Default_[Component_]Value. (Check_Aspect_Too_Late): New procedure. (Rep_Item_Too_Late.Is_Derived_Type_With_Constraint): Remove, dead code. * aspects.ads (Is_Representation_Aspect): Default_Value is a representation aspect.
2020-06-15[Ada] AI12-0260 Functions Is_Basic and To_Basic in Wide_Characters.HandlingArnaud Charlet6-8/+5903
2020-06-15 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * libgnat/a-wichha.ads, libgnat/a-wichha.adb, libgnat/a-wichun.ads, libgnat/a-wichun.adb (Is_Basic, To_Basic): New. * libgnat/s-utf_32.ads, libgnat/s-utf_32.adb (Is_UTF_32_Basic, To_UTF_32_Basic, Decomposition_Search): New subprograms. (Unicode_Decomposition): New table.
2020-06-15[Ada] Passing actual parameter values to out formals when Default_Value is setGary Dismukes1-0/+19
2020-06-15 Gary Dismukes <dismukes@adacore.com> gcc/ada/ * exp_ch6.adb (Add_Call_By_Copy_Code): In the case of a view conversion passed to a scalar out-mode parameter where the formal has Default_Value set, declare the copy temp with the base type of the formal's subtype and initialize the copy temp with the actual's value.
2020-06-15[Ada] Bad access checks on if/case expression as actualJustin Squirek4-20/+323
2020-06-15 Justin Squirek <squirek@adacore.com> gcc/ada/ * exp_ch4.adb (Expand_N_Case_Expression): Set default value for Target to silence potential warnings. (Expand_N_If_Expression): Add calculation to check when the if expression is used directly in the context of an actual of an anonymous access type and add a special path to force expansion of the if expression in this case. * exp_ch6.adb (Expand_Branch): Generate an assignment to the level temporary for a given branch. (Expand_Call_Helper): Add expansion to allow for creating a temporary to store associated accessiblity levels on each branch of the conditional expression. Also perform expansion of function calls into expressions with actions, and fixup references to N with Call_Node. (Insert_Level_Assign): Move through nested conditional expressions to each branch. * sem_util.ads, sem_util.adb (Is_Anonymous_Access_Actual): Added to detect when to force expansion of if expressions.
2020-06-15[Ada] Do not expect task discriminants in Global and Depends contractsPiotr Trojanek1-6/+2
2020-06-15 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sem_prag.adb (Analyze_Depends_In_Decl_Part, Analyze_Global_In_Decl_Part): Do not install task discriminants for analysis of the Global/Depends contracts.
2020-06-15[Ada] Do not expect Global or Depends on single protected objectsPiotr Trojanek1-3/+3
2020-06-15 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * contracts.adb (Analyze_Object_Contract): Do not expect Global/Depends on single protected units.
2020-06-15[Ada] Incorrect accessibility checks on functions callsJustin Squirek1-4/+7
2020-06-15 Justin Squirek <squirek@adacore.com> gcc/ada/ * sem_res.adb (Valid_Conversion): Add missing condition to trigger proper static accessiblity failiures when the target type is an anonymous access.
2020-06-15[Ada] Replace repeated Ekind with Ekind_InPiotr Trojanek1-2/+1
2020-06-15 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * exp_ch6.adb (Expand_Call_Helper): Replace repeated Ekind with Ekind_In.
2020-06-15[Ada] Remove excessive parensPiotr Trojanek2-3/+3
2020-06-15 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * exp_ch6.adb, sem_util.adb: Remove excessive parents, especially since they don't make the code any easier to read.
2020-06-15[Ada] Support aspect Relaxed_Initialization and attribute InitializedPiotr Trojanek11-11/+402
2020-06-15 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * aspects.ads (Aspect_Id): Add Aspect_Relaxed_Initialization. (Implementation_Defined_Aspect): Add new aspect. (Aspect_Argument): Add new aspect with Optional_Expression argument. (Is_Representation_Aspect): Add new aspect as a non-representation one. (Aspect_Names): Add name for the new aspect. (Aspect_Delay): Add new aspect as a non-delayed one. * sem_ch3.adb: Minor reformatting. * einfo.ads, einfo.adb (Is_Relaxed_Initialization_State): New query; reuses existing code for querying abstract state options. * exp_attr.adb (Expand_N_Attribute_Reference): For now ignore attribute 'Initialized. * sem_attr.adb (Analyze_Attribute_Old_Result): Allow attribute 'Result to be used in the aspect Relaxed_Initialization expression. (Analyze_Attribute): Analyze attribute 'Initialized; based on existing code for attribute 'Valid_Scalars. (Eval_Attribute): Do not expect attribute 'Initialized, just like attribute 'Valid_Scalars is not expected. * sem_ch13.adb (Analyze_Aspect_Relaxed_Initialization): New routine. (Analyze_Aspect_Specifications): Analyze new aspect in a dedicated routine. (Check_Aspect_At_Freeze_Point): Do not expect new aspect. * sem_prag.adb (Analyze_Abstract_State): Support option Relaxed_Initialization on abstract states. * sem_util.ads, sem_util.adb (Has_Relaxed_Initialization): New query for the GNATprove backend. * snames.ads-tmpl (Snames): Add Name_Ids for the new aspect and attribute; add an Attribute_Id for the new attribute.
2020-06-15[Ada] Put_Image: Enable for access-to-subprogram typesBob Duff4-11/+9
2020-06-15 Bob Duff <duff@adacore.com> gcc/ada/ * exp_put_image.adb, libgnat/s-putima.adb, libgnat/s-putima.ads, rtsfind.ads: Enable Put_Image if Is_Access_Subprogram_Type (Typ). Remove comment saying it's disabled in that case. Rename Put_Image_Access_Prot to be Put_Image_Access_Prot_Subp to clarify that we're talking about access-to-subprogram, not access-to-protected-object.
2020-06-15[Ada] Clean up error handling of 'ImageBob Duff2-37/+39
2020-06-15 Bob Duff <duff@adacore.com> gcc/ada/ * sem_attr.adb (Check_Image_Type): New procedure for checking the type, depending on language version. Disable the Ada 2020 support until the corresponding expander work is done. (Analyze_Image_Attribute): Call Check_Image_Type. Rearrange the code to be simplier and more logical. When P_Type is modified, modify P_Base_Type accordingly. * sem_util.adb (Is_Object_Image): Do not return False if the prefix is a type. X'Image should be considered an image of an object iff X is an object (albeit illegal pre-2020 if nonscalar).
2020-06-15[Ada] Put_Image: Enable for access-to-subprogram typesBob Duff4-6/+43
2020-06-15 Bob Duff <duff@adacore.com> gcc/ada/ * libgnat/s-putima.ads, libgnat/s-putima.adb (Put_Image_Access_Subp, Put_Image_Access_Prot): New procedures for printing access-to-subprogram objects. Remove an explicit " ", because Put_Image includes the annoying leading blank. * rtsfind.ads: Add new procedures in s-putima. * exp_put_image.adb: Call new procedures as appropriate.
2020-06-15[Ada] Put_Image: Implement for private types with full real typeBob Duff2-9/+24
2020-06-15 Bob Duff <duff@adacore.com> gcc/ada/ * exp_imgv.adb (Expand_Image_Attribute): Allow private types. Put_Image generates Image for numeric types, and private types whose full type is numeric. This requires the Conversion_OK flag for integer and floating-point types. For fixed point, we need the extra conversion. * exp_put_image.adb (Build_Elementary_Put_Image_Call): Remove special handling of real types. (Enable_Put_Image): Enable for reals.
2020-06-15[Ada] Put_Image improvements for stringsBob Duff6-64/+61
2020-06-15 Bob Duff <duff@adacore.com> gcc/ada/ * exp_attr.adb (Put_Image): Use underlying type for strings. Remove unchecked union processing. * exp_put_image.adb (Tagged_Put_Image_Enabled): Use -gnatd_z to enable default Put_Image for tagged types. This allows testing that feature. (Build_String_Put_Image_Call): Set Conversion_OK flag. (Make_Component_List_Attributes): Remove unchecked union processing. (Enable_Put_Image): Disable for unchecked unions. Enable for nonscalar types (which were mistakenly disabled in earlier changes). * debug.adb: Document -gnatd_z switch. * libgnat/s-putima.adb (Put_Image_String, Put_Image_Wide_String, Put_Image_Wide_Wide_String): Double double-quote characters. Forget about special handling of control characters for now -- that's rare enough to not be a priority, and it's not clear what the right thing to do is anyway. * namet.adb: Minor: Improve debugger-friendliness. * sinfo.ads: Minor: Add "???" comment.
2020-06-15[Ada] Remove unreferenced and dubious Is_Renaming_DeclarationPiotr Trojanek2-25/+0
2020-06-15 Piotr Trojanek <trojanek@adacore.com> gcc/ada/ * sem_util.ads, sem_util.adb (Is_Renaming_Declaration): Remove.
2020-06-15[Ada] Link failure with call to expression function in preconditionEd Schonberg1-3/+9
2020-06-15 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * freeze.adb (Freeze_Expression): When traversing the tree looking for the proper insertion point for the freeze node of an entity that is declared in an outer scope, set the candidate subprogram body node properly. Previous code has an off-by-one error.
2020-06-15[Ada] Implement AI12-0077 Has_Same_Storage on objects of size zeroEric Botcazou1-12/+25
2020-06-15 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_attr.adb (Expand_N_Attribute_Reference) <Has_Same_Storage>: Do not do superfluous work. Add the condition (X'Size /= 0) on both paths and turn binary AND into short-circuit AND THEN.
2020-06-15[Ada] Update 'Loop_Entry checking to match changes in 'Old rules.Steve Baird1-3/+3
2020-06-15 Steve Baird <baird@adacore.com> gcc/ada/ * sem_attr.adb (Analyze_Attribute): In the Loop_Entry case, replace a call to Statically_Denotes_Object with a call to Statically_Names_Object and clean up the preceding comment.
2020-06-15[Ada] Use uniform type resolution for membership testsEric Botcazou1-14/+13
2020-06-15 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * sem_res.adb (Resolve_Set_Membership): Remove local variable. In the non-overloaded case, call Intersect_Types on the left operand and the first alternative to get the resolution type. But test the subtype of the left operand to give the warning.
2020-06-15RISC-V: Suppress warning for signed and unsigned integer comparison.Kito Cheng1-3/+3
gcc/ChangeLog: * config/riscv/riscv.c (riscv_gen_gpr_save_insn): Change type to unsigned for i. (riscv_gpr_save_operation_p): Change type to unsigned for i and len.
2020-06-15Optimize multiplication for V8QI,V16QI,V32QI under TARGET_AVX512BW.liuhongt7-2/+234
2020-06-13 Hongtao Liu <hongtao.liu@intel.com> gcc/ChangeLog: PR target/95488 * config/i386/i386-expand.c (ix86_expand_vecmul_qihi): New function. * config/i386/i386-protos.h (ix86_expand_vecmul_qihi): Declare. * config/i386/sse.md (mul<mode>3): Drop mask_name since there's no real simd int8 multiplication instruction with mask. Also optimize it under TARGET_AVX512BW. (mulv8qi3): New expander. gcc/testsuite/ChangeLog: * gcc.target/i386/avx512bw-pr95488-1.c: New test. * gcc.target/i386/avx512bw-pr95488-2.c: Ditto. * gcc.target/i386/avx512vl-pr95488-1.c: Ditto. * gcc.target/i386/avx512vl-pr95488-2.c: Ditto.
2020-06-15Daily bump.GCC Administrator4-1/+56
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 Anlauf2-11/+34
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 Koenig2-2/+16
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 Koenig5-7/+82
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-14d: Fix line lengths after mechanical field renames.Iain Buclaw2-4/+8
gcc/d/ChangeLog: * expr.cc (ExprVisitor::visit (AssocArrayLiteralExp *)): Fix line lengths, no functional change. * typeinfo.cc (TypeInfoVisitor::layout_interfaces): Likewise. (layout_classinfo_interfaces): Likewise.
2020-06-14testsuite: Re-add gdc.test prefix in test names (PR testsuite/95575)Iain Buclaw1-6/+12
gcc/testsuite/ChangeLog: PR testsuite/95575 * lib/gdc-utils.exp (gdc-do-test): Re-add $subdir link and inclusion in filename.
2020-06-14Daily bump.GCC Administrator3-1/+22
2020-06-13Correct test to avoid failures in ILP32.Martin Sebor1-7/+7
Amends: PR middle-end/95353 - spurious -Wstringop-overflow writing to a trailing array plus offset. gcc/testsuite/ChangeLog: * gcc.dg/builtin-stringop-chk-5.c: Make assertions independent of data model.
2020-06-13Remove failing test case accidentally committed.Thomas Koenig1-39/+0
When committing 0cfc34ad1293a5e19f1dc67c461c58d99222ac9d, I accidentylly committed gcc/testsuite/gfortran.dg/finalize_36.f90 . This removes this, again. gcc/testsuite/ChangeLog: * gfortran.dg/finalize_36.f90: Remove accidentally committed test case.
2020-06-13Disable -Wstringop-overflow warning after checking code path of caller.Thomas Koenig2-0/+47
The warning that is disabled, only on this single line, has been inspected and found to be not applicable; it is known that the size of the buffer is safe. libgfortran/ChangeLog: 2020-06-13 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/95313 * io/write.c (ztoa_big): Disable -Wstringop-overflow for one line.
2020-06-13Daily bump.GCC Administrator6-1/+500
2020-06-12runtime: fix arenaBaseOffset for aix/ppcClément Chigot3-3/+3
The arenaBaseOffset modifications was aimed only for aix/ppc64. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/237038
2020-06-12go.test: update issue4085b.go to version from Go 1.13Ian Lance Taylor1-1/+3
This lets the test pass on AIX. Not updating to master because we get slightly different error messages, so that is a more complex change.
2020-06-12tsan: Add param to disable func-entry-exit instrumentationMarco Elver5-2/+67
Adds param tsan-instrument-func-entry-exit, which controls if __tsan_func_{entry,exit} calls should be emitted or not. The default behaviour is to emit the calls. This may be required by alternative race detection runtimes. One such runtime is the Kernel Concurrency Sanitizer (KCSAN): https://github.com/google/ktsan/wiki/KCSAN After this change, GCC should satisfy all requirements for KCSAN: https://lore.kernel.org/lkml/20200515150338.190344-7-elver@google.com/ gcc/ChangeLog: * gimplify.c (gimplify_function_tree): Optimize and do not emit IFN_TSAN_FUNC_EXIT in a finally block if we do not need it. * params.opt: Add --param=tsan-instrument-func-entry-exit=. * tsan.c (instrument_memory_accesses): Make fentry_exit_instrument bool depend on new param. gcc/testsuite/ChangeLog: * c-c++-common/tsan/func_entry_exit.c: New test. * c-c++-common/tsan/func_entry_exit_disabled.c: New test.
2020-06-12Add .clang-tidy to git ignored.Martin Liska1-0/+1
Installed as obvious. ChangeLog: * .gitignore: Add .clang-tidy.
2020-06-12testcase for shared DR alignmentRichard Biener1-0/+41
This adds a reduced C testcase from libgomp.fortran/examples-4/target-1.f90 and libgomp.fortran/examples-4/target_data-1.f90 FAILs, showing a case of SLP instance stmt sharing that affects the shared dataref alignment info. 2020-06-12 Richard Biener <rguenther@suse.de> * gcc.dg/vect/bb-slp-44.c: New testcase.
2020-06-12vect: Fix an ICE in vect_loop_versioning [PR95570]Fei Yang2-49/+45
In the test case for PR95570, the only data reference in the loop is a gather-statter access. Scalar evolution analysis for this data reference failed, so DR_STEP is NULL_TREE. This leads to the segmentation fault. We should filter out scatter-gather access in vect_enhance_data_refs_alignment. 2020-06-12 Felix Yang <felix.yang@huawei.com> gcc/ PR tree-optimization/95570 * tree-vect-data-refs.c (vect_relevant_for_alignment_p): New function. (vect_verify_datarefs_alignment): Call it to filter out data references in the loop whose alignment is irrelevant. (vect_get_peeling_costs_all_drs): Likewise. (vect_peeling_supportable): Likewise. (vect_enhance_data_refs_alignment): Likewise. gcc/testsuite/ PR tree-optimization/95570 * gcc.dg/vect/pr95570.c: New test.
2020-06-12fix vectorizable_condition ICE with EXTRACT_LAST_REDUCTIONRichard Biener1-1/+2
The previous reorg missed a guard around the else clause access. 2020-06-12 Richard Biener <rguenther@suse.de> PR tree-optimization/95633 * tree-vect-stmts.c (vectorizable_condition): Properly guard the vec_else_clause access with EXTRACT_LAST_REDUCTION.
2020-06-12libstdc++: Improve tests for std::atomic_flagJonathan Wakely3-12/+10
The tests for clear() and test_and_set() didn't cover all cases. * testsuite/29_atomics/atomic_flag/clear/1.cc: Also test clear() when the value is currently set. * testsuite/29_atomics/atomic_flag/test_and_set/explicit.cc: Actually check the return value. * testsuite/29_atomics/atomic_flag/test_and_set/implicit.cc: Likewise.