aboutsummaryrefslogtreecommitdiff
path: root/gcc
AgeCommit message (Collapse)AuthorFilesLines
2024-04-24testsuite,objective-c++: Fix imported NSObjCRuntime.h.Iain Sandoe1-0/+3
We have imported some headers from the GNUStep project to allow us to maintain the testsuite independent to changing versions of system headers. One of these headers has a macro that (now we have support for __has_feature) expands to a declaration that triggers a warning. These headers are considered part of the implementation so that, in this case, we can suppress the warning with the system_header pragma. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/testsuite/ChangeLog: * objc-obj-c++-shared/GNUStep/Foundation/NSObjCRuntime.h: Make this header use pragma system_header. (cherry picked from commit d83e0e3bc375a05844438d28c9a4ab24c5401eb9)
2024-04-24testsuite, objective-c: Cater for Windows intptr type.Iain Sandoe1-3/+3
This adjusts the diagnostic output matches to cater for the differences in intptr types on Windows. Patch from 'nightstrike'. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/testsuite/ChangeLog: * objc.dg/proto-lossage-4.m: Amendn diagnostic matches for Windows. (cherry picked from commit 07f497c2da3600cc99cd7d1b5c6726972fb2b5a1)
2024-04-24testsuite: Add target requires for ifuncs to mv31.C.Iain Sandoe1-0/+1
g++.target/i386/mv31.C fails on targets without ifuncs support so add the necessary target supports guard. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/testsuite/ChangeLog: * g++.target/i386/mv31.C: Add target supports guard for ifuncs. (cherry picked from commit 350fcc7884ba80f38dd1476ae41029c648a5f8b9)
2024-04-24Darwin: Fix empty g++ command lines [PR105599].Iain Sandoe1-1/+2
An empty g++ command line should produce a diagnostic that there are no inputs. The PR is that currently Darwin produces a dignostic about missing link items instead - this is because (errnoeously), for this driver, we are creating a link job for empty command lines. The problem occurs in four stages: The g++ driver appends -shared-libgcc to the command line. The Darwin driver_init code in the backend does not see this (it sees an empty command line). When the back end driver code driver sees an empty command line, it does not add any supplementary flags (e.g. asm-macosx-version-min) - precisely to avoid anything being claimed as an input_file and therefore triggering a link line. Since we do not have a value for asm-macosx-version-min when processing the driver specs, we unconditionally inject 'multiply_defined suppress' which is used with shared libgcc (but only intended on very old Darwin). This then causes the generation of a link job. The solution, for the present, is to move version-specific link params to the LINK_SPEC so that they are only processed when a link job has already been decided. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> PR target/105599 gcc/ChangeLog: * config/darwin.h: Move versions-specific handling of multiply_defined from SUBTARGET_DRIVER_SELF_SPECS to LINK_SPEC. (cherry picked from commit 794737976b9a6418eab817f143bb4eb2d0c834d2)
2024-04-24tsan: Don't instrument non-generic AS accesses [PR111736]Jakub Jelinek2-0/+20
Similar to the asan and ubsan changes, we shouldn't instrument non-generic address space accesses with tsan, because we just have library functions which take address of the objects as generic address space pointers, so they can't handle anything else. 2024-03-26 Jakub Jelinek <jakub@redhat.com> gcc/ChangeLog: PR sanitizer/111736 * tsan.c (instrument_expr): Punt on non-generic address space accesses. gcc/testsuite/ChangeLog: * gcc.dg/tsan/pr111736.c: New test. (cherry picked from commit 471967ab8b4c49338ba77defbe24b06cc51c0093)
2024-04-24ubsan: Don't -fsanitize=null instrument __seg_fs/gs pointers [PR111736]Jakub Jelinek2-2/+40
On x86 and avr some address spaces allow 0 pointers (on avr actually even generic as, but libsanitizer isn't ported to it and I'm not convinced we should completely kill -fsanitize=null in that case). The following patch makes sure those aren't diagnosed for -fsanitize=null, though they are still sanitized for -fsanitize=alignment. 2024-03-22 Jakub Jelinek <jakub@redhat.com> gcc/ChangeLog: PR sanitizer/111736 * ubsan.c (ubsan_expand_null_ifn, instrument_mem_ref): Avoid SANITIZE_NULL instrumentation for non-generic address spaces for which targetm.addr_space.zero_address_valid (as) is true. gcc/testsuite/ChangeLog: * gcc.dg/ubsan/pr111736.c: New test. (cherry picked from commit ddd4a3ca87410886b039cc225907b4f6e650082e)
2024-04-24tree-optimization/111736 - avoid address sanitizing of __seg_gsRichard Biener2-0/+27
The following more thoroughly avoids address sanitizing accesses to non-generic address-spaces. gcc/ChangeLog: PR tree-optimization/111736 * asan.c (instrument_derefs): Do not instrument accesses to non-generic address-spaces. gcc/testsuite/ChangeLog: * gcc.target/i386/pr111736.c: New testcase. (cherry picked from commit 134ef2a8cac1a5cc718739bd7d3b3472947c80d6)
2024-04-24sanitizer/111736 - skip ASAN for globals in alternate address-spaceRichard Biener1-0/+2
gcc/ChangeLog: PR sanitizer/111736 * asan.c (asan_protect_global): Do not protect globals in non-generic address-space. (cherry picked from commit 7e40497805c0831596334fe474112f991276e11b)
2024-04-24Daily bump.GCC Administrator5-1/+95
2024-04-23testsuite,X86: Fix missing USER_LABEL_PREFIX cases.Iain Sandoe4-8/+8
Yet another set of testcases that do not account for targets that use __USER_LABEL_PREFIX__. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/testsuite/ChangeLog: * gcc.target/i386/memcpy-strategy-10.c: Account for __USER_LABEL_PREFIX__. * gcc.target/i386/memcpy-strategy-5.c: Likewise. * gcc.target/i386/memset-strategy-5.c: Likewise. * gcc.target/i386/memset-strategy-7.c: Likewise.
2024-04-23add missing dg-require alias to gcc.dg/torture/pr100786.cRichard Biener1-0/+1
2022-03-28 Richard Biener <rguenther@suse.de> * gcc.dg/torture/pr100786.c: Add dg-require alias. (cherry picked from commit f6819b7fea38f2e5482c71aabab3d44a8bd7d904)
2024-04-23Darwin: Fix a type mismatch warning for a non-GCC bootstrap compiler.Iain Sandoe1-1/+1
DECL_MD_FUNCTION_CODE() returns an int, on one particular compiler the code in darwin_fold_builtin() triggers a warning. Fixed thus. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/ChangeLog: * config/darwin.c (darwin_fold_builtin): Make fcode an int to avoid a mismatch with DECL_MD_FUNCTION_CODE(). (cherry picked from commit 25587472ccd223c861fe77cfeca4ba33c3f6cd99)
2024-04-23configure, Darwin: Check ld64 support for -platform-version.Iain Sandoe3-2/+41
Newer versions of ld64 allow specifiying the OS target (e.g. macos or ios) the version and the SDK version all in a single command. This checks the availability of the command for the current toolchain. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/ChangeLog: * config.in: Regenerate. * configure: Regenerate. * configure.ac: Test ld64 for -platform-version support. (cherry picked from commit d3cc82dc9cc2d4f1021fc5d4c1463c3a14fc6795)
2024-04-23testsuite, Darwin : Do not claim 'GAS' for cctools assembler.Iain Sandoe1-1/+8
Although the cctools assembler is based of GNU GAS, it is from a very old version (1.38) which does not support many of the features that the target supports test is expecting. gcc/testsuite/ChangeLog: * lib/target-supports.exp: Exclude cctools assembler based on GAS 1.38. (cherry picked from commit e42ea63bcc12e819c3e1066974a691988e86b724)
2024-04-23Objective-C: Default flag_objc_sjlj_exceptions off for NeXT ABI >= 2.Matt Jacobson2-4/+4
Signed-off-by: Matt Jacobson <mhjacobson@me.com> gcc/c-family/ChangeLog: * c-opts.c (c_common_post_options): Default to flag_objc_sjlj_exceptions = 1 only when flag_objc_abi < 2. gcc/objc/ChangeLog: * objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Warn about and reset flag_objc_sjlj_exceptions regardless of flag_objc_exceptions. (next_runtime_02_initialize): Use a checking assert that flag_objc_sjlj_exceptions is off. (cherry picked from commit 798666392b512a585f0de2983a5d3423e960959e)
2024-04-23Objective-C, NeXT runtime: Correct the default for fobjc-nilcheck.Iain Sandoe1-0/+4
It is intended that the default for the NeXT runtime at ABI 2 is to check for nil message receivers. This updates this to match the documented behaviour and to match the behaviour of the system tools. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/objc/ChangeLog: * objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Default receiver nilchecks on. (cherry picked from commit de0b250b2badb475f8c09f3cd2c57fd3f9127fe3)
2024-04-23Objective-C: fix crash with -fobjc-nilcheckIain Sandoe8-22/+108
When -fobjc-nilcheck is enabled, messages that result in a struct type should yield a zero-initialized struct when sent to nil. Currently, the frontend crashes when it encounters this situation. This patch fixes the crash by generating the tree for the `{}` initializer. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> Co-authored-by: Matt Jacobson <mhjacobson@me.com> PR objc/101666 gcc/objc/ChangeLog: * objc-act.c (objc_build_constructor): Handle empty constructor lists. * objc-next-runtime-abi-02.c (build_v2_objc_method_fixup_call): Handle nil receivers. (build_v2_build_objc_method_call): Likewise. gcc/testsuite/ChangeLog: * obj-c++.dg/pr101666-0.mm: New test. * obj-c++.dg/pr101666-1.mm: New test. * obj-c++.dg/pr101666.inc: New. * objc.dg/pr101666-0.m: New test. * objc.dg/pr101666-1.m: New test. * objc.dg/pr101666.inc: New. (cherry picked from commit d2aa4e0b3b5053df8f5853d9ed29022ff0d3ecf6)
2024-04-23Daily bump.GCC Administrator5-1/+78
2024-04-22Objective-C, NeXT: Adjust symbol marking to match host tools.Iain Sandoe2-2/+6
Current host tools mark some additional symbols as 'no dead strip' and also expose one additional group to the linker. This does not affect older Darwin versions or x86_64, but omitting these changes results in link errors for aarch64. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/ChangeLog: * config/darwin.c (darwin_label_is_anonymous_local_objc_name): Make protocol class methods linker-visible. gcc/objc/ChangeLog: * objc-next-runtime-abi-02.c (next_runtime_abi_02_protocol_decl): Do not dead-strip the runtime meta-data symbols. (build_v2_classrefs_table): Likewise. (build_v2_protocol_list_address_table): Likewise. (cherry picked from commit ecd5727c0a662a8fea6b5f8eac6f3f15bf5ef851)
2024-04-22testsuite: Fix weak_undefined handling on DarwinRainer Orth2-0/+13
The patch that introduced the weak_undefined effective-target keyword and corresponding dg-add-options support commit 378ec7b87a5265dbe2d489c245fac98ef37fa638 Author: Alexandre Oliva <oliva@adacore.com> Date: Thu Mar 23 00:45:05 2023 -0300 [testsuite] test for weak_undefined support and add options badly broke the affected tests on macOS like so: ERROR: gcc.dg/addr_equal-1.c: unknown dg option: 89 for " dg-add-options 5 weak_undefined " ERROR: gcc.dg/addr_equal-1.c: unknown dg option: 89 for " dg-add-options 5 weak_undefined " add_options_for_weak_undefined tries to call an non-existant proc "89". Even after fixing this by escaping the brackets, two tests still failed to link since they lacked the corresponding calls do dg-add-options weak_undefined. Tested on x86_64-apple-darwin20.6.0 and i386-pc-solaris2.11. 2023-03-27 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> gcc/testsuite: * lib/target-supports.exp (add_options_for_weak_undefined): Escape brackets. * gcc.dg/visibility-22.c: Add weak_undefined options. (cherry picked from commit 8443f42f05f9026dadad1236b9e44ec294c70337)
2024-04-22testsuite, objective-c: Fix a testcase on Windows.Iain Sandoe1-6/+8
Windows needs to use uintptr_t to represent an integral pointer type (long is not the right type there). Patch from 'nightstike'. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/testsuite/ChangeLog: * obj-c++.dg/proto-lossage-4.mm: Use uintptr_t for integral pointer representations. (cherry picked from commit 142bd88c5f609546a466743ab1066d5620a830bc)
2024-04-22c++, driver: Fix -static-libstdc++ for targets without Bstatic/dynamic.Iain Sandoe1-0/+5
The current implementation for swapping between the static and shared c++ runtimes relies on the static linker supporting Bstatic/dynamic which is not available for every target (Darwin's linker does not support this). Specs substitution (%s) is an alternative solution for this (which is what Darwin uses for Fortran, D and Objective-C). However, specs substitution requires that the '-static-libstdc++' be preserved in the driver's command line. The patch here arranges for this to be done when the configuration determines that linker support for Bstatic/dynamic is missing. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/cp/ChangeLog: * g++spec.c (lang_specific_driver): Preserve -static-libstdc++ in the driver command line for targets without -Bstatic/dynamic support in their static linker. (cherry picked from commit a846817739c1e7b930d593cd51963d6b46b5dfc6)
2024-04-22testsuite, Darwin: Fix darwin-comm-1.c error messages for Darwin <= 10.Iain Sandoe1-2/+3
When amending the allowed alignment size to accommodate the larger values permitted by newer tools, we retained the object file limit of 2^15 for Darwin versions <= 10, since that is what the native tools expect there. This triggers a different diagnostic path with a distinct error message, which is checked in the revised test here. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/testsuite/ChangeLog: * gcc.dg/darwin-comm-1.c: Check for the correct error message for Darwin <= 10. (cherry picked from commit 54a5f478487a955c3ffaec3e9164a72599bc1cfb)
2024-04-22testsuite, Darwin: Remove an unnecessary flags addition.Iain Sandoe3-11/+2
The addition of the multiply_defined suppress flag has been handled for some considerable time now in the Darwin specs; remove it from the testsuite libs. Avoid duplicates in the specs. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/ChangeLog: * config/darwin.h: Avoid duplicate multiply_defined specs on earlier Darwin versions with shared libgcc. libstdc++-v3/ChangeLog: * testsuite/lib/libstdc++.exp: Remove additional flag handled by Darwin specs. gcc/testsuite/ChangeLog: * lib/g++.exp: Remove additional flag handled by Darwin specs. * lib/obj-c++.exp: Likewise. (cherry picked from commit 3c776fdf1a825818ad7248d442e846f532574ff7)
2024-04-22configure, Darwin: Adjust handing of stdlib option.Iain Sandoe2-19/+64
The intent of the configuration choices for -stdlib is that default setting should choose reasonable options for the target. This should enable -stdlib= for Darwin targets where libc++ is the default on the system (so that it is only necessary to provide the headers). However, it seems that there are some cases where (external) config scripts are using -stdlib (incorrectly) to determine if the compiler in use is GCC or clang. In order to allow for these cases, this patch refines the setting like so: --with-gxx-libcxx-include-dir= is used to configure the path containing libc++ headers; it also controls the enabling of the -stdlib option. We are adding a special value for path: if --with-gxx-libcxx-include-dir is 'no' we disable the stdlib option. Otherwise if the --with-gxx-libcxx-include-dir is set we use the path provided, and enable the stdlib option. if --with-gxx-libcxx-include-dir is unset We decide on the stdlib option based on the OS type and revision being targeted. The path is set to a fixed position relative to the compiler install (similar logic to that used for libstdc++ headers). Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/ChangeLog: * configure: Regenerate. * configure.ac: Handle explict disable of stdlib option, set defaults for Darwin. (cherry picked from commit ce7a757fd9ecb99c4f54cfde5cf5ef9a9e7819fc)
2024-04-22Daily bump.GCC Administrator1-1/+1
2024-04-21Daily bump.GCC Administrator1-1/+1
2024-04-20Daily bump.GCC Administrator1-1/+1
2024-04-19Daily bump.GCC Administrator1-1/+1
2024-04-18Daily bump.GCC Administrator1-1/+1
2024-04-17Daily bump.GCC Administrator1-1/+1
2024-04-16Daily bump.GCC Administrator3-1/+51
2024-04-15[AArch64]: Do not allow SIMD clones with simdlen 1 [PR113552]Tamar Christina3-6/+33
This is a backport of g:306713c953d509720dc394c43c0890548bb0ae07. The AArch64 vector PCS does not allow simd calls with simdlen 1, however due to a bug we currently do allow it for num == 0. This causes us to emit a symbol that doesn't exist and we fail to link. gcc/ChangeLog: PR tree-optimization/113552 * config/aarch64/aarch64.c (aarch64_simd_clone_compute_vecsize_and_simdlen): Block simdlen 1. gcc/testsuite/ChangeLog: PR tree-optimization/113552 * gcc.target/aarch64/pr113552.c: New test. * gcc.target/aarch64/simd_pcs_attribute-3.c: Remove bogus check.
2024-04-15middle-end/114599 - fix bitmap allocation for check_ifunc_callee_symtab_nodesRichard Biener1-4/+7
There's no default bitmap obstack during global CTORs, so allocate the bitmap locally. PR middle-end/114599 PR gcov-profile/114115 * symtab.c (ifunc_ref_map): Do not use auto_bitmap. (is_caller_ifunc_resolver): Optimize bitmap_bit_p/bitmap_set_bit pair. (symtab_node::check_ifunc_callee_symtab_nodes): Properly allocate ifunc_ref_map here. (cherry picked from commit 9ab8fdfeef5b1a47b358e08a98177b2fad65fed9)
2024-04-15tree-profile: Disable indirect call profiling for IFUNC resolversH.J. Lu5-2/+130
We can't profile indirect calls to IFUNC resolvers nor their callees as it requires TLS which hasn't been set up yet when the dynamic linker is resolving IFUNC symbols. Add an IFUNC resolver caller marker to cgraph_node and set it if the function is called by an IFUNC resolver. Disable indirect call profiling for IFUNC resolvers and their callees. Tested with profiledbootstrap on Fedora 39/x86-64. gcc/ChangeLog: PR tree-optimization/114115 * cgraph.h (symtab_node): Add check_ifunc_callee_symtab_nodes. (cgraph_node): Add called_by_ifunc_resolver. * cgraphunit.c (symbol_table::compile): Call symtab_node::check_ifunc_callee_symtab_nodes. * symtab.c (check_ifunc_resolver): New. (ifunc_ref_map): Likewise. (is_caller_ifunc_resolver): Likewise. (symtab_node::check_ifunc_callee_symtab_nodes): Likewise. * tree-profile.c (gimple_gen_ic_func_profiler): Disable indirect call profiling for IFUNC resolvers and their callees. gcc/testsuite/ChangeLog: PR tree-optimization/114115 * gcc.dg/pr114115.c: New test. (cherry picked from commit cab32bacaea268ec062b1fb4fc662d90c9d1cfce)
2024-04-15Daily bump.GCC Administrator1-1/+1
2024-04-14Daily bump.GCC Administrator1-1/+1
2024-04-13Daily bump.GCC Administrator3-1/+17
2024-04-12RISC-V: Fix __atomic_compare_exchange with 32 bit value on RV64Kito Cheng2-0/+21
atomic_compare_and_swapsi will use lr.w to do obtain the original value, which sign extends to DI. RV64 only has DI comparisons, so we also need to sign extend the expected value to DI as otherwise the comparison will fail when the expected value has the 32nd bit set. gcc/ChangeLog: PR target/114130 * config/riscv/sync.md (atomic_compare_and_swap<mode>): Sign extend the expected value if needed. gcc/testsuite/ChangeLog: * gcc.target/riscv/pr114130.c: New. Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com> (cherry picked from commit fd07a29e39f5347d6cef3e7042a32306f97a1719)
2024-04-12Daily bump.GCC Administrator1-1/+1
2024-04-11Daily bump.GCC Administrator1-1/+1
2024-04-10Daily bump.GCC Administrator1-1/+1
2024-04-09Daily bump.GCC Administrator1-1/+1
2024-04-08Daily bump.GCC Administrator3-1/+36
2024-04-06Fortran: fix DATA and derived types with pointer components [PR114474]Harald Anlauf2-0/+89
When matching actual arguments in match_actual_arg, these are initially treated as a possible dummy procedure, assuming that the correct type is determined later. This resolution could fail when the procedure is a derived type constructor with a pointer component and appears in a DATA statement, where the pointer shall be associated with an initial data target. Check for those cases where the type obviously has not been resolved yet, and which were missed because there was no component reference. gcc/fortran/ChangeLog: PR fortran/114474 * primary.c (gfc_variable_attr): Catch variables used in structure constructors within DATA statements that are still tagged with a temporary type BT_PROCEDURE from match_actual_arg and which have the target attribute, and fix their typespec. gcc/testsuite/ChangeLog: PR fortran/114474 * gfortran.dg/data_pointer_3.f90: New test. (cherry picked from commit bbb7c513dddc5c9b2d5e9b78bc1c2f85a0cfe07e)
2024-04-05fortran: Fix setting of array lower bound for named arraysChung-Lin Tang3-14/+35
This patch fixes a case of setting array low-bounds, found for particular uses of SOURCE=/MOLD=. This adjusts the relevant part in gfc_trans_allocate() to set e3_has_nodescriptor only for non-named arrays. 2021-12-03 Tobias Burnus <tobias@codesourcery.com> gcc/fortran/ChangeLog: * trans-stmt.c (gfc_trans_allocate): Set e3_has_nodescriptor to true only for non-named arrays. gcc/testsuite/ChangeLog: * gfortran.dg/allocate_with_source_26.f90: Adjust testcase. * gfortran.dg/allocate_with_mold_4.f90: New testcase. (cherry picked from commit 6262e3a22b3d86afc116480bc59a7bb30b0cfd40)
2024-04-05Daily bump.GCC Administrator1-1/+1
2024-04-04Daily bump.GCC Administrator1-1/+1
2024-04-03Daily bump.GCC Administrator4-1/+42
2024-04-02Fix SSA corruption due to widening_mul opt on conflict across an abnormal ↵Qing Zhao2-0/+29
edge [PR111407] This is a bug in tree-ssa-math-opts.c, when applying the widening mul optimization, the compiler needs to check whether the operand is in a ABNORMAL PHI, if YES, we should avoid the transformation. PR tree-optimization/111407 gcc/ChangeLog: * tree-ssa-math-opts.c (convert_mult_to_widen): Avoid the transform when one of the operands is subject to abnormal coalescing. gcc/testsuite/ChangeLog: * gcc.dg/pr111407.c: New test. (cherry picked from commit 4aca1cfd6235090e48a53dab734437740671bbf3)