aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-07-10testsuite: Fix WPA scanning.Martin Liska1-2/+2
gcc/testsuite/ChangeLog: PR gcov-profile/96148 * lib/scanwpaipa.exp: Fix wpa dump file suffix the same way as other in the file.
2020-07-10c++: Support non-type template parms of union type.Jason Merrill5-10/+119
Another thing newly allowed by P1907R1. The ABI group has discussed representing unions with designated initializers, and has separately specified how to represent designators; this patch implements both. gcc/cp/ChangeLog: * tree.c (structural_type_p): Allow unions. * mangle.c (write_expression): Express unions with a designator. libiberty/ChangeLog: * cp-demangle.c (cplus_demangle_operators): Add di, dx, dX. (d_expression_1): Handle di and dX. (is_designated_init, d_maybe_print_designated_init): New. (d_print_comp_inner): Use d_maybe_print_designated_init. * testsuite/demangle-expected: Add designator tests. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/nontype-class-union1.C: New test.
2020-07-10c++: Allow floating-point template parms in C++20.Jason Merrill12-59/+89
P1907R1 made various adjustments to non-type template parameters, notably introducing the notion of "structural type". I implemented an early version of that specification in r10-4426, but it was adjusted in the final paper to allow more. This patch implements allowing template parameters of floating-point type; still to be implemented are unions and subobjects. gcc/cp/ChangeLog: * pt.c (convert_nontype_argument): Handle REAL_TYPE. (invalid_nontype_parm_type_p): Allow all structural types. * tree.c (structural_type_p): Use SCALAR_TYPE_P. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/pr81246.C: No error in C++20. * g++.dg/cpp0x/variadic74.C: No error in C++20. * g++.dg/cpp1z/nontype-auto3.C: No error in C++20. * g++.dg/template/crash106.C: No error in C++20. * g++.dg/template/crash119.C: No error in C++20. * g++.dg/template/nontype12.C: No error in C++20. * g++.dg/template/void3.C: Don't require follow-on message. * g++.dg/template/void7.C: Don't require follow-on message. * g++.dg/template/void9.C: Don't require follow-on message.
2020-07-10c++: [[no_unique_address]] fixes. [PR96105]Jason Merrill4-7/+92
We were wrongly checking is_empty_class on the result of strip_array_types rather than the actual field type. We weren't considering the alignment of the data member. We needed to handle unions the same way as layout_nonempty_base_or_field. gcc/cp/ChangeLog: PR c++/96105 PR c++/96052 PR c++/95976 * class.c (check_field_decls): An array of empty classes is not an empty data member. (layout_empty_base_or_field): Handle explicit alignment. Fix union handling. gcc/testsuite/ChangeLog: PR c++/96105 PR c++/96052 PR c++/95976 * g++.dg/cpp2a/no_unique_address4.C: New test. * g++.dg/cpp2a/no_unique_address5.C: New test. * g++.dg/cpp2a/no_unique_address6.C: New test.
2020-07-10x86: Check TARGET_AVX512VL when enabling FMAH.J. Lu1-1/+4
Check TARGET_AVX512VL when enabling FMA to avoid gcc.target/i386/avx512er-vrsqrt28ps-3.c:25:1: error: unrecognizable insn: (insn 29 28 30 6 (set (reg:V8SF 108) (fma:V8SF (reg:V8SF 106) (reg:V8SF 105) (reg:V8SF 110))) when TARGET_AVX512VL isn't enabled. PR target/96144 * config/i386/i386-expand.c (ix86_emit_swsqrtsf): Check TARGET_AVX512VL when enabling FMA.
2020-07-10arm: Implement Armv8.1-M low overhead loopsAndrea Corallo16-6/+459
gcc/ChangeLog 2020-06-18 Andrea Corallo <andrea.corallo@arm.com> Mihail-Calin Ionescu <mihail.ionescu@arm.com> Iain Apreotesei <iain.apreotesei@arm.com> * config/arm/arm-protos.h (arm_target_insn_ok_for_lob): New prototype. * config/arm/arm.c (TARGET_INVALID_WITHIN_DOLOOP): Define. (arm_invalid_within_doloop): Implement invalid_within_doloop hook. (arm_target_insn_ok_for_lob): New function. * config/arm/arm.h (TARGET_HAVE_LOB): Define macro. * config/arm/thumb2.md (*doloop_end_internal, doloop_begin) (dls_insn): Add new patterns. (doloop_end): Modify to select LR when LOB is available. * config/arm/unspecs.md: Add new unspec. * doc/sourcebuild.texi (arm_v8_1_lob_ok) (arm_thumb2_ok_no_arm_v8_1_lob): Document new target supports options. gcc/testsuite/ChangeLog 2020-06-18 Andrea Corallo <andrea.corallo@arm.com> Mihail-Calin Ionescu <mihail.ionescu@arm.com> Iain Apreotesei <iain.apreotesei@arm.com> * gcc.target/arm/lob.h: New header. * gcc.target/arm/lob1.c: New testcase. * gcc.target/arm/lob2.c: Likewise. * gcc.target/arm/lob3.c: Likewise. * gcc.target/arm/lob4.c: Likewise. * gcc.target/arm/lob5.c: Likewise. * gcc.target/arm/lob6.c: Likewise. * gcc.target/arm/unsigned-extend-2.c: Do not run when generating low loop overhead. * gcc.target/arm/ivopts.c: Fix check for low loop overhead. * lib/target-supports.exp (check_effective_target_arm_v8_1_lob) (check_effective_target_arm_thumb2_ok_no_arm_v8_1_lob): New procs.
2020-07-10[Ada] Revert mistaken negation related to references to labelsPiotr Trojanek1-2/+2
gcc/ada/ * sem_ch8.adb (Find_Direct_Name): Fix code to match the comment.
2020-07-10[Ada] Add warning for overlays changing scalar storage orderEric Botcazou1-4/+6
gcc/ada/ * sem_ch13.adb (Analyze_Attribute_Definition_Clause) <Address>: Issue an unconditional warning for an overlay that changes the scalar storage order.
2020-07-10[Ada] Fix detection of actual parameters for procedure callsPiotr Trojanek1-10/+24
gcc/ada/ * sem_ch8.adb (Is_Actual_Parameter): Fix processing when parent is a procedure call statement; extend comment.
2020-07-10[Ada] Ada2020: AI12-0368 Declare expressions can be staticBob Duff4-22/+122
gcc/ada/ * sem_res.adb (Resolve_Expression_With_Actions): Check the rules of AI12-0368, and mark the declare expression as static or known at compile time as appropriate. * sem_ch4.adb: Minor reformatting. * libgnat/a-stoufo.ads, libgnat/a-stoufo.adb: Allow up to 9 replacement parameters. I'm planning to use this in the test case for this ticket.
2020-07-10[Ada] Spurious error on parameterless acccess_to_subprogramEd Schonberg2-2/+9
gcc/ada/ * exp_ch3.adb (Build_Access_Subprogram_Wrapper_Body): Create a proper signature when the access type denotes a parameterless subprogram. * exp_ch6.adb (Expand_Call): Handle properly a parameterless indirect call when the corresponding access type has contracts.
2020-07-10[Ada] Further improve the expansion of array aggregatesEric Botcazou1-73/+125
gcc/ada/ * exp_aggr.adb (Convert_To_Positional): Add Dims local variable and pass it in calls to Is_Flat and Flatten. (Check_Static_Components): Pass Dims in call to Is_Static_Element. (Nonflattenable_Next_Aggr): New predicate. (Flatten): Add Dims parameter and Expr local variable. Call Nonflattenable_Next_Aggr in a couple of places. In the case when an Others choice is present, check that the element is either static or a nested aggregate that can be flattened, before disregarding the replication limit for elaboration purposes. Check that a nested array is flattenable in the case of a multidimensional array in any position. Remove redundant check in the Others case and pass Dims in call to Is_Static_Element. Use Expr variable. (Is_Flat): Change type of Dims parameter from Int to Nat. (Is_Static_Element): Add Dims parameter. Replace tests on literals with call to Compile_Time_Known_Value. If everything else failed and the dimension is 1, preanalyze the expression before calling again Compile_Time_Known_Value on it. Return true for null. (Late_Expansion): Do not expand further if the assignment to the target can be done directly by the back end.
2020-07-10[Ada] Preserve casing of output filesArnaud Charlet2-41/+51
gcc/ada/ * osint-c.adb (Set_File_Name): Preserve casing of file. * osint.adb (File_Names_Equal): New. (Executable_Name): Use File_Equal instead of Canonical_Case_File_Name.
2020-07-10[Ada] Fix memory leak in routine Wait_On_SocketPascal Obry1-7/+15
gcc/ada/ * libgnat/g-socket.adb (Wait_On_Socket): Fix memory leaks and file descriptor leaks. A memory leak was created each time the routine was called without a selector (Selector = Null). Also, in case of exception in the routine a memory leak and descriptor leak was created as the created file selector was not closed.
2020-07-10[Ada] Minor style fixesPascal Obry1-8/+10
gcc/ada/ * libgnat/g-socket.adb: Minor style fixes.
2020-07-10[Ada] Potentially unevaluated nested expressionsJavier Miranda1-92/+119
gcc/ada/ * sem_util.adb (Immediate_Context_Implies_Is_Potentially_Unevaluated): New subprogram. (Is_Potentially_Unevaluated): Do not stop climbing the tree on the first candidate subexpression; required to handle nested expressions.
2020-07-10[Ada] Reformatting and typo correctionsGary Dismukes5-67/+68
gcc/ada/ * exp_aggr.adb, exp_spark.adb, sem_ch13.ads, sem_ch13.adb, snames.ads-tmpl: Minor reformatting and typo fixes.
2020-07-10[Ada] Fix detection of volatile properties in SPARKYannick Moy1-0/+8
gcc/ada/ * sem_util.adb (Has_Enabled_Property): Add handling of non-variable objects.
2020-07-10[Ada] Cleanup excessive conditions in Check_CompletionPiotr Trojanek1-15/+17
gcc/ada/ * sem_ch3.adb (Check_Completion): Refactor chained if-then-elsif-... statement to be more like a case statement (note: we can't simply use case statement because of Is_Intrinsic_Subprogram in the first condition).
2020-07-10[Ada] Remove references to non-existing E_Protected_ObjectPiotr Trojanek4-21/+2
gcc/ada/ * einfo.ads (E_Protected_Object): Enumeration literal removed. * lib-xref.ads (Xref_Entity_Letters): Remove reference to removed literal. * sem_ch3.adb (Check_Completion): Likewise. * sem_util.adb (Has_Enabled_Property): Likewise.
2020-07-10[Ada] Use small limit for aggregates inside subprogramsArnaud Charlet14-174/+196
gcc/ada/ * exp_aggr.adb (Max_Aggregate_Size): Use small limit for aggregate inside subprograms. * sprint.adb (Sprint_Node_Actual [N_Object_Declaration]): Do not print the initialization expression if the No_Initialization flag is set. * sem_util.ads, sem_util.adb (Predicate_Enabled): New. * exp_ch4.adb (Expand_N_Type_Conversion): Code cleanup and apply predicate check consistently. * exp_ch6.adb (Expand_Actuals.By_Ref_Predicate_Check): Ditto. * sem_ch3.adb (Analyze_Object_Declaration): Ditto. * exp_ch3.adb (Build_Assignment): Revert handling of predicate check for allocators with qualified expressions, now handled in Freeze_Expression directly. * sem_aggr.adb: Fix typos. * checks.adb: Code refactoring: use Predicate_Enabled. (Apply_Predicate_Check): Code cleanup. * freeze.adb (Freeze_Expression): Freeze the subtype mark before a qualified expression on an allocator. * exp_util.ads, exp_util.adb (Within_Internal_Subprogram): Renamed Predicate_Check_In_Scope to clarify usage, refine handling of predicates within init procs which should be enabled when the node comes from source. * sem_ch13.adb (Freeze_Entity_Checks): Update call to Predicate_Check_In_Scope.
2020-07-10[Ada] Small cleanup throughout Exp_Ch4Eric Botcazou1-33/+32
gcc/ada/ * exp_ch4.adb (Expand_Array_Comparison): Reformat. (Expand_Concatenate): Use standard size values directly and use Standard_Long_Long_Unsigned instead of RE_Long_Long_Unsigned. (Expand_Modular_Op): Use Standard_Long_Long_Integer in case the modulus is larger than Integer. (Expand_N_Op_Expon): Use standard size value directly. (Narrow_Large_Operation): Use Uint instead of Nat for sizes and use a local variable for the size of the type. (Get_Size_For_Range): Return Uint instead of Nat. (Is_OK_For_Range): Take Uint instead of Nat.
2020-07-10[Ada] Spurious error in generic dispatching constructor callJavier Miranda1-1/+2
gcc/ada/ * exp_ch6.adb (Make_Build_In_Place_Iface_Call_In_Allocator): Build the internal anonymous access type using as a reference the designated type imposed by the context (instead of using the return type of the called function).
2020-07-10[Ada] Fix assertion failure on (in-)out function parameterYannick Moy1-0/+1
gcc/ada/ * sem_res.adb (Resolve_Actuals): Protect call to Is_Valued_Procedure.
2020-07-10[Ada] Revert too late setting of Ekind on discriminantsPiotr Trojanek1-3/+6
gcc/ada/ * sem_ch3.adb (Process_Discriminants): Revert recent change to location of Set_Ekind; detect effectively volatile discriminants by their type only.
2020-07-10[Ada] Add global contracts to Ada.Numerics.Big_Numbers librariesJoffrey Huguet2-76/+135
gcc/ada/ * libgnat/a-nbnbin.ads, libgnat/a-nbnbre.ads: Add global contract (Global => null) to all functions.
2020-07-10[Ada] Part of implementation of AI12-0212: container aggregatesEd Schonberg8-2/+460
gcc/ada/ * aspects.ads: Add Aspect_Aggregate. * exp_aggr.adb (Expand_Container_Aggregate): Expand positional container aggregates into separate initialization and insertion operations. * sem_aggr.ads (Resolve_Container_Aggregate): New subprogram. * sem_aggr.adb (Resolve_Container_Aggregate): Parse aspect aggregate, establish element types and key types if present, and resolve aggregate components. * sem_ch13.ads (Parse_Aspect_Aggregate): Public subprogram used in validation, resolution and expansion of container aggregates * sem_ch13.adb (Parse_Aspect_Aggregate): Retrieve names of primitives specified in aspect specification. (Validate_Aspect_Aggregate): Check legality of specified operations given in aspect specification, before nane resolution. (Resolve_Aspect_Aggregate): At freeze point resolve operations and verify that given operations have the required profile. * sem_res.adb (Resolve): Call Resolve_Aspect_Aggregate if aspect is present for type. * snames.ads-tmpl: Add names used in aspect Aggregate: Empty, Add_Named, Add_Unnamed, New_Indexed, Assign_Indexed.
2020-07-10[Ada] Make System.Generic_Bignums more flexibleArnaud Charlet8-394/+625
gcc/ada/ * Makefile.rtl (GNATRTL_NONTASKING_OBJS): Add s-shabig.o. * libgnat/s-shabig.ads: New file to share definitions. * libgnat/s-genbig.ads, libgnat/s-genbig.adb: Reorganized to make it more generic and flexible in terms of memory allocation and data structure returned. (To_String): Moved to System.Generic_Bignums to allow sharing this code. (Big_And, Big_Or, Big_Shift_Left, Big_Shift_Right): New. * libgnat/s-bignum.adb, libgnat/s-bignum.ads: Adapt to new System.Generic_Bignums spec. * libgnat/a-nbnbin.adb: Likewise. (To_String): Moved to System.Generic_Bignums to allow sharing this code. * libgnat/a-nbnbre.adb (Normalize): Fix handling of Num = 0 leading to an exception.
2020-07-10[Ada] Fix crash on quantified expression in expression function (2)Eric Botcazou1-2/+3
gcc/ada/ * freeze.adb (Freeze_Expr_Types): Replace call to Find_Aspect with call to Find_Value_Of_Aspect and adjust accordingly.
2020-07-10[Ada] Fix crash on quantified expression in expression functionEric Botcazou2-0/+17
gcc/ada/ * einfo.adb (Write_Field24_Name): Handle E_Loop_Parameter. * freeze.adb (Freeze_Expr_Types): Freeze the iterator type used as Default_Iterator of the name of an N_Iterator_Specification node.
2020-07-10[Ada] Fix internal error on if-expression in call returning tagged typeEric Botcazou3-6/+34
gcc/ada/ * checks.adb (Determine_Range): Deal with Min and Max attributes. * exp_ch6.adb (Expand_Call_Helper): When generating code to pass the accessibility level to the caller in the case of an actual which is an if-expression, also remove the nodes created after the declaration of the dummy temporary. * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Use Natural as the type of the minimum accessibility level object.
2020-07-10[Ada] Fix failing assertions related to volatile objectsPiotr Trojanek3-8/+15
gcc/ada/ * sem_ch3.adb (Process_Discriminants): Set Ekind of the processed discriminant entity before passing to Is_Effectively_Volatile, which was crashing on a failed assertion. * sem_prag.adb (Analyze_External_Property_In_Decl_Part): Prevent call to No_Caching_Enabled with entities other than variables, which was crashing on a failed assertion. (Analyze_Pragma): Style cleanups. * sem_util.adb (Is_Effectively_Volatile): Enforce comment with an assertion; prevent call to No_Caching_Enabled with entities other than variables. (Is_Effectively_Volatile_Object): Only call Is_Effectively_Volatile on objects, not on types. (No_Caching_Enabled): Enforce comment with an assertion.
2020-07-10[Ada] Remove use of debug flag -gnatdF for GNATproveYannick Moy1-7/+1
gcc/ada/ * debug.adb: Update comments to free usage of -gnatdF.
2020-07-10[Ada] Reuse SPARK expansion of attribute Update for delta_aggregatePiotr Trojanek1-160/+198
gcc/ada/ * exp_spark.adb (Expand_SPARK_Delta_Or_Update): Refactored from Expand_SPARK_N_Attribute_Reference; rewrite into N_Aggregate or N_Delta_Aggregate depending on what is being rewritten. (Expand_SPARK_N_Delta_Aggregate): New routine to expand delta_aggregate. (Expand_SPARK_N_Attribute_Reference): Call the refactored routine.
2020-07-10[Ada] Fix expansion of 'Update with multiple choices in GNATprovePiotr Trojanek1-9/+57
gcc/ada/ * exp_spark.adb (Expand_SPARK_N_Attribute_Reference): Fix expansion of attribute Update.
2020-07-10[Ada] Crash in Walk_Library_Items on ghost unitsArnaud Charlet1-1/+5
gcc/ada/ * sem.adb (Walk_Library_Items): Fix handling of Ghost units.
2020-07-10fix constant folding from array CTORsRichard Biener2-2/+25
This fixes the case where we try to fold a read from an array initalizer and happen to cross the boundary of multiple CTORs which isn't really supported. For the interesting cases like the testcase we actually handle the folding by encoding the whole initializer. 2020-07-10 Richard Biener <rguenther@suse.de> PR tree-optimization/96133 * gimple-fold.c (fold_array_ctor_reference): Do not recurse to folding a CTOR that does not fully cover the asked for object. * gcc.dg/torture/pr96133.c: New testcase.
2020-07-10Initial Sapphire Rapids and Alder Lake support from ISA r40Cui,Lili12-5/+110
gcc/ * common/config/i386/cpuinfo.h (get_intel_cpu): Handle sapphirerapids. * common/config/i386/i386-common.c (processor_names): Add sapphirerapids and alderlake. (processor_alias_table): Add sapphirerapids and alderlake. * common/config/i386/i386-cpuinfo.h (processor_subtypes): Add INTEL_COREI7_ALDERLAKE and INTEL_COREI7_ALDERLAKE. * config.gcc: Add -march=sapphirerapids and alderlake. * config/i386/driver-i386.c (host_detect_local_cpu) Handle sapphirerapids and alderlake. * config/i386/i386-c.c (ix86_target_macros_internal): Handle sapphirerapids and alderlake. * config/i386/i386-options.c (m_SAPPHIRERAPIDS) : Define. (m_ALDERLAKE): Ditto. (m_CORE_AVX512) : Add m_SAPPHIRERAPIDS. (processor_cost_table): Add sapphirerapids and alderlake. (ix86_option_override_internal) Handle PTA_WAITPKG, PTA_ENQCMD, PTA_CLDEMOTE, PTA_SERIALIZE, PTA_TSXLDTRK. * config/i386/i386.h (ix86_size_cost) : Define SAPPHIRERAPIDS and ALDERLAKE. (processor_type) : Add PROCESSOR_SAPPHIRERAPIDS and PROCESSOR_ALDERLAKE. (PTA_ENQCMD): New. (PTA_CLDEMOTE): Ditto. (PTA_SERIALIZE): Ditto. (PTA_TSXLDTRK): New. (PTA_SAPPHIRERAPIDS): Ditto. (PTA_ALDERLAKE): Ditto. (processor_type) : Add PROCESSOR_SAPPHIRERAPIDS and PROCESSOR_ALDERLAKE. * doc/extend.texi: Add sapphirerapids and alderlake. * doc/invoke.texi: Add sapphirerapids and alderlake. gcc/testsuite/ * gcc.target/i386/funcspec-56.inc: Handle new march. * g++.target/i386/mv16.C: Handle new march
2020-07-10Add -fdump-profile-report.Martin Liska3-21/+30
When using -fprofile-report, -fdump-profile-report can be used to print the report to a foo.c.000i.profile-report file instead of stderr. I see it handy for comparison purpose. gcc/ChangeLog: * dumpfile.c [profile-report]: Add new profile dump. * dumpfile.h (enum tree_dump_index): Ad TDI_profile_report. * passes.c (pass_manager::dump_profile_report): Change stderr to dump_file.
2020-07-09vect: Use adjusted niters by considering peeling prologueKewen Lin1-1/+7
This patch is derived from the review of vector with length patch series. I relaxed the guard on LOOP_VINFO_PEELING_FOR_ALIGNMENT for vector with length as Richard S.'s suggestion, then encountered one failure from case gcc.dg/vect/vect-ifcvt-11.c with param vect-partial-vector-usage=2 enablement run. The root cause is that we still use the original niters for the loop body vectorization, it leads the access to go out of bound, instead we should use LOOP_VINFO_NITERS which has been adjusted in vect_do_peeling by considering the peeling number for prologue. Bootstrapped/regtested on aarch64-linux-gnu and powerpc64le-linux-gnu. gcc/ChangeLog: * tree-vect-loop.c (vect_transform_loop): Use LOOP_VINFO_NITERS which is adjusted by considering peeled prologue for non vect_use_loop_mask_for_alignment_p cases.
2020-07-10Daily bump.GCC Administrator10-1/+321
2020-07-09openacc: Set bias to zero for explicit attach/detach clauses in C and C++Julian Brown6-8/+139
This is a fix for the pointer (or array) size inadvertently being used for the bias with attach and detach mapping kinds, for both C and C++. 2020-07-09 Julian Brown <julian@codesourcery.com> Thomas Schwinge <thomas@codesourcery.com> gcc/c/ PR middle-end/95270 * c-typeck.c (c_finish_omp_clauses): Set OMP_CLAUSE_SIZE (bias) to zero for standalone attach/detach clauses. gcc/cp/ PR middle-end/95270 * semantics.c (finish_omp_clauses): Likewise. include/ PR middle-end/95270 * gomp-constants.h (gomp_map_kind): Expand comment for attach/detach mapping kinds. gcc/testsuite/ PR middle-end/95270 * c-c++-common/goacc/mdc-1.c: Update expected dump output for zero bias. libgomp/ PR middle-end/95270 * testsuite/libgomp.oacc-c-c++-common/pr95270-1.c: New test. * testsuite/libgomp.oacc-c-c++-common/pr95270-2.c: New test.
2020-07-09openacc: GOMP_MAP_ATTACH handling in find_group_lastJulian Brown2-4/+23
Arrange for GOMP_MAP_ATTACH to be grouped together with a preceding GOMP_MAP_TO_PSET or other "to" data movement clause, except in cases where an explicit "attach" clause is used. 2020-07-09 Julian Brown <julian@codesourcery.com> include/ * gomp-constants.h (gomp_map_kind): Update comment for GOMP_MAP_TO_PSET. libgomp/ * oacc-mem.c (find_group_last): Group data-movement clauses (GOMP_MAP_TO_PSET, GOMP_MAP_TO, etc.) together with a subsequent GOMP_MAP_ATTACH. Allow standalone GOMP_MAP_ATTACH also.
2020-07-09openacc: Fortran derived-type mapping fixJulian Brown3-2/+34
Fix a bug with mapping Fortran components which themselves have derived types in the OpenACC 2.5+ manual deep-copy support. 2020-07-09 Julian Brown <julian@codesourcery.com> gcc/fortran/ * trans-openmp.c (gfc_trans_omp_clauses): Use 'inner' not 'decl' for derived type members which themselves have derived types. gcc/testsuite/ * gfortran.dg/goacc/mapping-tests-3.f90: New test. * gfortran.dg/goacc/mapping-tests-4.f90: New test.
2020-07-09rs6000: Allow MMA built-in initialization regardless of compiler optionsPeter Bergner3-14/+58
Built-in initialization occurs only once and fairly early, when the command line options are in force. If the -mcpu=<CPU> is pre-power10, then we fail to initialize the MMA built-ins, so they are not available to call in a #pragma target/attribute target function. The fix is to basically always (on server type cpus) initialize the MMA built-ins so we can use them in #pragma target/attribute target functions. 2020-07-09 Peter Bergner <bergner@linux.ibm.com> gcc/ PR target/96125 * config/rs6000/rs6000-call.c (rs6000_init_builtins): Define the MMA specific types __vector_quad and __vector_pair, and initialize the MMA built-ins if TARGET_EXTRA_BUILTINS is set. (mma_init_builtins): Don't test for mask set in rs6000_builtin_mask. Remove now unneeded mask variable. * config/rs6000/rs6000.c (rs6000_option_override_internal): Add the OPTION_MASK_MMA flag for power10 if not already set. gcc/testsuite/ PR target/96125 * gcc.target/powerpc/pr96125.c: New test.
2020-07-09fixup BIT_FIELD_REF detection in SLP discoveryRichard Biener1-19/+21
This fixes a thinko where we end up combining a BIT_FIELD_REF and a memory access, fixed by checking all stmts are a load or none. 2020-07-09 Richard Biener <rguenther@suse.de> PR tree-optimization/96133 * tree-vect-slp.c (vect_build_slp_tree_1): Compare load_p status between stmts.
2020-07-09c++: Partially revert fix for PR c++/95497 [PR96132]Patrick Palka2-0/+10
I was mistaken to assume that a dependent type is necessarily incomplete, and indeed there are multiple places in the frontend where we check a type for both dependency and completeness. So this patch partially reverts the fix for PR95497, restoring the dependent_type_p check that guarded the call to is_really_empty_class below. gcc/cp/ChangeLog: PR c++/96132 * constexpr.c (potential_constant_expression_1) <case PARM_DECL>: Restore dependent_type_p check that guarded the call to is_really_empty_class. gcc/testsuite/ChangeLog: PR c++/96132 * g++.dg/template/incomplete12.C: New test.
2020-07-09x86: Enable FMA in rsqrt<mode>2 expanderH.J. Lu4-19/+42
Enable FMA in rsqrt<mode>2 expander and fold rsqrtv16sf2 expander into rsqrt<mode>2 expander which expands to UNSPEC_RSQRT28 for TARGET_AVX512ER. Although it doesn't show performance change in our workloads, FMA can improve other workloads. gcc/ PR target/88713 * config/i386/i386-expand.c (ix86_emit_swsqrtsf): Enable FMA. * config/i386/sse.md (VF_AVX512VL_VF1_128_256): New. (rsqrt<mode>2): Replace VF1_128_256 with VF_AVX512VL_VF1_128_256. (rsqrtv16sf2): Removed. gcc/testsuite/ PR target/88713 * gcc.target/i386/pr88713-1.c: New test. * gcc.target/i386/pr88713-2.c: Likewise.
2020-07-09remove premature vect_verify_datarefs_alignmentRichard Biener8-89/+28
This followup removes vect_verify_datarefs_alignment and its premature cancellation of vectorization leaving the actual decision whether alignment is supported to the functions deciding whether we can vectorize a load or store. 2020-07-08 Richard Biener <rguenther@suse.de> * tree-vectorizer.h (vect_verify_datarefs_alignment): Remove. (vect_slp_analyze_and_verify_instance_alignment): Rename to ... (vect_slp_analyze_instance_alignment): ... this. * tree-vect-data-refs.c (verify_data_ref_alignment): Remove. (vect_verify_datarefs_alignment): Likewise. (vect_enhance_data_refs_alignment): Do not call vect_verify_datarefs_alignment. (vect_slp_analyze_node_alignment): Rename from vect_slp_analyze_and_verify_node_alignment and do not call verify_data_ref_alignment. (vect_slp_analyze_instance_alignment): Rename from vect_slp_analyze_and_verify_instance_alignment. * tree-vect-stmts.c (vectorizable_store): Dump when we vectorize an unaligned access. (vectorizable_load): Likewise. * tree-vect-loop.c (vect_analyze_loop_2): Do not call vect_verify_datarefs_alignment. * tree-vect-slp.c (vect_slp_analyze_bb_1): Adjust. * gcc.dg/vect/bb-slp-10.c: Adjust. * gcc.dg/vect/slp-45.c: Likewise. * gcc.dg/vect/vect-109.c: Likewise.
2020-07-09Schedule reduction partition in the last.Bin Cheng2-3/+36
If reduction partition's SCC is broken by runtime alias checks, force a negative post order to it so that it will be scheduled in the last. 2020-07-09 Bin Cheng <bin.cheng@linux.alibaba.com> gcc/ PR tree-optimization/95804 * tree-loop-distribution.c (break_alias_scc_partitions): Force negative post order to reduction partition. gcc/testsuite/ PR tree-optimization/95804 * gcc.dg/tree-ssa/pr95804.c: New test.