platform/upstream/linaro-gcc.git
8 years agoBackport from GCC mainline.
Maxim Ostapenko [Tue, 14 Jun 2016 07:58:45 +0000 (10:58 +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.

Change-Id: Icbfd5b352bcc46a376c7c8bee62f73e54d4d87c2
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237306 138bc75d-0d04-0410-961f-82ee72b054a4

8 years agoBackport from GCC mainline.
Maxim Ostapenko [Wed, 18 May 2016 07:52:39 +0000 (10:52 +0300)]
Backport from GCC mainline.

2015-02-09  Jakub Jelinek  <jakub@redhat.com>

PR sanitizer/64981
* builtins.c (expand_builtin): Call targetm.expand_builtin
for BUILT_IN_MD builtins regardless of asan_intercepted_p.

* gcc.dg/asan/pr64981.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220551 138bc75d-0d04-0410-961f-82ee72b054a4

Change-Id: I9a9a63e81bfaca534a8cfeadbaca7d5b55eae5c2
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
8 years agoInstall ASAN_OPTIONS from file
Slava Barinov [Thu, 12 May 2016 10:06:59 +0000 (13:06 +0300)]
Install ASAN_OPTIONS from file

Using ASAN_OPTIONS file is simpler solution that post-install script and
prevents issues with sanitized bash.

Change-Id: Iaa2b362f0cff0d7269635780dfc88bd6c3ec7d52
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
8 years agoMove sanitizer libraries to corresponding packages
Slava Barinov [Wed, 11 May 2016 08:52:36 +0000 (11:52 +0300)]
Move sanitizer libraries to corresponding packages

Currently libasan.so, libtsan.so and liblsan.so symlinks are packaged
into gcc.rpm but asan-build-env script pushes 'libasan.so' name without
suffix into /etc/ld.so.preload which breaks sanitized builds.

Now they are moved into corresponding packages and will be created
during sanitizer rpm installation.

Change-Id: I0917185adb0084048ef54c1cf9b40874006b71e0
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
8 years agoBail out on stack overflow in ASan recovery mode.
Maxim Ostapenko [Tue, 10 May 2016 08:17:04 +0000 (11:17 +0300)]
Bail out on stack overflow in ASan recovery mode.
In recovery mode, when ASan detects stack overflow (say, when infinite recursion
detected), it tries to continue program execution and hangs on repetitive error
reports. There isn't any sense to do it, we can just bail out on stack overflow
error, because the program would crash soon anyway.

Backport from LLVM upstream r268713.

Change-Id: Iba2760072cff7c9e767c6dae74540f22c7080bdb
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
8 years agoSupport *-build-env packages with no ld.so.preload
Slava Barinov [Fri, 29 Apr 2016 14:15:02 +0000 (17:15 +0300)]
Support *-build-env packages with no ld.so.preload

In environments where there is no existing ld.so.preload file the
post-install script from *-build-env packages fails on 'mv' command and
does not add libasan as first library which leads to build failure with
message "ASan runtime does not come first in initial library list"

Change-Id: I7f22c4bca808adf728cb4ba42482c05f9f4c919e
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
8 years agogcc-force-options: Create symlink gcc-real to allow acceleration of gcc with forced...
Yury Usishchev [Tue, 22 Mar 2016 08:05:41 +0000 (11:05 +0300)]
gcc-force-options: Create symlink gcc-real to allow acceleration of gcc with forced options.

gcc-force-options script moves gcc binary from /usr/bin/gcc to /usr/bin/gcc-real.
To correctly accelerate new binary qemu-binfmt requires symlink in /emul dirrectory.

Change-Id: Ie72fdc2775cbb2e1da00c2d8144a267bbfcfd9cf
Signed-off-by: Yury Usishchev <y.usishchev@samsung.com>
8 years agopackaing: added '--enable-lto' to configure option 26/68026/1 accepted/tizen/base/20160504.195908 submit/tizen_base/20160503.033054
Dongkyun, Son [Sat, 30 Apr 2016 12:56:17 +0000 (21:56 +0900)]
packaing: added '--enable-lto' to configure option

Change-Id: Ie71c36be6c3c178d72e1854c6643a681ff16fd9f
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
8 years agoEnable sanitizers for Aarch64 in spec files: 57/63557/4
Maxim Ostapenko [Thu, 24 Mar 2016 12:11:16 +0000 (15:11 +0300)]
Enable sanitizers for Aarch64 in spec files:
Deliver {a, l, ub}san-force-options and {a, l}san-build-env packages.

Change-Id: I2b49fabac8068ffa1170fdc4b2b96fe9a42eb25b
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
8 years agoBackport Tizen specific stuff from VDLinux 6. 56/63556/4
Maxim Ostapenko [Thu, 24 Mar 2016 12:12:41 +0000 (15:12 +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.

Change-Id: I43c68a801fef60c6b8c7adb86695fd178f408c21
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
8 years agoFix c-c++-common/asan/pr64820.c testcase to pass output pattern tests under 55/63555/4
Maxim Ostapenko [Thu, 24 Mar 2016 12:12:35 +0000 (15:12 +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.

Change-Id: Ic7be1b413b6761d4a89c4a6aa428b2255c7608e8
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
8 years agoBackport manual fixes for GCC in order to fix various build and runtime errors. 54/63554/4
Maxim Ostapenko [Thu, 24 Mar 2016 12:12:28 +0000 (15:12 +0300)]
Backport manual fixes for GCC in order to fix various build and runtime errors.

- Return to old hash table.
- Define missing void_zero_node macro.
- Add missing tree_int_cst_le function.
- Add missing gcc/signop.h header.
- Add missing macro.
- Add missing specialization stuff for double_int class.
- Add missing wi::clz and wi::clrsb functions. Add new file wide-int.cc.
- Remove include of double-int.h from gcc/gengtype.c and gcc/gengtype-state.c.
- Small fix for hash table. Change operator '->' to '.' because we have
  a reference to hash table, not a pointer.
- Change varpool_node::finalize_decl (var) back to varpool_finalize_decl (var).
- Fix sanopt.c optimizing part to fit old style pointer map.
- Fix for CHECK_TYPE_SIZE(__kernel_old_uid_t) and CHECK_TYPE_SIZE(__kernel_old_gid_t)
  fails on Aarch64.
- Replace gcall back to gimple_statement_call.
- Use old cgraph interface.
- Define missing void_node macro.
- Add missing SUBREG_PROMOTED_SIGN macro.
- Fix ICE in ubsan_type_descriptor due to overflow in tree_fits_uhwi_p.

Change-Id: I9741e28505c96c37fb1ff89f4721725c1a5a5eaf
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
8 years agoBackport recovery mode related stuff from LLVM mainline. 53/63553/4
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.

Change-Id: I11ad0ddf94e803a0f240bf76cdff529e1b72f576
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
8 years agoBackport sanitizer patches from GCC mainline. 52/63552/4
Maxim Ostapenko [Thu, 24 Mar 2016 12:11:55 +0000 (15:11 +0300)]
Backport sanitizer patches from GCC mainline.

Backport from mainline. Enable Address Sanitizer for AArch64.

2014-09-26  Christophe Lyon  <christophe.lyon@linaro.org>

gcc/
* config/aarch64/aarch64-linux.h (ASAN_CC1_SPEC): Define.
(CC1_SPEC): Define.
* config/aarch64/aarch64.c (aarch64_asan_shadow_offset): New function.
(TARGET_ASAN_SHADOW_OFFSET): Define.

libsanitizer/
* configure.tgt: Enable build on aarch64*-linux.

Conflicts:
ChangeLog.vd

2014-05-14  Yury Gribov  <y.gribov@samsung.com>

PR sanitizer/61100
* Makefile.am (nodist_saninclude_HEADERS): Install
public headers.
* Makefile.in: Regenerate.

* c-c++-common/asan/asan-interface-1.c: New test.
* lib/asan-dg.exp (asan_include_flags): New function.
(asan_init): Call asan_include_flags to obtain path
to sanitizer headers.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210413 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
gcc/testsuite/c-c++-common/asan/asan-interface-1.c

PR sanitizer/61272
* ubsan.c (is_ubsan_builtin_p): Turn assert into a condition.

* g++.dg/ubsan/pr61272.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210723 138bc75d-0d04-0410-961f-82ee72b054a4

libsanitizer merge from upstream r209283

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210743 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cc
libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h

* g++.dg/asan/asan_test.C: Add -std=c++11 and
-DSANITIZER_USE_DEJAGNU_GTEST=1 to dg-options, remove
-DASAN_USE_DEJAGNU_GTEST=1.
* g++.dg/asan/asan_mem_test.cc: Updated from upstream
r209283.
* g++.dg/asan/asan_oob_test.cc: Likewise.
* g++.dg/asan/sanitizer_test_utils.h: Likewise.
* g++.dg/asan/asan_str_test.cc: Likewise.
* g++.dg/asan/asan_test_utils.h: Likewise.
* g++.dg/asan/sanitizer_test_config.h: Likewise.
* g++.dg/asan/asan_test.cc: Likewise.  Allow size 12
for long double.
* g++.dg/asan/sanitizer_pthread_wrappers.h: New file.
Imported from upstream r209283.
* g++.dg/asan/asan_test_config.h: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211090 138bc75d-0d04-0410-961f-82ee72b054a4

2014-04-15  Max Ostapenko  <m.ostapenko@partner.samsung.com>

* c-c++-common/asan/null-deref-1.c: Change regexp to pass test
under qemu-arm.
* c-c++-common/ubsan/div-by-zero-1.c: Likewise.
* c-c++-common/ubsan/div-by-zero-2.c: Likewise.
* c-c++-common/ubsan/div-by-zero-3.c: Likewise.
* c-c++-common/ubsan/load-bool-enum.c (foo): Likewise.
* c-c++-common/ubsan/null-1.c: Likewise.
* c-c++-common/ubsan/null-10.c: Likewise.
* c-c++-common/ubsan/null-11.c: Likewise.
* c-c++-common/ubsan/null-2.c: Likewise.
* c-c++-common/ubsan/null-3.c: Likewise.
* c-c++-common/ubsan/null-4.c: Likewise.
* c-c++-common/ubsan/null-5.c: Likewise.
* c-c++-common/ubsan/null-6.c: Likewise.
* c-c++-common/ubsan/null-7.c: Likewise.
* c-c++-common/ubsan/null-8.c: Likewise.
* c-c++-common/ubsan/null-9.c: Likewise.
* c-c++-common/ubsan/overflow-add-2.c: Likewise.
* c-c++-common/ubsan/overflow-int128.c: Likewise.
* c-c++-common/ubsan/overflow-mul-2.c: Likewise.
* c-c++-common/ubsan/overflow-mul-4.c: Likewise.
* c-c++-common/ubsan/overflow-negate-1.c: Likewise.
* c-c++-common/ubsan/overflow-sub-2.c: Likewise.
* c-c++-common/ubsan/pr59333.c: Likewise.
* c-c++-common/ubsan/pr59667.c: Likewise.
* c-c++-common/ubsan/pr60613-2.c: Likewise.
* c-c++-common/ubsan/pr60636.c: Likewise.
* c-c++-common/ubsan/shift-1.c: Likewise.
* c-c++-common/ubsan/shift-2.c: Likewise.
* c-c++-common/ubsan/vla-1.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209402 138bc75d-0d04-0410-961f-82ee72b054a4

PR middle-end/60281
* asan.c (asan_emit_stack_protection): Force the base to align to
appropriate bits if STRICT_ALIGNMENT.  Set shadow_mem align to
appropriate bits if STRICT_ALIGNMENT.
* cfgexpand.c (expand_stack_vars): Set base_align appropriately
when asan is on.
(expand_used_vars): Leave a space in the stack frame for alignment
if STRICT_ALIGNMENT.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209554 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/60275
* common.opt (fsanitize-recover, fsanitize-undefined-trap-on-error):
New options.
* gcc.c (sanitize_spec_function): Don't return "" for "undefined"
if flag_sanitize_undefined_trap_on_error.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_DIVREM_OVERFLOW_ABORT,
BUILT_IN_UBSAN_HANDLE_SHIFT_OUT_OF_BOUNDS_ABORT,
BUILT_IN_UBSAN_HANDLE_VLA_BOUND_NOT_POSITIVE_ABORT,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_ABORT,
BUILT_IN_UBSAN_HANDLE_ADD_OVERFLOW_ABORT,
BUILT_IN_UBSAN_HANDLE_SUB_OVERFLOW_ABORT,
BUILT_IN_UBSAN_HANDLE_MUL_OVERFLOW_ABORT,
BUILT_IN_UBSAN_HANDLE_NEGATE_OVERFLOW_ABORT,
BUILT_IN_UBSAN_HANDLE_LOAD_INVALID_VALUE_ABORT): New builtins.
* ubsan.c (ubsan_instrument_unreachable): Return
__builtin_trap () if flag_sanitize_undefined_trap_on_error.
(ubsan_expand_null_ifn): Emit __builtin_trap ()
if flag_sanitize_undefined_trap_on_error and
__ubsan_handle_type_mismatch_abort if !flag_sanitize_recover.
(ubsan_expand_null_ifn, ubsan_build_overflow_builtin,
instrument_bool_enum_load): Emit __builtin_trap () if
flag_sanitize_undefined_trap_on_error and
__builtin_handle_*_abort () if !flag_sanitize_recover.
* doc/invoke.texi (-fsanitize-recover,
-fsanitize-undefined-trap-on-error): Document.
c-family/
* c-ubsan.c (ubsan_instrument_return): Return __builtin_trap ()
if flag_sanitize_undefined_trap_on_error.
(ubsan_instrument_division, ubsan_instrument_shift,
ubsan_instrument_vla): Likewise.  Use __ubsan_handle_*_abort ()
if !flag_sanitize_recover.
testsuite/
* g++.dg/ubsan/return-2.C: Revert 2014-03-24 changes, add
-fno-sanitize-recover to dg-options.
* g++.dg/ubsan/cxx11-shift-1.C: Remove c++11 target restriction,
add -std=c++11 to dg-options.
* g++.dg/ubsan/cxx11-shift-2.C: Likewise.
* g++.dg/ubsan/cxx1y-vla.C: Remove c++1y target restriction,
add -std=c++1y to dg-options.
* c-c++-common/ubsan/undefined-1.c: Revert 2014-03-24 changes, add
-fno-sanitize-recover to dg-options.
* c-c++-common/ubsan/overflow-sub-1.c: Likewise.
* c-c++-common/ubsan/vla-4.c: Likewise.
* c-c++-common/ubsan/pr59503.c: Likewise.
* c-c++-common/ubsan/vla-3.c: Likewise.
* c-c++-common/ubsan/save-expr-1.c: Likewise.
* c-c++-common/ubsan/overflow-add-1.c: Likewise.
* c-c++-common/ubsan/shift-3.c: Likewise.
* c-c++-common/ubsan/overflow-1.c: Likewise.
* c-c++-common/ubsan/overflow-negate-2.c: Likewise.
* c-c++-common/ubsan/vla-2.c: Likewise.
* c-c++-common/ubsan/overflow-mul-1.c: Likewise.
* c-c++-common/ubsan/pr60613-1.c: Likewise.
* c-c++-common/ubsan/shift-6.c: Likewise.
* c-c++-common/ubsan/overflow-mul-3.c: Likewise.
* c-c++-common/ubsan/overflow-add-3.c: New test.
* c-c++-common/ubsan/overflow-add-4.c: New test.
* c-c++-common/ubsan/div-by-zero-6.c: New test.
* c-c++-common/ubsan/div-by-zero-7.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209672 138bc75d-0d04-0410-961f-82ee72b054a4

Fix ubsan internal-fn.c handling.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@209699 138bc75d-0d04-0410-961f-82ee72b054a4

* gcc.c (sanitize_spec_function): Handle SANITIZE_FLOAT_DIVIDE.
* builtins.def: Initialize builtins even for SANITIZE_FLOAT_DIVIDE.
* flag-types.h (enum sanitize_code): Add SANITIZE_FLOAT_DIVIDE.
* opts.c (common_handle_option): Add -fsanitize=float-divide-by-zero.
c-family/
* c-ubsan.c (ubsan_instrument_division): Handle REAL_TYPEs.  Perform
INT_MIN / -1 sanitization only for integer types.
c/
* c-typeck.c (build_binary_op): Call ubsan_instrument_division
also when SANITIZE_FLOAT_DIVIDE is on.
cp/
* typeck.c (cp_build_binary_op): Call ubsan_instrument_division
even when SANITIZE_FLOAT_DIVIDE is on.  Set doing_div_or_mod even
for non-integer types.
testsuite/
* c-c++-common/ubsan/div-by-zero-5.c: Fix formatting.
* c-c++-common/ubsan/float-div-by-zero-1.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209927 138bc75d-0d04-0410-961f-82ee72b054a4

* doc/invoke.texi: Describe -fsanitize=float-divide-by-zero.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210002 138bc75d-0d04-0410-961f-82ee72b054a4

* builtins.def: Change SANITIZE_FLOAT_DIVIDE to SANITIZE_NONDEFAULT.
* gcc.c (sanitize_spec_function): Likewise.
* convert.c (convert_to_integer): Include "ubsan.h".  Add
floating-point to integer instrumentation.
* doc/invoke.texi: Document -fsanitize=float-cast-overflow.
* flag-types.h (enum sanitize_code): Add SANITIZE_FLOAT_CAST and
SANITIZE_NONDEFAULT.
* opts.c (common_handle_option): Handle -fsanitize=float-cast-overflow.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_FLOAT_CAST_OVERFLOW,
BUILT_IN_UBSAN_HANDLE_FLOAT_CAST_OVERFLOW_ABORT): Add.
* ubsan.c: Include "realmpfr.h" and "dfp.h".
(get_ubsan_type_info_for_type): Handle REAL_TYPEs.
(ubsan_type_descriptor): Set tkind to 0xffff for types other than
float/double/long double.
(ubsan_instrument_float_cast): New function.
* ubsan.h (ubsan_instrument_float_cast): Declare.
testsuite/
* c-c++-common/ubsan/float-cast-overflow-1.c: New test.
* c-c++-common/ubsan/float-cast-overflow-10.c: New test.
* c-c++-common/ubsan/float-cast-overflow-2.c: New test.
* c-c++-common/ubsan/float-cast-overflow-3.c: New test.
* c-c++-common/ubsan/float-cast-overflow-4.c: New test.
* c-c++-common/ubsan/float-cast-overflow-5.c: New test.
* c-c++-common/ubsan/float-cast-overflow-6.c: New test.
* c-c++-common/ubsan/float-cast-overflow-7.c: New test.
* c-c++-common/ubsan/float-cast-overflow-7.h: New file.
* c-c++-common/ubsan/float-cast-overflow-8.c: New test.
* c-c++-common/ubsan/float-cast-overflow-9.c: New test.
* c-c++-common/ubsan/float-cast.h: New file.
* g++.dg/ubsan/float-cast-overflow-bf.C: New test.
* gcc.dg/ubsan/float-cast-overflow-bf.c: New test.
libsanitizer/
* ubsan/ubsan_value.cc (getFloatValue): Handle 96-bit
floating-point types.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210862 138bc75d-0d04-0410-961f-82ee72b054a4

2014-05-27  Dominique d'Humieres <dominiq@lps.ens.fr>

PR testsuite/61319
* c-c++-common/ubsan/float-cast-overflow-1.c: Make the sign of
-nan optional.
* c-c++-common/ubsan/float-cast-overflow-2.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-4.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210958 138bc75d-0d04-0410-961f-82ee72b054a4

PR testsuite/61319
* c-c++-common/ubsan/float-cast.h: Conditionally define LLONG_MAX,
LLONG_MIN, and ULLONG_MAX.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210970 138bc75d-0d04-0410-961f-82ee72b054a4

* sanitizer_common/sanitizer_stacktrace.cc: Cherry pick upstream
r209879.
* sanitizer_common/sanitizer_common.h: Likewise.
* asan/asan_mapping.h: Likewise.
* asan/asan_linux.cc: Likewise.
* tsan/tsan_mman.cc: Cherry pick upstream r209744.
* sanitizer_common/sanitizer_allocator.h: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211080 138bc75d-0d04-0410-961f-82ee72b054a4

2014-06-11  Richard Biener  <rguenther@suse.de>

* asan/asan_linux.cc: Cherry pick upstream r210012.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211453 138bc75d-0d04-0410-961f-82ee72b054a4

* asan.c (pass_sanopt::execute): Handle IFN_UBSAN_BOUNDS.
* flag-types.h (enum sanitize_code): Add SANITIZE_BOUNDS and or it
into SANITIZE_UNDEFINED.
* doc/invoke.texi: Describe -fsanitize=bounds.
* gimplify.c (gimplify_call_expr): Add gimplification of internal
functions created in the FEs.
* internal-fn.c: Move "internal-fn.h" after "tree.h".
(expand_UBSAN_BOUNDS): New function.
* internal-fn.def (UBSAN_BOUNDS): New internal function.
* internal-fn.h: Don't define internal functions here.
* opts.c (common_handle_option): Add -fsanitize=bounds.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_OUT_OF_BOUNDS,
BUILT_IN_UBSAN_HANDLE_OUT_OF_BOUNDS_ABORT): Add.
* tree-core.h: Define internal functions here.
(struct tree_base): Add ifn field.
* tree-pretty-print.c: Include "internal-fn.h".
(dump_generic_node): Handle functions without CALL_EXPR_FN.
* tree.c (get_callee_fndecl): Likewise.
(build_call_expr_internal_loc): New function.
* tree.def (CALL_EXPR): Update description.
* tree.h (CALL_EXPR_IFN): Define.
(build_call_expr_internal_loc): Declare.
* ubsan.c (get_ubsan_type_info_for_type): Return 0 for non-arithmetic
types.
(ubsan_type_descriptor): Change bool parameter to enum
ubsan_print_style.  Adjust the code.  Add handling of
UBSAN_PRINT_ARRAY.
(ubsan_expand_bounds_ifn): New function.
(ubsan_expand_null_ifn): Adjust ubsan_type_descriptor call.
(ubsan_build_overflow_builtin): Likewise.
(instrument_bool_enum_load): Likewise.
(ubsan_instrument_float_cast): Likewise.
* ubsan.h (enum ubsan_print_style): New enum.
(ubsan_expand_bounds_ifn): Declare.
(ubsan_type_descriptor): Adjust declaration.  Use a default parameter.
c-family/
* c-gimplify.c: Include "c-ubsan.h" and "pointer-set.h".
(ubsan_walk_array_refs_r): New function.
(c_genericize): Instrument array bounds.
* c-ubsan.c: Include "internal-fn.h".
(ubsan_instrument_division): Mark instrumented arrays as having
side effects.  Adjust ubsan_type_descriptor call.
(ubsan_instrument_shift): Likewise.
(ubsan_instrument_vla): Adjust ubsan_type_descriptor call.
(ubsan_instrument_bounds): New function.
(ubsan_array_ref_instrumented_p): New function.
(ubsan_maybe_instrument_array_ref): New function.
* c-ubsan.h (ubsan_instrument_bounds): Declare.
(ubsan_array_ref_instrumented_p): Declare.
(ubsan_maybe_instrument_array_ref): Declare.
testsuite/
* c-c++-common/ubsan/bounds-1.c: New test.
* c-c++-common/ubsan/bounds-2.c: New test.
* c-c++-common/ubsan/bounds-3.c: New test.
* c-c++-common/ubsan/bounds-4.c: New test.
* c-c++-common/ubsan/bounds-5.c: New test.
* c-c++-common/ubsan/bounds-6.c: New test.

Conflicts:
gcc/c-family/c-ubsan.c
gcc/ubsan.c

2014-06-23  Paolo Carlini  <paolo.carlini@oracle.com>

* sanitizer_common/sanitizer_common_interceptors.inc:
Cherry pick upstream r211008.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211912 138bc75d-0d04-0410-961f-82ee72b054a4

* c-c++-common/ubsan/bounds-2.c: Adjust dg-output.
(fn1): Remove store to out-of-bounds location.  Add memory barrier.
(fn2): Likewise.
(fn5): Likewise.
(fn6): Likewise.
(fn7): Likewise.
(fn8): Likewise.
(fn9): Likewise.
(fn11): Likewise.
* c-c++-common/ubsan/bounds-5.c (fn1): Remove store to out-of-bounds
location.  Add memory barrier.
(fn2): Likewise.
(fn3): Likewise.
(fn4): Likewise.
(fn5): Likewise.
* c-c++-common/ubsan/bounds-7.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212061 138bc75d-0d04-0410-961f-82ee72b054a4

* doc/invoke.texi (-fsanitize=bounds): Move to the table with
-fsanitize=undefined suboptions.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212146 138bc75d-0d04-0410-961f-82ee72b054a4

* convert.c (convert_to_integer): Don't instrument conversions if the
function has no_sanitize_undefined attribute.
* ubsan.c: Don't run the ubsan pass if the function has
no_sanitize_undefined attribute.
c/
* c-decl.c (grokdeclarator): Don't instrument VLAs if the function
has no_sanitize_undefined attribute.
cp/
* cp-gimplify.c (cp_genericize): Don't instrument returns if the
function has no_sanitize_undefined attribute.
* decl.c (compute_array_index_type): Don't instrument VLAs if the
function has no_sanitize_undefined attribute.
testsuite/
* c-c++-common/ubsan/attrib-2.c: New test.
* g++.dg/ubsan/return-3.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212148 138bc75d-0d04-0410-961f-82ee72b054a4

* doc/invoke.texi (-fsanitize=bounds): Tweak wording.
(-fsanitize=float-divide-by-zero): Move to the table with
-fsanitize=undefined suboptions.
(-fsanitize=float-cast-overflow): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212260 138bc75d-0d04-0410-961f-82ee72b054a4

* c-ubsan.c (ubsan_instrument_bounds): Don't instrument if
TYPE_MAX_VALUE is NULL.

* gcc.dg/ubsan/bounds-1.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212552 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/
2014-07-17  Max Ostapenko  <m.ostapenko@partner.samsung.com>

* c-c++-common/ubsan/bounds-2.c: Change output pattern.
* c-c++-common/ubsan/bounds-5.c: Likewise.
* c-c++-common/ubsan/bounds-6.c: Likewise.
* c-c++-common/ubsan/bounds-7.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-1.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-10.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-2.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-3.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-4.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-5.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-6.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-8.c: Likewise.
* gcc.dg/ubsan/float-cast-overflow-bf.c: Likewise.
* g++.dg/ubsan/float-cast-overflow-bf.C: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212755 138bc75d-0d04-0410-961f-82ee72b054a4

* c-c++-common/ubsan/bounds-2.c (fn4): Adjust to check the array size
in the structure.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212933 138bc75d-0d04-0410-961f-82ee72b054a4

* opts.c (common_handle_option): Handle -fsanitize=alignment.
* ubsan.h (enum ubsan_null_ckind): Add UBSAN_CTOR_CALL.
(ubsan_expand_bounds_ifn, ubsan_expand_null_ifn): Change return
type to bool.
* stor-layout.h (min_align_of_type): New prototype.
* asan.c (pass_sanopt::execute): Don't perform gsi_next if
ubsan_expand* told us not to do it.  Remove the extra gsi_end_p
check.
* ubsan.c: Include builtins.h.
(ubsan_expand_bounds_ifn): Change return type to bool,
always return true.
(ubsan_expand_null_ifn): Change return type to bool, change
argument to gimple_stmt_iterator *.  Handle both null and alignment
sanitization, take type from ckind argument's type rather than
first argument.
(instrument_member_call): Removed.
(instrument_mem_ref): Remove t argument, add mem and base arguments.
Handle both null and alignment sanitization, don't say whole
struct access is member access.  Build 3 argument IFN_UBSAN_NULL
call instead of 2 argument.
(instrument_null): Adjust instrument_mem_ref caller.  Don't
instrument calls here.
(pass_ubsan::gate, pass_ubsan::execute): Handle SANITIZE_ALIGNMENT
like SANITIZE_NULL.
* stor-layout.c (min_align_of_type): New function.
* flag-types.h (enum sanitize_code): Add SANITIZE_ALIGNMENT.
Or it into SANITIZE_UNDEFINED.
* doc/invoke.texi (-fsanitize=alignment): Document.
cp/
* cp-gimplify.c (cp_genericize_r): For -fsanitize=null and/or
-fsanitize=alignment call ubsan_maybe_instrument_reference
for casts to REFERENCE_TYPE and ubsan_maybe_instrument_member_call
for calls to member functions.
c-family/
* c-common.h (min_align_of_type): Removed prototype.
* c-common.c (min_align_of_type): Removed.
* c-ubsan.h (ubsan_maybe_instrument_reference,
ubsan_maybe_instrument_member_call): New prototypes.
* c-ubsan.c: Include stor-layout.h and builtins.h.
(ubsan_maybe_instrument_reference_or_call,
ubsan_maybe_instrument_reference, ubsan_maybe_instrument_call): New
functions.
testsuite/
* c-c++-common/ubsan/align-1.c: New test.
* c-c++-common/ubsan/align-2.c: New test.
* c-c++-common/ubsan/align-3.c: New test.
* c-c++-common/ubsan/align-4.c: New test.
* c-c++-common/ubsan/align-5.c: New test.
* c-c++-common/ubsan/attrib-4.c: New test.
* g++.dg/ubsan/align-1.C: New test.
* g++.dg/ubsan/align-2.C: New test.
* g++.dg/ubsan/align-3.C: New test.
* g++.dg/ubsan/attrib-1.C: New test.
* g++.dg/ubsan/null-1.C: New test.
* g++.dg/ubsan/null-2.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213406 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
gcc/asan.c
gcc/c-family/c-common.c

2014-08-28  Yury Gribov  <y.gribov@samsung.com>

* c-c++-common/asan/pr62089.c: Fix test on 32-bit platforms.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214673 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/
* flag-types.h (enum sanitize_code): Add SANITIZE_NONNULL_ATTRIBUTE
and SANITIZE_RETURNS_NONNULL_ATTRIBUTE, or them into SANITIZE_UNDEFINED.
* opts.c (common_handle_option): Handle SANITIZE_NONNULL_ATTRIBUTE and
SANITIZE_RETURNS_NONNULL_ATTRIBUTE and disable
flag_delete_null_pointer_checks for them.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_NONNULL_ARG,
BUILT_IN_UBSAN_HANDLE_NONNULL_ARG_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_ABORT): New.
* ubsan.c (instrument_bool_enum_load): Set *gsi back to
stmt's iterator.
(instrument_nonnull_arg, instrument_nonnull_return): New functions.
(pass_ubsan::gate): Return true even for SANITIZE_NONNULL_ATTRIBUTE
or SANITIZE_RETURNS_NONNULL_ATTRIBUTE.
(pass_ubsan::execute): Call instrument_nonnull_{arg,return}.
* doc/invoke.texi (-fsanitize=nonnull-attribute,
-fsanitize=returns-nonnull-attribute): Document.
gcc/testsuite/
* c-c++-common/ubsan/attrib-3.c: New test.
* c-c++-common/ubsan/nonnull-1.c: New test.
* c-c++-common/ubsan/nonnull-2.c: New test.
* c-c++-common/ubsan/nonnull-3.c: New test.
* c-c++-common/ubsan/nonnull-4.c: New test.
* c-c++-common/ubsan/nonnull-5.c: New test.
libsanitizer/
* ubsan/ubsan_handlers.cc, ubsan/ubsan_handlers.h: Cherry pick
upstream r215485, r217389, r217391 and r217400.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215118 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog:

2014-09-19  Marat Zakirov  <m.zakirov@samsung.com>

* asan.c (build_check_stmt): Alignment arg was added.
(asan_expand_check_ifn): Optimization for alignment >= 8.

gcc/testsuite/ChangeLog:

2014-09-19  Marat Zakirov  <m.zakirov@samsung.com>

* c-c++-common/asan/red-align-1.c: New test.
* c-c++-common/asan/red-align-2.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215380 138bc75d-0d04-0410-961f-82ee72b054a4

[libsanitizer merge from upstream r218156]

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215527 138bc75d-0d04-0410-961f-82ee72b054a4

libiberty/

2014-09-26  Max Ostapenko  <m.ostapenko@partner.samsung.com>

* pex-common.h (struct pex_funcs): Add new parameter for open_write field.
* pex-unix.c (pex_unix_open_write): Add support for new parameter.
* pex-djgpp.c (pex_djgpp_open_write): Likewise.
* pex-win32.c (pex_win32_open_write): Likewise.
* pex-common.c (pex_run_in_environment): Likewise.

include/

2014-09-26  Max Ostapenko  <m.ostapenko@partner.samsung.com>

* libiberty.h (PEX_STDOUT_APPEND): New flag.
(PEX_STDERR_APPEND): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215632 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/

2014-09-26  Jakub Jelinek  <jakub@redhat.com>
    Max Ostapenko  <m.ostapenko@partner.samsung.com>

* common.opt: New option.
* doc/invoke.texi: Describe new option.
* gcc.c (execute): Don't free first string early, but at the end
of the function.  Call retry_ice if compiler exited with
ICE_EXIT_CODE.
(main): Factor out common code.
(print_configuration): New function.
(files_equal_p): Likewise.
(check_repro): Likewise.
(run_attempt): Likewise.
(do_report_bug): Likewise.
(append_text): Likewise.
(try_generate_repro): Likewise

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215633 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/63316
* asan.c (asan_expand_check_ifn): Fix up align >= 8 optimization.

* c-c++-common/asan/pr63316.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215547 138bc75d-0d04-0410-961f-82ee72b054a4

PR c/61405
PR c/53874
gcc/
* asan.c (maybe_instrument_call): Add default case.
* ipa-pure-const.c (special_builtin_state): Likewise.
* predict.c (expr_expected_value_1): Likewise.
* lto-streamer-out.c (write_symbol): Initialize variable.
gcc/c-family/
* c-common.h (struct c_common_resword): Don't define CPP_KEYWORD.
gcc/c/
* c-parser.c: Don't define CPP_KEYWORD.
(c_parser_switch_statement): Pass original type to c_finish_case.
* c-tree.h (c_finish_case): Update declaration.
* c-typeck.c (c_finish_case): Add TYPE parameter.  Pass it
conditionally to c_do_switch_warnings.
gcc/cp/
* semantics.c (finish_switch_cond): Call unlowered_expr_type.
* tree.c (bot_manip): Add default case.
* parser.c (cp_parser_primary_expression): Cast the controlling
expression of a switch to an int.
(cp_parser_unqualified_id): Likewise.
gcc/testsuite/
* c-c++-common/pr53874.c: New test.
* c-c++-common/pr61405.c: New test.
libcpp/
* include/cpplib.h (enum cpp_ttype): Define CPP_KEYWORD.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215559 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
gcc/c/c-tree.h

2014-10-03  Yury Gribov  <y.gribov@samsung.com>

* asan.c (asan_finish_file): Disable __asan_init calls for KASan;
don't emit empty ctors.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215851 138bc75d-0d04-0410-961f-82ee72b054a4

* ubsan.h (ubsan_get_source_location): New prototype.
* ubsan.c (ubsan_source_location_type): New variable.
Function renamed to ...
(ubsan_get_source_location_type): ... this.  Cache
return value in ubsan_source_location_type variable.
(ubsan_source_location, ubsan_create_data): Use
ubsan_get_source_location_type instead of
ubsan_source_location_type.
* asan.c (asan_protect_global): Don't protect globals
with ubsan_get_source_location_type () type.
(asan_add_global): Provide global decl location info
if possible.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215916 138bc75d-0d04-0410-961f-82ee72b054a4

* doc/invoke.texi: Document -fsanitize=bool and -fsanitize=enum.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216033 138bc75d-0d04-0410-961f-82ee72b054a4

* asan.c (pass_sanopt::execute): Handle IFN_UBSAN_OBJECT_SIZE.
* doc/invoke.texi: Document -fsanitize=object-size.
* flag-types.h (enum sanitize_code): Add SANITIZE_OBJECT_SIZE and
or it into SANITIZE_UNDEFINED.
* gimple-fold.c (gimple_fold_call): Optimize IFN_UBSAN_OBJECT_SIZE.
* internal-fn.c (expand_UBSAN_OBJECT_SIZE): New function.
* internal-fn.def (UBSAN_OBJECT_SIZE): Define.
* opts.c (common_handle_option): Handle -fsanitize=object-size.
* ubsan.c: Include tree-object-size.h.
(ubsan_type_descriptor): Call tree_to_uhwi instead of tree_to_shwi.
(ubsan_expand_bounds_ifn): Use false instead of 0.
(ubsan_expand_objsize_ifn): New function.
(instrument_object_size): New function.
(pass_ubsan::execute): Add object size instrumentation.
* ubsan.h (ubsan_expand_objsize_ifn): Declare.
testsuite/
* c-c++-common/ubsan/object-size-1.c: New test.
* c-c++-common/ubsan/object-size-2.c: New test.
* c-c++-common/ubsan/object-size-3.c: New test.
* c-c++-common/ubsan/object-size-4.c: New test.
* c-c++-common/ubsan/object-size-5.c: New test.
* c-c++-common/ubsan/object-size-6.c: New test.
* c-c++-common/ubsan/object-size-7.c: New test.
* c-c++-common/ubsan/object-size-8.c: New test.
* c-c++-common/ubsan/object-size-9.c: New test.
* g++.dg/ubsan/object-size-1.C: New test.
* gcc.dg/ubsan/object-size-9.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216099 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
gcc/internal-fn.c

gcc/ChangeLog:

2014-09-19  Marat Zakirov  <m.zakirov@samsung.com>

* asan.c (instrument_derefs): BIT_FIELD_REF added.

gcc/testsuite/ChangeLog:

2014-09-19  Marat Zakirov  <m.zakirov@samsung.com>

* c-c++-common/asan/bitfield-5.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216144 138bc75d-0d04-0410-961f-82ee72b054a4

* ubsan/Makefile.am (DEFS): Add -DPIC.
* ubsan/Makefile.in: Regenerated.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216206 138bc75d-0d04-0410-961f-82ee72b054a4

Fix sanitizer build on sparc.

* 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): Likewsie.
(IOC_SIZE): Likewsie.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216224 138bc75d-0d04-0410-961f-82ee72b054a4

* flag-types.h (sanitize_code): Don't assume targets have 32-bit
integers.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216349 138bc75d-0d04-0410-961f-82ee72b054a4

New syntax for -fsanitize-recover.

2014-10-22  Jakub Jelinek  <jakub@redhat.com>
    Yury Gribov  <y.gribov@samsung.com>

gcc/
* common.opt (flag_sanitize_recover): New variable.
(fsanitize-recover): Remove Var/Init, deprecate.
(fsanitize-recover=): New option.
* doc/invoke.texi (fsanitize-recover): Update docs.
* opts.c (finish_options): Use opts->x_flag_sanitize
instead of flag_sanitize.  Prohibit -fsanitize-recover
for anything besides UBSan.  Formatting.
(common_handle_option): Handle OPT_fsanitize_recover_
and OPT_fsanitize_recover.  Use opts->x_flag_sanitize
instead of flag_sanitize.
* asan.c (pass_sanopt::execute): Fix up formatting.
* ubsan.c (ubsan_expand_bounds_ifn, ubsan_expand_null_ifn,
ubsan_expand_objsize_ifn, ubsan_build_overflow_builtin,
instrument_bool_enum_load, ubsan_instrument_float_cast,
instrument_nonnull_arg, instrument_nonnull_return): Check
bits in flag_sanitize_recover bitmask instead of
flag_sanitize_recover as bool flag.

gcc/c-family/
* c-ubsan.c (ubsan_instrument_division, ubsan_instrument_shift,
ubsan_instrument_vla): Check bits in flag_sanitize_recover bitmask
instead of flag_sanitize_recover as bool flag.

gcc/testsuite/
* c-c++-common/ubsan/align-1.c: Update cmdline options.
* c-c++-common/ubsan/align-3.c: Likewise.
* c-c++-common/ubsan/bounds-1.c: Likewise.
* c-c++-common/ubsan/div-by-zero-7.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-10.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-7.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-8.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-9.c: Likewise.
* c-c++-common/ubsan/nonnull-2.c: Likewise.
* c-c++-common/ubsan/nonnull-3.c: Likewise.
* c-c++-common/ubsan/object-size-3.c: Likewise.
* c-c++-common/ubsan/overflow-1.c: Likewise.
* c-c++-common/ubsan/overflow-add-1.c: Likewise.
* c-c++-common/ubsan/overflow-add-3.c: Likewise.
* c-c++-common/ubsan/overflow-mul-1.c: Likewise.
* c-c++-common/ubsan/overflow-mul-3.c: Likewise.
* c-c++-common/ubsan/overflow-negate-2.c: Likewise.
* c-c++-common/ubsan/overflow-sub-1.c: Likewise.
* c-c++-common/ubsan/pr59503.c: Likewise.
* c-c++-common/ubsan/pr60613-1.c: Likewise.
* c-c++-common/ubsan/save-expr-1.c: Likewise.
* c-c++-common/ubsan/shift-3.c: Likewise.
* c-c++-common/ubsan/shift-6.c: Likewise.
* c-c++-common/ubsan/undefined-1.c: Likewise.
* c-c++-common/ubsan/vla-2.c: Likewise.
* c-c++-common/ubsan/vla-3.c: Likewise.
* c-c++-common/ubsan/vla-4.c: Likewise.
* g++.dg/ubsan/cxx11-shift-1.C: Likewise.
* g++.dg/ubsan/return-2.C: Likewise.
* c-c++-common/ubsan/recovery-1.c: New test.
* c-c++-common/ubsan/recovery-2.c: New test.
* c-c++-common/ubsan/recovery-3.c: New test.
* c-c++-common/ubsan/recovery-common.inc: New file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216552 138bc75d-0d04-0410-961f-82ee72b054a4

* c-ubsan.c (ubsan_instrument_shift): Perform the MINUS_EXPR
in unsigned type.

* c-c++-common/ubsan/undefined-2.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216593 138bc75d-0d04-0410-961f-82ee72b054a4

Allow to override Asan shadow offset.

2014-10-28  Yury Gribov  <y.gribov@samsung.com>

gcc/
* asan.c (set_asan_shadow_offset): New function.
(asan_shadow_offset): Likewise.
(asan_emit_stack_protection): Call asan_shadow_offset.
(build_shadow_mem_access): Likewise.
* asan.h (set_asan_shadow_offset): Declare.
* common.opt (fasan-shadow-offset): New option.
(frandom-seed): Fixed parameter name.
* doc/invoke.texi (fasan-shadow-offset): Describe new option.
(frandom-seed): Fixed parameter name.
* opts-global.c (handle_common_deferred_options): Handle
-fasan-shadow-offset.
* opts.c (common_handle_option): Likewise.

gcc/testsuite/
* c-c++-common/asan/shadow-offset-1.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216773 138bc75d-0d04-0410-961f-82ee72b054a4

Add strtoll and strtoull to libiberty.

2014-10-28  Yury Gribov  <y.gribov@samsung.com>

include/
* libiberty.h (strtol, strtoul, strtoll, strtoull): New prototypes.

libiberty/
* strtoll.c: New file.
* strtoull.c: New file.
* configure.ac: Add long long checks.  Add harness for strtoll and
strtoull.  Check decls for strtol, strtoul, strtoll, strtoull.
* Makefile.in (CFILES, CONFIGURED_OFILES): Add strtoll and strtoull.
* config.in: Regenerate.
* configure: Regenerate.
* functions.texi: Regenerate.
* testsuite/Makefile.in (check-strtol): New rule.
(test-strtol): Likewise.
(mostlyclean): Clean up strtol test.
* testsuite/test-strtol.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216772 138bc75d-0d04-0410-961f-82ee72b054a4

Enable -fsanitize-recover for KASan.

2014-10-28  Yury Gribov  <y.gribov@samsung.com>

gcc/
* asan.c (report_error_func): Add noabort path.
(check_func): Ditto.  Formatting.
(asan_expand_check_ifn): Handle noabort path.
* common.opt (flag_sanitize_recover): Add SANITIZE_KERNEL_ADDRESS
to default value.
* doc/invoke.texi (-fsanitize-recover=): Mention KASan.
* opts.c (finish_options): Reword comment.
* sanitizer.def: Add noabort ASan builtins.

gcc/testsuite/
* c-c++-common/asan/kasan-recover-1.c: New test.
* c-c++-common/asan/kasan-recover-2.c: New test.
* c-c++-common/asan/instrument-with-calls-1.c: Get rid of -save-temps.
* c-c++-common/asan/instrument-with-calls-2.c: Likewise.
* c-c++-common/asan/instrument-with-calls-3.c: Likewise.
* c-c++-common/asan/kasan-recover-1.c: Likewise.
* c-c++-common/asan/kasan-recover-2.c: Likewise.
* c-c++-common/asan/no-asan-globals.c: Likewise.
* c-c++-common/asan/no-instrument-reads.c: Likewise.
* c-c++-common/asan/no-instrument-writes.c: Likewise.
* c-c++-common/asan/no-use-after-return.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216778 138bc75d-0d04-0410-961f-82ee72b054a4

Don't inline GCC memory builtins if ASan is enabled.

gcc/

2014-10-28  Max Ostapenko  <m.ostapenko@partner.samsung.com>

        * asan.h (asan_intercepted_p): New function.
        * asan.c (asan_mem_ref_hasher::hash): Remove MEM_REF access size from
        hash value construction.  Call iterative_hash_expr instead of explicit
        hash building.
        (asan_mem_ref_hasher::equal): Change condition.
        (has_mem_ref_been_instrumented): Likewise.
        (update_mem_ref_hash_table): Likewise.
        (maybe_update_mem_ref_hash_table): New function.
        (instrument_strlen_call): Removed.
        (get_mem_refs_of_builtin_call): Handle new parameter.
        (instrument_builtin_call): Call maybe_update_mem_ref_hash_table instead
        of instrument_mem_region_access if intercepted_p is true.
        (instrument_mem_region_access): Instrument only base with len instead of
        base and end with 1.
        (build_check_stmt): Remove start_instrumented and end_instrumented
        parameters.
        (enum asan_check_flags): Remove ASAN_CHECK_START_INSTRUMENTED and
        ASAN_CHECK_END_INSTRUMENTED.  Change ASAN_CHECK_LAST.
        (asan_expand_check_ifn): Remove start_instrumented and end_instrumented.
        * builtins.c (expand_builtin): Include asan.h.  Don't expand string/memory
        builtin functions that have interceptors if ASan is enabled.

gcc/testsuite/

        * c-c++-common/asan/no-redundant-instrumentation-1.c: Updated test.
        * c-c++-common/asan/no-redundant-instrumentation-4.c: Likewise.
        * c-c++-common/asan/no-redundant-instrumentation-5.c: Likewise.
        * c-c++-common/asan/no-redundant-instrumentation-6.c: Likewise.
        * c-c++-common/asan/no-redundant-instrumentation-7.c: Likewise.
        * c-c++-common/asan/no-redundant-instrumentation-8.c: Likewise.
        * c-c++-common/asan/no-redundant-instrumentation-2.c: Removed.
        * c-c++-common/asan/no-redundant-instrumentation-9.c: Likewise.
        * c-c++-common/asan/no-redundant-instrumentation-10.c: New test.
        * c-c++-common/asan/no-redundant-instrumentation-11.c: Likewise.
        * c-c++-common/asan/no-redundant-instrumentation-12.c: Likewise.
        * c-c++-common/asan/no-redundant-instrumentation-13.c: Likewise.
        * c-c++-common/asan/no-redundant-instrumentation-14.c: Likewise.
        * c-c++-common/asan/no-redundant-instrumentation-15.c: Likewise.
        * c-c++-common/asan/pr63638.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216783 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/63697
* tree-vrp.c (simplify_internal_call_using_ranges): For subcode ==
MINUS_EXPR, check overflow on vr0.min - vr1.max and vr0.max - vr1.min
instead of vr0.min - vr1.min and vr0.max - vr1.max.

* c-c++-common/ubsan/overflow-sub-3.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216962 138bc75d-0d04-0410-961f-82ee72b054a4

* ubsan.c (instrument_object_size): Optimize [x & CST] array accesses.
testsuite/
* c-c++-common/ubsan/object-size-10.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217071 138bc75d-0d04-0410-961f-82ee72b054a4

* Makefile.in (OBJS): Add sanopt.o.
(GTFILES): Add sanopt.c.
* asan.h (asan_expand_check_ifn): Declare.
* asan.c (asan_expand_check_ifn): No longer static.
(class pass_sanopt, pass_sanopt::execute, make_pass_sanopt): Move...
* sanopt.c: ...here.  New file.
testsuite/
* c-c++-common/ubsan/align-2.c: Remove dg-output.
* c-c++-common/ubsan/align-4.c: Likewise.
* g++.dg/ubsan/null-1.C: Likewise.
* g++.dg/ubsan/null-2.C: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217099 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
gcc/asan.c

* sanopt.c (sanopt_optimize_walker): Limit removal of the checks.
Remove vector limit.
testsuite/
* c-c++-common/ubsan/align-2.c: Add dg-output.
* c-c++-common/ubsan/align-4.c: Likewise.
* c-c++-common/ubsan/align-6.c: New test.
* c-c++-common/ubsan/align-7.c: New test.
* c-c++-common/ubsan/align-8.c: New test.
* g++.dg/ubsan/null-1.C: Add dg-output.
* g++.dg/ubsan/null-2.C: Likewise.
* g++.dg/ubsan/null-3.C: New test.
* g++.dg/ubsan/null-4.C: New test.
* g++.dg/ubsan/null-5.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217189 138bc75d-0d04-0410-961f-82ee72b054a4

* c-c++-common/ubsan/align-7.c: Skip for -flto -fno-fat-lto-objects.
* c-c++-common/ubsan/align-8.c: Likewise.
* g++.dg/ubsan/null-4.C: Likewise.
* g++.dg/ubsan/null-5.C: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217282 138bc75d-0d04-0410-961f-82ee72b054a4

Avoid tail call in c-c++-common/asan/strlen-overflow-1.c

PR testsuite/63830
* c-c++-common/asan/strlen-overflow-1.c (main): Avoid tail call.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217417 138bc75d-0d04-0410-961f-82ee72b054a4

* doc/invoke.texi: Document -fsanitize=bool and -fsanitize=enum.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216033 138bc75d-0d04-0410-961f-82ee72b054a4

* fold-const.c (fold_binary_loc): Don't fold if the result
is undefined.
* match.pd (A + (-B) -> A - B, A - (-B) -> A + B,
-(-A) -> A): Likewise.

* c-c++-common/ubsan/overflow-sub-4.c: New test.
* c-c++-common/ubsan/overflow-sub-2.c: Adjust dg-output.
* c-c++-common/ubsan/overflow-int128.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217427 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
gcc/match.pd

libsanitizer merge from upstream r221802

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217518 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
libsanitizer/asan/Makefile.in

PR sanitizer/63839
* asan.c (ATTR_CONST_NORETURN_NOTHROW_LEAF_LIST,
ATTR_COLD_CONST_NORETURN_NOTHROW_LEAF_LIST): Define.
* builtin-attrs.def (ATTR_COLD_CONST_NORETURN_NOTHROW_LEAF_LIST):
Define.
* builtins.c (fold_builtin_0): Don't include ubsan.h.  Don't
instrument BUILT_IN_UNREACHABLE here.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_BUILTIN_UNREACHABLE): Make
const.
* sanopt.c (pass_sanopt::execute): Instrument BUILT_IN_UNREACHABLE.
* tree-ssa-ccp.c (optimize_unreachable): Bail out if
SANITIZE_UNREACHABLE.
* ubsan.c (ubsan_instrument_unreachable): Rewrite for GIMPLE.
* ubsan.h (ubsan_instrument_unreachable): Adjust declaration.
testsuite/
* c-c++-common/ubsan/pr63839.c: New test.
* c-c++-common/ubsan/unreachable-2.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217553 138bc75d-0d04-0410-961f-82ee72b054a4

* fold-const.c (fold_negate_expr): Don't fold INTEGER_CST if
that overflows when SANITIZE_SI_OVERFLOW is on.  Guard -(-A)
folding with TYPE_OVERFLOW_SANITIZED.

* c-c++-common/ubsan/overflow-negate-3.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217556 138bc75d-0d04-0410-961f-82ee72b054a4

2014-08-12  Yury Gribov  <y.gribov@samsung.com>

gcc/
* internal-fn.c (init_internal_fns): Fix off-by-one.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213848 138bc75d-0d04-0410-961f-82ee72b054a4

* tree-ssa-reassoc.c (optimize_range_tests_diff): Perform
MINUS_EXPR in unsigned type to avoid undefined behavior.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216252 138bc75d-0d04-0410-961f-82ee72b054a4

* sanitizer_common/Makefile.am (AM_CXXFLAGS): Use -std=gnu++11.
* asan/Makefile.am (AM_CXXFLAGS): Ditto.
* lsan/Makefile.am (AM_CXXFLAGS): Ditto.
* interception/Makefile.am (AM_CXXFLAGS): Ditto.
* tsan/Makefile.am (AM_CXXFLAGS): Ditto.
* libbacktrace/Makefile.am (AM_CXXFLAGS): Ditto.
* ubsan/Makefile.am (AM_CXXFLAGS): Ditto.
* sanitizer_common/Makefile.in: Regenerate.
* asan/Makefile.in: Ditto.
* lsan/Makefile.in: Ditto.
* interception/Makefile.in: Ditto.
* tsan/Makefile.in: Ditto.
* libbacktrace/Makefile.in: Ditto.
* ubsan/Makefile.in: Ditto.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217562 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
libsanitizer/asan/Makefile.in

* sanopt.c: Include tree-ssa-operands.h.
(struct sanopt_info): Add has_freeing_call_p,
has_freeing_call_computed_p, imm_dom_path_with_freeing_call_p,
imm_dom_path_with_freeing_call_computed_p, freeing_call_events,
being_visited_p fields.
(struct sanopt_ctx): Add asan_check_map field.
(imm_dom_path_with_freeing_call, maybe_optimize_ubsan_null_ifn,
maybe_optimize_asan_check_ifn): New functions.
(sanopt_optimize_walker): Use them, optimize even ASAN_CHECK
internal calls.
(pass_sanopt::execute): Call sanopt_optimize even for
-fsanitize=address.
* gimple.c (nonfreeing_call_p): Return true for non-ECF_LEAF
internal calls.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217581 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
gcc/sanopt.c

Export "detect_leaks=0"

PR bootstrap/63888
* bootstrap-asan.mk (ASAN_OPTIONS): Export "detect_leaks=0".

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217678 138bc75d-0d04-0410-961f-82ee72b054a4

2014-11-18  Yury Gribov  <y.gribov@samsung.com>

PR sanitizer/63802

gcc/
* stor-layout.c (min_align_of_type): Respect user alignment
more.

gcc/testsuite/
* c-c++-common/ubsan/pr63802.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217689 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
gcc/stor-layout.c

gcc

2014-11-18  Marat Zakirov  <m.zakirov@samsung.com>

* opts.c (finish_options): Disable aggressive opts for sanitizer.
(common_handle_option): Move code to finish_options.

gcc/testsuite

2014-11-18  Marat Zakirov  <m.zakirov@samsung.com>

* c-c++-common/asan/aggressive-opts.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217690 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/63866
* asan.c (asan_global_struct): Create a TYPE_DECL for "__asan_global",
put it into TYPE_NAME and TYPE_STUB_DECL.
* ubsan.c (ubsan_type_descriptor_type): New variable.
Function renamed to ...
(ubsan_get_type_descriptor_type): ... this.  Cache
return value in ubsan_type_descriptor_type variable.
Create a TYPE_DECL for "__ubsan_type_descriptor", put it into
TYPE_NAME and TYPE_STUB_DECL.
(ubsan_get_source_location_type): Create a TYPE_DECL for
"__ubsan_source_location", put it into TYPE_NAME and TYPE_STUB_DECL.
(ubsan_type_descriptor, ubsan_create_data): Call
ubsan_get_type_descriptor_type instead of ubsan_type_descriptor_type.
Create a TYPE_DECL for name, put it into TYPE_NAME and TYPE_STUB_DECL.

* c-c++-common/ubsan/pr63866.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217718 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/63813
* c-ubsan.c (ubsan_maybe_instrument_reference_or_call): Change type
argument to ptype, set type to TREE_TYPE (ptype).  Don't call
get_pointer_alignment for non-pointers.  Use ptype, or if it is
reference type, corresponding pointer type, as type of kind
argument.
(ubsan_maybe_instrument_reference,
ubsan_maybe_instrument_member_call): Adjust callers.

* g++.dg/ubsan/pr63813.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217741 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/63913
* ubsan.c: Include tree-eh.h.
(instrument_bool_enum_load): Handle loads that can throw.

* g++.dg/ubsan/pr63913.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217755 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/63520
* internal-fn.c (expand_ubsan_result_store): New function.
(expand_addsub_overflow, expand_neg_overflow, expand_mul_overflow):
Use it instead of just emit_move_insn.

* c-c++-common/ubsan/pr63520.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217758 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
gcc/internal-fn.c

PR sanitizer/63879
* fold-const.c (negate_expr_p) <case NEGATE_EXPR>: Return
!TYPE_OVERFLOW_SANITIZED.
(fold_negate_expr) <case INTEGER_CST>: Fold when overflow
does not trap and when overflow wraps, or when SANITIZE_SI_OVERFLOW
is 0.

* c-c++-common/ubsan/pr63879-1.c: New test.
* c-c++-common/ubsan/pr63879-2.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217766 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/62132
* c-c++-common/asan/misalign-1.c: Pass -fno-omit-frame-pointer on
darwin, adjust dg-output.
* c-c++-common/asan/misalign-2.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217777 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/63690
* ubsan.c (instrument_object_size): Check for MEM_REF.

* gcc.dg/ubsan/pr63690.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217778 138bc75d-0d04-0410-961f-82ee72b054a4

Fixing the mess I did with the two previous commits. Sorry!

PR sanitizer/62132
* c-c++-common/asan/misalign-1.c: Pass -fno-omit-frame-pointer on
darwin, adjust dg-output.
* c-c++-common/asan/misalign-2.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217779 138bc75d-0d04-0410-961f-82ee72b054a4

Fix up accidentally twice-applied patch.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217784 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/63939
* c-c++-common/asan/global-overflow-1.c: Allow extra spaces after
stack pointer address, to fit darwin output when symbolizer is not
present.
* c-c++-common/asan/heap-overflow-1.c: Likewise.
* c-c++-common/asan/memcmp-1.c: Likewise.
* c-c++-common/asan/misalign-1.c: Likewise.
* c-c++-common/asan/misalign-2.c: Likewise.
* c-c++-common/asan/null-deref-1.c: Likewise.
* c-c++-common/asan/stack-overflow-1.c: Likewise.
* c-c++-common/asan/strlen-overflow-1.c: Likewise.
* c-c++-common/asan/strncpy-overflow-1.c: Likewise.
* c-c++-common/asan/use-after-free-1.c: Likewise.
* g++.dg/asan/deep-stack-uaf-1.C: Likewise.
* g++.dg/asan/deep-tail-call-1.C: Likewise.
* g++.dg/asan/large-func-test-1.C: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217817 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/64013
* sanitizer_common/sanitizer_linux.cc (FileExists): Cherry pick
upstream r222532.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217921 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/63788
* asan.c (initialize_sanitizer_builtins): Add BT_FN_SIZE_CONST_PTR_INT
var.  Conditionally build BUILT_IN_OBJECT_SIZE decl.
(ATTR_PURE_NOTHROW_LEAF_LIST): Define.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218084 138bc75d-0d04-0410-961f-82ee72b054a4

* gcc.c (SANITIZER_SPEC): Don't error on -fsanitize=thread
without -pie or -shared, error on -fsanitize=thread -static instead.

* lib/tsan-dg.exp (check_effective_target_fsanitize_thread,
tsan_init): Don't use -fPIE or -pie.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218097 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
gcc/testsuite/lib/tsan-dg.exp

PR c/63862
c-family/
* c-ubsan.c (ubsan_instrument_shift): Change the type of a MINUS_EXPR
to op1_utype.
* c-gimplify.c (c_gimplify_expr): Convert right operand of a shift
expression to unsigned_type_node.
c/
* c-typeck.c (build_binary_op) <RSHIFT_EXPR, LSHIFT_EXPR>: Don't
convert the right operand to integer type.
cp/
* typeck.c (cp_build_binary_op) <RSHIFT_EXPR, LSHIFT_EXPR>: Don't
convert the right operand to integer type.
testsuite/
* gcc.c-torture/execute/shiftopt-1.c: Don't XFAIL anymore.
* c-c++-common/ubsan/shift-7.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218142 138bc75d-0d04-0410-961f-82ee72b054a4

* c-ubsan.c (ubsan_instrument_shift): Use op1_utype for MINUS_EXPR
instead of unsigned_type_node.

* c-c++-common/ubsan/shift-8.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218163 138bc75d-0d04-0410-961f-82ee72b054a4

Backport from GCC mainline.

2015-03-16  Max Ostapenko  <m.ostapenko@partner.samsung.com>

PR sanitizer/64820

gcc/
* cfgexpand.c (align_base): New function.
(alloc_stack_frame_space): Call it.
(expand_stack_vars): Align prev_frame to be sure
data->asan_vec elements aligned properly.

gcc/testsuite/
* c-c++-common/asan/pr64820.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221457 138bc75d-0d04-0410-961f-82ee72b054a4

Backport from GCC mainline.

2015-04-01  Max Ostapenko  <m.ostapenko@partner.samsung.com>

PR target/65624

gcc/
* config/aarch64/aarch64-builtins.c (aarch64_simd_expand_builtin): Increase
args array size by one to avoid buffer overflow.

gcc/testsuite/
* gcc.target/aarch64/pr65624.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221807 138bc75d-0d04-0410-961f-82ee72b054a4

Backport from GCC trunk.

2015-04-13  Yury Gribov  <y.gribov@samsung.com>

PR sanitizer/64839

libsanitizer/
* sanitizer_common/sanitizer_platform.h: Cherry pick
upstream r234470.
* sanitizer_common/sanitizer_platform_limits_posix.cc: Ditto.
* configure.ac (RPC_DEFS): Check for precense of RPC headers.
* sanitizer_common/Makefile.am (DEFS): Pass info to compiler.
* Makefile.in: Regenerate.
* asan/Makefile.in: Regenerate.
* config.h.in: Regenerate.
* configure: Regenerate.
* interception/Makefile.in: Regenerate.
* libbacktrace/Makefile.in: Regenerate.
* lsan/Makefile.in: Regenerate.
* sanitizer_common/Makefile.in: Regenerate.
* tsan/Makefile.in: Regenerate.
* ubsan/Makefile.in: Regenerate.

Backport from GCC trunk.

2015-04-17  Yury Gribov  <y.gribov@samsung.com>

gcc/
* asan.c (set_sanitized_sections): New function.
(section_sanitized_p): Ditto.
(asan_protect_global): Optionally sanitize user-defined
sections.
* asan.h (set_sanitized_sections): Declare new function.
* common.opt (fsanitize-sections): New option.
* doc/invoke.texi (-fsanitize-sections): Document new option.
* opts-global.c (handle_common_deferred_options): Handle new
option.

gcc/testsuite/
* c-c++-common/asan/user-section-1.c: New test.

Backport from mainline.

PR testsuite/66046
* c-c++-common/ubsan/align-6.c: Don't match trailing newlines in the
last dg-output.
* c-c++-common/ubsan/align-7.c: Likewise.
* c-c++-common/ubsan/bounds-8.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-9.c: Likewise.
* c-c++-common/ubsan/load-bool-enum.c: Likewise.
* c-c++-common/ubsan/null-1.c: Likewise.
* c-c++-common/ubsan/null-10.c: Likewise.
* c-c++-common/ubsan/null-11.c: Likewise.
* c-c++-common/ubsan/null-2.c: Likewise.
* c-c++-common/ubsan/null-3.c: Likewise.
* c-c++-common/ubsan/null-4.c: Likewise.
* c-c++-common/ubsan/null-5.c: Likewise.
* c-c++-common/ubsan/null-6.c: Likewise.
* c-c++-common/ubsan/null-7.c: Likewise.
* c-c++-common/ubsan/null-8.c: Likewise.
* c-c++-common/ubsan/null-9.c: Likewise.
* c-c++-common/ubsan/object-size-1.c: Likewise.
* c-c++-common/ubsan/object-size-10.c: Likewise.
* c-c++-common/ubsan/object-size-4.c: Likewise.
* c-c++-common/ubsan/object-size-5.c: Likewise.
* c-c++-common/ubsan/object-size-7.c: Likewise.
* c-c++-common/ubsan/object-size-8.c: Likewise.
* c-c++-common/ubsan/object-size-9.c: Likewise.
* c-c++-common/ubsan/overflow-add-2.c: Likewise.
* c-c++-common/ubsan/overflow-int128.c: Likewise.
* c-c++-common/ubsan/overflow-mul-2.c: Likewise.
* c-c++-common/ubsan/overflow-mul-4.c: Likewise.
* c-c++-common/ubsan/overflow-negate-1.c: Likewise.
* c-c++-common/ubsan/overflow-negate-3.c: Likewise.
* c-c++-common/ubsan/overflow-sub-2.c: Likewise.
* c-c++-common/ubsan/overflow-sub-4.c: Likewise.
* c-c++-common/ubsan/pr59333.c: Likewise.
* c-c++-common/ubsan/pr59667.c: Likewise.
* c-c++-common/ubsan/pr60613-2.c: Likewise.
* c-c++-common/ubsan/pr60636.c: Likewise.
* c-c++-common/ubsan/pr63802.c: Likewise.
* c-c++-common/ubsan/recovery-1.c: Likewise.
* c-c++-common/ubsan/recovery-3.c: Likewise.
* c-c++-common/ubsan/shift-1.c: Likewise.
* c-c++-common/ubsan/shift-2.c: Likewise.
* c-c++-common/ubsan/shift-4.c: Likewise.
* c-c++-common/ubsan/shift-7.c: Likewise.
* c-c++-common/ubsan/undefined-2.c: Likewise.
* c-c++-common/ubsan/vla-1.c: Likewise.
* g++.dg/ubsan/null-1.C: Likewise.
* g++.dg/ubsan/null-3.C: Likewise.
* g++.dg/ubsan/null-4.C: Likewise.
* g++.dg/ubsan/vptr-8.C: Likewise.
* g++.dg/ubsan/vptr-9.C: Likewise.
* gcc.dg/ubsan/bounds-2.c: Likewise.
* gcc.dg/ubsan/object-size-9.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222878 138bc75d-0d04-0410-961f-82ee72b054a4

Backport from mainline.

2015-04-22  Yury Gribov  <y.gribov@samsung.com>

Allow wildcards in -fsanitize-sections.

gcc/
* asan.c (set_sanitized_sections): Parse incoming arg.
(section_sanitized_p): Support wildcards.
* doc/invoke.texi (-fsanitize-sections): Update description.

gcc/testsuite/
* c-c++-common/asan/user-section-1.c: New test.
* c-c++-common/asan/user-section-2.c: New test.
* c-c++-common/asan/user-section-3.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222322 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/63956
* ubsan.c (is_ubsan_builtin_p): Check also built-in class.
cp/
* constexpr.c: Include ubsan.h.
(cxx_eval_call_expression): Bail out for IFN_UBSAN_{NULL,BOUNDS}
internal functions and for ubsan builtins.
* error.c: Include internal-fn.h.
(dump_expr): Add printing of internal functions.
testsuite/
* c-c++-common/ubsan/shift-5.c: Add xfails.
* g++.dg/ubsan/div-by-zero-1.C: Don't use -w.  Add xfail.
* g++.dg/ubsan/pr63956.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218221 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
gcc/cp/constexpr.c

PR sanitizer/64121
* ubsan.c (instrument_object_size): Stop searching if the base
occurs in abnormal phi.

* c-c++-common/ubsan/pr64121.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218222 138bc75d-0d04-0410-961f-82ee72b054a4

* constexpr.c (cxx_eval_check_shift_p): New function.
(cxx_eval_binary_expression): Call it.  Set NON_CONSTANT_P if it
returns true.

* g++.dg/cpp0x/constexpr-shift1.C: New test.
* g++.dg/cpp1y/constexpr-shift1.C: New test.
* g++.dg/ubsan/pr63956.C: Add dg-errors.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218279 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
gcc/cp/constexpr.c

PR middle-end/56917
* fold-const.c (fold_unary_loc): Perform the negation in A's type
when transforming ~ (A - 1) or ~ (A + -1) to -A.

* c-c++-common/ubsan/pr56917.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218395 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/64289
* c-convert.c: Include ubsan.h.
(convert): For real -> integral casts and
-fsanitize=float-cast-overflow don't call convert_to_integer, but
instead instrument the float cast directly.

* c-c++-common/ubsan/pr64289.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218811 138bc75d-0d04-0410-961f-82ee72b054a4

* lib/ubsan-dg.exp: Add library path for libstdc++.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219035 138bc75d-0d04-0410-961f-82ee72b054a4

* lib/ubsan-dg.exp (check_effective_target_fsanitize_undefined):
Check if testcases run without errors, not just if they compile.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219084 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
gcc/testsuite/lib/ubsan-dg.exp

PR sanitizer/64344
* ubsan.h (ubsan_instrument_float_cast): Add ARG argument.
* ubsan.c (ubsan_instrument_float_cast): Add ARG argument, pass
it to libubsan handler instead of EXPR.  Fold comparisons earlier,
if the result is integer_zerop, return NULL_TREE.
* convert.c (convert_to_integer): Pass expr as ARG.
c/
* c-typeck.c (convert_for_assignment, c_finish_return): For
-fsanitize=float-cast-overflow casts from REAL_TYPE to integer/enum
types also set in_late_binary_op around convert call.
* c-convert.c (convert): For -fsanitize=float-cast-overflow REAL_TYPE
to integral type casts, if not in_late_binary_op, pass c_fully_fold
result on expr as last argument to ubsan_instrument_float_cast,
if in_late_binary_op, don't use c_save_expr but save_expr.
testsuite/
* c-c++-common/ubsan/pr64344-1.c: New test.
* c-c++-common/ubsan/pr64344-2.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219201 138bc75d-0d04-0410-961f-82ee72b054a4

* opts.c (common_handle_option): Add support for
-fno-sanitize=all and -f{,no-}sanitize-recover=all.
* doc/invoke.texi: Document -fno-sanitize=all,
-f{,no-}sanitize-recover=all.  Document that
-fsanitize=float-cast-overflow is not enabled
by -fsanitize=undefined.  Fix up documentation
of -f{,no-}sanitize-recover.

* c-c++-common/asan/sanitize-all-1.c: New test.
* c-c++-common/ubsan/sanitize-all-1.c: New test.
* c-c++-common/ubsan/sanitize-all-2.c: New test.
* c-c++-common/ubsan/sanitize-all-3.c: New test.
* c-c++-common/ubsan/sanitize-all-4.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219241 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/64632
* ubsan/ubsan_type_hash.cc: Cherry pick upstream r224972.

* g++.dg/ubsan/pr64632.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219912 138bc75d-0d04-0410-961f-82ee72b054a4

2015-01-27  Jakub Jelinek  <jakub@redhat.com>
    Yury Gribov  <y.gribov@samsung.com>

PR ubsan/64741
* ubsan.c (ubsan_source_location): Refactor code.
(ubsan_type_descriptor): Update type size. Refactor code.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220159 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
gcc/ubsan.c

* g++.dg/ubsan/shift-1.C: New test.
* gcc.dg/ubsan/c-shift-2.c: New test.
* c-c++-common/ubsan/shift-5.c: Remove file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220631 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/65019
* ubsan.c (ubsan_expand_objsize_ifn): Always return true.

* g++.dg/ubsan/pr65019.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220641 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/64984
* except.c (check_noexcept_r): Return NULL for internal
calls.

* g++.dg/ubsan/pr64984.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220649 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/65000
* g++.dg/ubsan/pr65000.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220663 138bc75d-0d04-0410-961f-82ee72b054a4

PR bootstrap/63888
* asan/asan_globals.cc (RegisterGlobal): Disable detect_odr_violation
support until it is rewritten upstream.

* c-c++-common/asan/pr63888.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220919 138bc75d-0d04-0410-961f-82ee72b054a4

* c-c++-common/ubsan/bounds-6.c: Use dg-do run.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221217 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/65280
* doc/invoke.texi: Update description of -fsanitize=bounds.

* c-ubsan.c (ubsan_instrument_bounds): Check for COMPONENT_REF
before trying to figure out whether we have a flexible array member.

* c-c++-common/ubsan/bounds-1.c: Add testing of flexible array
member-like arrays.
* c-c++-common/ubsan/bounds-8.c: New test.
* c-c++-common/ubsan/bounds-9.c: New test.
* gcc.dg/ubsan/bounds-2.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221250 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/65367
* ubsan.c (ubsan_expand_objsize_ifn): Update GSI instead of GSI_ORIG
when only removing the statement.  Handle expanding UBSAN_OBJECT_SIZE
separately.

* c-c++-common/ubsan/pr65367.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221325 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/65583
* ubsan.c (ubsan_create_edge): New function.
(instrument_bool_enum_load): Call it.
(instrument_nonnull_arg): Likewise.
(instrument_nonnull_return): Likewise.
(instrument_object_size): Likewise.

* g++.dg/ubsan/pr65583.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221723 138bc75d-0d04-0410-961f-82ee72b054a4

PR tree-optimization/65709
* ubsan.c (instrument_mem_ref): Use TREE_TYPE (base) instead of
TREE_TYPE (TREE_TYPE (t)).

* c-c++-common/ubsan/align-9.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221958 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
gcc/testsuite/ChangeLog

* c-ubsan.c (ubsan_instrument_bounds): Don't skip instrumenting
flexible member array-like members if SANITIZE_BOUNDS_STRICT.

* doc/invoke.texi: Document -fsanitize=bounds-strict.
* flag-types.h (enum sanitize_code): Add SANITIZE_BOUNDS_STRICT, or it
into SANITIZE_NONDEFAULT.
* opts.c (common_handle_option): Handle -fsanitize=bounds-strict.

* c-c++-common/ubsan/bounds-10.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222871 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
gcc/c-family/ChangeLog
gcc/flag-types.h

* c-ubsan.c (ubsan_instrument_shift): Use type0.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223646 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/66452
* toplev.c (check_global_declaration): Don't warn about artificial
decls.

* g++.dg/ubsan/pr66452.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224216 138bc75d-0d04-0410-961f-82ee72b054a4

* common.opt (fsanitize-undefined-trap-on-error): Add Driver.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@224708 138bc75d-0d04-0410-961f-82ee72b054a4

Backport from mainline.

libstdc++-v3/

* include/bits/regex_compiler.h (_S_cache_size): Multiply the
RHS of the shift-expression by _IsChar::value.

Conditionally include target specific files while building TSAN
2015-01-25  Venkataramanan Kumar  <venkataramanan.kumar@linaro.org>

        * configure.ac (TSAN_TARGET_DEPENDENT_OBJECTS): Define.
        * configure: Regenerate.
        * tsan/Makefile.am (EXTRA_libtsan_la_SOURCES): Define.
        (libtsan_la_DEPENDENCIES): Likewise.
        * Makefile.in: Regenerate.
        * asan/Makefile.in: Regenerate.
        * interception/Makefile.in: Regenerate.
        * libbacktrace/Makefile.in: Regenerate.
        * lsan/Makefile.in: Regenerate.
        * sanitizer_common/Makefile.in: Regenerate.
        * tsan/Makefile.in: Regenerate.
        * ubsan/Makefile.in: Regenerate.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220034 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
libsanitizer/configure
libsanitizer/tsan/Makefile.am
libsanitizer/tsan/Makefile.in

libsanitizer merge from upstream r250806.

libsanitizer/

2015-10-20  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>

* All source files: Merge from upstream r250806.
* configure.ac (link_sanitizer_common): Add -lrt flag.
* configure.tgt: Enable TSAN and LSAN for aarch64-linux targets.
Set CXX_ABI_NEEDED=true for darwin.
* asan/Makefile.am (asan_files): Add new files.
(DEFS): Add DCAN_SANITIZE_UB=0 and remove unused and legacy
DASAN_FLEXIBLE_MAPPING_AND_OFFSET=0.
* asan/Makefile.in: Regenerate.
* ubsan/Makefile.am (ubsan_files): Add new files.
(DEFS): Add DCAN_SANITIZE_UB=1.
(libubsan_la_LIBADD): Add -lc++abi if CXX_ABI_NEEDED is true.
* ubsan/Makefile.in: Regenerate.
* tsan/Makefile.am (tsan_files): Add new files.
(DEFS): Add DCAN_SANITIZE_UB=0.
* tsan/Makefile.in: Regenerate.
* sanitizer_common/Makefile.am (sanitizer_common_files): Add new files.
* sanitizer_common/Makefile.in: Regenerate.
* asan/libtool-version: Bump the libasan SONAME.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229111 138bc75d-0d04-0410-961f-82ee72b054a4

libsanitizer merge from upstream r250806, compiler part.

gcc/

* asan.c (asan_emit_stack_protection): Don't pass local stack to
asan_stack_malloc_[n] anymore. Check if asan_stack_malloc_[n] returned
NULL and use local stack than.
(asan_finish_file): Insert __asan_version_mismatch_check_v[n] call
in addition to __asan_init.
* sanitizer.def (BUILT_IN_ASAN_INIT): Rename to __asan_init.
(BUILT_IN_ASAN_VERSION_MISMATCH_CHECK): Add new builtin call.
* asan.h (asan_intercepted_p): Handle new string builtins.
* ubsan.c (ubsan_use_new_style_p): New function.
(ubsan_instrument_float_cast): If location is unknown, assign
input_location to loc. Propagate loc to ubsan_create_data if
ubsan_use_new_style_p returned true.

config/

* bootstrap-asan.mk: Replace ASAN_OPTIONS=detect_leaks with
LSAN_OPTIONS=detect_leaks.

gcc/testsuite/

* c-c++-common/ubsan/float-cast-overflow-10.c: Adjust test.
* c-c++-common/ubsan/float-cast-overflow-8.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-9.c: Likewise.
* g++.dg/asan/default-options-1.C: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229112 138bc75d-0d04-0410-961f-82ee72b054a4

libsanitizer/

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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229113 138bc75d-0d04-0410-961f-82ee72b054a4

libsanitizer/

PR bootstrap/63888
Reapply:
2015-02-20  Jakub Jelinek  <jakub@redhat.com>

* asan/asan_globals.cc (RegisterGlobal): Disable detect_odr_violation
support until it is rewritten upstream.

* c-c++-common/asan/pr63888.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229114 138bc75d-0d04-0410-961f-82ee72b054a4

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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229115 138bc75d-0d04-0410-961f-82ee72b054a4

libsanitizer/

* HOWTO_MERGE: New file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229116 138bc75d-0d04-0410-961f-82ee72b054a4

Update HOWTO_MERGE file for libsanitizer.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229215 138bc75d-0d04-0410-961f-82ee72b054a4

Fix ASan output pattern tests on Darwin.

gcc/testsuite/

PR sanitizer/68042
* c-c++-common/asan/memcmp-1.c: Adjust test to pass on Darwin.
* c-c++-common/asan/sanity-check-pure-c-1.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229212 138bc75d-0d04-0410-961f-82ee72b054a4

Fix bootstrap on x86_64-apple-darwin14 after r229119.

libsanitizer/

PR bootstrap/68041
* configure.ac (link_sanitizer_common): Link against librt only if it
contains shm_open, required by sanitizers.
(CXX_ABI_NEEDED): Remove variable.
* configure: Regenerate.
* ubsan/Makefile.am (libubsan_la_LIBADD): Do not add -lc++abi anymore.
* ubsan/Makefile.in: Regenerate.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229168 138bc75d-0d04-0410-961f-82ee72b054a4

libsanitizer merge from upstream r253555.

libsanitizer/

2015-11-23  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>

* All source files: Merge from upstream r253555.
* configure.tgt: Enable LSan on aarch64-*-linux* targets. Add new
dependences for TSan for aarch64-*-linux* targets.
* tsan/Makefile.am: Add new source files.
* configure: Regenerate.
* tsan/Makefile.in: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230739 138bc75d-0d04-0410-961f-82ee72b054a4

Conflicts:
libsanitizer/tsan/Makefile.am
libsanitizer/tsan/Makefile.in

libsanitizer merge from upstream r253555, compiler part.

gcc/

* opts.c (finish_options): Allow -fsanitize-recover=address for
userspace sanitization.
* asan.c (asan_expand_check_ifn): Redefine recover_p.
* doc/invoke.texi (fsanitize-recover): Update documentation.

gcc/testsuite/

* c-c++-common/asan/halt_on_error-1.c: New test.
* c-c++-common/asan/halt_on_error-2.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230741 138bc75d-0d04-0410-961f-82ee72b054a4

Fix libsanitizer build with old kernel headers on ARM after r230739.

libsanitizer/

* include/system/linux/asm/ptrace.h: New header.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230790 138bc75d-0d04-0410-961f-82ee72b054a4

Move ptrace.h to appropriate place.

libsanitizer/

* include/system/linux/asm/ptrace.h: Move to ...
* include/system/asm/ptrace.h: ... this.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230804 138bc75d-0d04-0410-961f-82ee72b054a4

Backport from mainline r219968. Fix ASan build on Aarch64 42-bit VMA and
Glibc < 2.21.

PR sanitizer/64435
* sanitizer_common/sanitizer_platform_limits_posix.cc: Cherry pick upstream
r226637.
* sanitizer_common/sanitizer_posix.cc: Cherry pick upstream r226639.

libbacktrace/

2016-03-02  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>

* elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to
avoid possible crash.
(elf_add): Don't set *fileline_fn to elf_nodebug value in case of
missing debug info anymore.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233911 138bc75d-0d04-0410-961f-82ee72b054a4

Backport from mainline.

gcc/
* config/elfos.h (ASM_DECLARE_OBJECT_NAME): Use decl size
instead of type size.
(ASM_FINISH_DECLARE_OBJECT): Likewise.

gcc/testsuite/
* gcc.target/i386/struct-size.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213699 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/66908
* c-ubsan.c: Include gimplify.h.
(ubsan_instrument_division): Unshare OP0 and OP1.
(ubsan_instrument_shift): Likewise.

* c-c++-common/ubsan/pr66908.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226110 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/66977
* typeck.c (get_member_function_from_ptrfunc): Don't sanitize
RSHIFT_EXPR.

* g++.dg/ubsan/pr66977.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226440 138bc75d-0d04-0410-961f-82ee72b054a4

* c-ubsan.c (ubsan_instrument_division): Use unshare_expr throughout.
(ubsan_instrument_shift): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@226116 138bc75d-0d04-0410-961f-82ee72b054a4

2015-08-21  Yury Gribov  <y.gribov@samsung.com>

* sanitizer.def (BUILT_IN_UBSAN_HANDLE_NONNULL_ARG,
BUILT_IN_UBSAN_HANDLE_NONNULL_ARG): Fix builtin types.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227054 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/67279
* c-typeck.c (build_binary_op): Don't instrument static initializers.

* gcc.dg/ubsan/pr67279.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227491 138bc75d-0d04-0410-961f-82ee72b054a4

2015-09-17  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR sanitizer/64078
        * c-c++-common/ubsan/object-size-9.c (s): Add alignment attribute.
        (f2, f3): Make the function static.
        * c-c++-common/ubsan/object-size-10.c (a, b): Add alignment attribute.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227886 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/64906
* c-ubsan.c (ubsan_instrument_division): Also pre-evaluate OP1.

* c-c++-common/ubsan/pr64906.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228112 138bc75d-0d04-0410-961f-82ee72b054a4

* c-ubsan.c (ubsan_instrument_division): Remove unnecessary code.
(ubsan_instrument_shift): Likewise.

* c-c++-common/ubsan/bounds-11.c: New test.
* c-c++-common/ubsan/bounds-12.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228114 138bc75d-0d04-0410-961f-82ee72b054a4

2015-10-29  Richard Biener  <rguenther@suse.de>

PR middle-end/56956
* fold-const.c (fold_cond_expr_with_comparison): Do not fold
unsigned conditonal negation to ABS_EXPR.

* c-c++-common/ubsan/pr56956.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229517 138bc75d-0d04-0410-961f-82ee72b054a4

PR c++/67941
* lambda.c (maybe_add_lambda_conv_op): Mark _FUN as
no_sanitize_undefined.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230897 138bc75d-0d04-0410-961f-82ee72b054a4

* lambda.c (maybe_add_lambda_conv_op): Only set
no_sanitize_undefined if SANITIZE_NULL.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230908 138bc75d-0d04-0410-961f-82ee72b054a4

gcc:
PR sanitizer/68418
* c-family/c-ubsan.c (ubsan_instrument_shift): Disable
sanitization of left shifts for wrapping signed types as well.

gcc/testsuite:
PR sanitizer/68418
* gcc.dg/ubsan/c99-wrapv-shift-1.c,
gcc.dg/ubsan/c99-wrapv-shift-2.c: New testcases.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231582 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/69055
* ubsan.c (ubsan_instrument_float_cast): Call
initialize_sanitizer_builtins.

* gfortran.dg/pr69055.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232024 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/69099
* c-convert.c (convert) [INTEGER_TYPE]: Drop ARG.  Don't pass ARG to
ubsan_instrument_float_cast.  Fold EXPR.  Use NULL_TREE instead of
NULL.

* convert.c (convert_to_integer_1): Adjust call to
ubsan_instrument_float_cast.  Use NULL_TREE instead of NULL.
* ubsan.c (ubsan_instrument_float_cast): Drop the ARG parameter.  Use
EXPR instead of ARG.
* ubsan.h (ubsan_instrument_float_cast): Adjust declaration.

* gcc.dg/ubsan/float-cast-overflow-atomic.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232099 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/68824
* tsan/tsan_interceptors.cc (NEED_TLS_GET_ADDR, __tls_get_addr,
InitializeInterceptors): Cherry pick upstream r258119.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232555 138bc75d-0d04-0410-961f-82ee72b054a4

Fix PR sanitizer/69276

* g++.dg/asan/pr69276.C: New test.
PR sanitizer/PR69276
* asan.c (has_stmt_been_instrumented_p): Instrument gimple calls
that are gimple_store_p.
(maybe_instrument_call): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233137 138bc75d-0d04-0410-961f-82ee72b054a4

Do not emit red stack zones for a fn with no_sanitize_address

PR sanitizer/69863
* cfgexpand.c (asan_sanitize_stack_p): New function.
(partition_stack_vars): Use the function.
(expand_stack_vars): Likewise.
(defer_stack_allocation): Likewise.
(expand_used_vars): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233524 138bc75d-0d04-0410-961f-82ee72b054a4

2016-04-08  Maxim Ostapenko  <m.ostapenko@samsung.com>

PR sanitizer/70541
* asan.c (instrument_derefs): If we get unknown location, extract it
with EXPR_LOCATION.
(maybe_instrument_call): Instrument gimple_call's arguments if needed.

* c-c++-common/asan/pr70541.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234827 138bc75d-0d04-0410-961f-82ee72b054a4

PR sanitizer/70712
* cfgexpand.c (expand_stack_vars): Fix typo.

* c-c++-common/asan/pr70712.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235384 138bc75d-0d04-0410-961f-82ee72b054a4

Change-Id: Ie47e8a2109bfedb19d2cd756a4683c4fd405f64e
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
8 years ago PR ipa/64896 74/64174/5 accepted/tizen/base/20160408.190334 submit/tizen_base/20160401.062552
jakub [Fri, 6 Feb 2015 20:47:20 +0000 (20:47 +0000)]
PR ipa/64896
* cgraphunit.c (cgraph_node::expand_thunk): If
restype is not is_gimple_reg_type nor the thunk_fndecl
returns aggregate_value_p, set restmp to a temporary variable
instead of resdecl.

* g++.dg/ipa/pr64896.C: New test.

Change-Id: I55b0a863934975cfe40a67a67368507d5c4c1686
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220489 138bc75d-0d04-0410-961f-82ee72b054a4

8 years agopackaging: add --with-tune option 42/60342/1 accepted/tizen/base/20160226.192040 submit/tizen_base/20160226.023340
Chan Lee [Thu, 25 Feb 2016 07:44:59 +0000 (16:44 +0900)]
packaging: add --with-tune option

Change-Id: If870c80a2d0c87fd557838b678c71891bea9a135
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
8 years agoremove --with-* option 66/59966/1 accepted/tizen/base/20160224.043513 submit/tizen_base/20160223.080204
Chan Lee [Thu, 18 Feb 2016 09:44:01 +0000 (18:44 +0900)]
remove --with-* option

remove -with-* option on arm archtecture.
We'd prefer to define this options in global option.

Change-Id: I9eeb9589d14236fda35ba4c7459e8885d8297886
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
8 years agopackaging: change pkgversion for Tizen/Linaro 51/58851/4 submit/tizen_base/20160217.071142
Chan Lee [Tue, 2 Feb 2016 05:44:14 +0000 (14:44 +0900)]
packaging: change pkgversion for Tizen/Linaro

change pkgversion like "Tizen/Linaro GCC [version] [release]" like
Tizen 2.4.
and remove prerelease string.
You can see this by typing 'gcc --version' or 'gcc -v'.

Change-Id: I27f9320f4e625d9219f0669d7ec85a38f83c8373
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
8 years agopackaging: define --disable-libquadmath option for all 94/59494/3
Chan Lee [Mon, 1 Feb 2016 00:30:39 +0000 (09:30 +0900)]
packaging: define --disable-libquadmath option for all

Change-Id: I89abe2cad14da483e0b6f3489ec66ca273485b0f
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
8 years agopackaging: remove --enable-ssp 93/59493/3
Chan Lee [Fri, 29 Jan 2016 05:38:50 +0000 (14:38 +0900)]
packaging: remove --enable-ssp

This configure option is not defined in gcc and ignored.

Change-Id: I2e853bc5812a248438b3825c846677d60738339f
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
8 years agopackaging: remove --enable-linux-futex 91/59491/2
Chan Lee [Thu, 28 Jan 2016 05:53:14 +0000 (14:53 +0900)]
packaging: remove --enable-linux-futex

Change-Id: Ie235d5d438937b6f7af834fc41f3fef158df51ca
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
8 years agopackaging: remove --disable-libstdcxx-pch 88/59488/2
Chan Lee [Thu, 28 Jan 2016 01:24:58 +0000 (10:24 +0900)]
packaging: remove --disable-libstdcxx-pch

--enable-libstdcxx-pch is default

Change-Id: I6b30a8aa2d08cd52c81aa87a804a684a0c8e16a2
Signed-off-by: Chan Lee <chan45.lee@samsung.com>
8 years agopackaging: Disable builidng FORTRAN compiler 03/59203/1 sandbox/hk0110/disable_fortran accepted/tizen/base/20160219.170554 accepted/tizen/base/20160224.184958 submit/tizen_base/20160215.073210 submit/tizen_base/20160215.073227 submit/tizen_base/20160224.115133
Hyung-Kyu (HQ) Choi [Tue, 2 Feb 2016 05:57:25 +0000 (14:57 +0900)]
packaging: Disable builidng FORTRAN compiler
- remove fortran related gcc configure options
- remove fortran related RPM packaging rules

And qemu-accel should be update to diable fortran correctly.

Change-Id: I29a188e096d77770ccfe014c1ddd08530a3ec595
Signed-off-by: Hyung-Kyu (HQ) Choi <hk0110.choi@samsung.com>
8 years agoFIXME: packaing: fix build error 25/57425/3 accepted/tizen/base/20160120.042443 submit/tizen_base/20160120.034818
Dongkyun, Son [Sat, 9 Jan 2016 07:49:12 +0000 (16:49 +0900)]
FIXME: packaing: fix build error

{standard input}: Assembler messages:
{standard input}:183: Error: thumb conditional instruction should be in IT block -- `movcc ip,#0'
{standard input}:184: Error: thumb conditional instruction should be in IT block -- `movcs ip,#-1'
{standard input}:219: Error: thumb conditional instruction should be in IT block -- `movcc ip,#0'
{standard input}:220: Error: thumb conditional instruction should be in IT block -- `movcs ip,#-1'
Makefile:409: recipe for target 'div_qr_1n_pi1.lo' failed

Change-Id: I44bb49c1ffa8d509143bade3b4c0946ac2e00fae

8 years agoFIXME: packaging: Added gmp/mpc/mpfr/cloog/isr source to build. 24/57424/3
Dongkyun, Son [Sat, 9 Jan 2016 07:26:36 +0000 (16:26 +0900)]
FIXME: packaging: Added gmp/mpc/mpfr/cloog/isr source to build.

Change-Id: I4e73a399e17caa484db0645f4684233450b36035

8 years agoFIXME: Revert "packaging: Dependency packages build integration" 23/57423/3
Dongkyun, Son [Wed, 20 Jan 2016 03:13:04 +0000 (12:13 +0900)]
FIXME: Revert "packaging: Dependency packages build integration"

This reverts commit 080b24cd93e01d07e77e1bb7d67b048516be069c.

Change-Id: Iedfe02f760be24a134c593be1d1cf777f67599fa

8 years agoFIXME: Revert "--ignorearch added for rpm" 22/57422/2
Dongkyun, Son [Wed, 20 Jan 2016 03:12:19 +0000 (12:12 +0900)]
FIXME: Revert "--ignorearch added for rpm"

This reverts commit b13a8a51629764a352ef35791618ff75416144ed.

Change-Id: Id91caaedde29606ce32ff226adab5ef4dba60bc4

8 years agopackaging: renamed gcc.spec -> linaro-gcc.spec 42/57342/1 accepted/tizen/base/20160119.091015 submit/tizen_base/20160119.085707
Dongkyun, Son [Tue, 19 Jan 2016 08:42:52 +0000 (17:42 +0900)]
packaging: renamed gcc.spec -> linaro-gcc.spec

Change-Id: If089aa6ba827441768e8981b6f7f7a7ff9ec1818
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
8 years ago--ignorearch added for rpm 31/57231/1 accepted/tizen/base/20160119.051949 submit/tizen_base/20160118.103457
Vyacheslav Barinov [Mon, 18 Jan 2016 07:51:29 +0000 (10:51 +0300)]
--ignorearch added for rpm

Without the flag build will only work for native build roots but not for OBS
cross-builds

Change-Id: If24f0675ea01e925792480944736ddc468a0ff55
Signed-off-by: Vyacheslav Barinov <v.barinov@samsung.com>
8 years agoMerge "packaging: Dependency packages build integration" into tizen_base
Dongkyun Son [Mon, 18 Jan 2016 06:23:06 +0000 (22:23 -0800)]
Merge "packaging: Dependency packages build integration" into tizen_base

8 years agopackaging: Dependency packages build integration 36/57136/3
Vyacheslav Barinov [Thu, 14 Jan 2016 07:35:33 +0000 (10:35 +0300)]
packaging: Dependency packages build integration

Now gmp, mpfr, mpc, isl and cloog-isl are built inside GCC build and do
not require packages in OBS.

This is done due to license issues with LGPLv3 version of GNU GMP
library, we must ensure there is no way to link Tizen apps with this
library and to install it on device.

Change-Id: I9d744c4a554cfbe46a623841cc11f50084aa31c5
Signed-off-by: Vyacheslav Barinov <v.barinov@samsung.com>
8 years agopackaging: removed *-static dependency 02/56902/2
Dongkyun, Son [Wed, 13 Jan 2016 10:40:52 +0000 (19:40 +0900)]
packaging: removed *-static dependency

_service file need to be updated.
<services>
    <service name='gbs'>
        <param name='git-meta'>_git-meta</param>
        <param name='revision'>tizen_base</param>
        <param name='url'>ssh://review.tizen.org:29418/platform/upstream/linaro-gcc</param>
    </service>
    <service name='gbs'>
        <param name='git-meta'>_git-meta</param>
        <param name='revision'>tizen_base</param>
        <param name='url'>ssh://review.tizen.org:29418/platform/upstream/gmp</param>
    </service>
    <service name='gbs'>
        <param name='git-meta'>_git-meta</param>
        <param name='revision'>tizen_base</param>
        <param name='url'>ssh://review.tizen.org:29418/platform/upstream/mpc</param>
    </service>
    <service name='gbs'>
        <param name='git-meta'>_git-meta</param>
        <param name='revision'>tizen_base</param>
        <param name='url'>ssh://review.tizen.org:29418/platform/upstream/mpfr</param>
    </service>
    <service name='gbs'>
        <param name='git-meta'>_git-meta</param>
        <param name='revision'>tizen_base</param>
        <param name='url'>ssh://review.tizen.org:29418/platform/upstream/cloog</param>
    </service>
    <service name='gbs'>
        <param name='git-meta'>_git-meta</param>
        <param name='revision'>tizen_base</param>
        <param name='url'>ssh://review.tizen.org:29418/platform/upstream/isl</param>
    </service>
</services>

Change-Id: Iaf064836a4aec942e4a47b76eabdc45f22cd997d
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
8 years agopackaging: removed *-static dependency 02/56902/1
Dongkyun, Son [Wed, 13 Jan 2016 10:40:52 +0000 (19:40 +0900)]
packaging: removed *-static dependency

Change-Id: Iaf064836a4aec942e4a47b76eabdc45f22cd997d
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
8 years agoset BASE-VER to 4.9.2 00/53700/2 tizen
Dongkyun, Son [Wed, 9 Dec 2015 00:40:50 +0000 (09:40 +0900)]
set BASE-VER to 4.9.2

Change-Id: Ic44d0861eb202653a7e51ecf342e629fc7eac9e3
Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
8 years agogcc/ 2015-03-06 Christophe Lyon <christophe.lyon@linaro.org> 92/53592/2
clyon [Fri, 6 Mar 2015 15:05:27 +0000 (15:05 +0000)]
gcc/ 2015-03-06 Christophe Lyon <christophe.lyon@linaro.org>

Backport from trunk r217707.
2014-11-18  Christophe Lyon  <christophe.lyon@linaro.org>

* config/arm/neon-testgen.ml (emit_prologue): Handle new
compile_test_optim argument.
(emit_automatics): Rename to emit_variables. Support variable
indentation of its output.
(compile_test_optim): New function.
(test_intrinsic): Call compile_test_optim.
* config/arm/neon.ml (features): Add Compiler_optim.
(ops): Add Compiler_optim feature to Vbic and Vorn.
(type_in_crypto_only): Replace 'or' by '||'.
(reinterp): Likewise.
(reinterpq): Likewise.

gcc/testsuite/
2015-03-06  Christophe Lyon  <christophe.lyon@linaro.org>

Backport from trunk r217707.
2014-11-18  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/arm/neon/vbicQs16.c: Regenerate.
* gcc.target/arm/neon/vbicQs32.c: Likewise.
* gcc.target/arm/neon/vbicQs64.c: Likewise.
* gcc.target/arm/neon/vbicQs8.c: Likewise.
* gcc.target/arm/neon/vbicQu16.c: Likewise.
* gcc.target/arm/neon/vbicQu32.c: Likewise.
* gcc.target/arm/neon/vbicQu64.c: Likewise.
* gcc.target/arm/neon/vbicQu8.c: Likewise.
* gcc.target/arm/neon/vbics16.c: Likewise.
* gcc.target/arm/neon/vbics32.c: Likewise.
* gcc.target/arm/neon/vbics64.c: Likewise.
* gcc.target/arm/neon/vbics8.c: Likewise.
* gcc.target/arm/neon/vbicu16.c: Likewise.
* gcc.target/arm/neon/vbicu32.c: Likewise.
* gcc.target/arm/neon/vbicu64.c: Likewise.
* gcc.target/arm/neon/vbicu8.c: Likewise.
* gcc.target/arm/neon/vornQs16.c: Likewise.
* gcc.target/arm/neon/vornQs32.c: Likewise.
* gcc.target/arm/neon/vornQs64.c: Likewise.
* gcc.target/arm/neon/vornQs8.c: Likewise.
* gcc.target/arm/neon/vornQu16.c: Likewise.
* gcc.target/arm/neon/vornQu32.c: Likewise.
* gcc.target/arm/neon/vornQu64.c: Likewise.
* gcc.target/arm/neon/vornQu8.c: Likewise.
* gcc.target/arm/neon/vorns16.c: Likewise.
* gcc.target/arm/neon/vorns32.c: Likewise.
* gcc.target/arm/neon/vorns64.c: Likewise.
* gcc.target/arm/neon/vorns8.c: Likewise.
* gcc.target/arm/neon/vornu16.c: Likewise.
* gcc.target/arm/neon/vornu32.c: Likewise.
* gcc.target/arm/neon/vornu64.c: Likewise.
* gcc.target/arm/neon/vornu8.c: Likewise.

Change-Id: I41608974563111a82d3113ae1973ad951b29ba29
git-svn-id: svn://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@221241 138bc75d-0d04-0410-961f-82ee72b054a4

8 years agoUse Cortex-A17 tuning parameters for Cortex-A12 90/53590/1
ktkachov [Mon, 12 Jan 2015 15:14:33 +0000 (15:14 +0000)]
Use Cortex-A17 tuning parameters for Cortex-A12

* config/arm/arm.c (arm_cortex_a12_tune): Update entries to match
Cortex-A17 tuning parameters.
* config/arm/arm-cores.def (cortex-a12): Schedule for cortex-a17.

Change-Id: I052388833c5c3f988665a8abc4ffa5a5b873d586
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219472 138bc75d-0d04-0410-961f-82ee72b054a4

8 years agoAdd -mcpu=cortex-a17.cortex-a7 89/53589/1
ktkachov [Fri, 28 Nov 2014 12:17:40 +0000 (12:17 +0000)]
Add -mcpu=cortex-a17.cortex-a7

* config/arm/arm-cores.def (cortex-a17.cortex-a7): New entry.
* config/arm/arm-tables.opt: Regenerate.
* config/arm/arm-tune.md: Regenerate.
* config/arm/bpabi.h (BE8_LINK_SPEC): Add mcpu=cortex-a17.cortex-a7.
* config/arm/t-aprofile: Add cortex-a17.cortex-a7 entry to
MULTILIB_MATCHES.

Change-Id: I187e367a89123ce3944cc95dc5d391dd6c359c8a
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218146 138bc75d-0d04-0410-961f-82ee72b054a4

8 years agoAdd Cortex-A17 support 88/53588/1
ktkachov [Fri, 28 Nov 2014 11:59:34 +0000 (11:59 +0000)]
Add Cortex-A17 support

* config/arm/arm.md (generic_sched): Specify cortexa17 in 'no' list.
Include cortex-a17.md.
* config/arm/arm.c (arm_issue_rate): Specify 2 for cortexa17.
* config/arm/arm-cores.def (cortex-a17): New entry.
* config/arm/arm-tables.opt: Regenerate.
* config/arm/arm-tune.md: Regenerate.
* config/arm/bpabi.h (BE8_LINK_SPEC): Specify mcpu=cortex-a17.
* config/arm/cortex-a17.md: New file.
* config/arm/cortex-a17-neon.md: New file.
* config/arm/driver-arm.c (arm_cpu_table): Add entry for cortex-a17.
* config/arm/t-aprofile: Add cortex-a17 entries to MULTILIB_MATCHES.

Change-Id: Ice7a25da1b3be47c143360d47c1544959f74dce9
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218145 138bc75d-0d04-0410-961f-82ee72b054a4

8 years ago2014-08-07 Marat Zakirov <m.zakirov@samsung.com> 87/53587/1
mzakirov [Thu, 7 Aug 2014 07:34:33 +0000 (07:34 +0000)]
2014-08-07 Marat Zakirov <m.zakirov@samsung.com>

* config/arm/thumb1.md (*thumb1_movhi_insn): Handle stack pointer.
(*thumb1_movqi_insn): Likewise.
* config/arm/thumb2.md (*thumb2_movhi_insn): Likewise.

Change-Id: Iaf99474d30284516a0c8f713376d315b94d69b08
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213695 138bc75d-0d04-0410-961f-82ee72b054a4

8 years agogcc/ 2014-07-11 Marat Zakirov <m.zakirov@samsung.com> 86/53586/1
mzakirov [Fri, 11 Jul 2014 09:02:39 +0000 (09:02 +0000)]
gcc/ 2014-07-11 Marat Zakirov <m.zakirov@samsung.com>

PR target/61561
* config/arm/arm.md (*movhi_insn_arch4): Handle stack pointer.
(*movhi_bytes): Likewise.
(*arm_movqi_insn): Likewise.

gcc/testsuite/
2014-07-11  Marat Zakirov  <m.zakirov@samsung.com>

PR target/61561
* gcc.dg/pr61561.c: New test.

Change-Id: I977cff643e5fa4b119a3c662510bdf7664d8a2e6
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212450 138bc75d-0d04-0410-961f-82ee72b054a4

8 years agomake gmp, mpc, mpfr, isl and cloog-isl deps static 85/53585/1
Yury Usishchev [Wed, 21 Oct 2015 11:32:02 +0000 (14:32 +0300)]
make gmp, mpc, mpfr, isl and cloog-isl deps static

Change-Id: I6af8833f6f9b45672d891ffc9a7e0cd7f83e0d65

8 years ago2014-11-04 Zhenqiang Chen <zhenqiang.chen@arm.com> 84/53584/1
zqchen [Tue, 4 Nov 2014 02:21:51 +0000 (02:21 +0000)]
2014-11-04 Zhenqiang Chen <zhenqiang.chen@arm.com>

Revert:
2014-11-03  Zhenqiang Chen  <zhenqiang.chen@arm.com>
* ifcvt.c (noce_emit_cmove, noce_get_alt_condition, noce_get_condition):
Allow CC mode if HAVE_cbranchcc4.

Change-Id: I59159ec53faba15957a6acce4462ba10ec0ceed1
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217062 138bc75d-0d04-0410-961f-82ee72b054a4

8 years agoAdd symlink to liblto_plugin to bfd-plugins directory 83/53583/1
Yury Usishchev [Tue, 25 Aug 2015 15:10:20 +0000 (18:10 +0300)]
Add symlink to liblto_plugin to bfd-plugins directory

Change-Id: Iefe8a944c0159af77e29d786f4ce4a5d7f1dbb92

8 years agoRework packaging for Tizen. 72/53572/1
Yury Usishchev [Thu, 2 Jul 2015 16:14:00 +0000 (19:14 +0300)]
Rework packaging for Tizen.

Change-Id: Idc6ae14ce9fcd767e45cd2285097565bdc5865ab

9 years agoMake Linaro GCC 4.9-2015.02. upstream-4.9.2 upstream/4.9.2
collison [Mon, 16 Feb 2015 09:23:46 +0000 (09:23 +0000)]
Make Linaro GCC 4.9-2015.02.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@220723 138bc75d-0d04-0410-961f-82ee72b054a4

9 years agoMerge branches/gcc-4_9-branch rev 220525
yroux [Thu, 12 Feb 2015 09:35:37 +0000 (09:35 +0000)]
Merge branches/gcc-4_9-branch rev 220525

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@220639 138bc75d-0d04-0410-961f-82ee72b054a4

9 years agoMerge branches/gcc-4_9-branch rev 220524
yroux [Thu, 12 Feb 2015 09:21:29 +0000 (09:21 +0000)]
Merge branches/gcc-4_9-branch rev 220524

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@220638 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-02-10 Michael Collison <michael.collison@linaro.org>
collison [Tue, 10 Feb 2015 08:27:57 +0000 (08:27 +0000)]
2015-02-10  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r217175, r217185, r217186.
2014-11-06  Hale Wang  <hale.wang@arm.com>

* config/arm/arm-cores.def: Add support for
-mcpu=cortex-m0.small-multiply,cortex-m0plus.small-multiply,
cortex-m1.small-multiply.
* config/arm/arm-tables.opt: Regenerate.
* config/arm/arm-tune.md: Regenerate.
* config/arm/arm.c: Update the rtx-costs for MUL.
* config/arm/bpabi.h: Handle
-mcpu=cortex-m0.small-multiply,cortex-m0plus.small-multiply,
cortex-m1.small-multiply.
* doc/invoke.texi: Document
-mcpu=cortex-m0.small-multiply,cortex-m0plus.small-multiply,
cortex-m1.small-multiply.

2015-02-10  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r217185, r217186.
2014-11-06  Hale Wang  <hale.wang@arm.com>

* gcc.target/arm/small-multiply-m0-1.c: New test for
* gcc.target/arm/small-multiply-m0-2.c: Likewise.
* gcc.target/arm/small-multiply-m0-3.c: Likewise.
* gcc.target/arm/small-multiply-m0plus-1.c: New test for
* gcc.target/arm/small-multiply-m0plus-2.c: Likewise.
* gcc.target/arm/small-multiply-m0plus-3.c: Likewise.
* gcc.target/arm/small-multiply-m1-1.c: New test for
* gcc.target/arm/small-multiply-m1-2.c: Likewise.
* gcc.target/arm/small-multiply-m1-3.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@220575 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-02-10 Michael Collison <michael.collison@linaro.org>
collison [Tue, 10 Feb 2015 08:17:09 +0000 (08:17 +0000)]
2015-02-10  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r217091.
2014-11-04  Jiong Wang  <jiong.wang@arm.com>
2014-11-04  Wilco Dijkstra  <wilco.dijkstra@arm.com>

PR target/63293
* config/aarch64/aarch64.c (aarch64_expand_epiloue): Add barriers before
stack adjustment.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@220574 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-01-27 Michael Collison <michael.collison@linaro.org>
collison [Tue, 10 Feb 2015 08:12:24 +0000 (08:12 +0000)]
2015-01-27  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r217118.
2014-11-05  Alex Velenko  <Alex.Velenko@arm.com>

* simplify-rtx.c (simplify_binary_operation_1): Div check added.
* rtl.h (SUBREG_P): New macro added.

2015-02-10  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r217118.
2014-11-05  Alex Velenko  <Alex.Velenko@arm.com>

* gcc.dg/asr-div1.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@220573 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-02-10 Michael Collison <michael.collison@linaro.org>
collison [Tue, 10 Feb 2015 08:05:35 +0000 (08:05 +0000)]
2015-02-10  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r217215.
2014-11-07  Jiong Wang  <jiong.wang@arm.com>
2014-11-07  Richard Biener  <rguenther@suse.de>

PR tree-optimization/63676
* gimple-fold.c (fold_gimple_assign): Do not fold node when
TREE_CLOBBER_P be true.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@220572 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-01-27 Michael Collison <michael.collison@linaro.org>
collison [Tue, 10 Feb 2015 08:00:29 +0000 (08:00 +0000)]
2015-01-27  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r217228.
2014-11-07  Jiong Wang  <jiong.wang@arm.com>

* gcc.dg/tree-ssa/20040204-1.c: Add aarch64*-*-* to the list.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@220571 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-02-10 Michael Collison <michael.collison@linaro.org>
collison [Tue, 10 Feb 2015 07:53:23 +0000 (07:53 +0000)]
2015-02-10  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r219583.
2015-01-14  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

PR target/64460
* config/arm/arm.md (*<arith_shift_insn>_multsi): Set 'shift' to 2.
(*<arith_shift_insn>_shiftsi): Set 'shift' attr to 3.

2015-02-10  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r217430.
2014-11-12  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

* config/arm/arm.c (*<arith_shift_insn>_shiftsi): Fix typo.

2015-02-10  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r219583.
2015-01-14  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

PR target/64460
* gcc.target/arm/pr64460_1.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@220570 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-02-10 Michael Collison <michael.collison@linaro.org>
collison [Tue, 10 Feb 2015 07:41:54 +0000 (07:41 +0000)]
2015-02-10  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r217431.
2014-11-12  Jiong Wang  <jiong.wang@arm.com>

* config/aarch64/aarch64.h (CALL_USED_REGISTERS): Mark LR as
caller-save.
(EPILOGUE_USES): Guard the check by epilogue_completed.
* config/aarch64/aarch64.c (aarch64_layout_frame): Explictly check for
LR.
(aarch64_can_eliminate): Check LR_REGNUM liveness.

2015-02-10  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r217431.
2014-11-12  Jiong Wang  <jiong.wang@arm.com>

* gcc.target/aarch64/lr_free_1.c: New testcase for -fomit-frame-pointer.
* gcc.target/aarch64/lr_free_2.c: New testcase for leaf
-fno-omit-frame-pointer.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@220569 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-02-10 Michael Collison <michael.collison@linaro.org>
collison [Tue, 10 Feb 2015 07:31:25 +0000 (07:31 +0000)]
2015-02-10  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r219718.
* expmed.c (store_bit_field_using_insv): Improve warning message.
Use %wu instead of HOST_WIDE_INT_PRINT_UNSIGNED.

2015-01-15  Jiong Wang  <jiong.wang@arm.com>

2015-02-10  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r219717.
2015-01-15  Jiong Wang  <jiong.wang@arm.com>

PR rtl-optimization/64011
* expmed.c (store_bit_field_using_insv): Warn and truncate bitsize when
there is partial overflow.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@220568 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-02-10 Michael Collison <michael.collison@linaro.org>
collison [Tue, 10 Feb 2015 07:24:17 +0000 (07:24 +0000)]
2015-02-10  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r217331.
2014-11-11  Bin Cheng  <bin.cheng@arm.com>

* sched-deps.c (sched_analyze_1): Check pending list if it is not
less than MAX_PENDING_LIST_LENGTH.
(sched_analyze_2, sched_analyze_insn, deps_analyze_insn): Ditto.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@220567 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-02-09 Michael Collison <michael.collison@linaro.org>
collison [Tue, 10 Feb 2015 02:23:40 +0000 (02:23 +0000)]
2015-02-09  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r216779.
2014-10-28  Alan Lawrence  <alan.lawrence@arm.com>

* expr.c (expand_expr_real_2): Remove code handling VEC_LSHIFT_EXPR.
* fold-const.c (const_binop): Likewise.
* cfgexpand.c (expand_debug_expr): Likewise.
* tree-inline.c (estimate_operator_cost): Likewise.
* tree-vect-generic.c (expand_vector_operations_1): Likewise.
* optabs.c (optab_for_tree_code): Likewise.
(expand_vec_shift_expr): Likewise, update comment.
* tree.def: Delete VEC_LSHIFT_EXPR, remove comment.
* optabs.h (expand_vec_shift_expr): Remove comment re. VEC_LSHIFT_EXPR.
* optabs.def: Remove vec_shl_optab.
* doc/md.texi: Remove references to vec_shr_m.

2015-02-09  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r216742.
2014-10-27  Alan Lawrence  <alan.lawrence@arm.com>

* config/aarch64/aarch64.c (TARGET_GIMPLE_FOLD_BUILTIN): Define again.
* config/aarch64/aarch64-builtins.c (aarch64_gimple_fold_builtin):
Restore, enable for bigendian, update to use __builtin..._scal...

2015-02-09  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r216741.
2014-10-27  Alan Lawrence  <alan.lawrence@arm.com>

* config/aarch64/aarch64-simd-builtins.def (reduc_smax_, reduc_smin_,
reduc_umax_, reduc_umin_, reduc_smax_nan_, reduc_smin_nan_): Remove.
(reduc_smax_scal_, reduc_smin_scal_, reduc_umax_scal_,
reduc_umin_scal_, reduc_smax_nan_scal_, reduc_smin_nan_scal_): New.

* config/aarch64/aarch64-simd.md
(reduc_<maxmin_uns>_<mode>): Rename VDQV_S variant to...
(reduc_<maxmin_uns>_internal<mode>): ...this.
(reduc_<maxmin_uns>_<mode>): New (VDQ_BHSI).
(reduc_<maxmin_uns>_scal_<mode>): New (*2).

(reduc_<maxmin_uns>_v2si): Combine with below, renaming...
(reduc_<maxmin_uns>_<mode>): Combine V2F with above, renaming...
(reduc_<maxmin_uns>_internal_<mode>): ...to this (VDQF).

* config/aarch64/arm_neon.h (vmaxv_f32, vmaxv_s8, vmaxv_s16,
vmaxv_s32, vmaxv_u8, vmaxv_u16, vmaxv_u32, vmaxvq_f32, vmaxvq_f64,
vmaxvq_s8, vmaxvq_s16, vmaxvq_s32, vmaxvq_u8, vmaxvq_u16, vmaxvq_u32,
vmaxnmv_f32, vmaxnmvq_f32, vmaxnmvq_f64, vminv_f32, vminv_s8,
vminv_s16, vminv_s32, vminv_u8, vminv_u16, vminv_u32, vminvq_f32,
vminvq_f64, vminvq_s8, vminvq_s16, vminvq_s32, vminvq_u8, vminvq_u16,
vminvq_u32, vminnmv_f32, vminnmvq_f32, vminnmvq_f64): Update to use
__builtin_aarch64_reduc_..._scal; remove vget_lane wrapper.

2015-02-09  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r216738.
2014-10-27  Alan Lawrence  <alan.lawrence@arm.com>

* config/aarch64/aarch64-simd-builtins.def
(reduc_splus_<mode>/VDQF, reduc_uplus_<mode>/VDQF, reduc_splus_v4sf):
Remove.
(reduc_plus_scal_<mode>, reduc_plus_scal_v4sf): New.

* config/aarch64/aarch64-simd.md (reduc_<sur>plus_mode): Remove.
(reduc_splus_<mode>, reduc_uplus_<mode>, reduc_plus_scal_<mode>): New.

(reduc_<sur>plus_mode): Change SUADDV -> UNSPEC_ADDV, rename to...
(aarch64_reduc_plus_internal<mode>): ...this.

(reduc_<sur>plus_v2si): Change SUADDV -> UNSPEC_ADDV, rename to...
(aarch64_reduc_plus_internalv2si): ...this.

(reduc_splus_<mode>/V2F): Rename to...
(aarch64_reduc_plus_internal<mode>): ...this.

* config/aarch64/iterators.md
(UNSPEC_SADDV, UNSPEC_UADDV, SUADDV): Remove.
(UNSPEC_ADDV): New.
(sur): Remove elements for UNSPEC_SADDV and UNSPEC_UADDV.

* config/aarch64/arm_neon.h (vaddv_s8, vaddv_s16, vaddv_s32, vaddv_u8,
vaddv_u16, vaddv_u32, vaddvq_s8, vaddvq_s16, vaddvq_s32, vaddvq_s64,
vaddvq_u8, vaddvq_u16, vaddvq_u32, vaddvq_u64, vaddv_f32, vaddvq_f32,
vaddvq_f64): Change __builtin_aarch64_reduc_[us]plus_... to
__builtin_aarch64_reduc_plus_scal, remove vget_lane wrapper.

2015-02-09  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r216737.
2014-10-27  Alan Lawrence  <alan.lawrence@arm.com>

PR tree-optimization/61114
* doc/md.texi (Standard Names): Add reduc_(plus,[us](min|max))|scal
optabs, and note in reduc_[us](plus|min|max) to prefer the former.

* expr.c (expand_expr_real_2): Use reduc_..._scal if available, fall
back to old reduc_...  BIT_FIELD_REF only if not.

* optabs.c (optab_for_tree_code): for REDUC_(MAX,MIN,PLUS)_EXPR,
return the reduce-to-scalar (reduc_..._scal) optab.
(scalar_reduc_to_vector): New.

* optabs.def (reduc_smax_scal_optab, reduc_smin_scal_optab,
reduc_plus_scal_optab, reduc_umax_scal_optab, reduc_umin_scal_optab):
New.

* optabs.h (scalar_reduc_to_vector): Declare.

* tree-vect-loop.c (vectorizable_reduction): Look for optabs reducing
to either scalar or vector.

2015-02-09  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r216736.
2014-10-27  Alan Lawrence  <alan.lawrence@arm.com>

PR tree-optimization/61114
* expr.c (expand_expr_real_2): For REDUC_{MIN,MAX,PLUS}_EXPR, add
extract_bit_field around optab result.

* fold-const.c (fold_unary_loc): For REDUC_{MIN,MAX,PLUS}_EXPR, produce
scalar not vector.

* tree-cfg.c (verify_gimple_assign_unary): Check result vs operand type
for REDUC_{MIN,MAX,PLUS}_EXPR.

* tree-vect-loop.c (vect_analyze_loop): Update comment.
(vect_create_epilog_for_reduction): For direct vector reduction, use
result of tree code directly without extract_bit_field.

* tree.def (REDUC_MAX_EXPR, REDUC_MIN_EXPR, REDUC_PLUS_EXPR): Update
comment.

2015-02-09  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r216734.
2014-10-27  Alan Lawrence  <alan.lawrence@arm.com>

* config/aarch64/aarch64.c (TARGET_GIMPLE_FOLD_BUILTIN): Comment out.
* config/aarch64/aarch64-builtins.c (aarch64_gimple_fold_builtin):
Remove using preprocessor directis.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@220562 138bc75d-0d04-0410-961f-82ee72b054a4

9 years agoBackport from trunk r216675.
prathamesh3492 [Mon, 9 Feb 2015 08:15:42 +0000 (08:15 +0000)]
Backport from trunk r216675.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@220528 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-02-09 Yvan Roux <yvan.roux@linaro.org>
yroux [Mon, 9 Feb 2015 01:11:37 +0000 (01:11 +0000)]
2015-02-09  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r217173, r217174, r217687.
2014-11-17  Terry Guo  <terry.guo@arm.com>

* config/arm/arm.c (arm_issue_rate): Return 2 for cortex-m7.
* config/arm/arm.md (generic_sched): Exclude cortex-m7.
(generic_vfp): Likewise.
* config/arm/cortex-m7.md: Pipeline description for cortex-m7.

2014-10-06  Hale Wang  <Hale.Wang@arm.com>

* config/arm/arm.c: Add cortex-m7 tune.
* config/arm/arm-cores.def: Use cortex-m7 tune.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@220527 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago[ARM,AArch64][testsuite] New Advanced SIMD intrinsics tests.
clyon [Sun, 8 Feb 2015 15:05:43 +0000 (15:05 +0000)]
[ARM,AArch64][testsuite] New Advanced SIMD intrinsics tests.

2015-02-04  Christophe Lyon  <christophe.lyon@linaro.org>

Backport from trunk r216640-r216661.
2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/vuzp.c: New file.
* gcc.target/aarch64/advsimd-intrinsics/vzip.c: Likewise.

2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/vmul.c: New file.

2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/vldX_lane.c: New file.

2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/vldX.c: New file.

2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/vld1_dup.c: New file.

2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/vdup-vmov.c: New file.

2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/vclz.c: New file.

2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/vbsl.c: New file.

2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/vaddw.c: New file.

2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/vaddl.c: New file.

2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/vaddhn.c: New file.

2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/vabdl.c: New file.

2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/vabd.c: New file.

2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/vabal.c: New file.

2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/binary_sat_op.inc: New
file.
* gcc.target/aarch64/advsimd-intrinsics/vqadd.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vqsub.c: Likewise.

2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/unary_sat_op.inc: New
file.
* gcc.target/aarch64/advsimd-intrinsics/vqabs.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vqneg.c: Likewise.

2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/cmp_fp_op.inc: New file.
* gcc.target/aarch64/advsimd-intrinsics/vcage.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vcagt.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vcale.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vcalt.c: Likewise.

2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/cmp_op.inc: New file.
* gcc.target/aarch64/advsimd-intrinsics/vceq.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vcge.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vcgt.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vcle.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vclt.c: Likewise.

2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/binary_op.inc: New file.
* gcc.target/aarch64/advsimd-intrinsics/vadd.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vand.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vbic.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/veor.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vorn.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vorr.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vsub.c: Likewise.

2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/aarch64/advsimd-intrinsics/unary_op.inc: New file.
* gcc.target/aarch64/advsimd-intrinsics/vabs.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vneg.c: Likewise.

2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* gcc.target/arm/README.advsimd-intrinsics: New file.
* gcc.target/aarch64/advsimd-intrinsics/README: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/arm-neon-ref.h: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/compute-ref-data.h:
Likewise.
* gcc.target/aarch64/advsimd-intrinsics/advsimd-intrinsics.exp:
Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vaba.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vld1.c: Likewise.
* gcc.target/aarch64/advsimd-intrinsics/vshl.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@220516 138bc75d-0d04-0410-961f-82ee72b054a4

9 years agoBackport from trunk r217230
prathamesh3492 [Thu, 5 Feb 2015 18:41:14 +0000 (18:41 +0000)]
Backport from trunk r217230

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@220459 138bc75d-0d04-0410-961f-82ee72b054a4

9 years agoBump version number, post release.
yroux [Thu, 15 Jan 2015 11:38:14 +0000 (11:38 +0000)]
Bump version number, post release.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@219645 138bc75d-0d04-0410-961f-82ee72b054a4

9 years agoMake Linaro GCC 4.9-2015.01.
yroux [Thu, 15 Jan 2015 11:35:00 +0000 (11:35 +0000)]
Make Linaro GCC 4.9-2015.01.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@219643 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-01-14 Yvan Roux <yvan.roux@linaro.org>
yroux [Wed, 14 Jan 2015 12:53:04 +0000 (12:53 +0000)]
2015-01-14  Yvan Roux  <yvan.roux@linaro.org>

Fix Linaro PR #902

Partial Backport from trunk r211798.
2014-06-18  Radovan Obradovic  <robradovic@mips.com>
    Tom de Vries  <tom@codesourcery.com>

* config/arm/arm.c (arm_emit_call_insn): Add IP and CC clobbers to
CALL_INSN_FUNCTION_USAGE.

Backport from trunk r209800.
2014-04-25  Tom de Vries  <tom@codesourcery.com>

* expr.c (clobber_reg_mode): New function.
* expr.h (clobber_reg): New function.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@219597 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-01-14 Yvan Roux <yvan.roux@linaro.org>
yroux [Wed, 14 Jan 2015 12:41:31 +0000 (12:41 +0000)]
2015-01-14  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r211783.
2014-06-18  Charles Baylis  <charles.baylis@linaro.org>

* config/arm/arm.c (neon_vector_mem_operand): Allow register
POST_MODIFY for neon loads and stores.
(arm_print_operand): Output post-index register for neon loads and
stores.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@219596 138bc75d-0d04-0410-961f-82ee72b054a4

9 years agogcc/
yroux [Wed, 14 Jan 2015 10:22:48 +0000 (10:22 +0000)]
gcc/
2015-01-14  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r218451.
2014-12-06  James Greenhalgh  <james.greenhalgh@arm.com>
    Sebastian Pop  <s.pop@samsung.com>
    Brian Rzycki  <b.rzycki@samsung.com>

PR tree-optimization/54742
* params.def (max-fsm-thread-path-insns, max-fsm-thread-length,
max-fsm-thread-paths): New.

* doc/invoke.texi (max-fsm-thread-path-insns, max-fsm-thread-length,
max-fsm-thread-paths): Documented.

* tree-cfg.c (split_edge_bb_loc): Export.
* tree-cfg.h (split_edge_bb_loc): Declared extern.

* tree-ssa-threadedge.c (simplify_control_stmt_condition): Restore the
original value of cond when simplification fails.
(fsm_find_thread_path): New.
(fsm_find_control_statement_thread_paths): New.
(thread_through_normal_block): Call find_control_statement_thread_paths.

* tree-ssa-threadupdate.c (dump_jump_thread_path): Pretty print
EDGE_FSM_THREAD.
(verify_seme): New.
(duplicate_seme_region): New.
(thread_through_all_blocks): Generate code for EDGE_FSM_THREAD edges
calling duplicate_seme_region.

* tree-ssa-threadupdate.h (jump_thread_edge_type): Add EDGE_FSM_THREAD.

gcc/testsuite/
2015-01-14  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r218451.
2014-12-06  James Greenhalgh  <james.greenhalgh@arm.com>
    Sebastian Pop  <s.pop@samsung.com>
    Brian Rzycki  <b.rzycki@samsung.com>

PR tree-optimization/54742
* gcc.dg/tree-ssa/ssa-dom-thread-6.c: New test.
* gcc.dg/tree-ssa/ssa-dom-thread-7.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@219584 138bc75d-0d04-0410-961f-82ee72b054a4

9 years agoMerge branches/gcc-4_9-branch rev 219502
yroux [Tue, 13 Jan 2015 19:12:03 +0000 (19:12 +0000)]
Merge branches/gcc-4_9-branch rev 219502

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@219549 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-01-13 Michael Collison <michael.collison@linaro.org>
yroux [Tue, 13 Jan 2015 08:52:55 +0000 (08:52 +0000)]
2015-01-13  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r217394.
2014-11-11  Andrew Pinski  <apinski@cavium.com>

Bug target/61997
* config.gcc (aarch64*-*-*): Set target_gtfiles to include
aarch64-builtins.c.
* config/aarch64/aarch64-builtins.c: Include gt-aarch64-builtins.h
at the end of the file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@219522 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-01-13 Michael Collison <michael.collison@linaro.org>
yroux [Tue, 13 Jan 2015 08:10:04 +0000 (08:10 +0000)]
2015-01-13  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r216267, r216547, r216548, r217072, r217192, r217405,
r217406, r217768.
2014-11-19  Renlin Li  <renlin.li@arm.com>

* config/aarch64/aarch64.h (TARGET_CPU_CPP_BUILTINS): Define __ARM_FP_FAST,
__ARM_FEATURE_FMA, __ARM_FP, __ARM_FEATURE_NUMERIC_MAXMIN, __ARM_NEON_FP.

2014-11-12  Tejas Belagod  <tejas.belagod@arm.com>

* Makefile.in (TEXI_GCC_FILES): Remove arm-acle-intrinsics.texi,
arm-neon-intrinsics.texi, aarch64-acle-intrinsics.texi.
* doc/aarch64-acle-intrinsics.texi: Remove.
* doc/arm-acle-intrinsics.texi: Remove.
* doc/arm-neon-intrinsics.texi: Remove.
* doc/extend.texi: Consolidate sections AArch64 intrinsics,
ARM NEON Intrinsics, ARM ACLE Intrinsics into one ARM C Language
Extension section. Add references to public ACLE specification.

2014-11-06  Renlin Li  <renlin.li@arm.com>

* config/aarch64/aarch64.c (aarch64_architecture_version): New.
(processor): New architecture_version field.
(aarch64_override_options): Initialize aarch64_architecture_version.
* config/aarch64/aarch64.h (TARGET_CPU_CPP_BUILTINS): Define __ARM_ARCH,
__ARM_ARCH_PROFILE, aarch64_arch_name macro.

2014-11-04  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Fix typo in definition
of __ARM_FEATURE_IDIV.

2014-10-22  Jiong Wang <jiong.wang@arm.com>

* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Add missing '\'.

2014-10-22  Renlin Li <renlin.li@arm.com>

* config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Define
__ARM_FEATURE_IDIV__.

2014-10-15  Renlin Li <renlin.li@arm.com>

* config/aarch64/aarch64.h (TARGET_CPU_CPP_BUILTINS): Define
__ARM_BIG_ENDIAN, __ARM_SIZEOF_MINIMAL_ENUM. Add __ARM_64BIT_STATE,
__ARM_ARCH_ISA_A64, __ARM_FEATURE_CLZ, __ARM_FEATURE_IDIV,
__ARM_FEATURE_UNALIGNED, __ARM_PCS_AAPCS64, __ARM_SIZEOF_WCHAR_T.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@219518 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-01-13 Michael Collison <michael.collison@linaro.org>
yroux [Tue, 13 Jan 2015 07:43:13 +0000 (07:43 +0000)]
2015-01-13  Michael Collison  <michael.collison@linaro.org>

Backport from trunk r211789, r211790, r211791, r211792, r211793, r211794,
r211795, r211796, r211797.
2014-06-18  Charles Baylis  <charles.baylis@linaro.org>

* config/arm/bpabi.c (__gnu_uldivmod_helper): Remove.

2014-06-18  Charles Baylis  <charles.baylis@linaro.org>

* config/arm/bpabi-v6m.S (__aeabi_uldivmod): Perform division using
__udivmoddi4.

2014-06-18  Charles Baylis  <charles.baylis@linaro.org>

* config/arm/bpabi.S (__aeabi_ldivmod, __aeabi_uldivmod,
push_for_divide, pop_for_divide): Use .cfi_* directives for DWARF
annotations. Fix DWARF information.

2014-06-18  Charles Baylis  <charles.baylis@linaro.org>

* config/arm/bpabi.S (__aeabi_ldivmod): Perform division using
__udivmoddi4, and fixups for negative operands.

2014-06-18  Charles Baylis  <charles.baylis@linaro.org>

* config/arm/bpabi.S (__aeabi_ldivmod): Optimise stack manipulation.

2014-06-18  Charles Baylis  <charles.baylis@linaro.org>

* config/arm/bpabi.S (__aeabi_uldivmod): Perform division using call
to __udivmoddi4.

2014-06-18  Charles Baylis  <charles.baylis@linaro.org>

* config/arm/bpabi.S (__aeabi_uldivmod): Optimise stack pointer
manipulation.

2014-06-18  Charles Baylis  <charles.baylis@linaro.org>

* config/arm/bpabi.S (__aeabi_uldivmod, __aeabi_ldivmod): Add comment
describing register usage on function entry and exit.

2014-06-18  Charles Baylis  <charles.baylis@linaro.org>

* config/arm/bpabi.S (__aeabi_uldivmod): Fix whitespace.
(__aeabi_ldivmod): Fix whitespace.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@219517 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-01-13 Yvan Roux <yvan.roux@linaro.org>
yroux [Tue, 13 Jan 2015 07:13:21 +0000 (07:13 +0000)]
2015-01-13  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r217593.
2014-11-14  Andrew Pinski  <apinski@cavium.com>

* config/aarch64/aarch64-cores.def (thunderx): Change the scheduler
over to thunderx.
* config/aarch64/aarch64.md: Include thunderx.md.
(generic_sched): Set to no for thunderx.
* config/aarch64/thunderx.md: New file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@219516 138bc75d-0d04-0410-961f-82ee72b054a4

9 years agogcc/testsuite/
yroux [Mon, 12 Jan 2015 14:07:05 +0000 (14:07 +0000)]
gcc/testsuite/
2015-01-12  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r211075.
2014-04-30  Alan Lawrence  <alan.lawrence@arm.com>

gcc.target/arm/simd/vrev16p8_1.c: New file.
gcc.target/arm/simd/vrev16qp8_1.c: New file.
gcc.target/arm/simd/vrev16qs8_1.c: New file.
gcc.target/arm/simd/vrev16qu8_1.c: New file.
gcc.target/arm/simd/vrev16s8_1.c: New file.
gcc.target/arm/simd/vrev16u8_1.c: New file.
gcc.target/arm/simd/vrev32p16_1.c: New file.
gcc.target/arm/simd/vrev32p8_1.c: New file.
gcc.target/arm/simd/vrev32qp16_1.c: New file.
gcc.target/arm/simd/vrev32qp8_1.c: New file.
gcc.target/arm/simd/vrev32qs16_1.c: New file.
gcc.target/arm/simd/vrev32qs8_1.c: New file.
gcc.target/arm/simd/vrev32qu16_1.c: New file.
gcc.target/arm/simd/vrev32qu8_1.c: New file.
gcc.target/arm/simd/vrev32s16_1.c: New file.
gcc.target/arm/simd/vrev32s8_1.c: New file.
gcc.target/arm/simd/vrev32u16_1.c: New file.
gcc.target/arm/simd/vrev32u8_1.c: New file.
gcc.target/arm/simd/vrev64f32_1.c: New file.
gcc.target/arm/simd/vrev64p16_1.c: New file.
gcc.target/arm/simd/vrev64p8_1.c: New file.
gcc.target/arm/simd/vrev64qf32_1.c: New file.
gcc.target/arm/simd/vrev64qp16_1.c: New file.
gcc.target/arm/simd/vrev64qp8_1.c: New file.
gcc.target/arm/simd/vrev64qs16_1.c: New file.
gcc.target/arm/simd/vrev64qs32_1.c: New file.
gcc.target/arm/simd/vrev64qs8_1.c: New file.
gcc.target/arm/simd/vrev64qu16_1.c: New file.
gcc.target/arm/simd/vrev64qu32_1.c: New file.
gcc.target/arm/simd/vrev64qu8_1.c: New file.
gcc.target/arm/simd/vrev64s16_1.c: New file.
gcc.target/arm/simd/vrev64s32_1.c: New file.
gcc.target/arm/simd/vrev64s8_1.c: New file.
gcc.target/arm/simd/vrev64u16_1.c: New file.
gcc.target/arm/simd/vrev64u32_1.c: New file.
gcc.target/arm/simd/vrev64u8_1.c: New file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@219465 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-01-12 Yvan Roux <yvan.roux@linaro.org>
yroux [Mon, 12 Jan 2015 13:59:14 +0000 (13:59 +0000)]
2015-01-12  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r217717.
2014-11-18  Felix Yang  <felix.yang@huawei.com>

* config/aarch64/aarch64.c (doloop_end): New pattern.
* config/aarch64/aarch64.md (TARGET_CAN_USE_DOLOOP_P): Implement.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@219464 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-01-12 Yvan Roux <yvan.roux@linaro.org>
yroux [Mon, 12 Jan 2015 13:49:50 +0000 (13:49 +0000)]
2015-01-12  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r217661.
2014-11-17  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

* config/aarch64/aarch64-cores.def (cortex-a53): Remove
AARCH64_FL_CRYPTO from feature flags.
(cortex-a57): Likewise.
(cortex-a57.cortex-a53): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@219463 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-01-11 Yvan Roux <yvan.roux@linaro.org>
yroux [Sun, 11 Jan 2015 19:07:15 +0000 (19:07 +0000)]
2015-01-11  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r218319.
2014-12-03  Andrew Stubbs  <ams@codesourcery.com>

Revert:

2014-09-17  Andrew Stubbs  <ams@codesourcery.com>

* config/arm/arm.c (arm_option_override): Reject -mfpu=neon
when architecture is older than ARMv7.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@219438 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-01-11 Yvan Roux <yvan.roux@linaro.org>
yroux [Sun, 11 Jan 2015 19:02:39 +0000 (19:02 +0000)]
2015-01-11  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r217691.
2014-11-18  Jiong Wang  <jiong.wang@arm.com>

* lra-eliminations.c (update_reg_eliminate): Relax gcc_assert for fixed
registers.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@219437 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-01-11 Yvan Roux <yvan.roux@linaro.org>
yroux [Sun, 11 Jan 2015 18:56:54 +0000 (18:56 +0000)]
2015-01-11  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r215503.
2014-09-23  Wilco Dijkstra  <wdijkstr@arm.com>

* common/config/aarch64/aarch64-common.c:
(default_options aarch_option_optimization_table):
Default to -fsched-pressure.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@219436 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2015-01-11 Yvan Roux <yvan.roux@linaro.org>
yroux [Sun, 11 Jan 2015 18:50:35 +0000 (18:50 +0000)]
2015-01-11  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r211132.
2014-06-02  Tom de Vries  <tom@codesourcery.com>

* config/aarch64/aarch64.c (aarch64_float_const_representable_p): Handle
case that x has VOIDmode.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@219435 138bc75d-0d04-0410-961f-82ee72b054a4

9 years agogcc/
yroux [Sun, 11 Jan 2015 18:43:51 +0000 (18:43 +0000)]
gcc/
2015-01-11  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r209620.
2014-04-22  Vidya Praveen  <vidyapraveen@arm.com>

* aarch64.md (float<GPI:mode><GPF:mode>2): Remove.
(floatuns<GPI:mode><GPF:mode>2): Remove.
(<optab><fcvt_target><GPF:mode>2): New pattern for equal width float
and floatuns conversions.
(<optab><fcvt_iesize><GPF:mode>2): New pattern for inequal width float
and floatuns conversions.
* iterators.md (fcvt_target, FCVT_TARGET): Support SF and DF modes.
(w1,w2): New mode attributes for inequal width conversions.

gcc/testsuite/
2015-01-11  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r209620.
2014-04-22  Vidya Praveen  <vidyapraveen@arm.com>

* gcc.target/aarch64/cvtf_1.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@219434 138bc75d-0d04-0410-961f-82ee72b054a4

9 years agogcc/
yroux [Sun, 11 Jan 2015 18:36:42 +0000 (18:36 +0000)]
gcc/
2015-01-11  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r217362, r217546.
2014-11-14  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

PR target/63724
        * config/aarch64/aarch64.c (aarch64_expand_mov_immediate): Split out
        numerical immediate handling to...
        (aarch64_internal_mov_immediate): ...this. New.
        (aarch64_rtx_costs): Use aarch64_internal_mov_immediate.
        (aarch64_mov_operand_p): Relax predicate.
        * config/aarch64/aarch64.md (mov<mode>:GPI): Do not expand CONST_INTs.
        (*movsi_aarch64): Turn into define_insn_and_split and new alternative
        for 'n'.
        (*movdi_aarch64): Likewise.

2014-11-11  James Greenhalgh  <james.greenhalgh@arm.com>

* config/aarch64/aarch64-simd.md
(aarch64_simd_bsl<mode>_internal): Remove float cases, canonicalize.
(aarch64_simd_bsl<mode>): Add gen_lowpart expressions where we
are punning between float vectors and integer vectors.

gcc/testsuite
2015-01-11  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r217362.
2014-11-11  James Greenhalgh  <james.greenhalgh@arm.com>

* gcc.target/aarch64/vbslq_f64_1.c: New.
* gcc.target/aarch64/vbslq_f64_2.c: Likewise.
* gcc.target/aarch64/vbslq_u64_1.c: Likewise.
* gcc.target/aarch64/vbslq_u64_2.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@219433 138bc75d-0d04-0410-961f-82ee72b054a4

9 years agoBump version number, post release.
yroux [Thu, 11 Dec 2014 15:58:45 +0000 (15:58 +0000)]
Bump version number, post release.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218633 138bc75d-0d04-0410-961f-82ee72b054a4

9 years agoMake Linaro GCC 4.9-2014.12.
yroux [Thu, 11 Dec 2014 15:55:25 +0000 (15:55 +0000)]
Make Linaro GCC 4.9-2014.12.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218631 138bc75d-0d04-0410-961f-82ee72b054a4

9 years agoMerge branches/gcc-4_9-branch rev 218412
yroux [Fri, 5 Dec 2014 14:21:22 +0000 (14:21 +0000)]
Merge branches/gcc-4_9-branch rev 218412

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218423 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2014-12-04 Yvan Roux <yvan.roux@linaro.org>
yroux [Thu, 4 Dec 2014 19:43:18 +0000 (19:43 +0000)]
2014-12-04  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r217079, r217080.
2014-11-04  Alan Lawrence  <alan.lawrence@arm.com>

config/arm/neon.md (reduc_smin_<mode> *2): Rename to...
(reduc_smin_scal_<mode> *2): ...this; extract scalar result.
(reduc_smax_<mode> *2): Rename to...
(reduc_smax_scal_<mode> *2): ...this; extract scalar result.
(reduc_umin_<mode> *2): Rename to...
(reduc_umin_scal_<mode> *2): ...this; extract scalar result.
(reduc_umax_<mode> *2): Rename to...
(reduc_umax_scal_<mode> *2): ...this; extract scalar result.

2014-11-04  Alan Lawrence  <alan.lawrence@arm.com>

config/arm/neon.md (reduc_plus_*): Rename to...
(reduc_plus_scal_*): ...this; reduce to temp and extract scalar result.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218398 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2014-12-04 Yvan Roux <yvan.roux@linaro.org>
yroux [Thu, 4 Dec 2014 19:38:42 +0000 (19:38 +0000)]
2014-12-04  Yvan Roux  <yvan.roux@linaro.org>

Fix Backport from trunk r216524 (committed at r218379).
Add missing file: config/aarch64/aarch64-cost-tables.h

* config/aarch64/aarch64-cost-tables.h: New file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218396 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2014-12-04 Yvan Roux <yvan.roux@linaro.org>
yroux [Thu, 4 Dec 2014 18:53:29 +0000 (18:53 +0000)]
2014-12-04  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r217076.
2014-11-04  Michael Collison <michael.collison@linaro.org>

* config/aarch64/iterators.md (lconst_atomic): New mode attribute
to support constraints for CONST_INT in atomic operations.
* config/aarch64/atomics.md
(atomic_<atomic_optab><mode>): Use lconst_atomic constraint.
(atomic_nand<mode>): Likewise.
(atomic_fetch_<atomic_optab><mode>): Likewise.
(atomic_fetch_nand<mode>): Likewise.
(atomic_<atomic_optab>_fetch<mode>): Likewise.
(atomic_nand_fetch<mode>): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218394 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2014-12-04 Yvan Roux <yvan.roux@linaro.org>
yroux [Thu, 4 Dec 2014 18:28:12 +0000 (18:28 +0000)]
2014-12-04  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r217026.
2014-11-03  Zhenqiang Chen  <zhenqiang.chen@arm.com>

* ifcvt.c (noce_emit_cmove, noce_get_alt_condition, noce_get_condition):
Allow CC mode if HAVE_cbranchcc4.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218393 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2014-12-04 Yvan Roux <yvan.roux@linaro.org>
yroux [Thu, 4 Dec 2014 18:23:42 +0000 (18:23 +0000)]
2014-12-04  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r217014.
2014-11-02  Michael Collison  <michael.collison@linaro.org>

* config/arm/arm.h (CLZ_DEFINED_VALUE_AT_ZERO) : Update
to support vector modes.
(CTZ_DEFINED_VALUE_AT_ZERO): Ditto.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218391 138bc75d-0d04-0410-961f-82ee72b054a4

9 years agogcc/
yroux [Thu, 4 Dec 2014 18:19:01 +0000 (18:19 +0000)]
gcc/
2014-12-04  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r216996, r216998, r216999, r217001, r217002, r217003,
r217004, r217742.
2014-11-18  James Greenhalgh  <james.greenhalgh@arm.com>

PR target/63937
* target.def (use_by_pieces_infrastructure_p): Take unsigned
HOST_WIDE_INT as the size parameter.
* targhooks.c (default_use_by_pieces_infrastructure_p): Likewise.
* targhooks.h (default_use_by_pieces_infrastructure_p): Likewise.
* config/arc/arc.c (arc_use_by_pieces_infrastructure_p)): Likewise.
* config/mips/mips.c (mips_use_by_pieces_infrastructure_p)): Likewise.
* config/s390/s390.c (s390_use_by_pieces_infrastructure_p)): Likewise.
* config/sh/sh.c (sh_use_by_pieces_infrastructure_p)): Likewise.
* config/aarch64/aarch64.c
(aarch64_use_by_pieces_infrastructure_p)): Likewise.
* doc/tm.texi: Regenerate.

2014-11-01  James Greenhalgh  <james.greenhalgh@arm.com>

* doc/tm.texi.in (MOVE_BY_PIECES_P): Remove.
(CLEAR_BY_PIECES_P): Likewise.
(SET_BY_PIECES_P): Likewise.
(STORE_BY_PIECES_P): Likewise.
* doc/tm.texi: Regenerate.
* system.h: Poison MOVE_BY_PIECES_P, CLEAR_BY_PIECES_P,
SET_BY_PIECES_P, STORE_BY_PIECES_P.
* expr.c (MOVE_BY_PIECES_P): Remove.
(CLEAR_BY_PIECES_P): Likewise.
(SET_BY_PIECES_P): Likewise.
(STORE_BY_PIECES_P): Likewise.
(can_move_by_pieces): Rewrite in terms of
targetm.use_by_pieces_infrastructure_p.
(emit_block_move_hints): Likewise.
(can_store_by_pieces): Likewise.
(store_by_pieces): Likewise.
(clear_storage_hints): Likewise.
(emit_push_insn): Likewise.
(expand_constructor): Likewise.

2014-11-01  James Greenhalgh  <james.greenhalgh@arm.com>

* config/aarch64/aarch64.c
(aarch64_use_by_pieces_infrastructre_p): New.
(TARGET_USE_BY_PIECES_INFRASTRUCTURE): Likewise.
* config/aarch64/aarch64.h (STORE_BY_PIECES_P): Delete.

2014-11-01  James Greenhalgh  <james.greenhalgh@arm.com>

* config/mips/mips.h (MOVE_BY_PIECES_P): Remove.
(STORE_BY_PIECES_P): Likewise.
* config/mips/mips.c (TARGET_USE_BY_PIECES_INFRASTRUCTURE_P): New.
(mips_move_by_pieces_p): Rename to...
(mips_use_by_pieces_infrastructure_p): ...this, use new hook
parameters, use the default hook implementation as a
fall-back.

2014-11-01  James Greenhalgh  <james.greenhalgh@arm.com>

* config/sh/sh.c (TARGET_USE_BY_PIECES_INFRASTRUCTURE_P): New.
(sh_use_by_pieces_infrastructure_p): Likewise.
* config/sh/sh.h (MOVE_BY_PIECES_P): Remove.
(STORE_BY_PIECES_P): Likewise.
(SET_BY_PIECES_P): Likewise.

2014-11-01  James Greenhalgh  <james.greenhalgh@arm.com>

* config/arc/arc.c (TARGET_USE_BY_PIECES_INFRASTRUCTURE_P): New.
(arc_use_by_pieces_infrastructure_p): Likewise.
* confir/arc/arc.h (MOVE_BY_PIECES_P): Delete.
(CAN_MOVE_BY_PIECES): Likewise.

2014-11-01  James Greenhalgh  <james.greenhalgh@arm.com>

* config/s390/s390.c (s390_use_by_pieces_infrastructure_p): New.
(TARGET_USE_BY_PIECES_INFRASTRUCTURE_P): Likewise.
* config/s390/s390.h (MOVE_BY_PIECES_P): Remove.
(CLEAR_BY_PIECES): Likewise.
(SET_BY_PIECES): Likewise.
(STORE_BY_PIECES): Likewise.

2014-11-01  James Greenhalgh  <james.greenhalgh@arm.com>

* target.def (use_by_pieces_infrastructure_p): New.
* doc/tm.texi.in (MOVE_BY_PIECES_P): Describe that this macro
is deprecated.
(STORE_BY_PIECES_P): Likewise.
(CLEAR_BY_PIECES_P): Likewise.
(SET_BY_PIECES_P): Likewise.
(TARGET_MOVE_BY_PIECES_PROFITABLE_P): Add hook.
* doc/tm.texi: Regenerate.
* expr.c (MOVE_BY_PIECES_P): Rewrite in terms of
TARGET_USE_BY_PIECES_INFRASTRUCTURE_P.
(STORE_BY_PIECES_P): Likewise.
(CLEAR_BY_PIECES_P): Likewise.
(SET_BY_PIECES_P): Likewise.
(STORE_MAX_PIECES): Move to...
* defaults.h (STORE_MAX_PIECES): ...here.
* targhooks.c (get_move_ratio): New.
(default_use_by_pieces_infrastructure_p): Likewise.
* targhooks.h (default_use_by_pieces_infrastructure_p): New.
* target.h (by_pieces_operation): New.

gcc/testsuite/
2014-12-04  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r217742.
2014-11-18  James Greenhalgh  <james.greenhalgh@arm.com>

PR target/63937
* gcc.dg/memset-2.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218390 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2014-12-04 Yvan Roux <yvan.roux@linaro.org>
yroux [Thu, 4 Dec 2014 17:55:00 +0000 (17:55 +0000)]
2014-12-04  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r216765.
2014-10-27  Jiong Wang <jiong.wang@arm.com>

PR target/63442
* optabs.c (prepare_cmp_insn): Use "ret_mode" instead of "word_mode".

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218387 138bc75d-0d04-0410-961f-82ee72b054a4

9 years agogcc/testsuite/
yroux [Thu, 4 Dec 2014 17:50:39 +0000 (17:50 +0000)]
gcc/testsuite/
2014-12-04  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r216638.
2014-10-24  Christophe Lyon  <christophe.lyon@linaro.org>

* lib/wrapper.exp ({tool}_maybe_build_wrapper): Clear
wrap_compile_flags before setting it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218386 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2014-12-04 Yvan Roux <yvan.roux@linaro.org>
yroux [Thu, 4 Dec 2014 17:46:32 +0000 (17:46 +0000)]
2014-12-04  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r216630.
2014-10-24  Felix Yang  <felix.yang@huawei.com>
Jiji Jiang  <jiangjiji@huawei.com>

PR target/63173
* config/aarch64/arm_neon.h (__LD2R_FUNC): Remove macro.
(__LD3R_FUNC): Ditto.
(__LD4R_FUNC): Ditto.
(vld2_dup_s8, vld2_dup_s16, vld2_dup_s32, vld2_dup_f32, vld2_dup_f64,
 vld2_dup_u8, vld2_dup_u16, vld2_dup_u32, vld2_dup_p8, vld2_dup_p16
 vld2_dup_s64, vld2_dup_u64, vld2q_dup_s8, vld2q_dup_p8,
 vld2q_dup_s16, vld2q_dup_p16, vld2q_dup_s32, vld2q_dup_s64,
 vld2q_dup_u8, vld2q_dup_u16, vld2q_dup_u32, vld2q_dup_u64
 vld2q_dup_f32, vld2q_dup_f64): Rewrite using builtin functions.
(vld3_dup_s64, vld3_dup_u64, vld3_dup_f64, vld3_dup_s8
 vld3_dup_p8, vld3_dup_s16, vld3_dup_p16, vld3_dup_s32
 vld3_dup_u8, vld3_dup_u16, vld3_dup_u32, vld3_dup_f32
 vld3q_dup_s8, vld3q_dup_p8, vld3q_dup_s16, vld3q_dup_p16
 vld3q_dup_s32, vld3q_dup_s64, vld3q_dup_u8, vld3q_dup_u16
 vld3q_dup_u32, vld3q_dup_u64, vld3q_dup_f32, vld3q_dup_f64): Likewise.
(vld4_dup_s64, vld4_dup_u64, vld4_dup_f64, vld4_dup_s8
 vld4_dup_p8, vld4_dup_s16, vld4_dup_p16, vld4_dup_s32
 vld4_dup_u8, vld4_dup_u16, vld4_dup_u32, vld4_dup_f32
 vld4q_dup_s8, vld4q_dup_p8, vld4q_dup_s16, vld4q_dup_p16
 vld4q_dup_s32, vld4q_dup_s64, vld4q_dup_u8, vld4q_dup_u16
 vld4q_dup_u32, vld4q_dup_u64, vld4q_dup_f32, vld4q_dup_f64): Likewise.
* config/aarch64/aarch64.md (define_c_enum "unspec"): Add
UNSPEC_LD2_DUP, UNSPEC_LD3_DUP, UNSPEC_LD4_DUP.
* config/aarch64/aarch64-simd-builtins.def (ld2r, ld3r, ld4r): New
builtins.
* config/aarch64/aarch64-simd.md (aarch64_simd_ld2r<mode>): New pattern.
(aarch64_simd_ld3r<mode>): Likewise.
(aarch64_simd_ld4r<mode>): Likewise.
(aarch64_ld2r<mode>): New expand.
(aarch64_ld3r<mode>): Likewise.
(aarch64_ld4r<mode>): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218385 138bc75d-0d04-0410-961f-82ee72b054a4

9 years agogcc/testsuite/
yroux [Thu, 4 Dec 2014 17:41:16 +0000 (17:41 +0000)]
gcc/testsuite/
2014-12-04  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r216544.
2014-10-22  Jiong Wang  <jiong.wang@arm.com>

* gcc.target/aarch64/pic-constantpool1.c: Add explicit declaration.
* gcc.target/aarch64/pic-symrefplus.c: Likewise.
* gcc.target/aarch64/reload-valid-spoff.c: Likewise.
* gcc.target/aarch64/vect.x: Likewise.
* gcc.target/aarch64/vect-ld1r.x: Add return type.
* gcc.target/aarch64/vect-fmax-fmin.c: Likewise.
* gcc.target/aarch64/vect-fp.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218384 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2014-12-04 Yvan Roux <yvan.roux@linaro.org>
yroux [Thu, 4 Dec 2014 17:33:17 +0000 (17:33 +0000)]
2014-12-04  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r217971.
2014-11-22  Uros Bizjak  <ubizjak@gmail.com>

* params.def (PARAM_MAX_COMPLETELY_PEELED_INSNS): Increase to 200.
* config/i386/i386.c (ix86_option_override_internal): Do not increase
PARAM_MAX_COMPLETELY_PEELED_INSNS.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218383 138bc75d-0d04-0410-961f-82ee72b054a4

9 years agogcc/testsuite/
yroux [Thu, 4 Dec 2014 16:04:04 +0000 (16:04 +0000)]
gcc/testsuite/
2014-12-04  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r216543.
2014-10-22  Jiong Wang  <jiong.wang@arm.com>

* lib/compat.exp (compat-run): Remove "unresolved".
* lib/gcc-defs.exp (${tools}_check_compile): Update code logic for
unsupported testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218380 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2014-12-04 Yvan Roux <yvan.roux@linaro.org>
yroux [Thu, 4 Dec 2014 15:58:59 +0000 (15:58 +0000)]
2014-12-04  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r216524.
2014-10-21  Andrew Pinski  <apinski@cavium.com>

* doc/invoke.texi (AARCH64/mtune): Document thunderx as an
available option also.
* config/aarch64/aarch64-cost-tables.h: New file.
* config/aarch64/aarch64-cores.def (thunderx): New core.
* config/aarch64/aarch64-tune.md: Regenerate.
* config/aarch64/aarch64.c: Include aarch64-cost-tables.h instead
of config/arm/aarch-cost-tables.h.
(thunderx_regmove_cost): New variable.
(thunderx_tunings): New variable.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218379 138bc75d-0d04-0410-961f-82ee72b054a4

9 years agogcc/testsuite/
yroux [Thu, 4 Dec 2014 15:51:32 +0000 (15:51 +0000)]
gcc/testsuite/
2014-12-04  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r216517.
2014-10-21  Jiong Wang  <jiong.wang@arm.com>

* gcc.target/arm/20031108-1.c (Proc_7): Add explicit declaration.
(Proc_1): Add return type.
* gcc.target/arm/cold-lc.c (show_stack): Add explict declaration.
* gcc.target/arm/neon-modes-2.c (foo): Likewise.
* gcc.target/arm/pr43920-2.c (lseek): Likewise.
* gcc.target/arm/pr44788.c (foo): Likewise.
* gcc.target/arm/pr55642.c (abs): Likewise.
* gcc.target/arm/pr58784.c (f): Likewise.
* gcc.target/arm/pr60650.c (foo1, foo2): Likewise.
* gcc.target/arm/vfp-ldmdbs.c (bar): Likewise.
* gcc.target/arm/vfp-ldmias.c (bar): Likewise.
* gcc.target/arm/pr60650-2.c (fn1, fn2): Add return type and add type
for local variables.
* lib/target-supports.exp
(check_effective_target_arm_crypto_ok_nocache): Add declaration for
vaeseq_u8.
(check_effective_target_arm_neon_fp16_ok_nocache): Add declaration for
vcvt_f16_f32.
(check_effective_target_arm_neonv2_ok_nocache): Add declaration for
vfma_f32.
* gcc.target/arm/pr51968.c: Add -Wno-implicit-function-declaration.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218378 138bc75d-0d04-0410-961f-82ee72b054a4

9 years agogcc/testsuite/
yroux [Thu, 4 Dec 2014 15:36:54 +0000 (15:36 +0000)]
gcc/testsuite/
2014-12-04  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r215071.
2014-09-09  Alan Lawrence  <alan.lawrence@arm.com>

* gcc.target/aarch64/simd/int_comparisons_1.c: Tighten regexp.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218377 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2014-12-04 Yvan Roux <yvan.roux@linaro.org>
yroux [Thu, 4 Dec 2014 14:57:02 +0000 (14:57 +0000)]
2014-12-04  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r216336.
2014-10-16  Richard Earnshaw  <rearnsha@arm.com>

* config/aarch64/aarch64.c (aarch64_legitimize_address): New function.
(TARGET_LEGITIMIZE_ADDRESS): Redefine.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218375 138bc75d-0d04-0410-961f-82ee72b054a4

9 years ago2014-12-04 Yvan Roux <yvan.roux@linaro.org>
yroux [Thu, 4 Dec 2014 14:52:46 +0000 (14:52 +0000)]
2014-12-04  Yvan Roux  <yvan.roux@linaro.org>

Backport from trunk r216253.
2014-10-15  Renlin Li <renlin.li@arm.com>

* config/aarch64/aarch64.h (ARM_DEFAULT_PCS, arm_pcs_variant): Delete.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@218374 138bc75d-0d04-0410-961f-82ee72b054a4