Slava Barinov [Thu, 3 Aug 2017 13:14:59 +0000 (16:14 +0300)]
[TTC-5] Forbid section anchors for ASan build (PR sanitizer/81697)
gcc/
* varasm.c (use_object_blocks_p): Forbid section anchors for ASan
gcc/testsuite/
* g++.dg/asan/global-alignment.C: New test to test global
variables alignment.
Change-Id: I3887e356397c599ec74793de6d60bc285a2c872b
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Dongkyun Son [Tue, 5 Sep 2017 00:14:31 +0000 (09:14 +0900)]
Merge tag 'submit/tizen_base/
20170830.083645' into tizen_4.0_base
Add ChangeLog.Tizen
packaging: Add libasan as requires for asan-runtime-env
packaging: Set shadow address space to unlimited for ASan
packaging: Force options for native compiler only
packaging: remain ld.so.preload.org
PR sanitizer/77631
[ubsan] Fix ICE
[UBSAN] Fix systemd initialization with UBSan.
Change-Id: I2bf79c94083204718ff27a88e5ec4aa2e53d307b
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
Sangmin Seo [Wed, 9 Aug 2017 05:18:33 +0000 (14:18 +0900)]
Add ChangeLog.Tizen
ChangeLog.Tizen is to keep track of private patches for Tizen GCC.
Change-Id: I2fbde58d410ab4a7ddbda361be86a48de9d891e3
Hoyub Lee [Mon, 21 Aug 2017 07:10:12 +0000 (16:10 +0900)]
packaging: Add libasan as requires for asan-runtime-env
Installing asan-runtime-env without libasan invokes error from ld.so.
Therefore, it is correct to add libasan as requires.
Change-Id: I9d2e2a3f60369b1332d7280b6cc6253a73e36439
Signed-off-by: Hoyub Lee <hoyub.lee@samsung.com>
Chan Lee [Fri, 25 Aug 2017 01:46:44 +0000 (10:46 +0900)]
packaging: Set shadow address space to unlimited for ASan
Currently, at the beginning of gbs build, shadow address space is set
according to the environment of the host machine. It makes ASan build
fail because ASan needs a whole shadow address space.
Actually ASan tries to set the value to unlimited at init time( ASanInitInternal() )
but it failes because of lack of permission like below.
[ 39s] ==6800==ERROR: AddressSanitizer setrlimit() failed 1
The value could be set at package install time because the user
is 'root' at this time.
Using ulimit can only set the value for current user('root') not 'abuild'
which is the user at build time so we need to set /etc/security/limits.conf directly.
Change-Id: Ia03911a37a689c186d0e028d01b665cf6a0c3073
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
Slava Barinov [Thu, 10 Aug 2017 08:05:46 +0000 (11:05 +0300)]
packaging: Force options for native compiler only
If both native and cross-compiler are installed (e. g. in qemu-accel build) the
gcc-force-options should only accelerate native compiler in order to keep
gcc-unforce-options work.
Change-Id: I1454fb199e6f849b89f7b16129e005894d800cbc
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Chan Lee [Wed, 23 Aug 2017 11:28:57 +0000 (20:28 +0900)]
packaging: remain ld.so.preload.org
Original file should be remained to restore when uninstalling rpm.
Change-Id: Id5e5b82ff327e14db966b142248d6a5a3e17917c
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
Denis Khalikov [Sat, 29 Jul 2017 19:18:59 +0000 (22:18 +0300)]
PR sanitizer/77631
* Makefile.am: Updated.
* configure.ac: Updated.
* configure: Regenerated.
* Makefile.in: Regenerated.
* elf.c (enum type_of_file): New enum.
(enum type_of_elf): New enum.
(enum debug_path): New enum.
(get_uint32): New function.
(get_crc32): New function.
(base_name_len): New function.
(check_sum): New function. Verify sum.
(process_elf_header): New function. Process elf header.
(elf_get_section_by_name): New function. Get section by name.
(backtrace_readlink): New function. Get type of file from filename.
(resolve_realname): New function. Resolve real name if file is link.
(backtrace_resolve_realname): New function. Resolve real name for any
file type.
(search_for_debugfile): New function. Search for debug file in known
paths.
(open_debugfile_by_gnulink): New function. Open debug file with
gnulink.
(hex): New function. Convert to hex.
(get_build_id_name): New function. Generate build-id name.
(open_debugfile_by_build_id): New function. Open debug file with
build-id.
(backtrace_open_debugfile): New function. Open debug file.
(get_exec_filename): New function. Get pathname of the executable.
(elf_add): Move code which reads elf header, headers section and names
section to process_elf_header.
Call backtrace_open_debugfile_file for executable.
(phdr_callback): Call backtrace_open_debugfile function for shared
library.
* crc32.c: New file.
(gnu_debuglink_crc32): New function. Generate crc32 sum.
Change-Id: I30d9fbcfa24b3aadf3b7c54525dccedd60cd1a5d
Denis Khalikov [Sun, 2 Jul 2017 15:47:03 +0000 (18:47 +0300)]
[ubsan] Fix ICE
While we have a current_function_decl in this case,
still create_tmp_var's called gimple_add_tmp_var and
mark_addressable don't work too well when the current
function is a C++ ctor or dtor that the FE then duplicates
2017-06-27 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/81209
* ubsan.c (ubsan_encode_value): Initialize DECL_CONTEXT on var.
* g++.dg/ubsan/pr81209.C: New test.
2017-06-20 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/81125
* ubsan.h (ubsan_encode_value): Workaround buggy clang++ parser
by removing enum keyword.
(ubsan_type_descriptor): Likewise. Formatting fix.
2017-06-19 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/81125
* ubsan.h (enum ubsan_encode_value_phase): New.
(ubsan_encode_value): Change second argument to
enum ubsan_encode_value_phase with default value of
UBSAN_ENCODE_VALUE_GENERIC.
* ubsan.c (ubsan_encode_value): Change second argument to
enum ubsan_encode_value_phase PHASE from bool IN_EXPAND_P,
adjust uses, for UBSAN_ENCODE_VALUE_GENERIC use just
create_tmp_var_raw instead of create_tmp_var and use a
TARGET_EXPR.
(ubsan_expand_bounds_ifn, ubsan_build_overflow_builtin,
instrument_bool_enum_load, ubsan_instrument_float_cast): Adjust
ubsan_encode_value callers.
PR sanitizer/81111
* ubsan.c (ubsan_encode_value): If current_function_decl is NULL,
use create_tmp_var_raw instead of create_tmp_var, mark it addressable
just by setting TREE_ADDRESSABLE on the result and use a TARGET_EXPR.
PR sanitizer/81125
* g++.dg/ubsan/pr81125.C: New test.
PR sanitizer/81111
* g++.dg/ubsan/pr81111.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@249480
138bc75d-0d04-0410-961f-
82ee72b054a4
Change-Id: I3b7816b4f9b1bb5916adf3684dcbcc5284e50954
Denis Khalikov [Tue, 8 Aug 2017 13:35:33 +0000 (16:35 +0300)]
[UBSAN] Fix systemd initialization with UBSan.
In case systemd was build with UBSan we should
ensure that /proc is mounted, to prevent booting
error.
Change-Id: I52016a5e440f311c85f6fe2cad1dfd7966976651
Signed-off-by: Denis Khalikov <d.khalikov@partner.samsung.com>
Slava Barinov [Wed, 12 Jul 2017 08:21:11 +0000 (11:21 +0300)]
[asan] Revert ABI changes after ASan patches backporting
gcc/
* asan.c: Remove __odr_indicator usage.
* asan_globals.cc: Likewise.
libsanitizer/
* asan/asan_init_version.h: Revert asan version to 6.
* asan/asan_interface_internal.h: Remove __odr_indicator.
* asan/libtool-version: Revert shared object version to 3.
Change-Id: I9f1c1766b7d00d659f9f47468f9293aeb52a0faf
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
chefmax [Tue, 8 Nov 2016 22:16:58 +0000 (22:16 +0000)]
gcc/
* asan.h (asan_intercepted_p): Handle BUILT_IN_STRCSPN,
BUILT_IN_STRPBRK, BUILT_IN_STRSPN and BUILT_IN_STRSTR.
Change-Id: I1560e575cd81bbe1c732f696bed559abe0f4ed9c
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241984
138bc75d-0d04-0410-961f-
82ee72b054a4
chefmax [Tue, 8 Nov 2016 22:15:35 +0000 (22:15 +0000)]
gcc/
* asan.h (ASAN_STACK_MAGIC_PARTIAL): Remove.
* asan.c (ASAN_STACK_MAGIC_PARTIAL): Replace with
ASAN_STACK_MAGIC_MIDDLE.
gcc/testsuite/
* c-c++-common/asan/null-deref-1.c: Adjust testcase.
Change-Id: I348a6339d17a2cb7faf293cefdc615d1d53d237a
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241983
138bc75d-0d04-0410-961f-
82ee72b054a4
chefmax [Tue, 8 Nov 2016 22:07:50 +0000 (22:07 +0000)]
libsanitizer/
* sanitizer_common/sanitizer_stacktrace.cc (GetCanonicFrame): Assume we
compiled code with GCC when extracting the caller PC for ARM if no
valid frame pointer is available.
Change-Id: Ic974dcb0800c15eabf74a2c78f791c6cedc1aa44
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241980
138bc75d-0d04-0410-961f-
82ee72b054a4
chefmax [Tue, 8 Nov 2016 22:06:02 +0000 (22:06 +0000)]
PR sanitizer/63958
Reapply:
2014-10-14 David S. Miller <davem@davemloft.net>
* sanitizer_common/sanitizer_platform_limits_linux.cc (time_t):
Define at __kernel_time_t, as needed for sparc.
(struct __old_kernel_stat): Don't check if __sparc__ is defined.
* libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
(__sanitizer): Define struct___old_kernel_stat_sz,
struct_kernel_stat_sz, and struct_kernel_stat64_sz for sparc.
(__sanitizer_ipc_perm): Adjust for sparc targets.
(__sanitizer_shmid_ds): Likewsie.
(__sanitizer_sigaction): Likewise.
(IOC_SIZE): Likewsie.
Change-Id: Iccdb7e974d8cb8fe5f6581da6b74b33c5bae7a9b
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241978
138bc75d-0d04-0410-961f-
82ee72b054a4
chefmax [Tue, 8 Nov 2016 22:04:09 +0000 (22:04 +0000)]
libsanitizer/
* All source files: Merge from upstream 285547.
* configure.tgt (SANITIZER_COMMON_TARGET_DEPENDENT_OBJECTS): New
variable.
* configure.ac (SANITIZER_COMMON_TARGET_DEPENDENT_OBJECTS): Handle it.
* asan/Makefile.am (asan_files): Add new files.
* asan/Makefile.in: Regenerate.
* ubsan/Makefile.in: Likewise.
* lsan/Makefile.in: Likewise.
* tsan/Makefile.am (tsan_files): Add new files.
* tsan/Makefile.in: Regenerate.
* sanitizer_common/Makefile.am (sanitizer_common_files): Add new files.
(EXTRA_libsanitizer_common_la_SOURCES): Define.
(libsanitizer_common_la_LIBADD): Likewise.
(libsanitizer_common_la_DEPENDENCIES): Likewise.
* sanitizer_common/Makefile.in: Regenerate.
* interception/Makefile.in: Likewise.
* libbacktace/Makefile.in: Likewise.
* Makefile.in: Likewise.
* configure: Likewise.
* merge.sh: Handle builtins/assembly.h merging.
* builtins/assembly.h: New file.
* asan/libtool-version: Bump the libasan SONAME.
Change-Id: I47a2591215c7529613d22a117644607b20db065b
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241977
138bc75d-0d04-0410-961f-
82ee72b054a4
Slava Barinov [Thu, 6 Jul 2017 13:14:58 +0000 (16:14 +0300)]
Fix cleanup location for try_finally_expr.
gcc/
* tree.def: Add STATEMENT_LIST_END tree code.
* tree.c: Add STATEMENT_LIST_END handling as TS_COMMON.
* gimplify.c (gimplify_expr): Use STATEMENT_LIST_END location to
provide right information for try_finally_expr.
* tree-eh.c (lower_try_finally_onedest): Set finally location
* c-family/c-semantics.c (pop_stmt_list): Support single-statement
lists extraction with STATEMENT_LIST_END in the end.
* fold-const.c (operand_equal_p): Add STATEMENT_LIST_END support.
gcc/cp/
* parser.c (cp_parser_compound_statement): Use STATEMENT_LIST_END
to keep the location of closing brace.
* pt.c: Handle STATEMENT_LIST_END.
* constraint.cc (check_function_concept): Handle concept definitions
with STATEMENT_LIST_END.
* error.c (dump_expr): Add STATEMENT_LIST_END support.
gcc/testsuite/
* g++.dg/ext/statement-list-end.C: New.
Change-Id: Id22e953b97b52d0f2a2ba44065337a59639578db
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Slava Barinov [Tue, 25 Jul 2017 08:44:17 +0000 (11:44 +0300)]
packaging: Enable ASan bootstrap for ASan projects
GCC will be built in ASan projects.
To test the GCC package the rpm macro `asanbootstrap' should be defined in
project config.
Change-Id: Id91425e2895f63ec92c8e83fb96f93aaade67728
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
timshen [Sat, 27 Aug 2016 02:03:23 +0000 (02:03 +0000)]
PR libstdc++/77356
* include/bits/regex_compiler.tcc(_M_insert_bracket_matcher,
_M_expression_term): Modify to support dash literal.
* include/bits/regex_scanner.h: Add dash as a token type to make
a different from the mandated dash literal by escaping.
* include/bits/regex_scanner.tcc(_M_scan_in_bracket): Emit dash
token in bracket expression parsing.
* testsuite/28_regex/regression.cc: Add new testcases.
(cherry-picked from commit
6f2116bed6e87668a914dc27fff34c7a68576d4e)
Change-Id: I8f516ef995f0fb7db479c441c9e7714bab518806
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239794
138bc75d-0d04-0410-961f-
82ee72b054a4
timshen [Sat, 23 Apr 2016 03:58:37 +0000 (03:58 +0000)]
PR libstdc++/70745
* include/bits/regex_executor.tcc (_Executor<>::_M_word_boundary):
Fix the match_not_bow and match_not_eow behavior.
* testsuite/28_regex/regression.cc: Add testcase.
(cherry-picked from commit
566d49d6947f4590609562dd5f33d0e6b24a4267)
Change-Id: Ie38f6f857575432c90f9ae17576ddff4c7bc021a
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235382
138bc75d-0d04-0410-961f-
82ee72b054a4
Slava Barinov [Thu, 13 Jul 2017 12:59:38 +0000 (15:59 +0300)]
Remove target-libgfortran from default targets
* configure.ac: Make target-libgfortran a configure option.
* configure: Regenerate.
This fixes on-host build broken by
58909fae.
Now OBS build works as usual since it provides --enable-libgfortran explicitly
and on-host test builds are not broken with error
`GNU Fortran compiler is not working'
Change-Id: I39ea37ddb0e52c1e2b43e3d304da1389ce615010
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Slava Barinov [Fri, 14 Jul 2017 08:25:35 +0000 (11:25 +0300)]
Switch on detect_leaks on 64-bit platforms by default
libsanitizer/
* asan/asan_flags.cc: Switch on leak detection for 64-bit target.
* lsan/lsan.cc: Likewise.
* sanitizer_common/sanitizer_flags.inc: Likewise.
Neither the OBS build nor sanitized firmware build are affected.
When Tizen application developer enables ASan for his own package only and run
it in 64-bit emulator (without any additional setup) ASan will report leaks
additionally to all other error messages.
Change-Id: Id16017e9bbe5221778330287c707bdf1846f0760
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Mikhail Kashkarov [Thu, 20 Jul 2017 11:19:13 +0000 (14:19 +0300)]
[TTC-3] Fix asan_symbolize.py output frame numbers.
If input line already symbolized and has format
'#0 0x7f6e35cf2e45 in func foo:46' - fix internal frame number.
packaging/
* asan_symbolized.py (have_line_to_symbolized): New function.
Change-Id: I2c52c58f9e2d6dfce709e87dee2abd62b642bcad
Mikhail Kashkarov [Thu, 13 Jul 2017 14:02:39 +0000 (17:02 +0300)]
[TTC-2] Fix asan_symbolize.py for C++ function prototypes detection.
Change-Id: Iffa30dce19f99506312a93b79cc8deb05404a82a
Sangmin Seo [Wed, 12 Jul 2017 09:37:50 +0000 (18:37 +0900)]
packaging: append -ldl -lpthread to ASan force options.
When building for address sanitization, some packages complain about
missing symbols due to omitted -ldl or -pthread. This patch appends
-ldl and -lpthread to the ASan force options in order to resolve this
kind of issue. Note that since -ldl and -lpthread are already needed
by libasan, adding them to the ASan force options should not cause any
problems.
This patch also adds -Wl,--as-needed before -ldl -lpthread in the
force options to prevent libdl or libpthread from being linked when
unnecessary.
Change-Id: Ic50059d4684e15773f56c589cfacda0bc944d955
Signed-off-by: Sangmin Seo <sangmin7.seo@samsung.com>
Sangmin Seo [Tue, 18 Jul 2017 05:01:23 +0000 (14:01 +0900)]
packaging: create a wrapper for collect2 in gcc-force-options
gcc-force-options used to prepend/append all force options to the
gcc/g++ wrappers. This approach worked well for most packages but
caused some configure scripts to behave differently when linker flags
are included in the force options. For example, if g++ is called with
-ldl appended, it always goes to the linking phase. As a result, when
configure has expanded AC_PROG_CXXCPP macro, variables related to
preprocessor are not properly set and actual build ends up using
incorrect compile and link flags.
Since prepending or appending linker flags to the linker makes more
sense than carrying them from the compilation phase, this patch
basically divides the force options into compiler flags and linker
ones, and inserts them to corresponding wrappers. Consequently, a
wrapper for collect2 is created, as we did for gcc and g++, in order
to pass the linker flags to the linker. Note that collect2 bridges
the compiler and the actual linker, and thus creating a wrapper for
collect2 is more portable and succinct than doing so for linkers.
Change-Id: I8733bf14c5a2c04bfebe38a339c94e7a738cf17c
Signed-off-by: Sangmin Seo <sangmin7.seo@samsung.com>
Slava Barinov [Thu, 13 Jul 2017 10:35:02 +0000 (13:35 +0300)]
packaging: Add %gcc_force_options and %gcc_unforce_options macros
The macros can be used in certain .spec files to switch off sanitization of
parts or modules without hard-coding sanitizer flags into packages.
Change-Id: I1643a3bdd64a3d48855f02622feb064d482e3655
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Signed-off-by: Sangmin Seo <sangmin7.seo@samsung.com>
Sangmin Seo [Thu, 29 Jun 2017 07:56:39 +0000 (16:56 +0900)]
Do not emit the -Wpsabi note for PR target/77728
Since PR target/77728 issue did not exist in Tizen/Linaro GCC 4.9.2
and has been resolved with the upstream patches, it does not make
sense to print the -Wpsabi note, which is "parameter passing for
argument of type ... changed in GCC 7.1." This patch removes the
-Wpsabi note generated by the commit
6da83d4adc857ba1c4370b2b8f32825d5cb13ebe
and dg-message comments from the test code.
gcc/config/
* arm/arm.c (aapcs_layout_arg): Remove code emitting -Wpsabi note.
(arm_function_arg): Likewise.
(arm_function_arg_boundary): Likewise.
(arm_setup_incoming_varargs): Likewise.
gcc/testsuite/
* g++.dg/abi/pr77728-1.C: Remove dg-message comments.
Change-Id: I5432536052bf9d534e21157ddfd2ac57d25da59f
Signed-off-by: Sangmin Seo <sangmin7.seo@samsung.com>
Mikhail Kashkarov [Thu, 15 Jun 2017 16:47:33 +0000 (19:47 +0300)]
Tests of AAPCS64 updates for alignment attribute
gcc/testsuite/
* gcc.target/aarch64/aapcs64/aapcs64.exp: Also execute rec_*.c
* gcc.target/aarch64/aapcs64/rec_align-5.c: New.
* gcc.target/aarch64/aapcs64/rec_align-6.c: New.
* gcc.target/aarch64/aapcs64/rec_align-7.c: New.
* gcc.target/aarch64/aapcs64/rec_align-8.c: New.
* gcc.target/aarch64/aapcs64/rec_align-9.c: New.
* gcc.target/aarch64/aapcs64/test_align-5.c: New.
* gcc.target/aarch64/aapcs64/test_align-6.c: New.
* gcc.target/aarch64/aapcs64/test_align-7.c: New.
* gcc.target/aarch64/aapcs64/test_align-8.c: New.
* gcc.target/aarch64/aapcs64/test_align-9.c: New.
* gcc.target/aarch64/aapcs64/rec_vaarg-1.c: New.
* gcc.target/aarch64/aapcs64/rec_vaarg-2.c: New.
Backported from trunk:
84ee090575f413f92377812d277b705d023a4b0b
Change-Id: Idf931ee8b3b5f556b7341734eb940f9a0926a03f
Mikhail Kashkarov [Thu, 15 Jun 2017 14:03:07 +0000 (17:03 +0300)]
Implement AAPCS64 updates for alignment attribute.
PR target/77728
gcc/
* config/aarch64/aarch64.c(aarch64_function_arg_alignmentq):
Rewrite, looking one level down for records and arrays.
Ignore TYPE_FIELDS chain decls other than FIELD_DECLs.
(aarch64_layout_arg): Adjust aarch64_function_arg_alignment caller.
(aarch64_function_arg_boundary): Likewise. Simplify using MIN/MAX.
(aarch64_gimplify_va_arg_expr): Adjust aarch64_function_arg_alignment
caller.
testsuite/
* g++.dg/abi/pr77728-2.C: New test.
Backported from trunk:
be35fa06e8f976e1cb880988d5c82813106922fd
32cb614ad1f60267f914e38da26a73259299d720
26312b0ea5f3dfc6e3d8d8d18c76d464d6fa328e
Change-Id: I4293167468353e9730dc918b87edda4484af8315
jakub [Tue, 25 Apr 2017 16:47:32 +0000 (16:47 +0000)]
PR target/77728
* config/arm/arm.c: Include gimple.h.
(aapcs_layout_arg): Emit -Wpsabi note if arm_needs_doubleword_align
returns negative, increment ncrn only if it returned positive.
(arm_needs_doubleword_align): Return int instead of bool,
ignore DECL_ALIGN of non-FIELD_DECL TYPE_FIELDS chain
members, but if there is any such non-FIELD_DECL
> PARM_BOUNDARY aligned decl, return -1 instead of false.
(arm_function_arg): Emit -Wpsabi note if arm_needs_doubleword_align
returns negative, increment nregs only if it returned positive.
(arm_setup_incoming_varargs): Likewise.
(arm_function_arg_boundary): Emit -Wpsabi note if
arm_needs_doubleword_align returns negative, return
DOUBLEWORD_ALIGNMENT only if it returned positive.
testsuite/
* g++.dg/abi/pr77728-1.C: New test.
Backported from trunk:
0e6ba620ce829dbde3ece9cefdbe09355ddfbb74
Change-Id: Ia454a63c3ebb930e546188ded5f339a967d81754
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@247259
138bc75d-0d04-0410-961f-
82ee72b054a4
Denis Khalikov [Mon, 29 May 2017 17:35:03 +0000 (20:35 +0300)]
[ubsan] Fix for vptr check
Summary:
There can be a situation when vptr not initializing
by constructor of the object, and has a junk data
which should be properly checked, because c++ standard
says:
"If the new-initializer is omitted, the object is default-initialized (8.5).
[ Note: If no initialization is performed,
the object has an indeterminate value. — end note ]
Change-Id: I6fd297dc10b2ddb54eaed9e6eb3a46310dafead4
Signed-off-by: Denis Khalikov <d.khalikov@partner.samsung.com>
Denis Khalikov [Thu, 8 Jun 2017 08:32:02 +0000 (11:32 +0300)]
[asan] Fix ASan preload issue.
There might be a situation when ASan initializing later
than shared library which has malloc in static constructor.
(rtld doesn't provide the order of initiazation)
In this case ASan doesn't initialize interceptors but already
intercepting malloc. If malloc is too big to be handled by static
local pool ASan will die with error:
Sanitizer CHECK failed: libsanitizer/asan/asan_malloc_linux.cc:40
((allocated_for_dlsym)) < ((kDlsymAllocPoolSize)) (1036, 1024)
Backported from LLVM mainline rL305058
Change-Id: I93c9662953629b373506fcacacee43edd791c68f
Signed-off-by: Denis Khalikov <d.khalikov@partner.samsung.com>
Chan Lee [Thu, 1 Jun 2017 03:28:22 +0000 (12:28 +0900)]
packaging: enable log_exe_name sanitizer option for ASan
This option shoule be 'log_exe_name' not 'log_exe_path'
According to SanitizerCommonFlags,
(https://github.com/google/sanitizers/wiki/SanitizerCommonFlags)
Enabling this option makes ASan mention name of executable when reporting error and append
executable name to logs (as in "log_path.exe_name.pid").
Change-Id: I0a49a2032355b6527ea7522faa1414ec8d567125
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
Denis Khalikov [Fri, 2 Jun 2017 09:17:06 +0000 (12:17 +0300)]
PR sanitizer/80414
* ubsan.c (ubsan_expand_bounds_ifn): Pass original index
to ubsan_encode_value.
Change-Id: Id8e339c51aac586cd7d61e02a6711e875354948a
Signed-off-by: Denis Khalikov <d.khalikov@partner.samsung.com>
Denis Khalikov [Mon, 17 Apr 2017 16:31:13 +0000 (19:31 +0300)]
[ubsan] Ported fix for PR sanitizer/79897
2017-03-07 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/79897
* ubsan.c (ubsan_encode_value): Call mark_addressable on the
temporary.
Change-Id: I075edb26f51d4ec2eccc2e59dbbe489b43b3b5db
Signed-off-by: Denis Khalikov <d.khalikov@partner.samsung.com>
nathan [Thu, 27 Apr 2017 10:56:35 +0000 (13:56 +0300)]
PR c++/79296 - ICE mangling localized template instantiation
* decl2.c (determine_visibility): Use template fn context for
local class instantiations.
PR c++/79296
* g++.dg/cpp0x/pr79296.C: New.
Change-Id: I51b9ba39a48a97a8836976baf5f598ede9ba695a
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245398
138bc75d-0d04-0410-961f-
82ee72b054a4
Dmitriy Nikiforov [Thu, 11 May 2017 14:37:27 +0000 (17:37 +0300)]
[sanitizer-coverage] Add new coverage dump interface
libsanitizer/
* include/santizer/coverage_interface.h
(__sanitizer_dump_coverage): New function.
* sanitizer_common/sanitizer_interface_internal.h
(__sanitizer_dump_coverage): Likewise.
* sanitizer_common/sanitizer_coverage_libcdep_new.cc: New file.
* sanitizer/Makefile.am: Updated.
* sanitzer/Makefile.in: Updated.
Partially backported from LLVM mainline r289498, r291267, r291736, r289851.
Change-Id: I6c13ca8e6e7cfb3c98596970c8ba243296464eeb
Signed-off-by: Dmitriy Nikiforov <d.nikiforov@partner.samsung.com>
Dmitriy Nikiforov [Thu, 11 May 2017 14:24:59 +0000 (17:24 +0300)]
[sanitizer-coverage] Add interface for coverage symbolization
libsanitizer/
* sanitizer_common/sanitizer_stacktrace_libcdep.cc:
(__sanitizer_symbolize_pc): New function.
(__sanitizer_get_module_and_offset_for_pc): New function.
* include/sanitizer/common_interface_defs.h
(__sanitizer_symbolize_pc): Likewise.
(__sanitizer_get_module_and_offset_for_pc): Likewise.
* sanitizer_common/sanitizer_interface_internal.h
(__sanitizer_get_module_and_offset_for_pc): Likewise.
Partially backported from LLVM mainline r281886, r279780, r288711,
r281668, r281015, r289498. Also, fixed argument names in declarations of
__sanitizer_get_module_and_offset_for_pc().
Change-Id: I3722eb8d3e1cd07b6b862f1a4421517b32b22c5a
Signed-off-by: Dmitriy Nikiforov <d.nikiforov@partner.samsung.com>
Dmitriy Nikiforov [Thu, 11 May 2017 14:21:34 +0000 (17:21 +0300)]
[sanitizer-coverage] Add stub for trace-pc instrumentation
libsanitizer/
* sanitizer_common/sanitizer_coverage_libcdep.cc (__sanitizer_cov_trace_pc):
New function.
Change-Id: I1ead302ccb56c8f20d1a6e29a7cdef8963fa4090
Signed-off-by: Dmitriy Nikiforov <d.nikiforov@partner.samsung.com>
Mikhail Kashkarov [Wed, 10 May 2017 09:58:52 +0000 (12:58 +0300)]
Move static array from header to .c file (fixed increased memory usage bs-45)
Please, remove this commit when merging c1cb342.
gcc/
* config/arm/arm-opts.h: Move struct arm_arch_core_flag and
static array arm_arch_core_flags to...
* common/config/arm/arm-common.c: There.
Change-Id: Id71ddb5deac5372791b63f9bf03852e661477bf4
Slava Barinov [Thu, 27 Apr 2017 08:20:09 +0000 (11:20 +0300)]
Do not build libgfortran unless requested explicitly
* gcc/fortran/config-lang.in : add conditional target_libs setup.
This option does not make sense in upstream GCC - Fortran frontend is useless
without runtime, but will work with qemu-accel in Tizen OBS environment.
Change-Id: Ie42fa3201a0bc022ef46ef53b51be896ad091943
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Chan Lee [Mon, 24 Apr 2017 07:11:01 +0000 (16:11 +0900)]
packaging: add fortran compiler
Change-Id: I139d3b29c690a05e29bcfcfa660350f63bbbdadc
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
Denis Khalikov [Wed, 26 Apr 2017 15:27:29 +0000 (18:27 +0300)]
commit
6fdba17a20fd7c5f31f39556dc511abe3a537204
Author: Maxim Ostapenko <m.ostapenko@partner.samsung.com>
Date: Fri Oct 28 06:49:53 2016 +0000
[asan/lsan] Avoid possible deadlock in dynamic ASan runtime thread initialization.
There is possible deadlock in dynamic ASan runtime when we dlopen() shared lib
which creates a thread at the global initialization stage. The scenario:
1) dlopen grabs a GI_pthread_mutex_lock in main thread.
2) main thread calls pthread_create, ASan intercepts it, calls real pthread_create
and waits for the second thread to be "fully initialized".
3) Newly created thread tries to access a thread local disable_counter in LSan
(to complete its "full initialization") and hangs in tls_get_addr_tail, because
it also tries to acquire GI_pthread_mutex_lock.
The issue is reproducible on relative recent Glibc versions e.g. 2.23.
Differential Revision: https://reviews.llvm.org/D26028
Change-Id: I0ed82cb81dd9d37d0be96ece03b667090b72164a
Slava Barinov [Fri, 7 Apr 2017 10:06:58 +0000 (13:06 +0300)]
Remove hard-coded path to extract-ubsan-logs script
Change-Id: Id515f89e748fbe9a18f5a615e100eb530a0c5930
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Dongkyun, Son [Thu, 6 Apr 2017 10:03:50 +0000 (19:03 +0900)]
Keep to use version 6.2.1
This is for the Tizen version policy (First released to 6.2.1
20161213)
Change-Id: I6aa5d673c922401eff605448fe4ab6b3512ccd71
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
Dongkyun, Son [Fri, 7 Apr 2017 01:27:29 +0000 (10:27 +0900)]
packaging: add license files to all sub components
The license files are added to only library components because they could be
included to target binary.
Change-Id: I7fb9885843794ea47c29833ead402386d890d663
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
Chan Lee [Fri, 7 Apr 2017 07:04:02 +0000 (16:04 +0900)]
packaging: remove cloog
Cloog had been removed from gcc.
Related git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218348
138bc75d-0d04-0410-961f-
82ee72b054a4
Change-Id: Ifc898f5f4b429382d082b43e3cbfd4e46b226e2f
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
Chan Lee [Mon, 27 Mar 2017 01:30:18 +0000 (10:30 +0900)]
packaging: provide 64bit libs on 32bit build env
In some cases, especially .Net toolchain needs 64bit libs to execute
even though 32bit build environment.
It's a little weird but possble because almost archtecture of build machine is 64bit.
Change-Id: I0d8df53d4743a4fa1b2c00d6aeeeed77e8b964cf
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
Slava Barinov [Thu, 2 Mar 2017 08:47:59 +0000 (11:47 +0300)]
Enabling libcc1 build
Change-Id: I4485bdf215e020450a65970474b591e98a7367f1
Slava Barinov [Tue, 28 Feb 2017 12:17:45 +0000 (15:17 +0300)]
Add liblsan packaging
Change-Id: I44084744a83cdc87e69b2a1f25cc4138bac31913
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Slava Barinov [Tue, 28 Feb 2017 11:35:47 +0000 (14:35 +0300)]
Basing on 6.3.1 branch
Change-Id: Idbb9664859cb4a000f1a5631bc948652b49e9fc4
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Maxim Ostapenko [Tue, 8 Nov 2016 10:45:49 +0000 (13:45 +0300)]
Move SanitizerToolName definition before MaybeMountProcFS.
The MaybeMountProcFS uses SanitizerToolName in its failure messages so we
need it defined at this point.
Change-Id: I6a568e1ebf3d646ecfbdb53fd8e48910e9b66559
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
Ivan Baravy [Mon, 27 Feb 2017 08:44:27 +0000 (11:44 +0300)]
Fix the UBSan inexpensive call sanitization
The change imported in order to fix false positive -Wmaybe-uninitialized
in several packages in UBSan builds.
* gimple.c: Include builtins.h
(gimple_inexpensive_call_p): New function.
* gimple.h (gimple_inexpensive_call_p): Declare.
* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Use it.
* tree-ssa-loop-ivcanon.c (tree_estimate_loop_size): Likewise;
fix formatting.
upstream hash:
f18de397b1e0523fd840800399ec6ea21ec04af8
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237172
138bc75d-0d04-0410-961f-
82ee72b054a4
Authored-by: hubicka
Ivan Baravy [Mon, 27 Feb 2017 08:07:23 +0000 (11:07 +0300)]
Make lsan-force-options and lsan-build-env more usable. Factor out common
code from {A, UB}San to sanitizer_common code.
Add -fno-omit-frame-pointer -U_FORTIFY_SOURCE to lsan-force-options because
LSan heavily relies on frame pointers. Disable LSan in QEMU builds through
LSAN_OPTIONS file. Refactor Tizen specific patches in ASan and UBSan.
Maxim Ostapenko [Thu, 4 Aug 2016 08:27:22 +0000 (11:27 +0300)]
Fix ASan tests.
Some ASan tests fail due to:
1) Unable to unwind malloc trace.
2) Return invalid code due to hant_on_error=false enabled by default.
Let's fix this.
Change-Id: I634c5bff0e21a693a4168eaa12f443cee114a83e
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
Ivan Baravy [Mon, 27 Feb 2017 08:00:20 +0000 (11:00 +0300)]
Set detect_leaks = false and halt_on_error = false by default.
Set detect_leaks and halt_on_error to false by default because mic
installs asan-build-env package too late.
Maxim Ostapenko [Wed, 6 Jul 2016 10:04:28 +0000 (13:04 +0300)]
Remove redundant calls of MaybeMountProcFS and refactor it.
It seems that we have lots of redundant MaybeMountProcFS, in particular
each mapped sanitized shared library calls it from AsanInitializer constructor.
Remove redudant MaybeMountProcFS calls from AsanInitializer and __asan_init.
Also, it seems that under qemu-aarch64 opening /proc/self/maps for reading
might be very expensive, so replace OpenFile("/proc/self/maps", RdOnly) with
FileExists("/proc/self/maps") in MaybeMountProcFS to avoid expensive calls.
Change-Id: I8ba28dbbc102be519fa2b284520509f601ec5cf7
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
Ivan Baravy [Mon, 27 Feb 2017 07:52:50 +0000 (10:52 +0300)]
Backport from GCC mainline.
2016-06-10 Maxim Ostapenko <m.ostapenko@samsung.com>
PR sanitizer/71480
* varasm.c (place_block_symbol): Adjust alignment for asan protected
STRING_CSTs even if TREE_CONSTANT_POOL_ADDRESS_P.
* c-c++-common/asan/pr71480.c: New test.
Ivan Baravy [Mon, 27 Feb 2017 07:42:49 +0000 (10:42 +0300)]
Fix c-c++-common/asan/pr64820.c testcase to pass output pattern tests under
qemu-aarch64. Adjust halt_on_error tests.
gcc/testsuite/
* c-c++-common/asan/pr64820.c: Adjust output patterns.
* c-c++-common/asan/halt_on_error-1.c: Adjust.
* c-c++-common/asan/halt_on_error-1.c: Likewise.
Ivan Baravy [Mon, 27 Feb 2017 07:27:43 +0000 (10:27 +0300)]
Backport Tizen specific stuff from VDLinux 6.
Backport from VDLinux 5. Optionally mount /proc in __asan_init to allow
systemd sanitization.
2014-10-21 Yury Gribov <y.gribov@samsung.com>
JIRA: MAVDT-64
* libsanitizer/asan/asan_rtl.cc (MaybeMountProcFS): New function.
(__asan_init): Call MaybeMountProcFS.
Mount /proc not only in AsanInitInternal, but also in __asan_init and AsanInitializer to
ensure we have proc mounted when needed.
* libsanitizer/asan/asan_rtl.cc (__asan_init): Call MaybeMountProcFS.
* (AsanInitializer): Likewise.
Set address space unlimited if it is not.
* libsanitizer/asan/asan_rtl.cc (MaybeDisableUlimit): New function.
(AsanInitInternal): Call it.
Read ASan and UBSan options from predefined file if it is available.
* libsanitizer/asan/asan_flags.cc: Read ASAN_OPTIONS from predefined
file if available.
* libsanitizer/ubsan/ubsan_flags.cc: Likewise.
Maxim Ostapenko [Mon, 26 Dec 2016 08:44:46 +0000 (11:44 +0300)]
Move lsan_check_in_progress definition to lsan_common.cc.
This commit fixes undefined reference error from libasan.so:
/lib/libasan.so: undefined reference to `lsan_check_in_progress'
occurred due to ASan runtime embeds part of LSan runtime and
misses lsan_check_in_progress symbol. To overcome the issue, just move
lsan_check_in_progress definition to lsan_common.cc.
Change-Id: I9ed7f4d490d525bbf7ce054285afaec24716f35a
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
Maxim Ostapenko [Wed, 5 Oct 2016 14:04:08 +0000 (17:04 +0300)]
Add mmap/munmap interceptors.
Some allocators may use mmap for their local pools that may cause false positive
reports because LSan currently doesn't intercept mmap call mainly due to its
complexity (we don't know whether a particular mmap would contain live pointers).
However for some cases (e.g. anonymous rw mmaps) we can guess that they would
contain live pointers thus we can add them into root regions. Thus, now we
intercept mmap/munmap calls, add anonymous rw mappings into root regions and
call real mmap.
Change-Id: Ie0bde91497a31ab670f15d67b34d328969dc0981
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
Maxim Ostapenko [Thu, 17 Nov 2016 12:58:25 +0000 (15:58 +0300)]
Make {A, L}San allocator more compact.
This change tries to reduce memory consumption of {A, L}Saned image by hacking
primary allocator internals:
* Reduce region size 2^20 -> 2^17.
* Make largest chunk size in primary allocator 2^17 -> 2^16.
The change appears to be quite useful for LSan'ed image:
Stock version:
total used free shared buffers cached
Mem: 964 828 136 3 4 92
Patched version:
total used free shared buffers cached
Mem: 964 688 275 5 13 185
Change-Id: I80b95f7dfb5a7be0e7208567a31606a3d027256c
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
Slava Barinov [Tue, 15 Nov 2016 12:51:42 +0000 (15:51 +0300)]
Set 0777 mode to sanitizer tool report
There are processes which are executed with root permissions and then
change the user during run on target.
Without setting up the file mode to 0777 trying to write log causes
write error and process exits.
Change-Id: I88c6738625d67f4db2efea76cc8928d4f58b6e7c
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Maxim Ostapenko [Mon, 7 Nov 2016 17:16:48 +0000 (20:16 +0300)]
Support print_cmdline in LSan.
Change-Id: I65d37582e6b5c3d54f8628e96edbaf4cbfc7c337
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
Slava Barinov [Wed, 24 Aug 2016 12:30:20 +0000 (15:30 +0300)]
Switch off UBSan for sha1 to reduce number of log messages
The sha1 contains intentional unaligned access
Change-Id: I5bb6d0c9bf274e8ed0fe4c87c341dee054623202
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Slava Barinov [Tue, 8 Nov 2016 08:32:09 +0000 (11:32 +0300)]
Force halt_on_error=true in ASan tests
Since our ASan does not fail application on error by default we should
switch this behaviour on explicitly to keep testsuite work.
Change-Id: I4344f82427bc62a40604a75f5f09f62333b6782d
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Ivan Baravy [Tue, 21 Feb 2017 18:26:42 +0000 (21:26 +0300)]
* gcc.dg/ubsan/static-init-null.c: New testcase
Slava Barinov [Wed, 31 Aug 2016 14:41:46 +0000 (17:41 +0300)]
Set 0644 mode to sanitizer tool report
Without setting up the file mode explicitly its impossible to read the
logs by users in OBS.
Change-Id: Icaa540b434fc6266cbd0b1ad3391e21b8cbb692f
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Slava Barinov [Tue, 30 Aug 2016 09:09:23 +0000 (12:09 +0300)]
Add binary name printing support to UBSan
The binary name is needed for reporting with log_path since PID is not
always enough to identify the process right.
Change-Id: Ibefe22bac9f4d2a89eaacb40e6d7dc860b08d5f9
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Slava Barinov [Thu, 25 Aug 2016 09:51:43 +0000 (12:51 +0300)]
Add SanitizerToolName to UBSan report message
Change-Id: Ia258f1e3906bb095ca0d33d3354dd9b1f640c89f
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
Maxim Ostapenko [Mon, 19 Sep 2016 14:38:07 +0000 (17:38 +0300)]
Deliver LSan fixes for Tizen.
* Read LSAN_OPTIONS from /LSAN_OPTIONS file.
* Add MaybeMountProcFS stuff for LSan. This would allow us to preload
liblsan.so even for systemd when /proc/ isn't mounted yet.
* Add ARM and x86 ports for LSan.
* Add PointsIntoChunk method to protect against segfault when pointer
points to metadata.
* Make cf.exitcode = 0 by default.
commit
a6549ffda72b4f84bbd2c763640181eaeccf6582
Maxim Ostapenko [Mon, 19 Sep 2016 14:38:07 +0000 (17:38 +0300)]
Add temporal fix for https://github.com/google/sanitizers/issues/703.
Redefine SANITIZER_MMAP_RANGE_SIZE to (1UL << 40) for AArch64. This is a
workaround for https://github.com/google/sanitizers/issues/703 that speeds
up LSan and makes it usable for AArch64.
Change-Id: I31672b4feab6c91a2ec17fae76ab9d1d494aeb5c
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
Maxim Ostapenko [Thu, 24 Mar 2016 12:12:07 +0000 (15:12 +0300)]
Backport recovery mode related stuff from LLVM mainline.
Backport ASan reports deduplication in recovery mode.
Backport from LLVM upstream r255228.
Optionally print reproducer cmdline in ASan reports.
Backport from LLVM upstream r258037.
Fix internal CHECK failure on double free in recovery mode.
Backport from LLVM upstream r259473.
Bail out on stack overflow in ASan recovery mode.
Backport from LLVM upstream r268713.
Change-Id: I11ad0ddf94e803a0f240bf76cdff529e1b72f576
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
Dongkyun, Son [Thu, 2 Feb 2017 06:27:19 +0000 (15:27 +0900)]
packaging: explicitly added configure options
--enable-plugin (same as 4.9's)
--disable-libcc1 (new on 6.2's)
Change-Id: I005be6c5c888597cda64b0fe94b6d20399ef4c93
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
Chan Lee [Thu, 19 Jan 2017 06:54:25 +0000 (15:54 +0900)]
packaging: remove plugin packages and files
Change-Id: I416cdc6e1bc6c687427a48796f1575a94f678f10
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
Chan Lee [Thu, 19 Jan 2017 06:51:50 +0000 (15:51 +0900)]
packaging: disable lsan for arm and x86
Change-Id: I0ff97d8f50f386eabd49f8b5d1479f6645e52e90
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
Dongkyun, Son [Wed, 11 Jan 2017 10:29:59 +0000 (19:29 +0900)]
packaging: add packaging
Change-Id: Icd5159e115d6827eaaff5ff59861d07438c29129
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
Yvan Roux [Fri, 10 Feb 2017 13:33:22 +0000 (13:33 +0000)]
Make Linaro GCC Snapshot 6.3-2017.02.
gcc/
* LINARO-VERSION: Update.
Change-Id: Iacba5ee450e7d5173ae2ae0e1b60100281b09706
Yvan Roux [Mon, 6 Feb 2017 12:25:57 +0000 (13:25 +0100)]
Merge branches/gcc-6-branch rev 245201.
Change-Id: Ibc46d8742ef080683f302f5623b4907e9622ac4c
Christophe Lyon [Mon, 30 Jan 2017 10:21:03 +0000 (10:21 +0000)]
gcc/testsuite/
Backport from trunk r244891.
2016-01-25 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.dg/lto/pr54709_0.c: Require 'shared' effective target.
* gcc.dg/lto/pr61526_0.c: Likewise.
* gcc.dg/lto/pr64415_0.c: Likewise.
Change-Id: I5e933c61f5f661ec9dcbd04b9f04b28e5c4ec0fb
Christophe Lyon [Mon, 30 Jan 2017 10:21:39 +0000 (10:21 +0000)]
gcc/
Backport from trunk r244894.
2016-01-25 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/79145
* config/arm/arm.md (xordi3): Force constant operand into a register
for TARGET_IWMMXT.
gcc/testsuite/
Backport from trunk r244894.
2016-01-25 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/79145
* gcc.target/arm/pr79145.c: New test.
Change-Id: Ia1ee8c855c4324fc3226fbc04bd485911c2c6289
Christophe Lyon [Mon, 30 Jan 2017 10:20:34 +0000 (10:20 +0000)]
gcc/
Backport from trunk r244879.
2017-01-24 Eric Botcazou <ebotcazou@adacore.com>
PR target/77439
* config/arm/arm.c (arm_function_ok_for_sibcall): Add back restriction
for long calls with APCS frame and VFP.
gcc/testsuite/
Backport from trunk r244879.
2017-01-24 Eric Botcazou <ebotcazou@adacore.com>
* gcc.target/arm/vfp-longcall-apcs.c: New test.
Change-Id: I1663e7b52decbb7c5d9cb13c42136e10e44940b7
Christophe Lyon [Mon, 30 Jan 2017 10:19:18 +0000 (10:19 +0000)]
gcc/
Backport from trunk r244828.
2017-01-23 Andreas Tobler <andreast@gcc.gnu.org>
* config/aarch64/aarch64.c (aarch64_elf_asm_constructor): Increase
size of buf.
(aarch64_elf_asm_destructor): Likewise.
Change-Id: I22482fe29e558254616a97aeddd6b39c48718a85
Christophe Lyon [Tue, 24 Jan 2017 20:50:47 +0000 (20:50 +0000)]
gcc/testsuite/
Backport from trunk r244772.
2017-01-23 Christophe Lyon <christophe.lyon@linaro.org>
* gcc.target/aarch64/advsimd-intrinsics/arm-neon-ref.h (CHECK_POLY): New.
(CHECK_RESULTS_NAMED_NO_FP16): Call CHECK_POLY instead of CHECK
for poly*_t types.
* gcc.target/aarch64/advsimd-intrinsics/vcnt.c (FNNAME): Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vcombine.c (void
exec_vcombine): Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vcreate.c (FNNAME): Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vget_high.c (void exec_vget_high): Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vget_low.c (void exec_vget_low): Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vldX.c (void exec_vldX): Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vldX_dup.c (void exec_vldX_dup): Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vldX_lane.c (void exec_vldX_lane): Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vmul.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vmvn.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vqtbX.c (void exec_vqtbX): Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vreinterpret_p128.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vrev.c (void exec_vrev): Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vsXi_n.inc: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vshuffle.inc: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vsli_n.c (void vsli_extra): Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vsri_n.c (void vsri_extra): Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vstX_lane.c (void exec_vstX_lane): Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vtbX.c (void exec_vtbX): Likewise.
* gcc.target/aarch64/advsimd-intrinsics/p64_p128.c (int main):
Likewise.
(TEST_VGET_LANE): Cast to uint to avoid warning.
* gcc.target/aarch64/advsimd-intrinsics/unary_sat_op.inc (void
FNNAME): Fix PRIx format for int16_t, int32_t, uint16_t, uint32_t.
* gcc.target/aarch64/advsimd-intrinsics/vfms_vfma_n.c (void
exec_vfma_vfms_n): Fix PRIx format for float64_t.
* gcc.target/aarch64/advsimd-intrinsics/vmovn.c (void exec_vmovn):
Fix PRIx format for int8_t, int16_t, uint8_t, uint16_t.
* gcc.target/aarch64/advsimd-intrinsics/vmul_lane.c (void
exec_vmul_lane): Fix PRIx format for int16_t, uint16_t.
* gcc.target/aarch64/advsimd-intrinsics/vmul_n.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vmull.c (void exec_vmull):
Fix PRIx format for int16_t, int64_t, uint16_t, uint64_t. Call
CHECK_POLY instead of CHECK for poly64_t types.
* gcc.target/aarch64/advsimd-intrinsics/vmull_lane.c (void
exec_vmull_lane): Fix PRIx format for int64_t, uint64_t.
* gcc.target/aarch64/advsimd-intrinsics/vpXXX.inc:
Fix PRIx format for int8_t, int16_t, uint8_t, uint16_t.
* gcc.target/aarch64/advsimd-intrinsics/vqabs.c (void
vqabs_extra): Fix PRIx format for int16_t, int32_t, uint16_t,
uint32_t.
* gcc.target/aarch64/advsimd-intrinsics/vqdmull.c: Fix PRIx format
for int32_t, int64_t.
* gcc.target/aarch64/advsimd-intrinsics/vqneg.c (void
vqneg_extra): Fix PRIx format for int16_t, int32_t.
* gcc.target/aarch64/advsimd-intrinsics/vreinterpret_p64.c
(TEST_VREINTERPRET_TO_POLY): New. (main): Call
TEST_VREINTERPRET_TO_POLY instead of TEST_VREINTERPRET where
needed.
Change-Id: I4e3d5d184b57c3d544daf384bebe1ca79a747cfe
Christophe Lyon [Tue, 24 Jan 2017 20:21:12 +0000 (20:21 +0000)]
gcc/
Backport from trunk r241965.
2016-11-08 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/arm/arm.c (arm_slowmul_tune): Use generic_extra_costs.
(arm_fastmul_tune): Likewise.
(arm_strongarm_tune): Likewise.
(arm_xscale_tune): Likewise.
(arm_9e_tune): Likewise.
(arm_marvell_pj4_tune): Likewise.
(arm_v6t2_tune): Likewise.
(arm_v6m_tune): Likewise.
(arm_fa726te_tune): Likewise.
gcc/
Backport from trunk r241966.
2016-11-08 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/arm/arm.opt (mold-rtx-costs): Delete.
(mnew-generic-costs): Delete.
* config/arm/arm-protos.h (struct tune_params): Delete rtx_costs field.
* config/arm/arm.c (arm_rtx_costs_1): Delete.
(arm_size_rtx_costs): Likewise.
(arm_slowmul_rtx_costs): Likewise.
(arm_fastmul_rtx_costs): Likewise.
(arm_xscale_rtx_costs): Likewise.
(arm_9e_rtx_costs): Likewise.
(arm_slowmul_tune, arm_fastmul_tune, arm_strongarm_tune,
arm_xscale_tune, arm_9e_tune, arm_v6t2_tune, arm_cortex_tune,
arm_cortex_a8_tune, arm_cortex_a7_tune, arm_cortex_a15_tune,
arm_cortex_a53_tune, arm_cortex_a57_tune, arm_cortex_a9_tune,
arm_cortex_a12_tune, arm_v7m_tune, arm_v6m_tune, arm_fa726te_tune
arm_cortex_a5_tune, arm_xgene1_tune, arm_marvell_pj4_tune,
arm_cortex_a35_tune, arm_exynosm1_tune, arm_cortex_a73_tune,
arm_cortex_m7_tune):
Delete rtx_costs field.
(arm_new_rtx_costs): Rename to...
(arm_rtx_costs_internal): ... This.
(arm_rtx_costs): Remove old way of doing rtx costs.
Change-Id: I6d1dbef466bc74c932fe597f18b8ef6cbcfb4c1c
Christophe Lyon [Tue, 24 Jan 2017 20:49:45 +0000 (20:49 +0000)]
gcc/
Backport from trunk r244643.
2016-01-19 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/aarch64/aarch64-protos.h (aarch64_nopcrelative_literal_loads):
Delete.
* config/aarch64/aarch64.md
(aarch64_reload_movcp<GPF_TF:mode><P:mode>): Delete reference to
aarch64_nopcrelative_literal_loads.
(aarch64_reload_movcp<VALL:mode><P:mode>): Likewise.
Change-Id: I734b2d4ee36a58c79daee33a2d221799e6c1efe2
Christophe Lyon [Tue, 24 Jan 2017 20:50:22 +0000 (20:50 +0000)]
gcc/
Backport from trunk r244716.
2017-01-20 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/71270
* config/arm/arm.c (neon_valid_immediate): Reject vector constants
in big-endian mode when they are not a single duplicated value.
Change-Id: Ic4d9bfae5ac18f63895ad5d4206027ce7cbcccd6
Christophe Lyon [Tue, 24 Jan 2017 20:49:19 +0000 (20:49 +0000)]
gcc/
Backport from trunk r244613.
2017-01-19 Richard Earnshaw <rearnsha@arm.com>
PR rtl-optimization/79121
* expr.c (expand_expr_real_2, case LSHIFT_EXPR): Look at the signedness
of the inner type when shifting an extended value.
gcc/testsuite/
Backport from trunk r244613.
2017-01-19 Richard Earnshaw <rearnsha@arm.com>
PR rtl-optimization/79121
* gcc.c-torture/execute/pr79121.c: New test.
Change-Id: If91063c6b5f6a7ce9b0ba96c75c04e6cd7a56bb4
Christophe Lyon [Tue, 24 Jan 2017 20:44:41 +0000 (20:44 +0000)]
gcc/
Backport from trunk r243820.
2016-12-20 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/78694
* config/arm/arm.c (dump_minipool): Copy mp->value before emitting it
in the minipool to avoid invalid RTL sharing.
gcc/testsuite/
Backport from trunk r243820.
2016-12-20 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/78694
* gcc.c-torture/compile/pr78694.c: New test.
Change-Id: Id655a90d077824831e9b365e52e749957c78226b
Christophe Lyon [Tue, 24 Jan 2017 20:48:18 +0000 (20:48 +0000)]
gcc/
Backport from trunk r244586.
2017-01-18 Wilco Dijkstra <wdijkstr@arm.com>
* config/aarch64/aarch64.c (aarch64_sched_adjust_priority)
New function.
(TARGET_SCHED_ADJUST_PRIORITY): Define target hook.
Change-Id: Id6f8c329d97ca125353b04ab813a453097bf45c0
Christophe Lyon [Tue, 24 Jan 2017 20:44:04 +0000 (20:44 +0000)]
gcc/
Backport from trunk r243755.
2016-12-16 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/aarch64/aarch64.md: New define_split above insv<mode>.
gcc/testsuite/
Backport from trunk r243755.
2016-12-16 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.target/aarch64/ubfx_lsr_1.c: New test.
gcc/
Backport from trunk r243756.
2016-12-16 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/aarch64/aarch64.md: New define_split above bswap<mode>2.
gcc/testsuite/
Backport from trunk r243756.
2016-12-16 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.target/aarch64/ubfiz_lsl_1.c: New test.
Change-Id: Ic891f120d65097d78a92ce5133c25d0710cf7405
Christophe Lyon [Tue, 24 Jan 2017 20:42:56 +0000 (20:42 +0000)]
gcc/
Backport from trunk r243744.
2016-12-16 Wilco Dijkstra <wdijkstr@arm.com>
* config/arm/arm.c (thumb_core_reg_alloc_order): Swap R12 and R14.
Change-Id: I31f4f5221b9bcb265cb8e461bcb028ee9e98c92a
Christophe Lyon [Tue, 24 Jan 2017 20:43:30 +0000 (20:43 +0000)]
gcc/
Backport from trunk r243745.
2016-12-16 Wilco Dijkstra <wdijkstr@arm.com>
* config/arm/arm.md (subsi3_carryin): Add Thumb-2 RSC #0.
(arm_negdi2) Rename to negdi2_insn, allow on Thumb-2.
* config/arm/thumb2.md (thumb2_negdi2): Remove pattern.
Change-Id: I596cd552bba3152c81f96e3e9aa9c47195e09c9f
Christophe Lyon [Tue, 24 Jan 2017 20:40:20 +0000 (20:40 +0000)]
gcc/
Backport from trunk r243011.
2016-11-30 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/78362
* config/aarch64/aarch64.md (add<mode>3): Extract inner expression
from a subreg in operands[1] and don't call REGNO on a non-reg
expression when deciding to force operands[2] into a reg.
gcc/testsuite/
Backport from trunk r243011.
2016-11-30 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/78362
* gcc.c-torture/compile/pr78362.c: New test.
Change-Id: I7c910ef24d5731c4bf14fae312da071d716cf1fb
Christophe Lyon [Tue, 24 Jan 2017 20:39:22 +0000 (20:39 +0000)]
gcc/testsuite/
Backport from trunk r242821.
2016-11-23 Naveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>
* gcc.target/aarch64/fmaxmin.c : Add -fno-vect-cost-model.
* gcc.target/aarch64/fmul_fcvt_2.c : Likewise.
* gcc.target/aarch64/vect-abs-compile.c : Likewise.
* gcc.target/aarch64/vect-clz.c : Likewise.
* gcc.target/aarch64/vect-fcm-eq-d.c : Likewise.
* gcc.target/aarch64/vect-fcm-ge-d.c : Likewise.
* gcc.target/aarch64/vect-fcm-gt-d.c : Likewise.
* gcc.target/aarch64/vect-fmovd-zero.c : Likewise.
* gcc.target/aarch64/vect-fmovd.c : Likewise.
* gcc.target/aarch64/vect-fmovf-zero.c : Likewise.
* gcc.target/aarch64/vect-fmovf.c : Likewise.
* gcc.target/aarch64/vect_ctz_1.c : Likewise.
gcc/testsuite/
Backport from trunk r242827.
2016-11-23 Naveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>
* gcc.target/aarch64/ldp_stp_1.c : Add -mcpu=generic.
* gcc.target/aarch64/store-pair-1.c : Likewise.
Change-Id: I554995f86636a9d3f9828fa7ae05406b5230be2b
Christophe Lyon [Tue, 24 Jan 2017 20:25:42 +0000 (20:25 +0000)]
gcc/
Backport from trunk r242471.
2016-11-16 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
PR target/78364
* config/arm/arm.md (*extv_reg): Restrict operands 2 and 3 to the
proper ranges for an SBFX instruction.
(extzv_t2): Likewise for UBFX.
Change-Id: I94a24294a7de7cf1c02fd841f4b184206520542e
Christophe Lyon [Tue, 24 Jan 2017 20:24:50 +0000 (20:24 +0000)]
gcc/
Backport from trunk r242384.
2016-11-14 Wilco Dijkstra <wdijkstr@arm.com>
* config/aarch64/aarch64.md (aarch64_ashl_sisd_or_int_<mode>3)
Use bfx attribute.
(aarch64_lshr_sisd_or_int_<mode>3): Likewise.
(aarch64_ashr_sisd_or_int_<mode>3): Likewise.
(<optab>si3_insn_uxtw): Likewise.
(<optab><mode>3_insn): Likewise.
(<ANY_EXTEND:optab><GPI:mode>_ashl<SHORT:mode>): Likewise.
(zero_extend<GPI:mode>_lshr<SHORT:mode>): Likewise.
(extend<GPI:mode>_ashr<SHORT:mode>): Likewise.
(<optab><mode>): Likewise.
(insv<mode>): Likewise.
(andim_ashift<mode>_bfiz): Likewise.
* config/aarch64/thunderx.md (thunderx_shift): Add bfx.
* config/arm/cortex-a53.md (cortex_a53_alu_shift): Likewise.
* config/arm/cortex-a57.md (cortex_a57_alu): Add bfx.
* config/arm/exynos-m1.md (exynos_m1_alu): Add bfx.
(exynos_m1_alu_p): Likewise.
* config/arm/types.md: Add bfx.
* config/arm/xgene1.md (xgene1_bfm): Add bfx.
gcc/
Backport from trunk r242385.
2016-11-14 Wilco Dijkstra <wdijkstr@arm.com>
* config/arm/cortex-a57.md (cortex_a57_alu): Move extend here, bfm...
(cortex_a57_alu_shift): ...here.
Change-Id: Iae492f8d77e9dfecb62dcee384f4db2abfbba6ae
Christophe Lyon [Tue, 24 Jan 2017 20:23:20 +0000 (20:23 +0000)]
gcc/
Backport from trunk r242383.
2016-11-14 Wilco Dijkstra <wdijkstr@arm.com>
* config/aarch64/aarch64.c (cortexa57_vector_cost):
Change vec_stmt_cost, vec_align_load_cost and vec_unalign_load_cost.
Change-Id: Ica758a72d803d572db08b6bd23ffed90d5b71ad4