AIX caches shared objects in archives with read-other permission.
libgomp and libatomic might be in use during the build or testing, which
may cause archiver operations on them to fail. This patch adjusts the
Makefile fragments to delete the library archives before creating fresh
archives containing both the 32 bit and 64 bit shared objects.
libatomic/ChangeLog:
2020-10-11 Clement Chigot <clement.chigot@atos.net>
* config/t-aix: Delete and recreate libatomic before creating
FAT library.
libgomp/ChangeLog:
2020-10-11 Clement Chigot <clement.chigot@atos.net>
* config/t-aix: Delete and recreate libgomp before creating
FAT library.
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.
This corrects a typo in the recipe for the special type alignment
rules that are used for 32bit powerpc Darwin platforms.
libobjc/ChangeLog:
* encoding.c (_darwin_rs6000_special_round_type_align):
Use DFMode in the emulation of the special round type.
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.
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.
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.
Make libstdc++fs.a a 32/64 bit FAT library.
It is too complicated for the FAT library Makefile fragment to determine if
--enable-libstdcxx-filesystem-ts has been enabled. This patch checks the
existence of libstdc++fs.a at build time and adds the complementary object
file if it was built.
libstdc++-v3/Changelog:
2020-10-11 Clement Chigot <clement.chigot@atos.net>
* config/os/aix/t-aix: Add complementary mode object file to
libstdc++fs.a
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.
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.
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.
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
The name __deref is defined as a macro by Windows headers.
This renames the __deref() helper function to __ref. It doesn't actually
dereference an iterator. it just has the same type as the iterator's
reference type.
libstdc++-v3/ChangeLog:
PR libstdc++/97362
* doc/html/manual/source_code_style.html: Regenerate.
* doc/xml/manual/appendix_contributing.xml: Add __deref to
BADNAMES.
* include/debug/functions.h (_Irreflexive_checker::__deref):
Rename to __ref.
* testsuite/17_intro/badnames.cc: Check __deref.
* 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.
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.
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.
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.
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.
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.
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.
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.
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.
This ensures that intermediate results are done in uint32_t values,
meeting the requirement for operations to be done modulo 2^32.
If the target doesn't define __UINT32_TYPE__ then substitute uint32_t
with a class type that uses uint_least32_t and masks the value to
UINT32_MAX.
I've also split the first loop that goes from k=0 to k<m into three
loops, for k=0, [1,s] and [s+1,m). This avoids branching for those three
cases in the body of the loop, and also avoids the concerns in PR 94823
regarding the k-1 index when k==0.
libstdc++-v3/ChangeLog:
PR libstdc++/97311
* include/bits/random.tcc (seed_seq::generate): Use uint32_t for
calculations. Also split the first loop into three loops to
avoid branching on k on every iteration, resolving PR 94823.
* testsuite/26_numerics/random/seed_seq/97311.cc: New test.
* testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-erro
line number.
Co-authored-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:
* include/bits/uniform_int_dist.h (uniform_int_distribution::_S_nd):
New member function implementing Lemire's "nearly divisionless"
algorithm.
(uniform_int_distribution::operator()): Use _S_nd when the range
of the URBG is the full width of the result type.
We usually export variables in recipes this way. I'm not sure it's
necessary, but it's consistent.
libstdc++-v3/ChangeLog:
* testsuite/Makefile.am: Set and export variable separately.
* testsuite/Makefile.in: Regenerate.
It looks like our check-performance target runs completely unoptimized,
which is a bit silly. This exports the CXXFLAGS from the parent make
process to the check_performance script.
libstdc++-v3/ChangeLog:
* scripts/check_performance: Use gnu++11 instead of gnu++0x.
* testsuite/Makefile.am (check-performance): Export CXXFLAGS to
child process.
* testsuite/Makefile.in: Regenerate.