Darwin is able to use two runtimes for objective-c; the
default is its native "NeXT" runtime, but also it can build
code using the "gnu-runtime". In order to do this, we have to
be able to find the gnu-runtime headers (which are installed
into the compiler's tree).
The process to do this is erroneously prepending the sysroot
to this when a sysroot is in force. The gnu-runtime headers have
never been installed in a Darwin (macOS) SDK so we must make
sure that they are found local to the compiler.
gcc/
2019-05-18 Iain Sandoe <iain@sandoe.co.uk>
* config/darwin-c.c (darwin_register_objc_includes): Do not
prepend the sysroot when building gnu-runtime header search
paths.
From-SVN: r271371
The instancetype has been added as a typedef alias to id
in order to allow diagnosis of cases where a class is used
or returned where an instance is expected.
This adds the typedef, and tests that we can parse it.
It doesn't alter the diagnostics yet.
gcc/objc/
2019-05-18 Iain Sandoe <iain@sandoe.co.uk>
* objc/objc-act.h (OCTI_INSTANCE_TYPE, OCTI_INSTANCETYPE_NAME): New.
(objc_global_trees): Add instance type and name.
(INSTANCE_TYPEDEF_NAME): New.
* objc/objc-act.c (synth_module_prologue): Build decls for
objc_instancetype_type and objc_instancetype_name.
gcc/testsuite/
2019-05-18 Iain Sandoe <iain@sandoe.co.uk>
* objc.dg/instancetype-0.m: New.
From-SVN: r271370
We have been emitting two section swiches in the Darwin's
file end function. This means that varasm is not updated
which could matter if we elect to reorder some of the file
end operations in support of LTO actions.
2019-05-18 Iain Sandoe <iain@sandoe.co.uk>
* config/darwin.c (darwin_file_end): Use switch_to_section ()
instead of direct output of the asm.
From-SVN: r271369
PR libstdc++/90520
* python/libstdcxx/v6/printers.py (UniquePointerPrinter.__init__):
Raise exception if unique_ptr tuple member has unknown structure.
* python/libstdcxx/v6/xmethods.py (UniquePtrGetWorker.__call__):
Adjust worker to support new __uniq_ptr_data base class. Do not
assume field called _M_head_impl is the first tuple element.
From-SVN: r271363
This uses epilogue_type directly. It also changes some ints to bools,
declares variables later, and simplifies some code.
There is one actual change:
else if (info->push_p
&& DEFAULT_ABI != ABI_V4
- && !crtl->calls_eh_return)
+ && epilogue_type != EPILOGUE_TYPE_EH_RETURN)
{
/* Prevent reordering memory accesses against stack pointer restore. */
(different because calls_eh_return can be true for sibcalls). This is
a bugfix. The code was never exercised.
One place in the epilogue still uses crtl->calls_eh_return. If that
is changed the prologue has to have a corresponding change, and the
emit_prologue function does not have an epilogue_type parameter, so
bail on changing this for now. We might want to do this (saving the
CR fields to separate stack slots) always, not just for functions
calling eh_return, but that will require more investigation.
* config/rs6000/rs6000.c (restore_saved_cr): Change a boolean
argument to be type bool (was int before).
(rs6000_emit_epilogue): Simplify some code. Declare some variables
at first use. Use type bool for some variables. Fix a theoretical
eh_return bug for svr4.
From-SVN: r271361
This adds the "enabled" attribute to the rs6000 backend. It uses the
(new) "isa" attribute to automatically select which instruction
alternatives should be enabled.
For now it allows isa strings of "p5", "p6", "p7", meaning the
instructions introduced on that CPU, not requiring vectors; and "p7v",
"p8v", "p9v" for the same, but with vectors.
These are currently mapped to TARGET_POPCNTB, TARGET_CMPB,
TARGET_POPCNTD, TARGET_VSX, TARGET_P8_VECTOR, and TARGET_P9_VECTOR;
that will change to something a bit saner later.
* config/rs6000/rs6000.md (isa): New attribute.
(enabled): New attribute.
From-SVN: r271360
Change that moved assemble_start_function/assemble_end_function to
backends missed aarch64. Fix that.
gcc/
2019-05-17 Max Filippov <jcmvbkbc@gmail.com>
* config/aarch64/aarch64.c (aarch64_output_mi_thunk): Call
assemble_start_function and assemble_end_function.
From-SVN: r271359
gcc/
PR middle-end/89433
* omp-general.c (oacc_build_routine_dims): Move some of its
processing into...
(oacc_verify_routine_clauses): ... this new function.
* omp-general.h (oacc_verify_routine_clauses): New prototype.
gcc/c/
PR c/89433
* c-parser.c (c_parser_oacc_routine): Normalize order of clauses.
(c_finish_oacc_routine): Call oacc_verify_routine_clauses.
gcc/cp/
PR c++/89433
* parser.c (cp_parser_oacc_routine)
(cp_parser_late_parsing_oacc_routine): Normalize order of clauses.
(cp_finalize_oacc_routine): Call oacc_verify_routine_clauses.
gcc/testsuite/
PR testsuite/89433
* c-c++-common/goacc/routine-2.c: Update, and move some test
into...
* c-c++-common/goacc/routine-level-of-parallelism-1.c: ... this
new file.
From-SVN: r271344
The rest of the Darwin ports now emit Lnnn$pb as the picbase
lable instead of the ancient (and hard to read) "L0000000nnn$pb".
This just updates this part of the rs6000 port, NFC intended.
2019-05-17 Iain Sandoe <iain@sandoe.co.uk>
* config/rs6000/rs6000.c (machopic_output_stub): Adjust the
formatting of picbase labels to match other ports.
From-SVN: r271342
NFC intended, this simply adds a missing tab to the
generaed code.
2019-05-17 Iain Sandoe <iain@sandoe.co.uk>
* config/rs6000/rs6000.c (macho_branch_islands): Fix bad indent
on the generated code.
From-SVN: r271341
fork() semantics can be problematic. Most unix style OS'es have
posix_spawn which can be used to replace fork + exec in many cases.
For more information see
e.g. https://www.microsoft.com/en-us/research/uploads/prod/2019/04/fork-hotos19.pdf
This replaces the one use of fork in libgfortran with posix_spawn.
2019-05-17 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/90038
* configure.ac (AC_CHECK_FUNCS_ONCE): Check for posix_spawn.
* intrinsics/execute_command_line (execute_command_line): Use
posix_spawn.
* Makefile.in: Regenerated.
* config.h.in: Regenerated.
* configure: Regenerated.
Regtested on x86_64-pc-linux-gnu.
From-SVN: r271340
We can scan stack for return address to get vector arguments passed on
stack.
Tested on Linux/x86-64 and Linux/x32.
* gcc.target/x86_64/abi/test_varargs-m128.c: New file.
* gcc.target/x86_64/abi/avx/test_varargs-m256.c: Likewise.
* gcc.target/x86_64/abi/avx512f/test_varargs-m512.c: Likewise.
From-SVN: r271329
Since MMX intrinsics are marked with SSE/SSE2/SSSE3 for SSE emulation,
enable them without SSE/SSE2/SSSE3 if MMX is enabled.
Restore TARGET_3DNOW check, which was changed to TARGET_3DNOW_A by
revision 271235.
gcc/
PR target/90497
* config/i386/i386-expand.c (ix86_expand_builtin): Enable MMX
intrinsics without SSE/SSE2/SSSE3.
* config/i386/mmx.md (mmx_uavgv8qi3): Restore TARGET_3DNOW
check.
(*mmx_uavgv8qi3): Likewise.
gcc/testsuite/
PR target/90497
* gcc.target/i386/pr90497-1.c: New test.
* gcc.target/i386/pr90497-2.c: Likewise.
From-SVN: r271328
This patch is updating all soft-fp from glibc, most changes are
copyright years update, and changes other than years update are
* soft-fp/extenddftf2.c: Use "_FP_W_TYPE_SIZE < 64" to check if
4_FP_W_TYPEs are used for IEEE quad precision.
* soft-fp/extendhftf2.c: Likewise.
* soft-fp/extendsftf2.c: Likewise.
* soft-fp/extendxftf2.c: Likewise.
* soft-fp/trunctfdf2.c: Likewise.
* soft-fp/trunctfhf2.c: Likewise.
* soft-fp/trunctfsf2.c: Likewise.
* soft-fp/trunctfxf2.c: Likewise.
* config/rs6000/ibm-ldouble.c: Likewise.
From-SVN: r271327
* testsuite/20_util/variant/compile.cc: Fix narrowing test for ILP32
targets. Add more cases from P0608R3.
* testsuite/20_util/variant/run.cc: Add more cases from P0608R3.
From-SVN: r271325
This is another attempt to reduce how often the assertions are
evaluated, so that code which doesn't try to use the function objects
doesn't need them to be invocable.
For _Rb_tree we access the _M_key_compare object directly, so can't put
the assertions in an accessor function for it. However, every invocation
of _M_key_compare is accompanied by a use of _S_key, so the assertions
can be put in there. For _Hashtable there are member functions that are
consistently used to obtain a hash code or test for equality, so the
assertions can go in those members.
PR libstdc++/85965
* include/bits/hashtable.h (_Hashtable::~_Hashtable()): Remove static
assertions from the destructor.
* include/bits/hashtable_policy.h (_Hash_code_base::_M_hash_code):
Move static_assert for hash function to here.
(_Hash_table_base::_M_equals): Move static_assert for equality
predicate to here.
* include/bits/stl_tree.h (_Rb_tree::_S_value(_Const_Link_type)):
Remove.
(_Rb_tree::_S_key(_Const_Link_type)): Move assertions here. Access
the value directly instead of calling _S_value.
(_Rb_tree::_S_value(_Const_Base_ptr)): Remove.
(_Rb_tree::_S_key(_Const_Base_ptr)): Do downcast and forward to
_S_key(_Const_Link_type).
* testsuite/23_containers/set/85965.cc: Check construction,
destruction, assignment and size() do not trigger the assertions.
* testsuite/23_containers/unordered_set/85965.cc: Likewise.
* testsuite/23_containers/map/48101_neg.cc: Call find and adjust
expected errors.
* testsuite/23_containers/multimap/48101_neg.cc: Likewise.
* testsuite/23_containers/multiset/48101_neg.cc: Likewise.
* testsuite/23_containers/set/48101_neg.cc: Likewise.
* testsuite/23_containers/unordered_map/48101_neg.cc: Likewise.
* testsuite/23_containers/unordered_multimap/48101_neg.cc: Likewise.
* testsuite/23_containers/unordered_multiset/48101_neg.cc: Likewise.
* testsuite/23_containers/unordered_set/48101_neg.cc: Likewise.
From-SVN: r271323
The current scheme used by the compiler for "gcbits" symbols involves
generating a symbol name based on a 32-char encoding of the bits data.
This scheme works well in most cases but can generate very long symbol
names in rare cases. To help avoid such long symbol names, switch to a
different encoding scheme based on the SHA1 digest of the payload if
the symbol size would be too large.
Fixesgolang/go#32083.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/177598
From-SVN: r271322
This patch adds -march=z900 to a test case that expects larl for loading
a value via the GOT. On z10 and later, lgrl is used which is tested in
a new, separate test case.
gcc/testsuite/ChangeLog:
2019-05-17 Robin Dapp <rdapp@linux.ibm.com>
* gcc.target/s390/global-array-element-pic.c: Add -march=z900.
* gcc.target/s390/global-array-element-pic2.c: New test for z10+.
From-SVN: r271321
The builtin was wired up to the wrong pattern. Fixed with this patch.
gcc/ChangeLog:
2019-05-17 Andreas Krebbel <krebbel@linux.ibm.com>
* config/s390/s390-builtins.def (s390_vec_sldw_*): Use the
vec_sldw insn pattern.
gcc/testsuite/ChangeLog:
2019-05-17 Andreas Krebbel <krebbel@linux.ibm.com>
* gcc.target/s390/zvector/vec-sldw.c: New test.
From-SVN: r271318
* include/bits/invoke.h [__cplusplus < 201703L] (__invoke_r<void>):
Use _GLIBCXX14_CONSTEXPR because void functions cannot be constexpr
in C++11.
From-SVN: r271317
2019-05-17 Martin Liska <mliska@suse.cz>
PR driver/90496
* toplev.c (output_stack_usage): With LTO and sanitizer it
happens that a global ctor (_GLOBAL__sub_I_00099_0_main)
has no file location.
From-SVN: r271313
2019-05-17 Martin Liska <mliska@suse.cz>
PR driver/90495
* toplev.c (output_stack_usage): With LTO and sanitizer it
happens that a global ctor (_GLOBAL__sub_I_00099_0_main)
has no file location.
From-SVN: r271312
PR go/90482
compiler: make value method of direct interface type takes pointer
Currently, a value method of a direct interface type takes the
value of the receiver, which is pointer shaped, as the first
parameter. When this method is called through interface, we
actually pass the interface data as a pointer. On most platforms
this is ok, as the underlying calling convention is the same,
except that on SPARC32, the calling convention is actually
different.
This CL changes the method function actually takes a pointer.
The function will convert the pointer to the pointer-shaped
receiver type (a no-op conversion from machine code's aspect).
For a direct call, in the caller we convert the receiver to a
pointer (also no-op conversion) before invoking the method. For
an interface call, we pass the pointer as before. This way, it is
consistent that we always pass a pointer.
Hopefully this fixes SPARC32 build and https://gcc.gnu.org/PR90482.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/177758
From-SVN: r271310
Currently runtime/internal/atomic functions are implemented in C
using C compiler intrinsics. This CL lets the Go frontend
recognize these functions and turn them into intrinsics directly.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/176918
* go-gcc.cc (Gcc_backend::Gcc_backend): Define atomic builtins.
From-SVN: r271308
runtime/internal/sys.Ctz32/64 and Bswap32/64 are currently
implemented with compiler builtin functions. But if they are
called from another package, the compiler does not know and
therefore cannot turn them into compiler intrinsics. This CL
makes the compiler recognize these functions and turn them into
intrinsics directly, as the gc compiler does.
This CL sets up a way for adding intrinsics in the compiler.
More intrinsics will be added in later CLs.
Also move the handling of runtime.getcallerpc/sp to the new way
of generating intrinsics.
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/176917
From-SVN: r271303
The assertion is wrong, it should be *s.end() == 0, but that's not
allowed. Just remove it, but keep the comment.
* src/c++17/fs_ops.cc (absolute(const path&, error_code&))
[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Remove bogus assertion.
From-SVN: r271300