aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2020-10-12Daily bump.GCC Administrator5-1/+174
2020-10-11import elementary functions as intrinsicsAlexandre Oliva4-50/+50
Importing them as intrinsics enables GCC to treat them as builtins whose behavior is known by GCC. Specifically, if they aren't intrinsics, calls to Sin and Cos won't be combined into sincos. We still need to make Sin and Cos wrappers inline in user-exposed interfaces to get users the benefit of this transformation. That is forthcoming in a separate patch. for gcc/ada/ChangeLog * libgnat/a-numaux.ads: Make all imports Intrinsic. * libgnat/a-numaux__darwin.ads: Likewise. * libgnat/a-numaux__libc-x86.ads: Likewise. * libgnat/a-numaux__vxworks.ads: Likewise.
2020-10-11Objective-C, Darwin : Make protocols private extern and weak.Iain Sandoe1-9/+27
Newer linkers want protocols to be private-extern and weak. This is conditional on the runtime version. gcc/objc/ChangeLog: * objc-next-runtime-abi-02.c (create_global_decl): Update to allow the caller to specify declaration or definition. (create_hidden_decl): Likewise. (next_runtime_abi_02_protocol_decl): Make the symbol weak and hidden for later OS runtime versions. (build_v2_protocol_list_address_table): Likewise.
2020-10-11Objective-C++ : Fix bitfield ivars.Iain Sandoe1-6/+1
This fixes a regression present from 8.x; It used to be OK to test for a DECL_INITIAL value to flag that an ivar was a bitfield (the initial value was the width). This still works on C / Objective-C, but no longer on C++. Replace the test with DECL_C_BIT_FIELD() which is set for both C and C++. gcc/objc/ChangeLog: * objc-next-runtime-abi-02.c (objc_v2_build_ivar_ref): Test DECL_C_BIT_FIELD to detect that an ivar is a bitfield.
2020-10-11testsuite, Objective-c++ : Update diagnostic plugin test.Iain Sandoe1-10/+23
The @selector() and @protocol() operators produce var decls these do not work with the example plugin. Unfortunatetely, unlike the ObjC front end, it is not so easy to construct a substitute expression that works reliably. Where it does not work we xfail for now. gcc/testsuite/ChangeLog: * obj-c++.dg/plugin/diagnostic-test-expressions-1.mm: Adjust testcase to include expressions for @selector and @protocol. XFAIL where this is still not sufficient to obtain a disgnostic range.
2020-10-11testsuite, objective-c++ : Add a dummy retain/release to testuite object.Iain Sandoe2-0/+16
On newer systems, the throw/catch process sends retain and release messages to thrown objects. While these are not needed in the testsuite cases, they cause the tests to fail because the selector is not handled. Add dummy methods to the testsuite object. gcc/testsuite/ChangeLog: * objc-obj-c++-shared/TestsuiteObject.h: Add dummy retain and release method declarations. * objc-obj-c++-shared/TestsuiteObject.m: Add dummy retain and release implementations.
2020-10-11testsuite, objective-c++ : GC is not available from Darwin16.Iain Sandoe1-1/+1
Update the dg-skip to cover newer systems. gcc/testsuite/ChangeLog: * obj-c++.dg/objc-gc-3.mm:i Skip for Darwin >= 16.
2020-10-11testsuite, Objective-C++ : Skip an ancient test on newer systems.Iain Sandoe1-2/+2
This test contains elements incompatible with modern Objective-C headers, it is only of relevance to Darwin8 or potentially on systems with SDKs that could target Darwin8, so skip it on newer systems. gcc/testsuite/ChangeLog: * obj-c++.dg/cxx-ivars-3.mm: Skip for macOS >= 10.7.
2020-10-11testsuite, Objective-c++ : Fix GNU API tests to work with NeXT where possible.Iain Sandoe3-2/+8
The version 2 GNU Objective C API is mostly compatible with the NeXT one. However, there are a few testsuite tweaks needed (and one test fails for NeXT without considerable increase in complexity). gcc/testsuite/ChangeLog: * obj-c++.dg/gnu-api-2-class-meta.mm: Add a flag to cause NeXT headers to expose prototypes for messaging. * obj-c++.dg/gnu-api-2-class.mm: Likewise. * obj-c++.dg/gnu-api-2-objc.mm: Skip this because of the extra protocols pulled in by system headers.
2020-10-11testsuite, Objective-C : Fix two plugin diagnostics tests for Darwin.Iain Sandoe1-6/+19
The @selector and @protocol keywords produce a var decl without useful location information. The current diagnostics plugin does not look at VAR_DECLs (and it would not be helpful if it did in this case, since a single decl is shared across all the users). However, ee can, in this case, make expressions that produce useful information. gcc/testsuite/ChangeLog: * objc.dg/plugin/diagnostic-test-expressions-1.m: Use assignment expressions for @selector and @protocol to obtain a useful diagnostic range.
2020-10-11testsuite, Objective-C : Fix call-super-2.m for newer NeXT headers.Iain Sandoe1-1/+5
We were using a callout to runtime.h which, eventually brings in the system runtime.h. One newer versions of the Darwin/NeXT headers this declares the objc_getClass() function as returning Class, rather than the internal representation of that. This breaks a fragile assumption in objc-act that the use of these internal functions can be deduced by looking at the function type. Ultimately, the fragility should be fixed - but this fixes up the test so that it only uses the compiler's forward declaration of the function. gcc/testsuite/ChangeLog: * objc.dg/call-super-2.m: Remove inclusion of runtime.h. Add a FIXME about the test portability.
2020-10-11testsuite, Objective-C : Update forward-1.m.Iain Sandoe1-4/+42
Newer versions of the runtime / NSObject don't respond to forward:. This uses the replacement. gcc/testsuite/ChangeLog: * objc.dg/torture/forward-1.m: Implement forwarding using the native NeXT (NSInvocation) method for Darwin.
2020-10-11testsuite, Objective-C : Add initialize method to root class.Iain Sandoe1-0/+6
Older versions of the runtime don't like it when the root class has a missing initialize method. They try to forward to an non- existent super class resulting in a crash. TODO: maybe we can diagnose this. gcc/testsuite/ChangeLog: * objc.dg/ivar-scope-4.m: Add inititialize method to the root class.
2020-10-11testsuite, Objective-C : Adjust gnu-api tests for Darwin.Iain Sandoe3-3/+12
The GNU v2 API matches the next v2 API in most respects. However, some of the tests depend on access to items that the later NeXT headers consider to be 'internal implementation details' and are not exposed (we arrange that with a DEFINE). One test is skipped here because, although it works internally, the number of objects returned is larger for the NeXT runtime in some cases (where the headers have been updated to bring in more of the system details). gcc/testsuite/ChangeLog: * objc.dg/gnu-api-2-class-meta.m: Add a flag to cause NeXT headers to expose prototypes for messaging. Mark the root class if the objc_root_class attribute is available. Use char ** as the second arg to main. * objc.dg/gnu-api-2-class.m: Use dispatch prototype. * objc.dg/gnu-api-2-objc.m: Skip on NeXT because of extra prototypes pulled in by headers.
2020-10-11testsuite, Objective-C : Update a test for newer OS versions.Iain Sandoe1-1/+1
Objective-C GC is not available for any recent Darwin version, nor is it available for the upcoming release of Darwin20. gcc/testsuite/ChangeLog: * objc.dg/objc-gc-4.m: Disable for macOS 10.15 and 11.x.
2020-10-11testsuite, Objective-C : Compatibility fixes.Iain Sandoe3-1/+6
Changes to deal with warnings and/or errors seen when compiling the tests with clang. gcc/testsuite/ChangeLog: * objc-obj-c++-shared/TestsuiteObject.h: If the compiler supports objc_root_object attributes, then mark the testsuite object accordingly. * objc-obj-c++-shared/TestsuiteObject.m: Avoid direct access to isa, which is an error for modern Objective-C. * objc/execute/class-tests-1.h: Declare a string function we use locally (avoid pulling in the whole of string.h).
2020-10-11Darwin, Objective-C : Adjust objective-c symbol linkage with version.Iain Sandoe2-7/+34
Earlier linkers cannot handle publicly-visible (or linker-visible) metadata, so we need to make the output of these conditional on version. gcc/ChangeLog: * config/darwin.c (darwin_globalize_label): Make a subset of metadate symbols global. (darwin_label_is_anonymous_local_objc_name): Make a subset of metadata symbols linker-visible. (darwin_override_options): Track more target OS versions, make the next_runtime version track this (unless it's set to 0 for GNU runtime). gcc/objc/ChangeLog: * objc-next-runtime-abi-02.c (FIXUP_NEEDED): Rename ... (USE_FIXUP_BEFORE): ... to this. (next_runtime_02_initialize): Likewise. (next_runtime_abi_02_get_arg_type_list_base): Likewise. (next_runtime_abi_02_build_objc_method_call): Likewise.
2020-10-11Darwin, Objective-C : Update meta-data linkage.Iain Sandoe1-1/+42
Newer versions of ld64 require that some meta-data symbols are global, and that a larger set are linker-visible. gcc/ChangeLog: * config/darwin.c (darwin_globalize_label): Add protocol meta-data labels to the set that are global. (darwin_label_is_anonymous_local_objc_name): Arrange for meta- data start labels to be linker-visible.
2020-10-11Objective-C, Darwin : Update message call codegen.Iain Sandoe1-46/+187
Platform compilers based on LLVM do not use the objc_sendMsg_fixit and friends for newer editions of the OS (runtimes for Arm64 do not even have those entries). We need to arrange to allow for this codegen on modern Darwin. The _fixit versions are needed for some OS versions (at least, up to 10.6) since the super2 call is not implemented there. It does not seem worth making the codegen more fine-grained at present. Other parts of the codegen need to be made conditional on either the runtime version or the linker capabilities. gcc/objc/ChangeLog: * objc-next-runtime-abi-02.c (TAG_MSGSENDSUPER): Revised spelling. (TAG_MSGSENDID): Likewise. (TAG_MSGSENDSUPER_STRET): Likewise. (TAG_MSGSENDID_STRET): Likewise. (FIXUP_NEEDED): Likewise. (TAG_FIXUP): New. (next_runtime_02_initialize): Adjust message calls to use fixup variants only when required. (next_runtime_abi_02_get_arg_type_list_base): Correct indent. (build_v2_build_objc_method_call): New. (build_v2_objc_method_fixup_call): Split out from ... (next_runtime_abi_02_build_objc_method_call): ... here. Arrange to adjust the call on the basis of the target runtime.
2020-10-11Objective-C, Darwin : Revise the runtime selection options.Iain Sandoe2-3/+3
For the NeXT/Darwin runtime as installed on macOS, we now need to deal with changes in ABI and APIs over the range of system versions supported. For the first phase of these changes, we will make the existing flag_next_runtime carry a value that represents the target OS version. It might be necessary to extend the value to represent the ABI ('fragile', V1/V2) or the linker capabilities (some changes to the linker-visible and public symbols are dependent on linker version). TODO: arrange to set the default NEXT_OBJC_RUNTIME on the basis of the configured target version. gcc/ChangeLog: * config/darwin.c (darwin_objc2_section): Allow for values > 1 to represent the next runtime. (darwin_objc1_section): Likewise. * config/darwin.h (NEXT_OBJC_RUNTIME): Set the default next runtime value to be 10.5.8.
2020-10-11Objective-C++, Darwin : Make metadata 'extern "C"'.Iain Sandoe1-3/+6
For current system toolchains NeXT runtime metadata symbols are not mangled for Objective-C++ (i.e. they are considered to be 'extern "C"'). This change becomes essential when we start to emit metadata refs as hidden and weak which is required by later editions of the runtime and linkers. gcc/objc/ChangeLog: * objc-runtime-shared-support.c (start_var_decl): Make the decl_assembler_name follow the metadata name for C++ on NeXT runtime platforms.
2020-10-11Ojective-C, Darwin : Adjust category superclass ref names (NFC).Iain Sandoe1-3/+3
Make the order of the class and superclass match the metadata order from clang. Makes it easier to compare produced meta- data between implementations. gcc/objc/ChangeLog: * objc-next-runtime-abi-02.c (next_runtime_abi_02_category_decl): Adjust category superclass name ordering.
2020-10-11Objective-C, Darwin : Update protocol metadata to current version.Iain Sandoe1-16/+87
Later versions of the NeXT runtime protocol metadata contain additional fields. This patch adds these fields and populates a new list of method types. gcc/objc/ChangeLog: * objc-next-runtime-abi-02.c (build_v2_super_template): Add new fields to the template. (build_v2_protocol_template): Build new field entries. (generate_v2_meth_descriptor_table): Adjust to allow recording all method types. (generate_v2_meth_type_list): New. (build_v2_protocol_initializer): Initialize the additional fields. (generate_v2_protocols): Record method types for all entries and generate the additional method type table.
2020-10-11Daily bump.GCC Administrator4-1/+124
2020-10-11Fix parameter map computation in ipa-modrefJan Hubicka1-1/+1
* ipa-modref.c (modref_transform): Fix parameter map computation.
2020-10-10[nvptx] Replace dots in function namesTom de Vries1-3/+54
When function splitting clones a function sinf in the host compiler, the clone is callled sinf.part.0. However, ptx does not allows dots in identifiers, so we run into: ... ptxas test.o, line 23; fatal : Parsing error near '.part': syntax error ptxas fatal : Ptx assembly aborted due to errors nvptx-as: ptxas returned 255 exit status ... Rename such functions by replacing the dots with dollar signs. Tested check-gcc on nvptx. Tested libgomp on x86_64-linux with nvptx accelerator. gcc/ChangeLog: 2020-10-10 Tom de Vries <tdevries@suse.de> PR target/97318 * config/nvptx/nvptx.c (nvptx_replace_dot): New function. (write_fn_proto, write_fn_proto_from_insn, nvptx_output_call_insn): Use nvptx_replace_dot.
2020-10-10[nvptx] Factor out write_fn_proto_1Tom de Vries1-19/+23
Factor out write_fn_proto_1 from write_fn_proto. Tested check-gcc on nvptx. Tested libgomp on x86_64-linux with nvptx accelerator. gcc/ChangeLog: 2020-10-10 Tom de Vries <tdevries@suse.de> * config/nvptx/nvptx.c (write_fn_proto_1): New function, factored out of ... (write_fn_proto): ... here. Return void.
2020-10-10Fix ICE in remap_arguments with removed parameters.Jan Hubicka1-1/+6
* ipa-modref.c (remap_arguments): Check range in map access.
2020-10-10Fix modref_transform ICE with more than 32 parameters.Jan Hubicka1-1/+1
* ipa-modref.c (modref_transform): Use reserve instead of safe_grow.
2020-10-10Fix ipa-modref ICE with not allocated summaries.Jan Hubicka1-1/+1
* ipa-modref.c (modref_transform): Check that summaries are allocated.
2020-10-10Fix modref handling of parameter adjustments and jump functions.Jan Hubicka2-10/+92
* ipa-modref-tree.h (struct modref_tree): Revert prevoius change. * ipa-modref.c (analyze_function): Dump original summary. (modref_read): Only set IPA if streaming summary (not optimization summary). (remap_arguments): New function. (modref_transform): New function. (compute_parm_map): Fix offset calculation. (ipa_merge_modref_summary_after_inlining): Do not merge stores when they can be ignored.
2020-10-10Improve tree-ssa-alias dump files.Jan Hubicka1-12/+32
* tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Improve debug dumps. (call_may_clobber_ref_p_1): Improve debug dumps.
2020-10-10Objective-C, Darwin : Pick up super refs directly.Iain Sandoe1-38/+38
The current code assumed that super refs could be computed indirectly, i.e. that the metadata generated by the compiler was immutable by the runtime. This does not always hold (it depends on the NeXT runtime version). So, compute super refs directly. gcc/objc/ChangeLog: * objc-next-runtime-abi-02.c (objc_get_superclass_ref_decl): Split this code out. (next_runtime_abi_02_get_class_super_ref): Compute super refs using the objc_get_superclass_ref_decl(). (next_runtime_abi_02_get_category_super_ref): Likewise.
2020-10-10Darwin : Only emit Objective-C section switches for older linkers.Iain Sandoe1-3/+4
At one time, the system linkers needed to have at least a dummy entry for every Objective-C section in use. This removes the extra emitted code when it is not needed by the linker. gcc/ChangeLog: * config/darwin.c (output_objc_section_asm_op): Avoid extra objective-c section switches unless the linker needs them.
2020-10-10Objective-C, Darwin : Update metadata section uses.Iain Sandoe3-2/+12
Newer versions of ld64 are more picky about adherence to placement rules for objective c metadata. This adds protocol refs and uses the ivar refs for all targets. gcc/ChangeLog: * config/darwin-sections.def (objc2_data_section): New. (objc2_ivar_section): New. * config/darwin.c (darwin_objc2_section): Act on Protocol and ivar refs. gcc/objc/ChangeLog: * objc-next-runtime-abi-02.c (next_runtime_abi_02_init_metadata_attributes): Make protocol refs a distinct section.
2020-10-10Objective-C, Darwin : Use special string sections for V2 NeXT runtime.Iain Sandoe3-3/+23
Newer versions of the runtime expect to find strings for class, method and method types in set-aside sections rather than the general c_strings one. gcc/ChangeLog: * config/darwin-sections.def (objc2_class_names_section, objc2_method_names_section, objc2_method_types_section): New * config/darwin.c (output_objc_section_asm_op): Output new sections. (darwin_objc2_section): Select new sections where used. gcc/objc/ChangeLog: * objc-next-runtime-abi-02.c (next_runtime_abi_02_init_metadata_attributes): Attach metadata for the special string sections to class, method and method type string sections.
2020-10-10Objective-C: Addess a FIXME (NFC).Iain Sandoe1-26/+6
This removes references to the next runtime from the gnu runtime implementation. gcc/objc/ChangeLog: * objc-gnu-runtime-abi-01.c (build_shared_structure_initializer): Remove references to the NeXT runtime. (generate_static_references): Likewise.
2020-10-10Darwin : Begin rework of zero-fill sections.Iain Sandoe2-51/+33
Much of the existing work in the Darwin BSS and common sections was to accommodate the PowerPC section anchors. We want to segregate this, since it might become desirable to support section anchors for arm64. First revision (here) is to use the same section conventions as the Xcode toochains for BSS and COMMON. We also drop the constraint about putting small items into data/static data that was a work-around for Java issues (irrelevant for several editions). gcc/ChangeLog: * config/darwin.c (darwin_emit_local_bss): Amend section names to match system tools. (darwin_output_aligned_bss): Likewise. gcc/testsuite/ChangeLog: * gcc.dg/darwin-sections.c: Adjust test for renamed BSS and common sections. Cater for 64 and 128 bit long doubles.
2020-10-10x86-64: Check CMPXCHG16B for x86-64-v[234]H.J. Lu3-0/+9
x86-64-v2 includes CMPXCHG16B. Since -mcx16 enables CMPXCHG16B and defines __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16, check it in x86-64-v[234] tests. PR target/97250 * gcc.target/i386/x86-64-v2.c: Verify that __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 is defined. * gcc.target/i386/x86-64-v3.c: Likewise. * gcc.target/i386/x86-64-v4.c: Likewise.
2020-10-10PR97359: Do not cache relops in GORI cache.Aldy Hernandez2-8/+13
logical_stmt_cache::cacheable_p() returns true for relops, but logical_combine (which does the caching) doesn't handle them and ICEs. This patch fixes the inconsistency by returning false for relops. This was working before because even though logical_combine doesn't handle relops, statements with only one SSA are handled in cache_stmt, which seems like the only statement we've ever encountered (even through a full Fedora build). lhs = s_5 > 999; However, with two SSA operands we ICE because logical_combine doesn't handle them: lhs = s_5 > y_8; We can either return false for relops in cacheable_p, or fix logical_combine to handle them. The original idea was to only cache ANDs and ORs, so I've done the former to unbreak trunk. We can decide later if there was ever any benefit in caching relops. gcc/ChangeLog: PR tree-optimization/97359 * gimple-range-gori.cc (logical_stmt_cache::cacheable_p): Only handle ANDs and ORs. (gori_compute_cache::cache_stmt): Adjust comment. gcc/testsuite/ChangeLog: * gcc.dg/pr97359.c: New test.
2020-10-10Daily bump.GCC Administrator3-1/+208
2020-10-09Don't keep strict_low_part in reloads for non-registers. [PR97313]Vladimir N. Makarov2-1/+30
gcc/ChangeLog: 2020-10-09 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimization/97313 * lra-constraints.c (match_reload): Don't keep strict_low_part in reloads for non-registers. gcc/testsuite/ChangeLog: 2020-10-09 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimization/97313 * gcc.target/i386/pr97313.c: New.
2020-10-09x86: Add <x86gprintrin.h>H.J. Lu41-272/+463
For sources which can't use any vector instructions, <x86intrin.h> and <immintrin.h> cannot be included for compiler intrinsics: $ echo "#include <x86intrin.h>" | gcc -S -O2 -mno-sse -mno-mmx -x c - In file included from /usr/include/stdlib.h:1013, from /usr/lib/gcc/x86_64-redhat-linux/10/include/mm_malloc.h:27, from /usr/lib/gcc/x86_64-redhat-linux/10/include/xmmintrin.h:34, from /usr/lib/gcc/x86_64-redhat-linux/10/include/immintrin.h:29, from /usr/lib/gcc/x86_64-redhat-linux/10/include/x86intrin.h:32, from <stdin>:1: /usr/include/bits/stdlib-float.h: In function ‘atof’: /usr/include/bits/stdlib-float.h:26:1: error: SSE register return with SSE disabled 26 | { | ^ $ libgcc/config/i386/shadow-stack-unwind.h has a workaround: /* NB: We need _get_ssp and _inc_ssp from <cetintrin.h>. But we can't include <x86intrin.h> which ends up including <mm_malloc.h>, which includes <stdlib.h> and <errno.h> unconditionally. But we can't include any libc system headers unconditionally from libgcc. Avoid including <mm_malloc.h> here by defining _IMMINTRIN_H_INCLUDED. */ #define _IMMINTRIN_H_INCLUDED #include <cetintrin.h> #undef _IMMINTRIN_H_INCLUDED Add a standalone intrinsic header file, <x86gprintrin.h>, to provide integer only intrinsics. All integer only intrinsics are placed in <x86gprintrin.h>. <x86intrin.h> and <immintrin.h> simply include <x86gprintrin.h>. gcc/ PR target/97148 * config.gcc (extra_headers): Add x86gprintrin.h. * config/i386/adxintrin.h: Check _X86GPRINTRIN_H_INCLUDED for <x86gprintrin.h>. * config/i386/bmi2intrin.h: Likewise. * config/i386/bmiintrin.h: Likewise. * config/i386/cetintrin.h: Likewise. * config/i386/cldemoteintrin.h: Likewise. * config/i386/clflushoptintrin.h: Likewise. * config/i386/clwbintrin.h: Likewise. * config/i386/enqcmdintrin.h: Likewise. * config/i386/fxsrintrin.h: Likewise. * config/i386/ia32intrin.h: Likewise. * config/i386/lwpintrin.h: Likewise. * config/i386/lzcntintrin.h: Likewise. * config/i386/movdirintrin.h: Likewise. * config/i386/pconfigintrin.h: Likewise. * config/i386/pkuintrin.h: Likewise. * config/i386/rdseedintrin.h: Likewise. * config/i386/rtmintrin.h: Likewise. * config/i386/serializeintrin.h: Likewise. * config/i386/tbmintrin.h: Likewise. * config/i386/tsxldtrkintrin.h: Likewise. * config/i386/waitpkgintrin.h: Likewise. * config/i386/wbnoinvdintrin.h: Likewise. * config/i386/xsavecintrin.h: Likewise. * config/i386/xsaveintrin.h: Likewise. * config/i386/xsaveoptintrin.h: Likewise. * config/i386/xsavesintrin.h: Likewise. * config/i386/xtestintrin.h: Likewise. * config/i386/immintrin.h: Include <x86gprintrin.h> instead of <fxsrintrin.h>, <xsaveintrin.h>, <xsaveoptintrin.h>, <xsavesintrin.h>, <xsavecintrin.h>, <lzcntintrin.h>, <bmiintrin.h>, <bmi2intrin.h>, <xtestintrin.h>, <cetintrin.h>, <movdirintrin.h>, <sgxintrin.h, <pconfigintrin.h>, <waitpkgintrin.h>, <cldemoteintrin.h>, <enqcmdintrin.h>, <serializeintrin.h>, <tsxldtrkintrin.h>, <adxintrin.h>, <clwbintrin.h>, <clflushoptintrin.h>, <wbnoinvdintrin.h> and <pkuintrin.h>. (_wbinvd): Moved to config/i386/x86gprintrin.h. (_rdrand16_step): Likewise. (_rdrand32_step): Likewise. (_rdpid_u32): Likewise. (_readfsbase_u32): Likewise. (_readfsbase_u64): Likewise. (_readgsbase_u32): Likewise. (_readgsbase_u64): Likewise. (_writefsbase_u32): Likewise. (_writefsbase_u64): Likewise. (_writegsbase_u32): Likewise. (_writegsbase_u64): Likewise. (_rdrand64_step): Likewise. (_ptwrite64): Likewise. (_ptwrite32): Likewise. * config/i386/x86gprintrin.h: New file. * config/i386/x86intrin.h: Include <x86gprintrin.h>. Don't include <ia32intrin.h>, <lwpintrin.h>, <tbmintrin.h>, <popcntintrin.h>, <mwaitxintrin.h> and <clzerointrin.h>. gcc/testsuite/ * gcc.target/i386/avx-1.c (__builtin_ia32_lwpval32): New to support <lwpintrin.h> included in <x86gprintrin.h>. (__builtin_ia32_lwpval64): Likewise. (__builtin_ia32_lwpins32): Likewise. (__builtin_ia32_lwpins64): Likewise. (__builtin_ia32_bextri_u32): New to support <tbmintrin.h> included in <x86gprintrin.h>. (__builtin_ia32_bextri_u64): Likewise. * gcc.target/i386/x86gprintrin-1.c: New test. * gcc.target/i386/x86gprintrin-2.c: Likewise. * gcc.target/i386/x86gprintrin-3.c: Likewise. * gcc.target/i386/x86gprintrin-4.c: Likewise. * gcc.target/i386/x86gprintrin-4a.c: Likewise. * gcc.target/i386/x86gprintrin-5.c: Likewise. * gcc.target/i386/x86gprintrin-5a.c: Likewise. * gcc.target/i386/x86gprintrin-5b.c: Likewise. * gcc.target/i386/x86gprintrin-6.c: Likewise. libgcc/ PR target/97148 * config/i386/shadow-stack-unwind.h: Include <x86gprintrin.h> instead of <cetintrin.h>.
2020-10-09[nvptx] Set -misa=sm_35 by defaultTom de Vries2-2/+6
The nvptx-as assembler verifies the ptx code using ptxas, if there's any in the PATH. The default in the nvptx port for -misa=sm_xx is sm_30, but the ptxas of the latest cuda release (11.1) no longer supports sm_30. Consequently we cannot build gcc against that release (although we should still be able to build without any cuda release). Fix this by setting -misa=sm_35 by default. Tested check-gcc on nvptx. Tested libgomp on x86_64-linux with nvpx accelerator. Both build again cuda 9.1. gcc/ChangeLog: 2020-10-09 Tom de Vries <tdevries@suse.de> PR target/97348 * config/nvptx/nvptx.h (ASM_SPEC): Also pass -m to nvptx-as if default is used. * config/nvptx/nvptx.opt (misa): Init with PTX_ISA_SM35.
2020-10-09Fixup gcc.dg/vect/pr65947-3.c when masked loads are availableRichard Biener3-4/+16
The following adds a effective target to properly allow the gcc.dg/vect/pr65947-3.c expected vectorization to be adjusted when run with, say, -march=cascadelake. 2020-10-09 Richard Biener <rguenther@suse.de> gcc/ * doc/sourcebuild.texi (vect_masked_load): Document. gcc/testsuite * lib/target-supports.exp (check_effective_target_vect_masked_load): New effective target. * gcc.dg/vect/pr65947-3.c: Update.
2020-10-09tree-optimization/97334 - improve BB SLP discoveryRichard Biener2-0/+25
We're running into a multiplication with one unvectorizable operand we expect to build from scalars but SLP discovery fatally fails the build of both since one stmt is commutated: _60 = _58 * _59; _63 = _59 * _62; _66 = _59 * _65; ... where _59 is the "bad" operand. The following patch makes the case work where the first stmt has a good operand by not fatally failing the SLP build for the operand but communicating upwards how to commutate. 2020-10-09 Richard Biener <rguenther@suse.de> PR tree-optimization/97334 * tree-vect-slp.c (vect_build_slp_tree_1): Do not fatally fail lanes other than zero when BB vectorizing. * gcc.dg/vect/bb-slp-pr65935.c: Amend.
2020-10-09IPA modref: fix miscompilation in clone when IPA modref is usedJan Hubicka1-1/+2
gcc/ChangeLog: PR ipa/97292 PR ipa/97335 * ipa-modref-tree.h (copy_from): Drop summary in a clone.
2020-10-09tree-optimization/97347 - fix another SLP constant insertion issueRichard Biener2-6/+54
Just use edge insertion which will appropriately handle the situation from botan. 2020-10-09 Richard Biener <rguenther@suse.de> PR tree-optimization/97347 * tree-vect-slp.c (vect_create_constant_vectors): Use edge insertion when inserting on the fallthru edge, appropriately insert at the start of BBs when inserting after PHIs. * g++.dg/vect/pr97347.cc: New testcase.
2020-10-09Fix for PR97317.Andrew MacLeod2-7/+29
gcc/ChangeLog: PR tree-optimization/97317 * range-op.cc (operator_cast::op1_range): Handle casts where the precision of the RHS is only 1 greater than the precision of the LHS. gcc/testsuite/ChangeLog: * gcc.dg/pr97317.c: New test.
2020-10-09random memory leak fixesRichard Biener6-13/+30
This fixes leaks discovered checking whether I introduced new ones with the last vectorizer changes. 2020-10-09 Richard Biener <rguenther@suse.de> * cgraphunit.c (expand_all_functions): Free tp_first_run_order. * ipa-modref.c (pass_ipa_modref::execute): Free order. * tree-ssa-loop-niter.c (estimate_numbers_of_iterations): Free loop body. * tree-vect-data-refs.c (vect_find_stmt_data_reference): Free data references upon failure. * tree-vect-loop.c (update_epilogue_loop_vinfo): Free BBs array of the original loop. * tree-vect-slp.c (vect_slp_bbs): Use an auto_vec for dataref_groups to release its memory.