+2017-01-09 Andreas Tobler <andreast@gcc.gnu.org>
+
+ Backport from mainline
+ 2016-10-10 Andreas Tobler <andreast@gcc.gnu.org>
+
+ * configure.ac: Add aarch64-*-freebsd*.
+ * configure: Regenerate.
+
2016-12-21 Release Manager
* GCC 6.3.0 released.
+2017-01-24 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/78478
+ * ax_check_define.m4: New file.
+
2016-12-21 Release Manager
* GCC 6.3.0 released.
--- /dev/null
+# ===========================================================================
+# http://www.gnu.org/software/autoconf-archive/ax_check_define.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CHECK_DEFINE([symbol], [ACTION-IF-FOUND], [ACTION-IF-NOT])
+# AX_CHECK_DEFINE([includes],[symbol], [ACTION-IF-FOUND], [ACTION-IF-NOT])
+#
+# DESCRIPTION
+#
+# Complements AC_CHECK_FUNC but it does not check for a function but for a
+# define to exist. Consider a usage like:
+#
+# AC_CHECK_DEFINE(__STRICT_ANSI__, CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500")
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 8
+
+AU_ALIAS([AC_CHECK_DEFINED], [AC_CHECK_DEFINE])
+AC_DEFUN([AC_CHECK_DEFINE],[
+AS_VAR_PUSHDEF([ac_var],[ac_cv_defined_$1])dnl
+AC_CACHE_CHECK([for $1 defined], ac_var,
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+ #ifdef $1
+ int ok;
+ #else
+ choke me
+ #endif
+]])],[AS_VAR_SET(ac_var, yes)],[AS_VAR_SET(ac_var, no)]))
+AS_IF([test AS_VAR_GET(ac_var) != "no"], [$2], [$3])dnl
+AS_VAR_POPDEF([ac_var])dnl
+])
+
+AU_ALIAS([AX_CHECK_DEFINED], [AX_CHECK_DEFINE])
+AC_DEFUN([AX_CHECK_DEFINE],[
+AS_VAR_PUSHDEF([ac_var],[ac_cv_defined_$2_$1])dnl
+AC_CACHE_CHECK([for $2 defined in $1], ac_var,
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <$1>]], [[
+ #ifdef $2
+ int ok;
+ #else
+ choke me
+ #endif
+]])],[AS_VAR_SET(ac_var, yes)],[AS_VAR_SET(ac_var, no)]))
+AS_IF([test AS_VAR_GET(ac_var) != "no"], [$3], [$4])dnl
+AS_VAR_POPDEF([ac_var])dnl
+])
+
+AC_DEFUN([AX_CHECK_FUNC],
+[AS_VAR_PUSHDEF([ac_var], [ac_cv_func_$2])dnl
+AC_CACHE_CHECK([for $2], ac_var,
+dnl AC_LANG_FUNC_LINK_TRY
+[AC_LINK_IFELSE([AC_LANG_PROGRAM([$1
+ #undef $2
+ char $2 ();],[
+ char (*f) () = $2;
+ return f != $2; ])],
+ [AS_VAR_SET(ac_var, yes)],
+ [AS_VAR_SET(ac_var, no)])])
+AS_IF([test AS_VAR_GET(ac_var) = yes], [$3], [$4])dnl
+AS_VAR_POPDEF([ac_var])dnl
+])# AC_CHECK_FUNC
noconfigdirs="$noconfigdirs ${libgcj}"
;;
aarch64*-*-freebsd*)
- noconfigdirs="$noconfigdirs target-libffi"
+ noconfigdirs="$noconfigdirs ${libgcj}"
;;
alpha*-*-*vms*)
noconfigdirs="$noconfigdirs ${libgcj}"
noconfigdirs="$noconfigdirs ${libgcj}"
;;
aarch64*-*-freebsd*)
- noconfigdirs="$noconfigdirs target-libffi"
+ noconfigdirs="$noconfigdirs ${libgcj}"
;;
alpha*-*-*vms*)
noconfigdirs="$noconfigdirs ${libgcj}"
+2017-01-30 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ Backport from mainline
+ 2017-01-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR libstdc++/78979
+ * inclhack.def (solaris_gets_c11, solaris_gets_cxx14)
+ (solaris_std_gets_cxx14, solaris_stdlib_noreturn): New fixes.
+ * fixincl.x: Regenerate.
+ * tests/base/iso/stdio_iso.h [SOLARIS_GETS_C11_CHECK,
+ SOLARIS_GETS_CXX14_CHECK, SOLARIS_STD_GETS_CXX14_CHECK,
+ SOLARIS_STDLIB_NORETURN_CHECK]: New tests.
+
2016-12-21 Release Manager
* GCC 6.3.0 released.
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
- * It has been AutoGen-ed November 18, 2016 at 12:35:01 PM by AutoGen 5.16.2
+ * It has been AutoGen-ed January 5, 2017 at 06:03:22 PM by AutoGen 5.16.2
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Fri Nov 18 12:35:01 2016
+/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Jan 5 18:03:22 CET 2017
*
* You must regenerate it. Use the ./genfixes script.
*
* certain ANSI-incompatible system header files which are fixed to work
* correctly with ANSI C and placed in a directory that GNU C will search.
*
- * This file contains 236 fixup descriptions.
+ * This file contains 240 fixup descriptions.
*
* See README for more information.
*
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Solaris_Gets_C11 fix
+ */
+tSCC zSolaris_Gets_C11Name[] =
+ "solaris_gets_c11";
+
+/*
+ * File name selection pattern
+ */
+tSCC zSolaris_Gets_C11List[] =
+ "iso/stdio_iso.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzSolaris_Gets_C11Machs[] = {
+ "*-*-solaris2*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zSolaris_Gets_C11Select0[] =
+ "(extern char[ \t]*\\*gets\\(char \\*\\));";
+
+#define SOLARIS_GETS_C11_TEST_CT 1
+static tTestDesc aSolaris_Gets_C11Tests[] = {
+ { TT_EGREP, zSolaris_Gets_C11Select0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Solaris_Gets_C11
+ */
+static const char* apzSolaris_Gets_C11Patch[] = {
+ "format",
+ "#if __STDC_VERSION__ < 201112L && __cplusplus < 201402L\n\
+%1 __attribute__((__deprecated__));\n\
+#endif",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Solaris_Gets_Cxx14 fix
+ */
+tSCC zSolaris_Gets_Cxx14Name[] =
+ "solaris_gets_cxx14";
+
+/*
+ * File name selection pattern
+ */
+tSCC zSolaris_Gets_Cxx14List[] =
+ "iso/stdio_iso.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzSolaris_Gets_Cxx14Machs[] = {
+ "*-*-solaris2*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zSolaris_Gets_Cxx14Select0[] =
+ "(#if __STDC_VERSION__ < 201112L)\n\
+(extern char\t\\*gets\\(char \\*\\) __ATTR_DEPRECATED;)";
+
+#define SOLARIS_GETS_CXX14_TEST_CT 1
+static tTestDesc aSolaris_Gets_Cxx14Tests[] = {
+ { TT_EGREP, zSolaris_Gets_Cxx14Select0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Solaris_Gets_Cxx14
+ */
+static const char* apzSolaris_Gets_Cxx14Patch[] = {
+ "format",
+ "%1 && __cplusplus < 201402L\n\
+%2",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Solaris_Int_Const fix
*/
tSCC zSolaris_Int_ConstName[] =
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Solaris_Std_Gets_Cxx14 fix
+ */
+tSCC zSolaris_Std_Gets_Cxx14Name[] =
+ "solaris_std_gets_cxx14";
+
+/*
+ * File name selection pattern
+ */
+tSCC zSolaris_Std_Gets_Cxx14List[] =
+ "stdio.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzSolaris_Std_Gets_Cxx14Machs[] = {
+ "*-*-solaris2*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zSolaris_Std_Gets_Cxx14Select0[] =
+ "using std::gets;";
+
+#define SOLARIS_STD_GETS_CXX14_TEST_CT 1
+static tTestDesc aSolaris_Std_Gets_Cxx14Tests[] = {
+ { TT_EGREP, zSolaris_Std_Gets_Cxx14Select0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Solaris_Std_Gets_Cxx14
+ */
+static const char* apzSolaris_Std_Gets_Cxx14Patch[] = {
+ "format",
+ "#if __cplusplus < 201402L\n\
+%0\n\
+#endif",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Solaris_Stdio_Tag fix
*/
tSCC zSolaris_Stdio_TagName[] =
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Solaris_Stdlib_Noreturn fix
+ */
+tSCC zSolaris_Stdlib_NoreturnName[] =
+ "solaris_stdlib_noreturn";
+
+/*
+ * File name selection pattern
+ */
+tSCC zSolaris_Stdlib_NoreturnList[] =
+ "iso/stdlib_c99.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzSolaris_Stdlib_NoreturnMachs[] = {
+ "*-*-solaris2*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zSolaris_Stdlib_NoreturnSelect0[] =
+ "(extern) _Noreturn (void quick_exit\\(int\\));";
+
+#define SOLARIS_STDLIB_NORETURN_TEST_CT 1
+static tTestDesc aSolaris_Stdlib_NoreturnTests[] = {
+ { TT_EGREP, zSolaris_Stdlib_NoreturnSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Solaris_Stdlib_Noreturn
+ */
+static const char* apzSolaris_Stdlib_NoreturnPatch[] = {
+ "format",
+ "%1 %2 __attribute__((__noreturn__));",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Statsswtch fix
*/
tSCC zStatsswtchName[] =
*
* List of all fixes
*/
-#define REGEX_COUNT 272
+#define REGEX_COUNT 276
#define MACH_LIST_SIZE_LIMIT 187
-#define FIX_COUNT 236
+#define FIX_COUNT 240
/*
* Enumerate the fixes
SOLARIS_COMPLEX_CXX_FIXIDX,
SOLARIS_CXX_LINKAGE_FIXIDX,
SOLARIS_GETC_STRICT_STDC_FIXIDX,
+ SOLARIS_GETS_C11_FIXIDX,
+ SOLARIS_GETS_CXX14_FIXIDX,
SOLARIS_INT_CONST_FIXIDX,
SOLARIS_INT_LIMITS_1_FIXIDX,
SOLARIS_INT_LIMITS_2_FIXIDX,
SOLARIS_POW_INT_OVERLOAD_FIXIDX,
SOLARIS_RWLOCK_INIT_1_FIXIDX,
SOLARIS_STD___FILBUF_FIXIDX,
+ SOLARIS_STD_GETS_CXX14_FIXIDX,
SOLARIS_STDIO_TAG_FIXIDX,
+ SOLARIS_STDLIB_NORETURN_FIXIDX,
STATSSWTCH_FIXIDX,
STDIO_STDARG_H_FIXIDX,
STDIO_VA_LIST_FIXIDX,
SOLARIS_GETC_STRICT_STDC_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aSolaris_Getc_Strict_StdcTests, apzSolaris_Getc_Strict_StdcPatch, 0 },
+ { zSolaris_Gets_C11Name, zSolaris_Gets_C11List,
+ apzSolaris_Gets_C11Machs,
+ SOLARIS_GETS_C11_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aSolaris_Gets_C11Tests, apzSolaris_Gets_C11Patch, 0 },
+
+ { zSolaris_Gets_Cxx14Name, zSolaris_Gets_Cxx14List,
+ apzSolaris_Gets_Cxx14Machs,
+ SOLARIS_GETS_CXX14_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aSolaris_Gets_Cxx14Tests, apzSolaris_Gets_Cxx14Patch, 0 },
+
{ zSolaris_Int_ConstName, zSolaris_Int_ConstList,
apzSolaris_Int_ConstMachs,
SOLARIS_INT_CONST_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
SOLARIS_STD___FILBUF_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aSolaris_Std___FilbufTests, apzSolaris_Std___FilbufPatch, 0 },
+ { zSolaris_Std_Gets_Cxx14Name, zSolaris_Std_Gets_Cxx14List,
+ apzSolaris_Std_Gets_Cxx14Machs,
+ SOLARIS_STD_GETS_CXX14_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aSolaris_Std_Gets_Cxx14Tests, apzSolaris_Std_Gets_Cxx14Patch, 0 },
+
{ zSolaris_Stdio_TagName, zSolaris_Stdio_TagList,
apzSolaris_Stdio_TagMachs,
SOLARIS_STDIO_TAG_TEST_CT, FD_MACH_ONLY,
aSolaris_Stdio_TagTests, apzSolaris_Stdio_TagPatch, 0 },
+ { zSolaris_Stdlib_NoreturnName, zSolaris_Stdlib_NoreturnList,
+ apzSolaris_Stdlib_NoreturnMachs,
+ SOLARIS_STDLIB_NORETURN_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aSolaris_Stdlib_NoreturnTests, apzSolaris_Stdlib_NoreturnPatch, 0 },
+
{ zStatsswtchName, zStatsswtchList,
apzStatsswtchMachs,
STATSSWTCH_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
};
/*
+ * Solaris <iso/stdio_iso.h> should deprecate gets before C11.
+ */
+fix = {
+ hackname = solaris_gets_c11;
+ mach = "*-*-solaris2*";
+ files = "iso/stdio_iso.h";
+ select = "(extern char[ \t]*\\*gets\\(char \\*\\));";
+
+ c_fix = format;
+ c_fix_arg = "#if __STDC_VERSION__ < 201112L && __cplusplus < 201402L\n"
+ "%1 __attribute__((__deprecated__));\n"
+ "#endif";
+
+ test_text = "extern char *gets(char *);";
+};
+
+/*
+ * Solaris <iso/stdio_iso.h> shouldn't declare gets for C++14.
+ */
+fix = {
+ hackname = solaris_gets_cxx14;
+ mach = "*-*-solaris2*";
+ files = "iso/stdio_iso.h";
+ select = <<- _EOSelect_
+(#if __STDC_VERSION__ < 201112L)
+(extern char \*gets\(char \*\) __ATTR_DEPRECATED;)
+_EOSelect_;
+ c_fix = format;
+ c_fix_arg = "%1 && __cplusplus < 201402L\n%2";
+
+ test_text = <<- _EOText_
+#if __STDC_VERSION__ < 201112L
+extern char *gets(char *) __ATTR_DEPRECATED;
+_EOText_;
+};
+
+/*
* Sun Solaris 2 has a version of sys/int_const.h that defines
* UINT8_C and UINT16_C to unsigned constants.
*/
};
/*
+ * Solaris <stdio.h> shouldn't use std::gets for C++14.
+ */
+fix = {
+ hackname = solaris_std_gets_cxx14;
+ mach = "*-*-solaris2*";
+ files = "stdio.h";
+ select = "using std::gets;";
+
+ c_fix = format;
+ c_fix_arg = "#if __cplusplus < 201402L\n%0\n#endif";
+
+ test_text = "using std::gets;";
+};
+
+/*
* Sun Solaris 8 has what appears to be some gross workaround for
* some old version of their c++ compiler. G++ doesn't want it
* either, but doesn't want to be tied to SunPRO version numbers.
};
/*
+ * Solaris <stdlib.h> shouldn't use _Noreturn, breaks with C++.
+ */
+fix = {
+ hackname = solaris_stdlib_noreturn;
+ mach = "*-*-solaris2*";
+ files = "iso/stdlib_c99.h";
+ select = "(extern) _Noreturn (void quick_exit\\(int\\));";
+
+ c_fix = format;
+ c_fix_arg = "%1 %2 __attribute__((__noreturn__));";
+
+ test_text = "extern _Noreturn void quick_exit(int);";
+};
+
+/*
* a missing semi-colon at the end of the statsswtch structure definition.
*/
fix = {
#if defined( SOLARIS_GETC_STRICT_STDC_CHECK )
#if !defined(_REENTRANT) && !defined(_LP64) && (!defined(_STRICT_STDC) || (__cplusplus >= 199711L))
#endif /* SOLARIS_GETC_STRICT_STDC_CHECK */
+
+
+#if defined( SOLARIS_GETS_C11_CHECK )
+#if __STDC_VERSION__ < 201112L && __cplusplus < 201402L
+extern char *gets(char *) __attribute__((__deprecated__));
+#endif
+#endif /* SOLARIS_GETS_C11_CHECK */
+
+
+#if defined( SOLARIS_GETS_CXX14_CHECK )
+#if __STDC_VERSION__ < 201112L && __cplusplus < 201402L
+extern char *gets(char *) __ATTR_DEPRECATED;
+#endif /* SOLARIS_GETS_CXX14_CHECK */
--- /dev/null
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "fixinc/tests/inc/iso/stdlib_c99.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+
+
+#if defined( SOLARIS_STDLIB_NORETURN_CHECK )
+extern void quick_exit(int) __attribute__((__noreturn__));
+#endif /* SOLARIS_STDLIB_NORETURN_CHECK */
#endif /* SOLARIS_STD___FILBUF_CHECK */
+#if defined( SOLARIS_STD_GETS_CXX14_CHECK )
+#if __cplusplus < 201402L
+using std::gets;
+#endif
+#endif /* SOLARIS_STD_GETS_CXX14_CHECK */
+
+
#if defined( STDIO_STDARG_H_CHECK )
#endif /* STDIO_STDARG_H_CHECK */
+2017-02-03 Carl Love <cel@us.ibm.com>
+
+ Backport of two commits from mainline, r244943 and r244904,
+ dated 017-01-26 and 2017-01-25 respectively
+
+ * config/rs6000/rs6000-c (altivec_overloaded_builtins): Fix order
+ of entries for ALTIVEC_BUILTIN_VEC_PACKS. Remove bogus entries
+ for P8V_BUILTIN_VEC_VGBBD.
+
+2017-02-03 Walter Lee <walt@tilera.com>
+
+ Backport from mainline
+ 2017-02-03 Walter Lee <walt@tilera.com>
+
+ PR target/78862
+ * config/tilegx/tilegx.md (tilegx_expand_prologue): Add blockage
+ after initial stackframe link reg save.
+ * config/tilepro/tilepro.md (tilepro_expand_prologue): Likewise.
+
+2017-02-03 Maxim Ostapenko <m.ostapenko@samsung.com>
+
+ PR lto/79061
+ * asan.c (asan_add_global): Force has_dynamic_init to zero in LTO mode.
+
+2017-01-31 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2017-01-29 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR target/79268
+ * config/rs6000/altivec.h (vec_xl): Revise #define.
+ (vec_xst): Likewise.
+
+2017-01-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ Backport from mainline
+ 2017-01-10 Eric Botcazou <ebotcazou@adacore.com>
+
+ * expr.c (store_field): In the bitfield case, fetch the return value
+ from the registers before applying a single big-endian adjustment.
+ Always do a final load for a BLKmode value not larger than a word.
+
+ 2017-01-09 Eric Botcazou <ebotcazou@adacore.com>
+
+ * expr.c (store_field): In the bitfield case, if the value comes from
+ a function call and is of an aggregate type returned in registers, do
+ not modify the field mode; extract the value in all cases if the mode
+ is BLKmode and the size is not larger than a word.
+
+2017-01-26 Richard Biener <rguenther@suse.de>
+
+ * tree-vrp.c (vrp_visit_assignment_or_call): Use set_defs_to_varying.
+
+ Backport from mainline
+ 2016-01-10 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/79034
+ * tree-call-cdce.c (shrink_wrap_one_built_in_call_with_conds):
+ Propagate out degenerate PHIs in the joiner.
+
+ 2016-12-13 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/78742
+ * tree.c (cst_and_fits_in_hwi): Look if the actual value fits.
+ * tree-object-size.c (compute_builtin_object_size): Use
+ tree_fits_shwi_p.
+ * tree-data-ref.c (initialize_matrix_A): Remove excess assert.
+
+2017-01-26 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2016-09-03 Kirill Yukhin <kirill.yukhin@intel.com>
+
+ * ubsan.c (ubsan_use_new_style_p): Fix check for empty string.
+
+2017-01-24 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR target/77439
+ * config/arm/arm.c (arm_function_ok_for_sibcall): Add back restriction
+ for long calls with APCS frame and VFP.
+
+2017-01-24 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/78478
+ Revert:
+ 2013-11-05 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/rtemself.h (LONG_DOUBLE_TYPE_SIZE): New define.
+
+2017-01-23 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2017-01-20 Martin Liska <mliska@suse.cz>
+
+ PR lto/69188
+ * tree-profile.c (init_ic_make_global_vars): Do not call
+ finalize_decl.
+ (gimple_init_gcov_profiler): Likewise.
+
+2017-01-21 Gerald Pfeifer <gerald@pfeifer.com>
+
+ Backport from mainline
+ 2016-12-29 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * doc/extend.texi (Cilk Plus Builtins): cilkplus.org now uses
+ https by default.
+ * doc/passes.texi (Cilk Plus Transformation): Ditto.
+ * doc/generic.texi (Statements for C++): Ditto, and use @uref.
+
+2017-01-20 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2017-01-16 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ * config/rs6000/rs6000.c (rtx_is_swappable_p): Change
+ UNSPEC_VSX__XXSPLTD to require special splat handling.
+
+2017-01-20 Wilco Dijkstra <wdijkstr@arm.com>
+
+ Backport from mainline
+ PR target/77455
+ * config/aarch64/aarch64.md (eh_return): Remove pattern and splitter.
+ * config/aarch64/aarch64.h (AARCH64_EH_STACKADJ_REGNUM): Remove.
+ (EH_RETURN_HANDLER_RTX): New define.
+ * config/aarch64/aarch64.c (aarch64_frame_pointer_required):
+ Force frame pointer in EH return functions.
+ (aarch64_expand_epilogue): Add barrier for eh_return.
+ (aarch64_final_eh_return_addr): Remove.
+ (aarch64_eh_return_handler_rtx): New function.
+ * config/aarch64/aarch64-protos.h (aarch64_final_eh_return_addr):
+ Remove.
+ (aarch64_eh_return_handler_rtx): New prototype.
+
+2017-01-20 Richard Earnshaw <rearnsha@arm.com>
+
+ Backported from mainline
+ 2017-01-19 Richard Earnshaw <rearnsha@arm.com>
+
+ PR rtl-optimization/79121
+ * expr.c (expand_expr_real_2, case LSHIFT_EXPR): Look at the signedness
+ of the inner type when shifting an extended value.
+
+2017-01-20 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2017-01-13 Martin Liska <mliska@suse.cz>
+
+ PR ipa/79043
+ * function.c (set_cfun): Add new argument force.
+ * function.h (set_cfun): Likewise.
+ * ipa-inline-transform.c (inline_call): Use the function when
+ strict alising from is dropped for function we inline to.
+
+2017-01-20 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2017-01-17 Martin Liska <mliska@suse.cz>
+
+ PR ipa/71207
+ * ipa-polymorphic-call.c (contains_type_p): Fix wrong
+ assumption and add comment.
+
+2017-01-19 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/72488
+ * tree-ssa-sccvn.c (run_scc_vn): When we abort the VN make
+ sure to restore SSA info.
+
+2017-01-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/78839
+ * dwarf2out.c (field_byte_offset): Restore the
+ PCC_BITFIELD_TYPE_MATTERS behavior for INTEGER_CST DECL_FIELD_OFFSET
+ and DECL_FIELD_BIT_OFFSET. Use fold_build2 instead of build2 + fold.
+ (analyze_variants_discr, gen_variant_part): Use fold_build2 instead
+ of build2 + fold.
+
+2017-01-17 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ Backport from mainline
+ 2016-12-07 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ PR rtl-optimization/78617
+ * lra-remat.c (do_remat): Initialize live_hard_regs from live in
+ registers, also setting hard registers mapped to pseudo registers.
+
+2017-01-13 Christophe Lyon <christophe.lyon@linaro.org>
+
+ Backport from mainline r244320.
+ 2017-01-11 Christophe Lyon <christophe.lyon@linaro.org>
+
+ PR target/78253
+ * config/arm/arm.c (legitimize_pic_address): Handle reference to
+ weak symbol.
+ (arm_assemble_integer): Likewise.
+
+2017-01-12 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2017-01-12 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR target/79044
+ * config/rs6000/rs6000.c (insn_is_swappable_p): Mark
+ element-reversing loads and stores as not swappable.
+
+2017-01-11 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.c (memory_address_length): Increase len
+ only when rip_relative_addr_p returns false.
+
+2017-01-11 Maxim Ostapenko <m.ostapenko@samsung.com>
+
+ Backport from mainline
+ 2017-01-11 Maxim Ostapenko <m.ostapenko@samsung.com>
+
+ PR lto/79042
+ * lto-cgraph.c (lto_output_varpool_node): Pack dynamically_initialized
+ bit.
+ (input_varpool_node): Unpack dynamically_initialized bit.
+ * lto-streamer.h (LTO_minor_version): Bump version.
+
+2017-01-10 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2016-12-30 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/78900
+ * config/rs6000/rs6000.c (rs6000_split_signbit): Change some
+ assertions. Add support for doing the signbit if the IEEE 128-bit
+ floating point value is in a GPR.
+ * config/rs6000/rs6000.md (Fsignbit): Delete.
+ (signbit<mode>2_dm): Delete using <Fsignbit> and just use "wa".
+ Update the length attribute if the value is in a GPR.
+ (signbit<mode>2_dm_<su>ext): Add combiner pattern to eliminate
+ the sign or zero extension instruction, since the value is always
+ 0/1.
+ (signbit<mode>2_dm2): Delete using <Fsignbit>.
+
+2017-01-10 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2017-01-09 Martin Liska <mliska@suse.cz>
+
+ PR pch/78970
+ * gcc.c (driver_handle_option): Handle OPT_E and set
+ have_E.
+ (lookup_compiler): Do not show error message with have_E.
+
+2017-01-10 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2017-01-05 Martin Liska <mliska@suse.cz>
+
+ PR pch/78970
+ * gcc.c (lookup_compiler): Reject '-' filename for a precompiled
+ header.
+
+2017-01-10 Thomas Schwinge <thomas@codesourcery.com>
+
+ PR tree-optimization/78024
+ * omp-low.c (oacc_loop_discovery): Call clear_bb_flags.
+
+ Backport trunk r239086:
+ 2016-08-03 Nathan Sidwell <nathan@codesourcery.com>
+
+ * config/nvptx/nvptx.c (nvptx_declare_function_name): Round frame
+ size to DImode boundary.
+ (nvptx_propagate): Likewise.
+
+2017-01-10 Chung-Ju Wu <jasonwucj@gmail.com>
+
+ Backport from mainline
+ 2016-04-28 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR target/70668
+ * config/nds32/nds32.md (casesi): Don't access the operands array
+ out of bounds.
+
+2017-01-09 Andreas Tobler <andreast@gcc.gnu.org>
+
+ Backport from mainline
+ 2016-10-10 Andreas Tobler <andreast@gcc.gnu.org>
+
+ * config.gcc: Add aarch64-*-freebsd* support.
+ * config.host: Likewise.
+ * config/aarch64/aarch64-freebsd.h: New file.
+ * config/aarch64/t-aarch64-freebsd: Ditto.
+
+2017-01-09 Bill Seurer <seurer@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2016-12-21 Bill Seurer <seurer@linux.vnet.ibm.com>
+
+ PR sanitizer/65479
+ * config/rs6000/rs6000.c (rs6000_option_override_internal): Add
+ -fasynchronous-unwind-tables option when -fsanitize=address is
+ specified.
+
+2017-01-09 Andreas Tobler <andreast@gcc.gnu.org>
+
+ Backport from mainline
+ 2016-09-19 Richard Biener <rguenther@suse.de>
+
+ * dwarf2out.c (dwarf2out_late_global_decl): When being during the
+ early debug phase do not add locations but only const value
+ attributes.
+
+ Backport from mainline
+ 2016-10-20 Richard Biener <rguenther@suse.de>
+
+ * cgraphunit.c (analyze_functions): Set node->definition to
+ false to signal symbol removal to debug_hooks->late_global_decl.
+
2017-01-09 Andre Vieira <andre.simoesdiasvieira@arm.com>
Backport from mainline
CONSTRUCTOR_APPEND_ELT (vinner, NULL_TREE,
fold_convert (const_ptr_type_node, module_name_cst));
varpool_node *vnode = varpool_node::get (decl);
- int has_dynamic_init = vnode ? vnode->dynamically_initialized : 0;
+ int has_dynamic_init = 0;
+ /* FIXME: Enable initialization order fiasco detection in LTO mode once
+ proper fix for PR 79061 will be applied. */
+ if (!in_lto_p)
+ has_dynamic_init = vnode ? vnode->dynamically_initialized : 0;
CONSTRUCTOR_APPEND_ELT (vinner, NULL_TREE,
build_int_cst (uptr, has_dynamic_init));
tree locptr = NULL_TREE;
+2017-01-10 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2017-01-05 Martin Liska <mliska@suse.cz>
+
+ PR pch/78970
+ * c-opts.c (c_common_post_options): Reject '-' filename for a precompiled
+ header.
+
2016-12-21 Release Manager
* GCC 6.3.0 released.
in_fnames[0] = "";
}
else if (strcmp (in_fnames[0], "-") == 0)
- in_fnames[0] = "";
+ {
+ if (pch_file)
+ error ("cannot use %<-%> as input filename for a precompiled header");
+
+ in_fnames[0] = "";
+ }
if (out_fname == NULL || !strcmp (out_fname, "-"))
out_fname = "";
at looking at optimized away DECLs, since
late_global_decl will subsequently be called from the
contents of the now pruned symbol table. */
- if (!decl_function_context (node->decl))
- (*debug_hooks->late_global_decl) (node->decl);
+ if (VAR_P (node->decl)
+ && !decl_function_context (node->decl))
+ {
+ /* We are reclaiming totally unreachable code and variables
+ so they effectively appear as readonly. Show that to
+ the debug machinery. */
+ TREE_READONLY (node->decl) = 1;
+ node->definition = false;
+ (*debug_hooks->late_global_decl) (node->decl);
+ }
node->remove ();
continue;
/* Definitions for AArch64 running FreeBSD
- Copyright (C) 2016 Free Software Foundation, Inc.
+ Copyright (C) 2016-2017 Free Software Foundation, Inc.
This file is part of GCC.
int aarch64_hard_regno_nregs (unsigned, machine_mode);
int aarch64_uxt_size (int, HOST_WIDE_INT);
int aarch64_vec_fpconst_pow_of_2 (rtx);
-rtx aarch64_final_eh_return_addr (void);
+rtx aarch64_eh_return_handler_rtx (void);
rtx aarch64_mask_from_zextract_ops (rtx, rtx);
const char *aarch64_output_move_struct (rtx *operands);
rtx aarch64_return_addr (int, rtx);
&& (!crtl->is_leaf || df_regs_ever_live_p (LR_REGNUM)))
return true;
+ /* Force a frame pointer for EH returns so the return address is at FP+8. */
+ if (crtl->calls_eh_return)
+ return true;
+
return false;
}
+ cfun->machine->frame.saved_varargs_size) != 0;
/* Emit a barrier to prevent loads from a deallocated stack. */
- if (final_adjust > crtl->outgoing_args_size || cfun->calls_alloca)
+ if (final_adjust > crtl->outgoing_args_size || cfun->calls_alloca
+ || crtl->calls_eh_return)
{
emit_insn (gen_stack_tie (stack_pointer_rtx, stack_pointer_rtx));
need_barrier_p = false;
emit_jump_insn (ret_rtx);
}
-/* Return the place to copy the exception unwinding return address to.
- This will probably be a stack slot, but could (in theory be the
- return register). */
-rtx
-aarch64_final_eh_return_addr (void)
-{
- HOST_WIDE_INT fp_offset;
-
- aarch64_layout_frame ();
+/* Implement EH_RETURN_HANDLER_RTX. EH returns need to either return
+ normally or return to a previous frame after unwinding.
- fp_offset = cfun->machine->frame.frame_size
- - cfun->machine->frame.hard_fp_offset;
+ An EH return uses a single shared return sequence. The epilogue is
+ exactly like a normal epilogue except that it has an extra input
+ register (EH_RETURN_STACKADJ_RTX) which contains the stack adjustment
+ that must be applied after the frame has been destroyed. An extra label
+ is inserted before the epilogue which initializes this register to zero,
+ and this is the entry point for a normal return.
- if (cfun->machine->frame.reg_offset[LR_REGNUM] < 0)
- return gen_rtx_REG (DImode, LR_REGNUM);
+ An actual EH return updates the return address, initializes the stack
+ adjustment and jumps directly into the epilogue (bypassing the zeroing
+ of the adjustment). Since the return address is typically saved on the
+ stack when a function makes a call, the saved LR must be updated outside
+ the epilogue.
- /* DSE and CSELIB do not detect an alias between sp+k1 and fp+k2. This can
- result in a store to save LR introduced by builtin_eh_return () being
- incorrectly deleted because the alias is not detected.
- So in the calculation of the address to copy the exception unwinding
- return address to, we note 2 cases.
- If FP is needed and the fp_offset is 0, it means that SP = FP and hence
- we return a SP-relative location since all the addresses are SP-relative
- in this case. This prevents the store from being optimized away.
- If the fp_offset is not 0, then the addresses will be FP-relative and
- therefore we return a FP-relative location. */
+ This poses problems as the store is generated well before the epilogue,
+ so the offset of LR is not known yet. Also optimizations will remove the
+ store as it appears dead, even after the epilogue is generated (as the
+ base or offset for loading LR is different in many cases).
- if (frame_pointer_needed)
- {
- if (fp_offset)
- return gen_frame_mem (DImode,
- plus_constant (Pmode, hard_frame_pointer_rtx, UNITS_PER_WORD));
- else
- return gen_frame_mem (DImode,
- plus_constant (Pmode, stack_pointer_rtx, UNITS_PER_WORD));
- }
-
- /* If FP is not needed, we calculate the location of LR, which would be
- at the top of the saved registers block. */
+ To avoid these problems this implementation forces the frame pointer
+ in eh_return functions so that the location of LR is fixed and known early.
+ It also marks the store volatile, so no optimization is permitted to
+ remove the store. */
+rtx
+aarch64_eh_return_handler_rtx (void)
+{
+ rtx tmp = gen_frame_mem (Pmode,
+ plus_constant (Pmode, hard_frame_pointer_rtx, UNITS_PER_WORD));
- return gen_frame_mem (DImode,
- plus_constant (Pmode,
- stack_pointer_rtx,
- fp_offset
- + cfun->machine->frame.saved_regs_size
- - 2 * UNITS_PER_WORD));
+ /* Mark the store volatile, so no optimization is permitted to remove it. */
+ MEM_VOLATILE_P (tmp) = true;
+ return tmp;
}
/* Output code to add DELTA to the first argument, and then jump
#define ASM_DECLARE_FUNCTION_NAME(STR, NAME, DECL) \
aarch64_declare_function_name (STR, NAME, DECL)
-/* The register that holds the return address in exception handlers. */
-#define AARCH64_EH_STACKADJ_REGNUM (R0_REGNUM + 4)
-#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, AARCH64_EH_STACKADJ_REGNUM)
+/* For EH returns X4 contains the stack adjustment. */
+#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, R4_REGNUM)
+#define EH_RETURN_HANDLER_RTX aarch64_eh_return_handler_rtx ()
/* Don't use __builtin_setjmp until we've defined it. */
#undef DONT_USE_BUILTIN_SETJMP
[(set_attr "type" "branch")]
)
-(define_insn "eh_return"
- [(unspec_volatile [(match_operand:DI 0 "register_operand" "r")]
- UNSPECV_EH_RETURN)]
- ""
- "#"
- [(set_attr "type" "branch")]
-
-)
-
-(define_split
- [(unspec_volatile [(match_operand:DI 0 "register_operand" "")]
- UNSPECV_EH_RETURN)]
- "reload_completed"
- [(set (match_dup 1) (match_dup 0))]
- {
- operands[1] = aarch64_final_eh_return_addr ();
- }
-)
-
(define_insn "*cb<optab><mode>1"
[(set (pc) (if_then_else (EQL (match_operand:GPI 0 "register_operand" "r")
(const_int 0))
# Machine description for AArch64 architecture.
-# Copyright (C) 2016 Free Software Foundation, Inc.
+# Copyright (C) 2016-2017 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
else if (disp && !base && !index)
{
len += 4;
- if (rip_relative_addr_p (&parts))
+ if (!rip_relative_addr_p (&parts))
len++;
}
else
} \
while (0)
-#undef LONG_DOUBLE_TYPE_SIZE
-#define LONG_DOUBLE_TYPE_SIZE (TARGET_80387 ? 80 : 64)
-
#define IX86_NO_LIBGCC_TFMODE
emit_jump_insn (gen_cbranchsi4 (test, operands[0], operands[2],
operands[4]));
- operands[5] = gen_reg_rtx (SImode);
- /* Step C, D, E, and F, using another temporary register operands[5]. */
- emit_jump_insn (gen_casesi_internal (operands[0],
- operands[3],
- operands[5]));
+ /* Step C, D, E, and F, using another temporary register. */
+ rtx tmp = gen_reg_rtx (SImode);
+ emit_jump_insn (gen_casesi_internal (operands[0], operands[3], tmp));
DONE;
})
init_frame (file, STACK_POINTER_REGNUM,
UNITS_PER_WORD, crtl->outgoing_args_size);
- /* Declare a local variable for the frame. */
+ /* Declare a local variable for the frame. Force its size to be
+ DImode-compatible. */
HOST_WIDE_INT sz = get_frame_size ();
if (sz || cfun->machine->has_chain)
init_frame (file, FRAME_POINTER_REGNUM,
- crtl->stack_alignment_needed / BITS_PER_UNIT, sz);
+ crtl->stack_alignment_needed / BITS_PER_UNIT,
+ (sz + GET_MODE_SIZE (DImode) - 1)
+ & ~(HOST_WIDE_INT)(GET_MODE_SIZE (DImode) - 1));
/* Declare the pseudos we have as ptx registers. */
int maxregs = max_reg_num ();
rtx pred = NULL_RTX;
rtx_code_label *label = NULL;
- gcc_assert (!(fs & (GET_MODE_SIZE (DImode) - 1)));
- fs /= GET_MODE_SIZE (DImode);
+ /* The frame size might not be DImode compatible, but the frame
+ array's declaration will be. So it's ok to round up here. */
+ fs = (fs + GET_MODE_SIZE (DImode) - 1) / GET_MODE_SIZE (DImode);
/* Detect single iteration loop. */
if (fs == 1)
fs = 0;
#define vec_sqrt __builtin_vec_sqrt
#define vec_vsx_ld __builtin_vec_vsx_ld
#define vec_vsx_st __builtin_vec_vsx_st
-#define vec_xl __builtin_vec_xl
-#define vec_xst __builtin_vec_xst
+#define vec_xl __builtin_vec_vsx_ld
+#define vec_xst __builtin_vec_vsx_st
/* Note, xxsldi and xxpermdi were added as __builtin_vsx_<xxx> functions
instead of __builtin_vec_<xxx> */
RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 },
{ ALTIVEC_BUILTIN_VEC_PACKS, ALTIVEC_BUILTIN_VPKSWSS,
RS6000_BTI_V8HI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 },
- { ALTIVEC_BUILTIN_VEC_VPKSWSS, ALTIVEC_BUILTIN_VPKSWSS,
- RS6000_BTI_V8HI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 },
- { ALTIVEC_BUILTIN_VEC_VPKUWUS, ALTIVEC_BUILTIN_VPKUWUS,
- RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 },
{ ALTIVEC_BUILTIN_VEC_PACKS, P8V_BUILTIN_VPKUDUS,
RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V2DI, RS6000_BTI_unsigned_V2DI, 0 },
{ ALTIVEC_BUILTIN_VEC_PACKS, P8V_BUILTIN_VPKSDSS,
RS6000_BTI_V4SI, RS6000_BTI_V2DI, RS6000_BTI_V2DI, 0 },
+ { ALTIVEC_BUILTIN_VEC_VPKSWSS, ALTIVEC_BUILTIN_VPKSWSS,
+ RS6000_BTI_V8HI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 },
+ { ALTIVEC_BUILTIN_VEC_VPKUWUS, ALTIVEC_BUILTIN_VPKUWUS,
+ RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 },
{ ALTIVEC_BUILTIN_VEC_VPKSHSS, ALTIVEC_BUILTIN_VPKSHSS,
RS6000_BTI_V16QI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 },
{ ALTIVEC_BUILTIN_VEC_VPKUHUS, ALTIVEC_BUILTIN_VPKUHUS,
{ P8V_BUILTIN_VEC_VUPKLSW, P8V_BUILTIN_VUPKLSW,
RS6000_BTI_bool_V2DI, RS6000_BTI_bool_V4SI, 0, 0 },
- { P8V_BUILTIN_VEC_VGBBD, P8V_BUILTIN_VGBBD,
- RS6000_BTI_V16QI, 0, 0, 0 },
- { P8V_BUILTIN_VEC_VGBBD, P8V_BUILTIN_VGBBD,
- RS6000_BTI_unsigned_V16QI, 0, 0, 0 },
-
{ P9V_BUILTIN_VEC_VSLV, P9V_BUILTIN_VSLV,
RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI,
RS6000_BTI_unsigned_V16QI, 0 },
&& !global_options_set.x_flag_ira_loop_pressure)
flag_ira_loop_pressure = 1;
+ /* -fsanitize=address needs to turn on -fasynchronous-unwind-tables in order
+ for tracebacks to be complete but not if any -fasynchronous-unwind-tables
+ options were already specified. */
+ if (flag_sanitize & SANITIZE_USER_ADDRESS
+ && !global_options_set.x_flag_asynchronous_unwind_tables)
+ flag_asynchronous_unwind_tables = 1;
+
/* Set the pointer size. */
if (TARGET_64BIT)
{
rtx dest_di = (d_mode == DImode) ? dest : gen_lowpart (DImode, dest);
rtx shift_reg = dest_di;
- gcc_assert (REG_P (dest));
- gcc_assert (REG_P (src) || MEM_P (src));
- gcc_assert (s_mode == KFmode || s_mode == TFmode);
+ gcc_assert (FLOAT128_IEEE_P (s_mode) && TARGET_POWERPC64);
if (MEM_P (src))
{
else
{
- unsigned int r = REGNO (src);
+ unsigned int r = reg_or_subregno (src);
- /* If this is a VSX register, generate the special mfvsrd instruction
- to get it in a GPR. Until we support SF and DF modes, that will
- always be true. */
- gcc_assert (VSX_REGNO_P (r));
+ if (INT_REGNO_P (r))
+ shift_reg = gen_rtx_REG (DImode, r + (BYTES_BIG_ENDIAN == 0));
- if (s_mode == KFmode)
- emit_insn (gen_signbitkf2_dm2 (dest_di, src));
else
- emit_insn (gen_signbittf2_dm2 (dest_di, src));
+ {
+ /* Generate the special mfvsrd instruction to get it in a GPR. */
+ gcc_assert (VSX_REGNO_P (r));
+ if (s_mode == KFmode)
+ emit_insn (gen_signbitkf2_dm2 (dest_di, src));
+ else
+ emit_insn (gen_signbittf2_dm2 (dest_di, src));
+ }
}
emit_insn (gen_lshrdi3 (dest_di, shift_reg, GEN_INT (63)));
case UNSPEC_VSX_CVSPDPN:
return 0;
case UNSPEC_VSPLT_DIRECT:
+ case UNSPEC_VSX_XXSPLTD:
*special = SH_SPLAT;
return 1;
case UNSPEC_REDUC_PLUS:
{
if (GET_CODE (body) == SET)
{
+ rtx rhs = SET_SRC (body);
+ /* Even without a swap, the RHS might be a vec_select for, say,
+ a byte-reversing load. */
+ if (GET_CODE (rhs) != MEM)
+ return 0;
+
*special = SH_NOSWAP_LD;
return 1;
}
{
if (GET_CODE (body) == SET && GET_CODE (SET_SRC (body)) != UNSPEC)
{
+ rtx lhs = SET_DEST (body);
+ /* Even without a swap, the LHS might be a vec_select for, say,
+ a byte-reversing store. */
+ if (GET_CODE (lhs) != MEM)
+ return 0;
+
*special = SH_NOSWAP_ST;
return 1;
}
(define_mode_iterator SIGNBIT [(KF "FLOAT128_VECTOR_P (KFmode)")
(TF "FLOAT128_VECTOR_P (TFmode)")])
-(define_mode_attr Fsignbit [(KF "wa")
- (TF "wa")])
-
; SF/DF suffix for traditional floating instructions
(define_mode_attr Ftrad [(SF "s") (DF "")])
(define_insn_and_split "signbit<mode>2_dm"
[(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r")
(unspec:SI
- [(match_operand:SIGNBIT 1 "input_operand" "<Fsignbit>,m,r")]
+ [(match_operand:SIGNBIT 1 "input_operand" "wa,m,r")]
UNSPEC_SIGNBIT))]
"TARGET_POWERPC64 && TARGET_DIRECT_MOVE"
"#"
rs6000_split_signbit (operands[0], operands[1]);
DONE;
}
- [(set_attr "length" "8,8,12")
+ [(set_attr "length" "8,8,4")
+ (set_attr "type" "mftgpr,load,integer")])
+
+(define_insn_and_split "*signbit<mode>2_dm_<su>ext"
+ [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r")
+ (any_extend:DI
+ (unspec:SI
+ [(match_operand:SIGNBIT 1 "input_operand" "wa,m,r")]
+ UNSPEC_SIGNBIT)))]
+ "TARGET_POWERPC64 && TARGET_DIRECT_MOVE"
+ "#"
+ "&& reload_completed"
+ [(const_int 0)]
+{
+ rs6000_split_signbit (operands[0], operands[1]);
+ DONE;
+}
+ [(set_attr "length" "8,8,4")
(set_attr "type" "mftgpr,load,integer")])
;; MODES_TIEABLE_P doesn't allow DImode to be tied with the various floating
;; special pattern to avoid using a normal movdi.
(define_insn "signbit<mode>2_dm2"
[(set (match_operand:DI 0 "gpc_reg_operand" "=r")
- (unspec:DI [(match_operand:SIGNBIT 1 "gpc_reg_operand" "<Fsignbit>")
+ (unspec:DI [(match_operand:SIGNBIT 1 "gpc_reg_operand" "wa")
(const_int 0)]
UNSPEC_SIGNBIT))]
"TARGET_POWERPC64 && TARGET_DIRECT_MOVE"
/* Save lr first in its special location because code after this
might use the link register as a scratch register. */
if (df_regs_ever_live_p (TILEGX_LINK_REGNUM) || crtl->calls_eh_return)
- FRP (frame_emit_store (TILEGX_LINK_REGNUM, TILEGX_LINK_REGNUM,
- stack_pointer_rtx, stack_pointer_rtx, 0));
+ {
+ FRP (frame_emit_store (TILEGX_LINK_REGNUM, TILEGX_LINK_REGNUM,
+ stack_pointer_rtx, stack_pointer_rtx, 0));
+ emit_insn (gen_blockage ());
+ }
if (total_size == 0)
{
/* Save lr first in its special location because code after this
might use the link register as a scratch register. */
if (df_regs_ever_live_p (TILEPRO_LINK_REGNUM) || crtl->calls_eh_return)
- FRP (frame_emit_store (TILEPRO_LINK_REGNUM, TILEPRO_LINK_REGNUM,
- stack_pointer_rtx, stack_pointer_rtx, 0));
+ {
+ FRP (frame_emit_store (TILEPRO_LINK_REGNUM, TILEPRO_LINK_REGNUM,
+ stack_pointer_rtx, stack_pointer_rtx, 0));
+ emit_insn (gen_blockage ());
+ }
if (total_size == 0)
{
+2017-01-26 Jason Merrill <jason@redhat.com>
+
+ PR c++/79176 - lambda ICE with -flto -Os
+ * decl2.c (vague_linkage_p): Handle decloned 'tors.
+ * tree.c (decl_linkage): Likewise.
+
+2017-01-20 Marek Polacek <polacek@redhat.com>
+
+ Backported from mainline
+ 2017-01-04 Marek Polacek <polacek@redhat.com>
+
+ PR c++/77545
+ PR c++/77284
+ * constexpr.c (potential_constant_expression_1): Handle CLEANUP_STMT.
+
+2017-01-17 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2017-01-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/78341
+ * parser.c (cp_parser_std_attribute_spec): Remove over-eager
+ assertion. Formatting fix.
+
+ 2017-01-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/78949
+ * typeck.c (cp_build_unary_op): Call mark_rvalue_use on arg if it has
+ vector type.
+
+ PR c++/78693
+ * parser.c (cp_parser_simple_declaration): Only complain about
+ inconsistent auto deduction if auto_result doesn't use auto.
+
+ PR c++/71182
+ * parser.c (cp_lexer_previous_token): Use vec_safe_address in the
+ assertion, as lexer->buffer may be NULL.
+
+2017-01-11 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/77812
+ * name-lookup.c (set_namespace_binding_1): An overload of 1 decl
+ is a new overload.
+
2016-12-21 Release Manager
* GCC 6.3.0 released.
/* We can see these in statement-expressions. */
return true;
+ case CLEANUP_STMT:
case EMPTY_CLASS_EXPR:
return false;
{
if (!TREE_PUBLIC (decl))
{
+ /* maybe_thunk_body clears TREE_PUBLIC on the maybe-in-charge 'tor
+ variants, check one of the "clones" for the real linkage. */
+ if ((DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (decl)
+ || DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl))
+ && DECL_CHAIN (decl)
+ && DECL_CLONED_FUNCTION (DECL_CHAIN (decl)))
+ return vague_linkage_p (DECL_CHAIN (decl));
+
gcc_checking_assert (!DECL_COMDAT (decl));
return false;
}
if (scope == NULL_TREE)
scope = global_namespace;
b = binding_for_name (NAMESPACE_LEVEL (scope), name);
- if (!b->value || TREE_CODE (val) == OVERLOAD || val == error_mark_node)
+ if (!b->value
+ /* For templates and using we create a single element OVERLOAD.
+ Look for the chain to know whether this is really augmenting
+ an existing overload. */
+ || (TREE_CODE (val) == OVERLOAD && OVL_CHAIN (val))
+ || val == error_mark_node)
b->value = val;
else
supplement_binding (b, val);
/* Skip past purged tokens. */
while (tp->purged_p)
{
- gcc_assert (tp != lexer->buffer->address ());
+ gcc_assert (tp != vec_safe_address (lexer->buffer));
tp--;
}
if (cp_parser_error_occurred (parser))
goto done;
- if (auto_result)
+ if (auto_result
+ && (!processing_template_decl || !type_uses_auto (auto_result)))
{
- if (last_type && last_type != error_mark_node
+ if (last_type
+ && last_type != error_mark_node
&& !same_type_p (auto_result, last_type))
{
/* If the list of declarators contains more than one declarator,
if (!cp_parser_parse_definitely (parser))
{
- gcc_assert (alignas_expr == error_mark_node
- || alignas_expr == NULL_TREE);
-
- alignas_expr =
- cp_parser_assignment_expression (parser);
+ alignas_expr = cp_parser_assignment_expression (parser);
if (alignas_expr == error_mark_node)
cp_parser_skip_to_end_of_statement (parser);
if (alignas_expr == NULL_TREE
if (TREE_PUBLIC (decl))
return lk_external;
+ /* maybe_thunk_body clears TREE_PUBLIC on the maybe-in-charge 'tor variants,
+ check one of the "clones" for the real linkage. */
+ if ((DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (decl)
+ || DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl))
+ && DECL_CHAIN (decl)
+ && DECL_CLONED_FUNCTION (DECL_CHAIN (decl)))
+ return decl_linkage (DECL_CHAIN (decl));
+
if (TREE_CODE (decl) == NAMESPACE_DECL)
return lk_external;
errstring = _("wrong type argument to bit-complement");
else if (!noconvert && CP_INTEGRAL_TYPE_P (TREE_TYPE (arg)))
arg = cp_perform_integral_promotions (arg, complain);
+ else if (!noconvert && VECTOR_TYPE_P (TREE_TYPE (arg)))
+ arg = mark_rvalue_use (arg);
break;
case ABS_EXPR:
Further details and examples about these built-in functions are described
in the Cilk Plus language manual which can be found at
-@uref{http://www.cilkplus.org}.
+@uref{https://www.cilkplus.org}.
@node Other Builtins
@section Other Built-in Functions Provided by GCC
@end smallexample
Detailed description for usage and functionality of @code{_Cilk_spawn} can be
-found at http://www.cilkplus.org
+found at @uref{https://www.cilkplus.org}.
@item CILK_SYNC_STMT
@end itemize
Documentation about Cilk Plus and language specification is provided under the
-"Learn" section in @w{@uref{http://www.cilkplus.org/}}. It is worth mentioning
+"Learn" section in @w{@uref{https://www.cilkplus.org}}. It is worth mentioning
that the current implementation follows ABI 1.1.
@node Gimplification pass
field_byte_offset (const_tree decl, struct vlr_context *ctx,
HOST_WIDE_INT *cst_offset)
{
- offset_int object_offset_in_bits;
- offset_int object_offset_in_bytes;
- offset_int bitpos_int;
- bool is_byte_offset_cst, is_bit_offset_cst;
tree tree_result;
dw_loc_list_ref loc_result;
else
gcc_assert (TREE_CODE (decl) == FIELD_DECL);
- is_bit_offset_cst = TREE_CODE (DECL_FIELD_BIT_OFFSET (decl)) != INTEGER_CST;
- is_byte_offset_cst = TREE_CODE (DECL_FIELD_OFFSET (decl)) != INTEGER_CST;
-
/* We cannot handle variable bit offsets at the moment, so abort if it's the
case. */
- if (is_bit_offset_cst)
+ if (TREE_CODE (DECL_FIELD_BIT_OFFSET (decl)) != INTEGER_CST)
return NULL;
#ifdef PCC_BITFIELD_TYPE_MATTERS
/* We used to handle only constant offsets in all cases. Now, we handle
properly dynamic byte offsets only when PCC bitfield type doesn't
matter. */
- if (PCC_BITFIELD_TYPE_MATTERS && is_byte_offset_cst && is_bit_offset_cst)
+ if (PCC_BITFIELD_TYPE_MATTERS
+ && TREE_CODE (DECL_FIELD_OFFSET (decl)) == INTEGER_CST)
{
+ offset_int object_offset_in_bits;
+ offset_int object_offset_in_bytes;
+ offset_int bitpos_int;
tree type;
tree field_size_tree;
offset_int deepest_bitpos;
object_offset_in_bits
= round_up_to_align (object_offset_in_bits, decl_align_in_bits);
}
+
+ object_offset_in_bytes
+ = wi::lrshift (object_offset_in_bits, LOG2_BITS_PER_UNIT);
+ if (ctx->variant_part_offset == NULL_TREE)
+ {
+ *cst_offset = object_offset_in_bytes.to_shwi ();
+ return NULL;
+ }
+ tree_result = wide_int_to_tree (sizetype, object_offset_in_bytes);
}
+ else
#endif /* PCC_BITFIELD_TYPE_MATTERS */
+ tree_result = byte_position (decl);
- tree_result = byte_position (decl);
if (ctx->variant_part_offset != NULL_TREE)
- tree_result = fold (build2 (PLUS_EXPR, TREE_TYPE (tree_result),
- ctx->variant_part_offset, tree_result));
+ tree_result = fold_build2 (PLUS_EXPR, TREE_TYPE (tree_result),
+ ctx->variant_part_offset, tree_result);
/* If the byte offset is a constant, it's simplier to handle a native
constant rather than a DWARF expression. */
if (!lower_cst_included)
lower_cst
- = fold (build2 (PLUS_EXPR, TREE_TYPE (lower_cst),
- lower_cst,
- build_int_cst (TREE_TYPE (lower_cst), 1)));
+ = fold_build2 (PLUS_EXPR, TREE_TYPE (lower_cst), lower_cst,
+ build_int_cst (TREE_TYPE (lower_cst), 1));
if (!upper_cst_included)
upper_cst
- = fold (build2 (MINUS_EXPR, TREE_TYPE (upper_cst),
- upper_cst,
- build_int_cst (TREE_TYPE (upper_cst), 1)));
+ = fold_build2 (MINUS_EXPR, TREE_TYPE (upper_cst), upper_cst,
+ build_int_cst (TREE_TYPE (upper_cst), 1));
if (!get_discr_value (lower_cst,
&new_node->dw_discr_lower_bound)
we recurse. */
vlr_sub_ctx.variant_part_offset
- = fold (build2 (PLUS_EXPR, TREE_TYPE (variant_part_offset),
- variant_part_offset, byte_position (member)));
+ = fold_build2 (PLUS_EXPR, TREE_TYPE (variant_part_offset),
+ variant_part_offset, byte_position (member));
gen_variant_part (member, &vlr_sub_ctx, variant_die);
}
else
{
dw_die_ref die = lookup_decl_die (decl);
if (die)
- add_location_or_const_value_attribute (die, decl, false);
+ {
+ /* We get called via the symtab code invoking late_global_decl
+ for symbols that are optimized out. Do not add locations
+ for those. */
+ varpool_node *node = varpool_node::get (decl);
+ if (! node || ! node->definition)
+ tree_add_const_value_attribute_for_decl (die, decl);
+ else
+ add_location_or_const_value_attribute (die, decl, false);
+ }
}
}
temp = expand_normal (exp);
- /* If the value has a record type and an integral mode then, if BITSIZE
- is narrower than this mode and this is for big-endian data, we must
- first put the value into the low-order bits. Moreover, the field may
- be not aligned on a byte boundary; in this case, if it has reverse
- storage order, it needs to be accessed as a scalar field with reverse
- storage order and we must first put the value into target order. */
- if (TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE
+ /* Handle calls that return values in multiple non-contiguous locations.
+ The Irix 6 ABI has examples of this. */
+ if (GET_CODE (temp) == PARALLEL)
+ {
+ HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (exp));
+ machine_mode temp_mode
+ = smallest_mode_for_size (size * BITS_PER_UNIT, MODE_INT);
+ rtx temp_target = gen_reg_rtx (temp_mode);
+ emit_group_store (temp_target, temp, TREE_TYPE (exp), size);
+ temp = temp_target;
+ }
+
+ /* Handle calls that return BLKmode values in registers. */
+ else if (mode == BLKmode && REG_P (temp) && TREE_CODE (exp) == CALL_EXPR)
+ {
+ rtx temp_target = gen_reg_rtx (GET_MODE (temp));
+ copy_blkmode_from_reg (temp_target, temp, TREE_TYPE (exp));
+ temp = temp_target;
+ }
+
+ /* If the value has aggregate type and an integral mode then, if BITSIZE
+ is narrower than this mode and this is for big-endian data, we first
+ need to put the value into the low-order bits for store_bit_field,
+ except when MODE is BLKmode and BITSIZE larger than the word size
+ (see the handling of fields larger than a word in store_bit_field).
+ Moreover, the field may be not aligned on a byte boundary; in this
+ case, if it has reverse storage order, it needs to be accessed as a
+ scalar field with reverse storage order and we must first put the
+ value into target order. */
+ if (AGGREGATE_TYPE_P (TREE_TYPE (exp))
&& GET_MODE_CLASS (GET_MODE (temp)) == MODE_INT)
{
HOST_WIDE_INT size = GET_MODE_BITSIZE (GET_MODE (temp));
temp = flip_storage_order (GET_MODE (temp), temp);
if (bitsize < size
- && reverse ? !BYTES_BIG_ENDIAN : BYTES_BIG_ENDIAN)
+ && reverse ? !BYTES_BIG_ENDIAN : BYTES_BIG_ENDIAN
+ && !(mode == BLKmode && bitsize > BITS_PER_WORD))
temp = expand_shift (RSHIFT_EXPR, GET_MODE (temp), temp,
size - bitsize, NULL_RTX, 1);
}
&& mode != TYPE_MODE (TREE_TYPE (exp)))
temp = convert_modes (mode, TYPE_MODE (TREE_TYPE (exp)), temp, 1);
- /* If TEMP is not a PARALLEL (see below) and its mode and that of TARGET
- are both BLKmode, both must be in memory and BITPOS must be aligned
- on a byte boundary. If so, we simply do a block copy. Likewise for
- a BLKmode-like TARGET. */
- if (GET_CODE (temp) != PARALLEL
- && GET_MODE (temp) == BLKmode
+ /* If the mode of TEMP and TARGET is BLKmode, both must be in memory
+ and BITPOS must be aligned on a byte boundary. If so, we simply do
+ a block copy. Likewise for a BLKmode-like TARGET. */
+ if (GET_MODE (temp) == BLKmode
&& (GET_MODE (target) == BLKmode
|| (MEM_P (target)
&& GET_MODE_CLASS (GET_MODE (target)) == MODE_INT
return const0_rtx;
}
- /* Handle calls that return values in multiple non-contiguous locations.
- The Irix 6 ABI has examples of this. */
- if (GET_CODE (temp) == PARALLEL)
- {
- HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (exp));
- rtx temp_target;
- if (mode == BLKmode || mode == VOIDmode)
- mode = smallest_mode_for_size (size * BITS_PER_UNIT, MODE_INT);
- temp_target = gen_reg_rtx (mode);
- emit_group_store (temp_target, temp, TREE_TYPE (exp), size);
- temp = temp_target;
- }
- else if (mode == BLKmode)
+ /* If the mode of TEMP is still BLKmode and BITSIZE not larger than the
+ word size, we need to load the value (see again store_bit_field). */
+ if (GET_MODE (temp) == BLKmode && bitsize <= BITS_PER_WORD)
{
- /* Handle calls that return BLKmode values in registers. */
- if (REG_P (temp) && TREE_CODE (exp) == CALL_EXPR)
- {
- rtx temp_target = gen_reg_rtx (GET_MODE (temp));
- copy_blkmode_from_reg (temp_target, temp, TREE_TYPE (exp));
- temp = temp_target;
- }
- else
- {
- HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (exp));
- rtx temp_target;
- mode = smallest_mode_for_size (size * BITS_PER_UNIT, MODE_INT);
- temp_target = gen_reg_rtx (mode);
- temp_target
- = extract_bit_field (temp, size * BITS_PER_UNIT, 0, 1,
- temp_target, mode, mode, false);
- temp = temp_target;
- }
+ machine_mode temp_mode = smallest_mode_for_size (bitsize, MODE_INT);
+ temp = extract_bit_field (temp, bitsize, 0, 1, NULL_RTX, temp_mode,
+ temp_mode, false);
}
/* Store the value in the bitfield. */
+2017-01-29 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ Backported from trunk
+ 2017-01-13 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ PR fortran/70697
+ * resolve.c (resolve_lock_unlock_event): Resolve the expression for
+ event's until_count.
+
+2017-01-29 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ Backport from trunk
+ PR fortran/70696
+ * trans-expr.c (gfc_get_tree_for_caf_expr): Ensure the backend_decl
+ is valid before accessing it. Remove unnecessary assert.
+ * trans-decl.c (gfc_build_qualified_array): Add static tokens to the
+ parent function's scope only, when the decl-context is not the
+ translation unit.
+
+2017-01-17 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2016-12-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/78866
+ * openmp.c (resolve_omp_clauses): Diagnose assumed size arrays in
+ OpenMP map, to and from clauses.
+ * trans-openmp.c: Include diagnostic-core.h, temporarily redefining
+ GCC_DIAG_STYLE to __gcc_tdiag__.
+ (gfc_omp_finish_clause): Diagnose implicitly mapped assumed size
+ arrays.
+
2016-12-22 Thomas Koenig <tkoenig@gcc.gnu.org>
Backport from trunk
else
resolve_oacc_data_clauses (n->sym, n->where, name);
}
+ else if (list != OMP_CLAUSE_DEPEND
+ && n->sym->as
+ && n->sym->as->type == AS_ASSUMED_SIZE)
+ gfc_error ("Assumed size array %qs in %s clause at %L",
+ n->sym->name, name, &n->where);
}
if (list != OMP_LIST_DEPEND)
return;
/* Check for EVENT WAIT the UNTIL_COUNT. */
- if (code->op == EXEC_EVENT_WAIT && code->expr4
- && (code->expr4->ts.type != BT_INTEGER || code->expr4->rank != 0))
- gfc_error ("UNTIL_COUNT= argument at %L must be a scalar INTEGER "
- "expression", &code->expr4->where);
+ if (code->op == EXEC_EVENT_WAIT && code->expr4)
+ {
+ if (!gfc_resolve_expr (code->expr4) || code->expr4->ts.type != BT_INTEGER
+ || code->expr4->rank != 0)
+ gfc_error ("UNTIL_COUNT= argument at %L must be a scalar INTEGER "
+ "expression", &code->expr4->where);
+ }
}
DECL_CONTEXT (token) = sym->ns->proc_name->backend_decl;
gfc_module_add_decl (cur_module, token);
}
+ else if (sym->attr.host_assoc
+ && TREE_CODE (DECL_CONTEXT (current_function_decl))
+ != TRANSLATION_UNIT_DECL)
+ gfc_add_decl_to_parent_function (token);
else
gfc_add_decl_to_function (token);
}
&expr->where);
}
- caf_decl = expr->symtree->n.sym->backend_decl;
- gcc_assert (caf_decl);
+ /* Make sure the backend_decl is present before accessing it. */
+ caf_decl = expr->symtree->n.sym->backend_decl == NULL_TREE
+ ? gfc_get_symbol_decl (expr->symtree->n.sym)
+ : expr->symtree->n.sym->backend_decl;
+
if (expr->symtree->n.sym->ts.type == BT_CLASS)
caf_decl = gfc_class_data_get (caf_decl);
if (expr->symtree->n.sym->attr.codimension)
#include "arith.h"
#include "omp-low.h"
#include "gomp-constants.h"
+#undef GCC_DIAG_STYLE
+#define GCC_DIAG_STYLE __gcc_tdiag__
+#include "diagnostic-core.h"
+#undef GCC_DIAG_STYLE
+#define GCC_DIAG_STYLE __gcc_gfc__
int ompws_flags;
return;
tree decl = OMP_CLAUSE_DECL (c);
+
+ /* Assumed-size arrays can't be mapped implicitly, they have to be
+ mapped explicitly using array sections. */
+ if (TREE_CODE (decl) == PARM_DECL
+ && GFC_ARRAY_TYPE_P (TREE_TYPE (decl))
+ && GFC_TYPE_ARRAY_AKIND (TREE_TYPE (decl)) == GFC_ARRAY_UNKNOWN
+ && GFC_TYPE_ARRAY_UBOUND (TREE_TYPE (decl),
+ GFC_TYPE_ARRAY_RANK (TREE_TYPE (decl)) - 1)
+ == NULL)
+ {
+ error_at (OMP_CLAUSE_LOCATION (c),
+ "implicit mapping of assumed size array %qD", decl);
+ return;
+ }
+
tree c2 = NULL_TREE, c3 = NULL_TREE, c4 = NULL_TREE;
if (POINTER_TYPE_P (TREE_TYPE (decl)))
{
/* cfun should never be set directly; use this function. */
void
-set_cfun (struct function *new_cfun)
+set_cfun (struct function *new_cfun, bool force)
{
- if (cfun != new_cfun)
+ if (cfun != new_cfun || force)
{
cfun = new_cfun;
invoke_set_current_function_hook (new_cfun ? new_cfun->decl : NULL_TREE);
extern void number_blocks (tree);
/* cfun shouldn't be set directly; use one of these functions instead. */
-extern void set_cfun (struct function *new_cfun);
+extern void set_cfun (struct function *new_cfun, bool force = false);
extern void push_cfun (struct function *new_cfun);
extern void pop_cfun (void);
/* Was the option -o passed. */
static int have_o = 0;
+/* Was the option -E passed. */
+static int have_E = 0;
+
/* Pointer to output file name passed in with -o. */
static const char *output_file = 0;
validated = true;
break;
+ case OPT_E:
+ have_E = true;
+ break;
+
case OPT_x:
spec_lang = arg;
if (!strcmp (spec_lang, "none"))
{
for (cp = compilers + n_compilers - 1; cp >= compilers; cp--)
if (cp->suffix[0] == '@' && !strcmp (cp->suffix + 1, language))
- return cp;
+ {
+ if (name != NULL && strcmp (name, "-") == 0
+ && (strcmp (cp->suffix, "@c-header") == 0
+ || strcmp (cp->suffix, "@c++-header") == 0)
+ && !have_E)
+ fatal_error (input_location,
+ "cannot use %<-%> as input filename for a "
+ "precompiled header");
+
+ return cp;
+ }
error ("language %s not recognized", language);
return 0;
if (expr->numeric_constant_value(&nc))
{
Numeric_constant result;
- if (Unary_expression::eval_constant(op, &nc, loc, &result))
+ bool issued_error;
+ if (Unary_expression::eval_constant(op, &nc, loc, &result,
+ &issued_error))
return result.expression(loc);
+ else if (issued_error)
+ return Expression::make_error(this->location());
}
}
}
// Apply unary opcode OP to UNC, setting NC. Return true if this
-// could be done, false if not. Issue errors for overflow.
+// could be done, false if not. On overflow, issues an error and sets
+// *ISSUED_ERROR.
bool
Unary_expression::eval_constant(Operator op, const Numeric_constant* unc,
- Location location, Numeric_constant* nc)
+ Location location, Numeric_constant* nc,
+ bool* issued_error)
{
+ *issued_error = false;
switch (op)
{
case OPERATOR_PLUS:
mpz_clear(uval);
mpz_clear(val);
- return nc->set_type(unc->type(), true, location);
+ if (!nc->set_type(unc->type(), true, location))
+ {
+ *issued_error = true;
+ return false;
+ }
+ return true;
}
// Return the integral constant value of a unary expression, if it has one.
Numeric_constant unc;
if (!this->expr_->numeric_constant_value(&unc))
return false;
+ bool issued_error;
return Unary_expression::eval_constant(this->op_, &unc, this->location(),
- nc);
+ nc, &issued_error);
}
// Return the type of a unary expression.
// Apply binary opcode OP to LEFT_NC and RIGHT_NC, setting NC. Return
// true if this could be done, false if not. Issue errors at LOCATION
-// as appropriate.
+// as appropriate, and sets *ISSUED_ERROR if it did.
bool
Binary_expression::eval_constant(Operator op, Numeric_constant* left_nc,
Numeric_constant* right_nc,
- Location location, Numeric_constant* nc)
+ Location location, Numeric_constant* nc,
+ bool* issued_error)
{
+ *issued_error = false;
switch (op)
{
case OPERATOR_OROR:
r = Binary_expression::eval_integer(op, left_nc, right_nc, location, nc);
if (r)
- r = nc->set_type(type, true, location);
+ {
+ r = nc->set_type(type, true, location);
+ if (!r)
+ *issued_error = true;
+ }
return r;
}
else
{
Numeric_constant nc;
+ bool issued_error;
if (!Binary_expression::eval_constant(op, &left_nc, &right_nc,
- location, &nc))
+ location, &nc,
+ &issued_error))
+ {
+ if (issued_error)
+ return Expression::make_error(location);
return this;
+ }
return nc.expression(location);
}
}
Numeric_constant right_nc;
if (!this->right_->numeric_constant_value(&right_nc))
return false;
+ bool issued_error;
return Binary_expression::eval_constant(this->op_, &left_nc, &right_nc,
- this->location(), nc);
+ this->location(), nc, &issued_error);
}
// Note that the value is being discarded.
Type_context subcontext(*context);
- if (is_comparison)
+ if (is_constant_expr)
+ {
+ subcontext.type = NULL;
+ subcontext.may_be_abstract = true;
+ }
+ else if (is_comparison)
{
// In a comparison, the context does not determine the types of
// the operands.
subcontext.type = subcontext.type->make_non_abstract_type();
}
- if (!is_constant_expr)
- this->left_->determine_type(&subcontext);
+ this->left_->determine_type(&subcontext);
if (is_shift_op)
{
subcontext.may_be_abstract = false;
}
- if (!is_constant_expr)
- this->right_->determine_type(&subcontext);
+ this->right_->determine_type(&subcontext);
if (is_comparison)
{
}
// Apply unary opcode OP to UNC, setting NC. Return true if this
- // could be done, false if not. Issue errors for overflow.
+ // could be done, false if not. On overflow, issues an error and
+ // sets *ISSUED_ERROR.
static bool
eval_constant(Operator op, const Numeric_constant* unc,
- Location, Numeric_constant* nc);
+ Location, Numeric_constant* nc, bool *issued_error);
static Expression*
do_import(Import*);
// Apply binary opcode OP to LEFT_NC and RIGHT_NC, setting NC.
// Return true if this could be done, false if not. Issue errors at
- // LOCATION as appropriate.
+ // LOCATION as appropriate, and sets *ISSUED_ERROR if it did.
static bool
eval_constant(Operator op, Numeric_constant* left_nc,
Numeric_constant* right_nc, Location location,
- Numeric_constant* nc);
+ Numeric_constant* nc, bool* issued_error);
// Compare constants LEFT_NC and RIGHT_NC according to OP, setting
// *RESULT. Return true if this could be done, false if not. Issue
is_common = true;
}
+ // The current garbage collector requires that the GC symbol be
+ // aligned to at least a four byte boundary. See the use of PRECISE
+ // and LOOP in libgo/runtime/mgc0.c.
+ int64_t align;
+ if (!sym_init->type()->backend_type_align(gogo, &align))
+ go_assert(saw_errors());
+ if (align < 4)
+ align = 4;
+ else
+ {
+ // Use default alignment.
+ align = 0;
+ }
+
// Since we are building the GC symbol in this package, we must create the
// variable before converting the initializer to its backend representation
// because the initializer may refer to the GC symbol for this type.
this->gc_symbol_var_ =
- gogo->backend()->implicit_variable(sym_name, sym_btype, false, true, is_common, 0);
+ gogo->backend()->implicit_variable(sym_name, sym_btype, false, true,
+ is_common, align);
if (phash != NULL)
*phash = this->gc_symbol_var_;
if (DECL_FUNCTION_PERSONALITY (callee->decl))
DECL_FUNCTION_PERSONALITY (to->decl)
= DECL_FUNCTION_PERSONALITY (callee->decl);
+
+ bool reload_optimization_node = false;
if (!opt_for_fn (callee->decl, flag_strict_aliasing)
&& opt_for_fn (to->decl, flag_strict_aliasing))
{
to->name (), to->order);
DECL_FUNCTION_SPECIFIC_OPTIMIZATION (to->decl)
= build_optimization_node (&opts);
+ reload_optimization_node = true;
}
+ /* Reload global optimization flags. */
+ if (reload_optimization_node && DECL_STRUCT_FUNCTION (to->decl) == cfun)
+ set_cfun (cfun, true);
+
/* If aliases are involved, redirect edge to the actual destination and
possibly remove the aliases. */
if (e->callee != callee)
/* Check that type is within range. */
if (offset < 0)
return false;
- if (TYPE_SIZE (outer_type) && TYPE_SIZE (otr_type)
- && TREE_CODE (TYPE_SIZE (outer_type)) == INTEGER_CST
- && TREE_CODE (TYPE_SIZE (otr_type)) == INTEGER_CST
- && wi::ltu_p (wi::to_offset (TYPE_SIZE (outer_type)),
- (wi::to_offset (TYPE_SIZE (otr_type)) + offset)))
- return false;
+
+ /* PR ipa/71207
+ As OUTER_TYPE can be a type which has a diamond virtual inheritance,
+ it's not necessary that INNER_TYPE will fit within OUTER_TYPE with
+ a given offset. It can happen that INNER_TYPE also contains a base object,
+ however it would point to the same instance in the OUTER_TYPE. */
context.offset = offset;
context.outer_type = TYPE_MAIN_VARIANT (outer_type);
static bool
do_remat (void)
{
+ unsigned regno;
rtx_insn *insn;
basic_block bb;
bitmap_head avail_cands;
bool changed_p = false;
/* Living hard regs and hard registers of living pseudos. */
HARD_REG_SET live_hard_regs;
+ bitmap_iterator bi;
bitmap_initialize (&avail_cands, ®_obstack);
bitmap_initialize (&active_cands, ®_obstack);
FOR_EACH_BB_FN (bb, cfun)
{
- REG_SET_TO_HARD_REG_SET (live_hard_regs, df_get_live_out (bb));
+ CLEAR_HARD_REG_SET (live_hard_regs);
+ EXECUTE_IF_SET_IN_BITMAP (df_get_live_in (bb), 0, regno, bi)
+ {
+ int hard_regno = regno < FIRST_PSEUDO_REGISTER
+ ? regno
+ : reg_renumber[regno];
+ if (hard_regno >= 0)
+ SET_HARD_REG_BIT (live_hard_regs, hard_regno);
+ }
bitmap_and (&avail_cands, &get_remat_bb_data (bb)->avin_cands,
&get_remat_bb_data (bb)->livein_cands);
/* Activating insns are always in the same block as their corresponding
}
bp_pack_value (&bp, node->tls_model, 3);
bp_pack_value (&bp, node->used_by_single_function, 1);
+ bp_pack_value (&bp, node->dynamically_initialized, 1);
bp_pack_value (&bp, node->need_bounds_init, 1);
streamer_write_bitpack (&bp);
node->alias_target = get_alias_symbol (node->decl);
node->tls_model = (enum tls_model)bp_unpack_value (&bp, 3);
node->used_by_single_function = (enum tls_model)bp_unpack_value (&bp, 1);
+ node->dynamically_initialized = bp_unpack_value (&bp, 1);
node->need_bounds_init = bp_unpack_value (&bp, 1);
group = read_identifier (ib);
if (group)
form followed by the data for the string. */
#define LTO_major_version 5
-#define LTO_minor_version 1
+#define LTO_minor_version 2
typedef unsigned char lto_decl_flags_t;
+2017-01-17 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2017-01-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/50199
+ * lto-lang.c (lto_post_options): Force flag_merge_constants = 1
+ if it was 0.
+
2016-12-21 Release Manager
* GCC 6.3.0 released.
support. */
flag_excess_precision_cmdline = EXCESS_PRECISION_FAST;
+ /* When partitioning, we can tear appart STRING_CSTs uses from the same
+ TU into multiple partitions. Without constant merging the constants
+ might not be equal at runtime. See PR50199. */
+ if (!flag_merge_constants)
+ flag_merge_constants = 1;
+
/* Initialize the compiler back end. */
return false;
}
static oacc_loop *
oacc_loop_discovery ()
{
- basic_block bb;
+ /* Clear basic block flags, in particular BB_VISITED which we're going to use
+ in the following. */
+ clear_bb_flags ();
oacc_loop *top = new_oacc_loop_outer (current_function_decl);
oacc_loop_discover_walk (top, ENTRY_BLOCK_PTR_FOR_FN (cfun));
that diagnostics come out in an unsurprising order. */
top = oacc_loop_sibling_nreverse (top);
- /* Reset the visited flags. */
- FOR_ALL_BB_FN (bb, cfun)
- bb->flags &= ~BB_VISITED;
+ /* Clear basic block flags again. */
+ clear_bb_flags ();
return top;
}
+2017-02-03 Carl Love <cel@us.ibm.com>
+
+ * gcc.target/powerpc/builtins-3-p8.c: Add new testfile for missing
+ vec_packs built-in tests.
+
+2017-02-03 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2017-01-27 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR target/65484
+ * g++.dg/vect/pr36648.cc: Modify to reflect that the loop is not
+ vectorized on POWER unless hardware misaligned loads are
+ available.
+
+2017-01-31 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2017-01-29 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR target/79268
+ * gcc.target/powerpc/pr79268.c: New file.
+ * gcc.target/powerpc/vsx-elemrev-1.c: Delete file.
+ * gcc.target/powerpc/vsx-elemrev-2.c: Likewise.
+ * gcc.target/powerpc/vsx-elemrev-3.c: Likewise.
+ * gcc.target/powerpc/vsx-elemrev-4.c: Likewise.
+
+2017-01-29 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ Backport from trunk
+ 2017-01-13 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ PR fortran/70697
+ * gfortran.dg/coarray/event_4.f08: New test.
+
+2017-01-29 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ Backport from trunk
+ 2017-01-19 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ PR fortran/70696
+ * gfortran.dg/coarray_43.f90: New test.
+
+ 2017-01-18 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ PR fortran/70696
+ * gfortran.dg/coarray_event_1.f08: New test.
+
+ 2017-01-13 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ PR fortran/70696
+ * gfortran.dg/coarray/event_3.f08: New test.
+
+2017-01-28 John David Anglin <danglin@gcc.gnu.org>
+
+ PR testsuite/70583
+ * g++.old-deja/g++.abi/vtable2.C: Adjust CMP_VPTR define on hppa.
+
+2017-01-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ 2017-01-09 Eric Botcazou <ebotcazou@adacore.com>
+
+ * g++.dg/opt/call2.C: New test.
+ * g++.dg/opt/call3.C: Likewise.
+ * gnat.dg/array26.adb: New test.
+ * gnat.dg/array26_pkg.ad[sb]: New helper.
+ * gnat.dg/array27.adb: New test.
+ * gnat.dg/array27_pkg.ad[sb]: New helper.
+ * gnat.dg/array28.adb: New test.
+ * gnat.dg/array28_pkg.ad[sb]: New helper.
+
+2017-01-26 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2016-01-10 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/79034
+ * g++.dg/torture/pr79034.C: New testcase.
+
+ 2016-12-13 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/78742
+ * gcc.dg/torture/pr78742.c: New testcase.
+
+2017-01-24 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.target/arm/vfp-longcall-apcs.c: New test.
+
+2017-01-23 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2016-01-23 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * gcc.dg/lto/pr69188_0.c: Require profiling support for testcase.
+
+2017-01-23 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2017-01-20 Martin Liska <mliska@suse.cz>
+
+ PR lto/69188
+ * gcc.dg/lto/pr69188_0.c: New test.
+ * gcc.dg/lto/pr69188_1.c: New test.
+
+2017-01-20 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2017-01-16 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ * gcc.target/powerpc/swaps-p8-27.c: New.
+
+2017-01-20 Wilco Dijkstra <wdijkstr@arm.com>
+
+ Backport from mainline
+ PR target/77455
+ * gcc.target/aarch64/eh_return.c: New test.
+
+2017-01-20 Marek Polacek <polacek@redhat.com>
+
+ Backported from mainline
+ 2017-01-04 Marek Polacek <polacek@redhat.com>
+
+ PR c++/77545
+ PR c++/77284
+ * g++.dg/cpp0x/range-for32.C: New test.
+ * g++.dg/cpp0x/range-for33.C: New test.
+
+2017-01-20 Richard Earnshaw <rearnsha@arm.com>
+
+ Backported from mainline
+ 2017-01-19 Richard Earnshaw <rearnsha@arm.com>
+
+ PR rtl-optimization/79121
+ * gcc.c-torture/execute/pr79121.c: New test.
+
+2017-01-20 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2017-01-13 Martin Liska <mliska@suse.cz>
+
+ PR ipa/79043
+ * gcc.c-torture/execute/pr79043.c: New test.
+
+2017-01-20 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2017-01-17 Martin Liska <mliska@suse.cz>
+
+ PR ipa/71207
+ * g++.dg/ipa/pr71207.C: New test.
+
+2017-01-17 Jakub Jelinek <jakub@redhat.com>
+
+ Backported from mainline
+ 2017-01-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/78341
+ * g++.dg/cpp0x/pr78341.C: New test.
+
+ PR middle-end/50199
+ * gcc.dg/lto/pr50199_0.c: New test.
+
+ 2017-01-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/78949
+ * c-c++-common/Wunused-var-16.c: New test.
+
+ PR c++/78693
+ * g++.dg/cpp0x/pr78693.C: New test.
+
+ PR c++/71182
+ * g++.dg/cpp0x/pr71182.C: New test.
+
+ 2016-12-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/78866
+ * gfortran.dg/gomp/map-1.f90: Add expected error.
+ * gfortran.dg/gomp/pr78866-1.f90: New test.
+ * gfortran.dg/gomp/pr78866-2.f90: New test.
+
+2017-01-17 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ Backport from mainline
+ 2016-12-07 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ PR rtl-optimization/78617
+ * gcc.c-torture/execute/pr78617.c: New test.
+
+2017-01-12 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ Backport from mainline
+ 2017-01-12 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR target/79044
+ * gcc.target/powerpc/swaps-p8-26.c: New.
+
+2017-01-11 Nathan Sidwell <nathan@acm.org>
+
+ PR c++/77812
+ * g++.dg/pr77812.C: New.
+
+2017-01-10 Thomas Schwinge <thomas@codesourcery.com>
+
+ Backport from trunk r241334:
+ 2016-10-19 Thomas Schwinge <thomas@codesourcery.com>
+
+ PR tree-optimization/78024
+ * gcc.dg/goacc/loop-processing-1.c: New file.
+
2017-01-09 Andre Vieira <andre.simoesdiasvieira@arm.com>
Backport from mainline
--- /dev/null
+/* PR c++/78949 */
+/* { dg-do compile } */
+/* { dg-options "-Wunused" } */
+
+typedef unsigned char V __attribute__((vector_size(16)));
+V v;
+
+void
+foo ()
+{
+ V y = {};
+ V x = {}; // { dg-bogus "set but not used" }
+ y &= ~x;
+ v = y;
+}
--- /dev/null
+// PR c++/71182
+// { dg-do compile { target c++11 } }
+
+class A {
+ template <typename> void As();
+};
+template <typename T> class B : A {
+ void f() {
+ A *g ;
+ g ? g->As<T>() : nullptr;
+ }
+};
--- /dev/null
+// PR c++/78341
+// { dg-do compile { target c++11 } }
+
+alignas (alignas double // { dg-error "" }
--- /dev/null
+// PR c++/78693
+// { dg-do compile { target c++11 } }
+
+template <class T>
+void
+foo (T t)
+{
+ auto i = t, j = 1; // { dg-bogus "inconsistent deduction" }
+}
+
+template <class T>
+void
+bar (T t)
+{
+ auto i = 1, j = t, k = 2; // { dg-bogus "inconsistent deduction" }
+}
+
+template <class T, class U>
+void
+foo (T t, U u)
+{
+ auto i = t, j = u; // { dg-bogus "inconsistent deduction" }
+}
+
+void
+foo ()
+{
+ foo (0);
+ bar (0);
+ foo (1, 2);
+}
--- /dev/null
+// PR c++/77545
+// { dg-do compile { target c++11 } }
+// { dg-options "-Wno-pedantic" }
+
+template < typename T > struct A
+{
+ A ();
+ ~A ();
+ T t;
+};
+
+void f (A < int > a)
+{
+ for (auto x : (A<int>[]) { a })
+ ;
+}
--- /dev/null
+// PR c++/77284
+// { dg-do compile { target c++11 } }
+
+#include <initializer_list>
+
+struct A
+{
+ ~A () {}
+};
+
+void foo (A & v)
+{
+ for (A a : { v }) {};
+}
--- /dev/null
+/* PR ipa/71207 */
+/* { dg-do run } */
+
+class Class1
+{
+public:
+ Class1() {};
+ virtual ~Class1() {};
+
+protected:
+ unsigned Field1;
+};
+
+class Class2 : public virtual Class1
+{
+};
+
+class Class3 : public virtual Class1
+{
+public:
+ virtual void Method1() = 0;
+
+ void Method2()
+ {
+ Method1();
+ }
+};
+
+class Class4 : public Class2, public virtual Class3
+{
+public:
+ Class4() {};
+ virtual void Method1() {};
+};
+
+int main()
+{
+ Class4 var1;
+ var1.Method2();
+
+ return 0;
+}
--- /dev/null
+// { dg-do run }
+// { dg-options "-O" }
+
+struct Foo
+{
+ Foo() : a(1), b(1), c('a') {}
+ int a;
+ int b;
+ char c;
+};
+
+static Foo copy_foo(Foo) __attribute__((noinline, noclone));
+
+static Foo copy_foo(Foo A)
+{
+ return A;
+}
+
+struct Bar : Foo
+{
+ Bar(Foo t) : Foo(copy_foo(t)) {}
+};
+
+Foo F;
+
+int main (void)
+{
+ Bar B (F);
+
+ if (B.a != 1 || B.b != 1 || B.c != 'a')
+ __builtin_abort ();
+
+ return 0;
+}
--- /dev/null
+// { dg-do run }
+// { dg-options "-O" }
+
+struct Foo
+{
+ Foo() : a(1), c('a') {}
+ short int a;
+ char c;
+};
+
+static Foo copy_foo(Foo) __attribute__((noinline, noclone));
+
+static Foo copy_foo(Foo A)
+{
+ return A;
+}
+
+struct Bar : Foo
+{
+ Bar(Foo t) : Foo(copy_foo(t)) {}
+};
+
+Foo F;
+
+int main (void)
+{
+ Bar B (F);
+
+ if (B.a != 1 || B.c != 'a')
+ __builtin_abort ();
+
+ return 0;
+}
--- /dev/null
+// PR c++/79176
+// { dg-do compile { target c++11 } }
+// { dg-options "-flto -Os" }
+
+struct A {};
+struct Object {
+ virtual bool m_fn1();
+ virtual ~Object();
+};
+struct Item : Object, virtual A {
+ ~Item() {
+ [] {};
+ }
+ bool m_fn1();
+};
+bool Item::m_fn1() {}
--- /dev/null
+// PR77812
+// struct-stat hack failure when first overload is a template
+
+enum f {};
+
+template <typename>
+void f ()
+{
+}
+enum f F;
+
+struct g {};
+
+template <typename>
+void g ()
+{
+}
+struct g G;
--- /dev/null
+/* { dg-do compile } */
+
+extern "C" {
+ float sqrtf(float);
+}
+
+class T {
+public:
+ float floats[1];
+
+ inline float length() const {
+ return sqrtf(floats[0]);
+ }
+};
+
+void destruct(void *);
+
+class Container {
+
+ T Ts[1];
+
+public:
+ ~Container() {
+ destruct((void *)Ts);
+ }
+
+ T& operator[](int n) {
+ return Ts[0];
+ }
+};
+
+void fill(Container&);
+
+void doit()
+{
+ Container data;
+ float max = 10;
+
+ int i, j, k;
+
+ for (i = 0; i < 10; i++) {
+ for (j = 1; j < 10; j++) {
+ if (max < 5)
+ break;
+ fill( data);
+ max = data[0].length();
+ for (k = 1; k < j; k++) {
+ max = 5;
+ }
+ }
+ }
+}
int main() { }
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! vect_no_align } } } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { ! vect_no_align } } } } */
+/* On older powerpc hardware (POWER7 and earlier), the default flag
+ -mno-allow-movmisalign prevents vectorization. On POWER8 and later,
+ when vect_hw_misalign is true, vectorization occurs. For other
+ targets, ! vect_no_align is a sufficient test. */
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { { ! vect_no_align } && { ! powerpc*-*-* } } || { powerpc*-*-* && vect_hw_misalign } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { { { ! vect_no_align } && { ! powerpc*-*-* } } || { powerpc*-*-* && vect_hw_misalign } } } } } */
#define INC_VDATA(A,N) ((A) += 2*(N))
#endif
#else
+// HPPA uses function pointers but they point to function descriptors.
+#if defined __hppa__
+#ifdef __hpux__
+#ifdef _LP64
+#define CMP_VPTR(A, B) (*(unsigned long *)(*(A)+16) == *(unsigned long *)((unsigned long)(B)+16))
+#else
+#define CMP_VPTR(A, B) (*(A) == (ptrdiff_t)(B))
+#endif /* _LP64 */
+#else
+extern "C" { unsigned int __canonicalize_funcptr_for_compare (void*); }
+#define CMP_VPTR(A, B) (__canonicalize_funcptr_for_compare(*(void **)A) == __canonicalize_funcptr_for_compare((void *)B))
+#endif /* __hpux__ */
+#else
#define CMP_VPTR(A, B) (*(A) == (ptrdiff_t)(B))
+#endif /* __hppa__ */
#define INC_VPTR(A) ((A) += 1)
#define INC_VDATA(A,N) ((A) += (N))
-#endif
+#endif /* __ia64__ */
int main ()
{
--- /dev/null
+int a = 0;
+int d = 1;
+int f = 1;
+
+int fn1() {
+ return a || 1 >> a;
+}
+
+int fn2(int p1, int p2) {
+ return p2 >= 2 ? p1 : p1 >> 1;
+}
+
+int fn3(int p1) {
+ return d ^ p1;
+}
+
+int fn4(int p1, int p2) {
+ return fn3(!d > fn2((f = fn1() - 1000) || p2, p1));
+}
+
+int main() {
+ if (fn4(0, 0) != 1)
+ __builtin_abort ();
+ return 0;
+}
--- /dev/null
+/* PR ipa/78791 */
+
+int val;
+
+int *ptr = &val;
+float *ptr2 = &val;
+
+static
+__attribute__((always_inline, optimize ("-fno-strict-aliasing")))
+typepun ()
+{
+ *ptr2=0;
+}
+
+main()
+{
+ *ptr=1;
+ typepun ();
+ if (*ptr)
+ __builtin_abort ();
+}
--- /dev/null
+/* Make sure that OpenACC loop processing happens. */
+/* { dg-additional-options "-O2 -fdump-tree-oaccdevlow" } */
+
+extern int place ();
+
+void vector_1 (int *ary, int size)
+{
+#pragma acc parallel num_workers (32) vector_length(32) copy(ary[0:size]) firstprivate (size)
+ {
+#pragma acc loop gang
+ for (int jx = 0; jx < 1; jx++)
+#pragma acc loop auto
+ for (int ix = 0; ix < size; ix++)
+ ary[ix] = place ();
+ }
+}
+
+/* { dg-final { scan-tree-dump "OpenACC loops.*Loop 0\\\(0\\\).*Loop 14\\\(1\\\).*\\\.data_dep\\\.\[0-9_\]+ = UNIQUE \\\(\[0-9\]+, 0, 1, 20\\\);.*Head-0:.*\\\.data_dep\\\.\[0-9_\]+ = UNIQUE \\\(\[0-9\]+, 0, 1, 20\\\);.*\\\.data_dep\\\.\[0-9_\]+ = UNIQUE \\\(\[0-9\]+, \\\.data_dep\\\.\[0-9_\]+, 0\\\);.*Tail-0:.*\\\.data_dep\\\.\[0-9_\]+ = UNIQUE \\\(\[0-9\]+, \\\.data_dep\\\.\[0-9_\]+, 1\\\);.*\\\.data_dep\\\.\[0-9_\]+ = UNIQUE \\\(\[0-9\]+, \\\.data_dep\\\.\[0-9_\]+, 0\\\);.*Loop 6\\\(4\\\).*\\\.data_dep\\\.\[0-9_\]+ = UNIQUE \\\(\[0-9\]+, 0, 1, 6\\\);.*Head-0:.*\\\.data_dep\\\.\[0-9_\]+ = UNIQUE \\\(\[0-9\]+, 0, 1, 6\\\);.*\\\.data_dep\\\.\[0-9_\]+ = UNIQUE \\\(\[0-9\]+, \\\.data_dep\\\.\[0-9_\]+, 2\\\);.*Tail-0:.*\\\.data_dep\\\.\[0-9_\]+ = UNIQUE \\\(\[0-9\]+, \\\.data_dep\\\.\[0-9_\]+, 1\\\);.*\\\.data_dep\\\.\[0-9_\]+ = UNIQUE \\\(\[0-9\]+, \\\.data_dep\\\.\[0-9_\]+, 2\\\);" "oaccdevlow" } } */
--- /dev/null
+/* PR middle-end/50199 */
+/* { dg-lto-options {{-O2 -flto -fno-merge-constants --param=lto-min-partition=1}} } */
+
+__attribute__ ((noinline)) const char *
+foo (const char *x)
+{
+ return x;
+}
+
+int
+main ()
+{
+ const char *a = "ab";
+ if (a != foo (a))
+ __builtin_abort ();
+ return 0;
+}
--- /dev/null
+/* PR ipa/69188 */
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -flto -O0 -fprofile-generate } } } */
+/* { dg-require-profiling "-fprofile-generate" } */
+
+void fn1(void)
+{
+}
--- /dev/null
+/* PR ipa/69188 */
+/* { dg-options "-flto -O1 -fprofile-generate" } */
+
+extern void fn1(void);
+
+int main() {
+ fn1();
+ return 0;
+}
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target int128 } */
+
+void foo();
+
+void func()
+{
+ int m;
+
+ int tab[m];
+
+ __int128 j;
+ for(; j; j++)
+ {
+ tab[j] = 0;
+ tab[j+1] = 0;
+ }
+
+ foo();
+}
--- /dev/null
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-inline" } */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+int val, test, failed;
+
+int main (void);
+
+void
+eh0 (void *p)
+{
+ val = (int)(long)p & 7;
+ if (val)
+ abort ();
+}
+
+void
+eh1 (void *p, int x)
+{
+ void *q = __builtin_alloca (x);
+ eh0 (q);
+ __builtin_eh_return (0, p);
+}
+
+void
+eh2a (int a,int b,int c,int d,int e,int f,int g,int h, void *p)
+{
+ val = a + b + c + d + e + f + g + h + (int)(long)p & 7;
+}
+
+void
+eh2 (void *p)
+{
+ eh2a (val, val, val, val, val, val, val, val, p);
+ __builtin_eh_return (0, p);
+}
+
+
+void
+continuation (void)
+{
+ test++;
+ main ();
+}
+
+void
+fail (void)
+{
+ failed = 1;
+ printf ("failed\n");
+ continuation ();
+}
+
+void
+do_test1 (void)
+{
+ if (!val)
+ eh1 (continuation, 100);
+ fail ();
+}
+
+void
+do_test2 (void)
+{
+ if (!val)
+ eh2 (continuation);
+ fail ();
+}
+
+int
+main (void)
+{
+ if (test == 0)
+ do_test1 ();
+ if (test == 1)
+ do_test2 ();
+ if (failed || test != 2)
+ exit (1);
+ exit (0);
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target powerpc_p8vector_ok } */
+/* { dg-options "-mcpu=power8" } */
+
+#include <altivec.h>
+
+vector signed int
+test_vsi_packs_vsll_vsll (vector signed long long x,
+ vector signed long long y)
+{
+ return vec_packs (x, y);
+}
+
+vector unsigned int
+test_vui_packs_vull_vull (vector unsigned long long x,
+ vector unsigned long long y)
+{
+ return vec_packs (x, y);
+}
+
+/* Expected test results:
+ test_vsi_packs_vsll_vsll 1 vpksdss
+ test_vui_packs_vull_vull 1 vpkudus */
+
+/* { dg-final { scan-assembler-times "vpksdss" 1 } } */
+/* { dg-final { scan-assembler-times "vpkudus" 1 } } */
--- /dev/null
+/* { dg-do compile { target { powerpc64le-*-* } } } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
+/* { dg-options "-mcpu=power8 -O3 " } */
+
+/* Verify that vec_xl and vec_xst accept vector pixel parameters. */
+
+/* Test case to resolve PR79268. */
+
+#include <altivec.h>
+
+vector pixel a;
+
+vector pixel
+pr79268 (vector pixel *x)
+{
+ vec_xst (a, 0, x);
+ return vec_xl (0, x);
+}
--- /dev/null
+/* { dg-do compile { target { powerpc64le-*-* } } } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
+/* { dg-options "-mcpu=power8 -O3 " } */
+/* { dg-final { scan-assembler-times "lxvw4x" 2 } } */
+/* { dg-final { scan-assembler "stxvw4x" } } */
+/* { dg-final { scan-assembler-not "xxpermdi" } } */
+
+/* Verify that swap optimization does not interfere with element-reversing
+ loads and stores. */
+
+/* Test case to resolve PR79044. */
+
+#include <altivec.h>
+
+void pr79044 (float *x, float *y, float *z)
+{
+ vector float a = __builtin_vec_xl (0, x);
+ vector float b = __builtin_vec_xl (0, y);
+ vector float c = __builtin_vec_mul (a, b);
+ __builtin_vec_xst (c, 0, z);
+}
--- /dev/null
+/* { dg-do compile { target { powerpc64le-*-* } } } */
+/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
+/* { dg-options "-mcpu=power8 -O3 " } */
+/* { dg-final { scan-assembler-times "lxvd2x" 2 } } */
+/* { dg-final { scan-assembler-times "stxvd2x" 1 } } */
+/* { dg-final { scan-assembler-times "xxpermdi" 3 } } */
+
+/* Verify that swap optimization works correctly for a VSX direct splat.
+ The three xxpermdi's that are generated correspond to two splats
+ and the __builtin_vsx_xxpermdi. */
+
+int printf (const char *__restrict __format, ...);
+typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__));
+
+double s1[] = {2134.3343, 6678.346};
+double s2[] = {41124.234, 6678.346};
+long long dd[] = {1, 2}, d[2];
+union{long long l[2]; double d[2];} e;
+
+void
+foo ()
+{
+ __m128d source1, source2, dest;
+ __m128d a, b, c;
+
+ e.d[1] = s1[1];
+ e.l[0] = !__builtin_isunordered(s1[0], s2[0])
+ && s1[0] == s2[0] ? -1 : 0;
+ source1 = __builtin_vec_vsx_ld (0, s1);
+ source2 = __builtin_vec_vsx_ld (0, s2);
+ a = __builtin_vec_splat (source1, 0);
+ b = __builtin_vec_splat (source2, 0);
+ c = (__m128d)__builtin_vec_cmpeq (a, b);
+ dest = __builtin_vsx_xxpermdi (source1, c, 1);
+ *(__m128d *)d = dest;
+}
+++ /dev/null
-/* { dg-do compile { target { powerpc64le*-*-* } } } */
-/* { dg-skip-if "do not override mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
-/* { dg-options "-mcpu=power8 -O0" } */
-/* { dg-final { scan-assembler-times "lxvd2x" 18 } } */
-/* { dg-final { scan-assembler-times "lxvw4x" 6 } } */
-/* { dg-final { scan-assembler-times "stxvd2x" 18 } } */
-/* { dg-final { scan-assembler-times "stxvw4x" 6 } } */
-/* { dg-final { scan-assembler-times "xxpermdi" 24 } } */
-
-#include <altivec.h>
-
-extern vector double vd, *vdp;
-extern vector signed long long vsll, *vsllp;
-extern vector unsigned long long vull, *vullp;
-extern vector float vf, *vfp;
-extern vector signed int vsi, *vsip;
-extern vector unsigned int vui, *vuip;
-extern double *dp;
-extern signed long long *sllp;
-extern unsigned long long *ullp;
-extern float *fp;
-extern signed int *sip;
-extern unsigned int *uip;
-
-void foo0 (void)
-{
- vd = vec_xl (0, vdp);
-}
-
-void foo1 (void)
-{
- vsll = vec_xl (0, vsllp);
-}
-
-void foo2 (void)
-{
- vull = vec_xl (0, vullp);
-}
-
-void foo3 (void)
-{
- vf = vec_xl (0, vfp);
-}
-
-void foo4 (void)
-{
- vsi = vec_xl (0, vsip);
-}
-
-void foo5 (void)
-{
- vui = vec_xl (0, vuip);
-}
-
-void foo6 (void)
-{
- vec_xst (vd, 0, vdp);
-}
-
-void foo7 (void)
-{
- vec_xst (vsll, 0, vsllp);
-}
-
-void foo8 (void)
-{
- vec_xst (vull, 0, vullp);
-}
-
-void foo9 (void)
-{
- vec_xst (vf, 0, vfp);
-}
-
-void foo10 (void)
-{
- vec_xst (vsi, 0, vsip);
-}
-
-void foo11 (void)
-{
- vec_xst (vui, 0, vuip);
-}
-
-void foo20 (void)
-{
- vd = vec_xl (0, dp);
-}
-
-void foo21 (void)
-{
- vsll = vec_xl (0, sllp);
-}
-
-void foo22 (void)
-{
- vull = vec_xl (0, ullp);
-}
-
-void foo23 (void)
-{
- vf = vec_xl (0, fp);
-}
-
-void foo24 (void)
-{
- vsi = vec_xl (0, sip);
-}
-
-void foo25 (void)
-{
- vui = vec_xl (0, uip);
-}
-
-void foo26 (void)
-{
- vec_xst (vd, 0, dp);
-}
-
-void foo27 (void)
-{
- vec_xst (vsll, 0, sllp);
-}
-
-void foo28 (void)
-{
- vec_xst (vull, 0, ullp);
-}
-
-void foo29 (void)
-{
- vec_xst (vf, 0, fp);
-}
-
-void foo30 (void)
-{
- vec_xst (vsi, 0, sip);
-}
-
-void foo31 (void)
-{
- vec_xst (vui, 0, uip);
-}
+++ /dev/null
-/* { dg-do compile { target { powerpc64le*-*-* } } } */
-/* { dg-skip-if "do not override mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
-/* { dg-options "-mcpu=power9 -O0" } */
-/* { dg-require-effective-target powerpc_p9vector_ok } */
-/* { dg-skip-if "" { powerpc*-*-aix* } { "*" } { "" } } */
-/* { dg-final { scan-assembler-times "lxvd2x" 6 } } */
-/* { dg-final { scan-assembler-times "lxvw4x" 6 } } */
-/* { dg-final { scan-assembler-times "lxvh8x" 4 } } */
-/* { dg-final { scan-assembler-times "lxvb16x" 4 } } */
-/* { dg-final { scan-assembler-times "stxvd2x" 6 } } */
-/* { dg-final { scan-assembler-times "stxvw4x" 6 } } */
-/* { dg-final { scan-assembler-times "stxvh8x" 4 } } */
-/* { dg-final { scan-assembler-times "stxvb16x" 4 } } */
-
-#include <altivec.h>
-
-extern vector double vd, *vdp;
-extern vector signed long long vsll, *vsllp;
-extern vector unsigned long long vull, *vullp;
-extern vector float vf, *vfp;
-extern vector signed int vsi, *vsip;
-extern vector unsigned int vui, *vuip;
-extern vector signed short vss, *vssp;
-extern vector unsigned short vus, *vusp;
-extern vector signed char vsc, *vscp;
-extern vector unsigned char vuc, *vucp;
-extern double *dp;
-extern signed long long *sllp;
-extern unsigned long long *ullp;
-extern float *fp;
-extern signed int *sip;
-extern unsigned int *uip;
-extern signed short *ssp;
-extern unsigned short *usp;
-extern signed char *scp;
-extern unsigned char *ucp;
-
-void foo0 (void)
-{
- vd = vec_xl (0, vdp);
-}
-
-void foo1 (void)
-{
- vsll = vec_xl (0, vsllp);
-}
-
-void foo2 (void)
-{
- vull = vec_xl (0, vullp);
-}
-
-void foo3 (void)
-{
- vf = vec_xl (0, vfp);
-}
-
-void foo4 (void)
-{
- vsi = vec_xl (0, vsip);
-}
-
-void foo5 (void)
-{
- vui = vec_xl (0, vuip);
-}
-
-void foo6 (void)
-{
- vss = vec_xl (0, vssp);
-}
-
-void foo7 (void)
-{
- vus = vec_xl (0, vusp);
-}
-
-void foo8 (void)
-{
- vsc = vec_xl (0, vscp);
-}
-
-void foo9 (void)
-{
- vuc = vec_xl (0, vucp);
-}
-
-void foo10 (void)
-{
- vec_xst (vd, 0, vdp);
-}
-
-void foo11 (void)
-{
- vec_xst (vsll, 0, vsllp);
-}
-
-void foo12 (void)
-{
- vec_xst (vull, 0, vullp);
-}
-
-void foo13 (void)
-{
- vec_xst (vf, 0, vfp);
-}
-
-void foo14 (void)
-{
- vec_xst (vsi, 0, vsip);
-}
-
-void foo15 (void)
-{
- vec_xst (vui, 0, vuip);
-}
-
-void foo16 (void)
-{
- vec_xst (vss, 0, vssp);
-}
-
-void foo17 (void)
-{
- vec_xst (vus, 0, vusp);
-}
-
-void foo18 (void)
-{
- vec_xst (vsc, 0, vscp);
-}
-
-void foo19 (void)
-{
- vec_xst (vuc, 0, vucp);
-}
-
-void foo20 (void)
-{
- vd = vec_xl (0, dp);
-}
-
-void foo21 (void)
-{
- vsll = vec_xl (0, sllp);
-}
-
-void foo22 (void)
-{
- vull = vec_xl (0, ullp);
-}
-
-void foo23 (void)
-{
- vf = vec_xl (0, fp);
-}
-
-void foo24 (void)
-{
- vsi = vec_xl (0, sip);
-}
-
-void foo25 (void)
-{
- vui = vec_xl (0, uip);
-}
-
-void foo26 (void)
-{
- vss = vec_xl (0, ssp);
-}
-
-void foo27 (void)
-{
- vus = vec_xl (0, usp);
-}
-
-void foo28 (void)
-{
- vsc = vec_xl (0, scp);
-}
-
-void foo29 (void)
-{
- vuc = vec_xl (0, ucp);
-}
-
-void foo30 (void)
-{
- vec_xst (vd, 0, dp);
-}
-
-void foo31 (void)
-{
- vec_xst (vsll, 0, sllp);
-}
-
-void foo32 (void)
-{
- vec_xst (vull, 0, ullp);
-}
-
-void foo33 (void)
-{
- vec_xst (vf, 0, fp);
-}
-
-void foo34 (void)
-{
- vec_xst (vsi, 0, sip);
-}
-
-void foo35 (void)
-{
- vec_xst (vui, 0, uip);
-}
-
-void foo36 (void)
-{
- vec_xst (vss, 0, ssp);
-}
-
-void foo37 (void)
-{
- vec_xst (vus, 0, usp);
-}
-
-void foo38 (void)
-{
- vec_xst (vsc, 0, scp);
-}
-
-void foo39 (void)
-{
- vec_xst (vuc, 0, ucp);
-}
+++ /dev/null
-/* { dg-do compile { target { powerpc64-*-* } } } */
-/* { dg-skip-if "do not override mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
-/* { dg-options "-mcpu=power8 -O0" } */
-/* { dg-final { scan-assembler-times "lxvd2x" 16 } } */
-/* { dg-final { scan-assembler-times "lxvw4x" 8 } } */
-/* { dg-final { scan-assembler-times "stxvd2x" 16 } } */
-/* { dg-final { scan-assembler-times "stxvw4x" 8 } } */
-
-#include <altivec.h>
-
-extern vector double vd, *vdp;
-extern vector signed long long vsll, *vsllp;
-extern vector unsigned long long vull, *vullp;
-extern vector float vf, *vfp;
-extern vector signed int vsi, *vsip;
-extern vector unsigned int vui, *vuip;
-extern double *dp;
-extern signed long long *sllp;
-extern unsigned long long *ullp;
-extern float *fp;
-extern signed int *sip;
-extern unsigned int *uip;
-
-void foo0 (void)
-{
- vd = vec_xl (0, vdp);
-}
-
-void foo1 (void)
-{
- vsll = vec_xl (0, vsllp);
-}
-
-void foo2 (void)
-{
- vull = vec_xl (0, vullp);
-}
-
-void foo3 (void)
-{
- vf = vec_xl (0, vfp);
-}
-
-void foo4 (void)
-{
- vsi = vec_xl (0, vsip);
-}
-
-void foo5 (void)
-{
- vui = vec_xl (0, vuip);
-}
-
-void foo6 (void)
-{
- vec_xst (vd, 0, vdp);
-}
-
-void foo7 (void)
-{
- vec_xst (vsll, 0, vsllp);
-}
-
-void foo8 (void)
-{
- vec_xst (vull, 0, vullp);
-}
-
-void foo9 (void)
-{
- vec_xst (vf, 0, vfp);
-}
-
-void foo10 (void)
-{
- vec_xst (vsi, 0, vsip);
-}
-
-void foo11 (void)
-{
- vec_xst (vui, 0, vuip);
-}
-
-void foo20 (void)
-{
- vd = vec_xl (0, dp);
-}
-
-void foo21 (void)
-{
- vsll = vec_xl (0, sllp);
-}
-
-void foo22 (void)
-{
- vull = vec_xl (0, ullp);
-}
-
-void foo23 (void)
-{
- vf = vec_xl (0, fp);
-}
-
-void foo24 (void)
-{
- vsi = vec_xl (0, sip);
-}
-
-void foo25 (void)
-{
- vui = vec_xl (0, uip);
-}
-
-void foo26 (void)
-{
- vec_xst (vd, 0, dp);
-}
-
-void foo27 (void)
-{
- vec_xst (vsll, 0, sllp);
-}
-
-void foo28 (void)
-{
- vec_xst (vull, 0, ullp);
-}
-
-void foo29 (void)
-{
- vec_xst (vf, 0, fp);
-}
-
-void foo30 (void)
-{
- vec_xst (vsi, 0, sip);
-}
-
-void foo31 (void)
-{
- vec_xst (vui, 0, uip);
-}
+++ /dev/null
-/* { dg-do compile { target { powerpc64-*-* } } } */
-/* { dg-skip-if "do not override mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
-/* { dg-options "-mcpu=power9 -O0" } */
-/* { dg-require-effective-target powerpc_p9vector_ok } */
-/* { dg-skip-if "" { powerpc*-*-aix* } { "*" } { "" } } */
-/* { dg-final { scan-assembler-times "lxvx" 40 } } */
-/* { dg-final { scan-assembler-times "stxvx" 40 } } */
-
-#include <altivec.h>
-
-extern vector double vd, *vdp;
-extern vector signed long long vsll, *vsllp;
-extern vector unsigned long long vull, *vullp;
-extern vector float vf, *vfp;
-extern vector signed int vsi, *vsip;
-extern vector unsigned int vui, *vuip;
-extern vector signed short vss, *vssp;
-extern vector unsigned short vus, *vusp;
-extern vector signed char vsc, *vscp;
-extern vector unsigned char vuc, *vucp;
-extern double *dp;
-extern signed long long *sllp;
-extern unsigned long long *ullp;
-extern float *fp;
-extern signed int *sip;
-extern unsigned int *uip;
-extern signed short *ssp;
-extern unsigned short *usp;
-extern signed char *scp;
-extern unsigned char *ucp;
-
-void foo0 (void)
-{
- vd = vec_xl (0, vdp);
-}
-
-void foo1 (void)
-{
- vsll = vec_xl (0, vsllp);
-}
-
-void foo2 (void)
-{
- vull = vec_xl (0, vullp);
-}
-
-void foo3 (void)
-{
- vf = vec_xl (0, vfp);
-}
-
-void foo4 (void)
-{
- vsi = vec_xl (0, vsip);
-}
-
-void foo5 (void)
-{
- vui = vec_xl (0, vuip);
-}
-
-void foo6 (void)
-{
- vss = vec_xl (0, vssp);
-}
-
-void foo7 (void)
-{
- vus = vec_xl (0, vusp);
-}
-
-void foo8 (void)
-{
- vsc = vec_xl (0, vscp);
-}
-
-void foo9 (void)
-{
- vuc = vec_xl (0, vucp);
-}
-
-void foo10 (void)
-{
- vec_xst (vd, 0, vdp);
-}
-
-void foo11 (void)
-{
- vec_xst (vsll, 0, vsllp);
-}
-
-void foo12 (void)
-{
- vec_xst (vull, 0, vullp);
-}
-
-void foo13 (void)
-{
- vec_xst (vf, 0, vfp);
-}
-
-void foo14 (void)
-{
- vec_xst (vsi, 0, vsip);
-}
-
-void foo15 (void)
-{
- vec_xst (vui, 0, vuip);
-}
-
-void foo16 (void)
-{
- vec_xst (vss, 0, vssp);
-}
-
-void foo17 (void)
-{
- vec_xst (vus, 0, vusp);
-}
-
-void foo18 (void)
-{
- vec_xst (vsc, 0, vscp);
-}
-
-void foo19 (void)
-{
- vec_xst (vuc, 0, vucp);
-}
-
-void foo20 (void)
-{
- vd = vec_xl (0, dp);
-}
-
-void foo21 (void)
-{
- vsll = vec_xl (0, sllp);
-}
-
-void foo22 (void)
-{
- vull = vec_xl (0, ullp);
-}
-
-void foo23 (void)
-{
- vf = vec_xl (0, fp);
-}
-
-void foo24 (void)
-{
- vsi = vec_xl (0, sip);
-}
-
-void foo25 (void)
-{
- vui = vec_xl (0, uip);
-}
-
-void foo26 (void)
-{
- vss = vec_xl (0, ssp);
-}
-
-void foo27 (void)
-{
- vus = vec_xl (0, usp);
-}
-
-void foo28 (void)
-{
- vsc = vec_xl (0, scp);
-}
-
-void foo29 (void)
-{
- vuc = vec_xl (0, ucp);
-}
-
-void foo30 (void)
-{
- vec_xst (vd, 0, dp);
-}
-
-void foo31 (void)
-{
- vec_xst (vsll, 0, sllp);
-}
-
-void foo32 (void)
-{
- vec_xst (vull, 0, ullp);
-}
-
-void foo33 (void)
-{
- vec_xst (vf, 0, fp);
-}
-
-void foo34 (void)
-{
- vec_xst (vsi, 0, sip);
-}
-
-void foo35 (void)
-{
- vec_xst (vui, 0, uip);
-}
-
-void foo36 (void)
-{
- vec_xst (vss, 0, ssp);
-}
-
-void foo37 (void)
-{
- vec_xst (vus, 0, usp);
-}
-
-void foo38 (void)
-{
- vec_xst (vsc, 0, scp);
-}
-
-void foo39 (void)
-{
- vec_xst (vuc, 0, ucp);
-}
--- /dev/null
+! { dg-do run }
+!
+! Check PR fortran/70696 is fixed.
+
+program global_event
+ use iso_fortran_env , only : event_type
+ implicit none
+ type(event_type) :: x[*]
+
+ call exchange
+ contains
+ subroutine exchange
+ integer :: cnt
+ event post(x[1])
+ event post(x[1])
+ call event_query(x, cnt)
+ if (cnt /= 2) error stop 1
+ event wait(x, until_count=2)
+ end subroutine
+end
--- /dev/null
+! { dg-do run }
+!
+! Check that pr 70697 is fixed.
+
+program event_4
+ use iso_fortran_env
+ integer :: nc(1)
+ type(event_type) done[*]
+ nc(1) = 1
+ event post(done[1])
+ event wait(done,until_count=nc(1))
+end
--- /dev/null
+! { dg-do link }
+! { dg-options "-fcoarray=lib -lcaf_single" }
+
+program coarray_43
+ implicit none
+ integer, parameter :: STR_LEN = 50
+ character(len=STR_LEN) :: str[*]
+ integer :: pos
+ write(str,"(2(a,i2))") "Greetings from image ",this_image()," of ",num_images()
+ block
+ pos = scan(str[5], set="123456789")
+ end block
+end program
--- /dev/null
+! { dg-do compile }
+! { dg-options "-fcoarray=lib -lcaf_single" }
+
+! Check that pr70696 is really fixed.
+
+ use iso_fortran_env
+ type(event_type) :: x[*]
+
+ ! exchange must not be called or the link problem before the patch
+ ! does not occur.
+contains
+ subroutine exchange
+ event post (x[1])
+ end subroutine
+end
! { dg-error "Rightmost upper bound of assumed size array section not specified" "" { target *-*-* } 68 }
! { dg-error "'aas' in MAP clause at \\\(1\\\) is not a proper array section" "" { target *-*-* } 68 }
- !$omp target map(aas) ! { dg-error "The upper bound in the last dimension must appear" "" { xfail *-*-* } }
+ !$omp target map(aas) ! { dg-error "Assumed size array" }
!$omp end target
!$omp target map(aas(5:7))
--- /dev/null
+! PR fortran/78866
+! { dg-do compile }
+
+subroutine pr78866(x)
+ integer :: x(*)
+!$omp target map(x) ! { dg-error "Assumed size array" }
+ x(1) = 1
+!$omp end target
+!$omp target data map(tofrom: x) ! { dg-error "Assumed size array" }
+!$omp target update to(x) ! { dg-error "Assumed size array" }
+!$omp target update from(x) ! { dg-error "Assumed size array" }
+!$omp end target data
+!$omp target map(x(:23)) ! { dg-bogus "Assumed size array" }
+ x(1) = 1
+!$omp end target
+!$omp target map(x(:)) ! { dg-error "upper bound of assumed size array section" }
+ x(1) = 1 ! { dg-error "not a proper array section" "" { target *-*-* } .-1 }
+!$omp end target
+end
--- /dev/null
+! PR fortran/78866
+! { dg-do compile }
+
+subroutine pr78866(x)
+ integer :: x(*)
+!$omp target ! { dg-error "implicit mapping of assumed size array" }
+ x(1) = 1
+!$omp end target
+end
--- /dev/null
+-- { dg-do run }
+-- { dg-options "-O" }
+
+with Array26_Pkg; use Array26_Pkg;
+
+procedure Array26 is
+
+ function Get return Outer_type is
+ Ret : Outer_Type;
+ begin
+ Ret (Inner_Type'Range) := F;
+ return Ret;
+ end;
+
+ A : Outer_Type := Get;
+ B : Inner_Type := A (Inner_Type'Range);
+
+begin
+ if B /= "123" then
+ raise Program_Error;
+ end if;
+end;
--- /dev/null
+package body Array26_Pkg is
+
+ function F return Inner_Type is
+ begin
+ return "123";
+ end;
+
+end Array26_Pkg;
--- /dev/null
+package Array26_Pkg is
+
+ subtype Outer_Type is String (1 .. 4);
+ subtype Inner_Type is String (1 .. 3);
+
+ function F return Inner_Type;
+
+end Array26_Pkg;
--- /dev/null
+-- { dg-do run }
+-- { dg-options "-O" }
+
+with Array27_Pkg; use Array27_Pkg;
+
+procedure Array27 is
+
+ function Get return Outer_type is
+ Ret : Outer_Type;
+ begin
+ Ret (Inner_Type'Range) := F;
+ return Ret;
+ end;
+
+ A : Outer_Type := Get;
+ B : Inner_Type := A (Inner_Type'Range);
+
+begin
+ if B /= "123" then
+ raise Program_Error;
+ end if;
+end;
--- /dev/null
+package body Array27_Pkg is
+
+ function F return Inner_Type is
+ begin
+ return "123";
+ end;
+
+end Array27_Pkg;
--- /dev/null
+package Array27_Pkg is
+
+ subtype Outer_Type is String (1 .. 8);
+ subtype Inner_Type is String (1 .. 3);
+
+ function F return Inner_Type;
+
+end Array27_Pkg;
--- /dev/null
+-- { dg-do run }
+-- { dg-options "-O" }
+
+with Array28_Pkg; use Array28_Pkg;
+
+procedure Array28 is
+
+ function Get return Outer_type is
+ Ret : Outer_Type;
+ begin
+ Ret (Inner_Type'Range) := F;
+ return Ret;
+ end;
+
+ A : Outer_Type := Get;
+ B : Inner_Type := A (Inner_Type'Range);
+
+begin
+ if B /= "12345" then
+ raise Program_Error;
+ end if;
+end;
--- /dev/null
+package body Array28_Pkg is
+
+ function F return Inner_Type is
+ begin
+ return "12345";
+ end;
+
+end Array28_Pkg;
--- /dev/null
+package Array28_Pkg is
+
+ subtype Outer_Type is String (1 .. 8);
+ subtype Inner_Type is String (1 .. 5);
+
+ function F return Inner_Type;
+
+end Array28_Pkg;
if (EDGE_COUNT (join_tgt_in_edge_from_call->dest->preds) > 1)
join_tgt_bb = split_edge (join_tgt_in_edge_from_call);
else
- join_tgt_bb = join_tgt_in_edge_from_call->dest;
+ {
+ join_tgt_bb = join_tgt_in_edge_from_call->dest;
+ /* We may have degenerate PHIs in the destination. Propagate
+ those out. */
+ for (gphi_iterator i = gsi_start_phis (join_tgt_bb); !gsi_end_p (i);)
+ {
+ gphi *phi = i.phi ();
+ replace_uses_by (gimple_phi_result (phi),
+ gimple_phi_arg_def (phi, 0));
+ remove_phi_node (&i, true);
+ }
+ }
}
else
{
switch (TREE_CODE (chrec))
{
case POLYNOMIAL_CHREC:
- gcc_assert (TREE_CODE (CHREC_RIGHT (chrec)) == INTEGER_CST);
-
A[index][0] = mult * int_cst_value (CHREC_RIGHT (chrec));
return initialize_matrix_A (A, CHREC_LEFT (chrec), index + 1, mult);
if (targetm.have_tls)
set_decl_tls_model (ic_void_ptr_var, decl_default_tls_model (ic_void_ptr_var));
- varpool_node::finalize_decl (ic_void_ptr_var);
-
gcov_type_ptr = build_pointer_type (get_gcov_type ());
ic_gcov_type_ptr_var
DECL_INITIAL (ic_gcov_type_ptr_var) = NULL;
if (targetm.have_tls)
set_decl_tls_model (ic_gcov_type_ptr_var, decl_default_tls_model (ic_gcov_type_ptr_var));
-
- varpool_node::finalize_decl (ic_gcov_type_ptr_var);
}
/* Create the type and function decls for the interface with gcov. */
walker.walk (ENTRY_BLOCK_PTR_FOR_FN (cfun));
if (walker.fail)
{
+ scc_vn_restore_ssa_info ();
free_scc_vn ();
return false;
}
static enum ssa_prop_result
vrp_visit_assignment_or_call (gimple *stmt, tree *output_p)
{
- tree def, lhs;
- ssa_op_iter iter;
+ tree lhs;
enum gimple_code code = gimple_code (stmt);
lhs = gimple_get_lhs (stmt);
}
/* Every other statement produces no useful ranges. */
- FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_DEF)
- set_value_range_to_varying (get_value_range (def));
+ set_defs_to_varying (stmt);
return SSA_PROP_VARYING;
}
bool
cst_and_fits_in_hwi (const_tree x)
{
- if (TREE_CODE (x) != INTEGER_CST)
- return false;
-
- if (TYPE_PRECISION (TREE_TYPE (x)) > HOST_BITS_PER_WIDE_INT)
- return false;
-
- return TREE_INT_CST_NUNITS (x) == 1;
+ return (TREE_CODE (x) == INTEGER_CST
+ && (tree_fits_shwi_p (x) || tree_fits_uhwi_p (x)));
}
/* Build a newly constructed VECTOR_CST node of length LEN. */
expanded_location xloc = expand_location (loc);
if (xloc.file == NULL || strncmp (xloc.file, "\1", 2) == 0
- || xloc.file == '\0' || xloc.file[0] == '\xff'
+ || xloc.file[0] == '\0' || xloc.file[0] == '\xff'
|| xloc.file[1] == '\xff')
return false;
+2017-01-09 Andreas Tobler <andreast@gcc.gnu.org>
+
+ Backport from mainline
+ 2016-10-10 Andreas Tobler <andreast@gcc.gnu.org>
+
+ * config.host: Add support for aarch64-*-freebsd*.
+
2016-12-21 Release Manager
* GCC 6.3.0 released.
+2017-01-31 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/79305
+ * c99_protos.h: Spell HAVE_EXPL correctly.
+ * intrinsics/c99_functions.c: Ditto.
+
+2017-01-24 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/78478
+ * acinclude.m4: Include ../config/ax_check_define.m4
+ * configure.ac: Check if _SOFT_FLOAT is defined.
+ * configure.host (i?86 | x86_64): Use fpu-generic when
+ have_soft_float is set.
+ * configure: Regenerate.
+
2016-12-21 Release Manager
* GCC 6.3.0 released.
Backport from trunk
PR libgfortran/77707
- io/transfer.c (next_record): Flush before calculating next_record.
+ * io/transfer.c (next_record): Flush before calculating next_record.
Correctly calculate.
2016-09-28 Steven G. Kargl <kargl@gcc.gnu.org>
Backport from trunk
PR fortran/77507
- * ieee/ieee_arithmetic.F90 (IEEE_VALUE_4,IEEE_VALUE_8,IEEE_VALULE_10,
+ * ieee/ieee_arithmetic.F90 (IEEE_VALUE_4,IEEE_VALUE_8,IEEE_VALULE_10,
IEEE_VALUE_16): Use correct keyword.
2016-08-22 Release Manager
(read_logical): If '!' bang encountered when not in namelist mode got
bad_logical to give an error. (read_integer): Likewise reject '!'.
(read_character): Remove condition testing c = '!' which is now inside
- the is_separator macro. (parse_real): Reject '!' unless in namelist mode.
- (read_complex): Reject '!' unless in namelist mode. (read_real): Likewise
- reject '!'.
+ the is_separator macro. (parse_real): Reject '!' unless in
+ namelist mode.
+ (read_complex): Reject '!' unless in namelist mode.
+ (read_real): Likewise reject '!'.
2016-02-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>
m4_include(../config/acx.m4)
m4_include(../config/no-executables.m4)
m4_include(../config/math.m4)
+m4_include(../config/ax_check_define.m4)
dnl Check that we have a working GNU Fortran compiler
AC_DEFUN([LIBGFOR_WORKING_GFORTRAN], [
extern double complex cexp (double complex);
#endif
-#if !defined(HAVE_CEXPL) && defined(HAVE_COSL) && defined(HAVE_SINL) && defined(EXPL)
+#if !defined(HAVE_CEXPL) && defined(HAVE_COSL) && defined(HAVE_SINL) && defined(HAVE_EXPL)
#define HAVE_CEXPL 1
extern long double complex cexpl (long double complex);
#endif
void *local;
if (type == CAF_REGTYPE_LOCK_STATIC || type == CAF_REGTYPE_LOCK_ALLOC
- || type == CAF_REGTYPE_CRITICAL || type == CAF_REGTYPE_EVENT_STATIC
- || type == CAF_REGTYPE_EVENT_ALLOC)
- local = calloc (size, sizeof (bool));
+ || type == CAF_REGTYPE_CRITICAL)
+ local = calloc (size, sizeof (bool));
+ else if (type == CAF_REGTYPE_EVENT_STATIC || type == CAF_REGTYPE_EVENT_ALLOC)
+ /* In the event_(wait|post) function the counter for events is a uint32,
+ so better allocate enough memory here. */
+ local = calloc (size, sizeof (uint32_t));
else
local = malloc (size);
*token = malloc (sizeof (single_token_t));
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
export_symbols_cmds_FC='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
- export_symbols_cmds_FC='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds_FC='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
fi
+# Check if _SOFT_FLOAT is defined
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _SOFT_FLOAT defined" >&5
+$as_echo_n "checking for _SOFT_FLOAT defined... " >&6; }
+if test "${ac_cv_defined__SOFT_FLOAT+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ #ifdef _SOFT_FLOAT
+ int ok;
+ #else
+ choke me
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_defined__SOFT_FLOAT=yes
+else
+ ac_cv_defined__SOFT_FLOAT=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_defined__SOFT_FLOAT" >&5
+$as_echo "$ac_cv_defined__SOFT_FLOAT" >&6; }
+if test $ac_cv_defined__SOFT_FLOAT != "no"; then :
+ have_soft_float=yes
+fi
+
# Runs configure.host to set up necessary host-dependent shell variables.
# We then display a message about it, and propagate them through the
# build chain.
AC_CHECK_FUNC([fp_trap],[have_fp_trap=yes AC_DEFINE([HAVE_FP_TRAP],[1],[fp_trap is present])])
AC_CHECK_FUNC([fp_enable],[have_fp_enable=yes AC_DEFINE([HAVE_FP_ENABLE],[1],[fp_enable is present])])
+# Check if _SOFT_FLOAT is defined
+AC_CHECK_DEFINE([_SOFT_FLOAT],[have_soft_float=yes])
+
# Runs configure.host to set up necessary host-dependent shell variables.
# We then display a message about it, and propagate them through the
# build chain.
# the x86 denormal exception.
case "${host_cpu}" in
i?86 | x86_64)
- fpu_host='fpu-387'
+ if test "x${have_soft_float}" = "xyes"; then
+ fpu_host='fpu-generic'
+ else
+ fpu_host='fpu-387'
+ fi
ieee_support='yes'
;;
esac
}
#endif
-#if !defined(HAVE_CEXPL) && defined(HAVE_COSL) && defined(HAVE_SINL) && defined(EXPL)
+#if !defined(HAVE_CEXPL) && defined(HAVE_COSL) && defined(HAVE_SINL) && defined(HAVE_EXPL)
#define HAVE_CEXPL 1
long double complex cexpl (long double complex z);
sizeof REFLECTION - 1
};
-const uintptr unsafe_Pointer_gc[] = {sizeof(void*), GC_APTR, 0, GC_END};
+const uintptr unsafe_Pointer_gc[] __attribute__((aligned(4))) =
+ {sizeof(void*), GC_APTR, 0, GC_END};
const struct __go_type_descriptor unsafe_Pointer =
{
struct ParForThread
{
// the thread's iteration space [32lsb, 32msb)
- uint64 pos;
+ uint64 pos __attribute__((aligned(8)));
// stats
uint64 nsteal;
uint64 nstealcnt;
// Futex-based impl treats it as uint32 key,
// while sema-based impl as M* waitm.
// Used to be a union, but unions break precise GC.
- uintptr key;
+ uintptr key __attribute__((aligned(4)));
};
struct Note
{
// Futex-based impl treats it as uint32 key,
// while sema-based impl as M* waitm.
// Used to be a union, but unions break precise GC.
- uintptr key;
+ uintptr key __attribute__((aligned(4)));
};
struct String
{
// otherwise parfor may return while other threads are still working
ParForThread *thr; // array of thread descriptors
// stats
- uint64 nsteal;
+ uint64 nsteal __attribute__((aligned(8))); // force alignment for m68k
uint64 nstealcnt;
uint64 nprocyield;
uint64 nosyield;
+2017-01-10 Thomas Schwinge <thomas@codesourcery.com>
+
+ Backport trunk r239125:
+ 2016-08-04 Thomas Schwinge <thomas@codesourcery.com>
+
+ * testsuite/libgomp.oacc-c-c++-common/crash-1.c: Make it a "link"
+ test, and don't hardcode -O0.
+
+ Backport trunk r239086:
+ 2016-08-03 Nathan Sidwell <nathan@codesourcery.com>
+
+ * testsuite/libgomp.oacc-c-c++-common/crash-1.c: New.
+
2016-12-21 Release Manager
* GCC 6.3.0 released.
--- /dev/null
+/* { dg-do link } */
+
+/* For -O0, ICEd in nvptx backend due to unexpected frame size. */
+#pragma acc routine worker
+void
+worker_matmul (int *c, int i)
+{
+ int j;
+
+#pragma acc loop
+ for (j = 0; j < 4; j++)
+ c[j] = j;
+}
+
+
+int
+main ()
+{
+ int c[4];
+
+#pragma acc parallel
+ {
+ worker_matmul (c, 0);
+ }
+
+ return 0;
+}
+2017-02-01 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/78346
+ * include/bits/predefined_ops.h (_Iter_equals_iter): Store iterator
+ not its referent.
+ (_Iter_comp_to_iter): Likewise.
+ * testsuite/25_algorithms/search/78346.cc: New test.
+
+ PR libstdc++/79195
+ * include/experimental/array (make_array): Use common_type<_Dest>
+ and delay instantiation of common_type until after conditional_t.
+ Qualify std::forward call.
+ (to_array): Add exception specification.
+ * testsuite/experimental/array/make_array.cc: Test argument types
+ without a common type.
+
+ PR libstdc++/79254
+ * include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI]
+ (basic_string::operator=(const basic_string&)): If source object is
+ small just deallocate, otherwise perform new allocation before
+ making any changes.
+ * testsuite/21_strings/basic_string/allocator/wchar_t/copy_assign.cc:
+ Test exception-safety of copy assignment when allocator propagates.
+ * testsuite/21_strings/basic_string/allocator/char/copy_assign.cc:
+ Likewise.
+ * testsuite/util/testsuite_allocator.h (uneq_allocator::swap): Make
+ std::swap visible.
+
+2017-01-22 Gerald Pfeifer <gerald@pfeifer.com>
+
+ Backport from mainline
+ 2017-01-01 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * doc/xml/faq.xml: Update address of C++ ABI link.
+ * doc/xml/manual/abi.xml: Ditto.
+
+2017-01-16 Ville Voutilainen <ville.voutilainen@gmail.com>
+
+ Backport from mainline
+ 2017-01-16 Ville Voutilainen <ville.voutilainen@gmail.com>
+
+ PR libstdc++/78389
+ * include/bits/list.tcc (merge(list&&)): Fix backwards size adjustments.
+ (merge(list&&, _StrictWeakOrdering)): Likewise.
+ * testsuite/23_containers/list/operations/78389.cc: Add
+ better test for the sizes.
+
+2017-01-15 Ville Voutilainen <ville.voutilainen@gmail.com>
+
+ Backport from mainline
+ 2017-01-13 Ville Voutilainen <ville.voutilainen@gmail.com>
+
+ PR libstdc++/78389
+ * include/bits/list.tcc (merge(list&&)):
+ Adjust list sizes if the comparator throws.
+ (merge(list&&, _StrictWeakOrdering)): Likewise.
+ * testsuite/23_containers/list/operations/78389.cc: New.
+
+2017-01-15 Ville Voutilainen <ville.voutilainen@gmail.com>
+
+ Backport from mainline
+ 2016-12-19 Ville Voutilainen <ville.voutilainen@gmail.com>
+
+ Make the perfect-forwarding constructor of a two-element tuple
+ sfinae away when the first argument is an allocator_arg.
+ * include/std/tuple (tuple(_U1&&, _U2&&)): Constrain.
+ * testsuite/20_util/tuple/cons/allocator_with_any.cc: New.
+
2017-01-06 Jonathan Wakely <jwakely@redhat.com>
Backport from mainline
details than for C, and most CPU designers (for good reasons elaborated
below) have not stepped up to publish C++ ABIs. Such an ABI has been
defined for the Itanium architecture (see
- <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.codesourcery.com/cxx-abi/">C++
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://mentorembedded.github.io/cxx-abi/">C++
ABI for Itanium</link>) and that is used by G++ and other compilers
as the de facto standard ABI on many common architectures (including x86).
G++ can also use the ARM architecture's EABI, for embedded
virtual functions, etc. These details are defined as the compiler
Application Binary Interface, or ABI. The GNU C++ compiler uses an
industry-standard C++ ABI starting with version 3. Details can be
- found in the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://mentorembedded.github.com/cxx-abi/abi.html">ABI
+ found in the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://mentorembedded.github.io/cxx-abi/abi.html">ABI
specification</link>.
</para>
the way the compiler deals with this class in by-value return
statements or parameters: instead of passing instances of this
class in registers, the compiler will be forced to use memory. See the
-section on <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://mentorembedded.github.com/cxx-abi/abi.html#calls">Function
+section on <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://mentorembedded.github.io/cxx-abi/abi.html#calls">Function
Calling Conventions and APIs</link>
of the C++ ABI documentation for further details.
</para></listitem>
<biblioentry xml:id="biblio.cxxabi">
<title>
<link xmlns:xlink="http://www.w3.org/1999/xlink"
- xlink:href="http://www.codesourcery.com/cxx-abi/">
+ xlink:href="http://mentorembedded.github.io/cxx-abi/">
C++ ABI Summary
</link>
</title>
if (!_Alloc_traits::_S_always_equal() && !_M_is_local()
&& _M_get_allocator() != __str._M_get_allocator())
{
- // replacement allocator cannot free existing storage
- _M_destroy(_M_allocated_capacity);
- _M_data(_M_local_data());
- _M_set_length(0);
+ // Propagating allocator cannot free existing storage so must
+ // deallocate it before replacing current allocator.
+ if (__str.size() <= _S_local_capacity)
+ {
+ _M_destroy(_M_allocated_capacity);
+ _M_data(_M_local_data());
+ _M_set_length(0);
+ }
+ else
+ {
+ const auto __len = __str.size();
+ auto __alloc = __str._M_get_allocator();
+ // If this allocation throws there are no effects:
+ auto __ptr = _Alloc_traits::allocate(__alloc, __len + 1);
+ _M_destroy(_M_allocated_capacity);
+ _M_data(__ptr);
+ _M_capacity(__len);
+ _M_set_length(__len);
+ }
}
std::__alloc_on_copy(_M_get_allocator(), __str._M_get_allocator());
}
// 300. list::merge() specification incomplete
if (this != std::__addressof(__x))
{
- _M_check_equal_allocators(__x);
+ _M_check_equal_allocators(__x);
iterator __first1 = begin();
iterator __last1 = end();
iterator __first2 = __x.begin();
iterator __last2 = __x.end();
- while (__first1 != __last1 && __first2 != __last2)
- if (*__first2 < *__first1)
- {
- iterator __next = __first2;
- _M_transfer(__first1, __first2, ++__next);
- __first2 = __next;
- }
- else
- ++__first1;
- if (__first2 != __last2)
- _M_transfer(__last1, __first2, __last2);
+ size_t __orig_size = __x.size();
+ __try {
+ while (__first1 != __last1 && __first2 != __last2)
+ if (*__first2 < *__first1)
+ {
+ iterator __next = __first2;
+ _M_transfer(__first1, __first2, ++__next);
+ __first2 = __next;
+ }
+ else
+ ++__first1;
+ if (__first2 != __last2)
+ _M_transfer(__last1, __first2, __last2);
- this->_M_inc_size(__x._M_get_size());
- __x._M_set_size(0);
+ this->_M_inc_size(__x._M_get_size());
+ __x._M_set_size(0);
+ }
+ __catch(...)
+ {
+ size_t __dist = distance(__first2, __last2);
+ this->_M_inc_size(__orig_size - __dist);
+ __x._M_set_size(__dist);
+ __throw_exception_again;
+ }
}
}
iterator __last1 = end();
iterator __first2 = __x.begin();
iterator __last2 = __x.end();
- while (__first1 != __last1 && __first2 != __last2)
- if (__comp(*__first2, *__first1))
- {
- iterator __next = __first2;
- _M_transfer(__first1, __first2, ++__next);
- __first2 = __next;
- }
- else
- ++__first1;
- if (__first2 != __last2)
- _M_transfer(__last1, __first2, __last2);
-
- this->_M_inc_size(__x._M_get_size());
- __x._M_set_size(0);
+ size_t __orig_size = __x.size();
+ __try
+ {
+ while (__first1 != __last1 && __first2 != __last2)
+ if (__comp(*__first2, *__first1))
+ {
+ iterator __next = __first2;
+ _M_transfer(__first1, __first2, ++__next);
+ __first2 = __next;
+ }
+ else
+ ++__first1;
+ if (__first2 != __last2)
+ _M_transfer(__last1, __first2, __last2);
+
+ this->_M_inc_size(__x._M_get_size());
+ __x._M_set_size(0);
+ }
+ __catch(...)
+ {
+ size_t __dist = distance(__first2, __last2);
+ this->_M_inc_size(__orig_size - __dist);
+ __x._M_set_size(__dist);
+ __throw_exception_again;
+ }
}
}
/** @file predefined_ops.h
* This is an internal header file, included by other library headers.
- * You should not attempt to use it directly.
+ * You should not attempt to use it directly. @headername{algorithm}
*/
#ifndef _GLIBCXX_PREDEFINED_OPS_H
template<typename _Iterator1>
struct _Iter_equals_iter
{
- typename std::iterator_traits<_Iterator1>::reference _M_ref;
+ _Iterator1 _M_it1;
explicit
_Iter_equals_iter(_Iterator1 __it1)
- : _M_ref(*__it1)
+ : _M_it1(__it1)
{ }
template<typename _Iterator2>
bool
operator()(_Iterator2 __it2)
- { return *__it2 == _M_ref; }
+ { return *__it2 == *_M_it1; }
};
template<typename _Iterator>
struct _Iter_comp_to_iter
{
_Compare _M_comp;
- typename std::iterator_traits<_Iterator1>::reference _M_ref;
+ _Iterator1 _M_it1;
_Iter_comp_to_iter(_Compare __comp, _Iterator1 __it1)
- : _M_comp(__comp), _M_ref(*__it1)
+ : _M_comp(__comp), _M_it1(__it1)
{ }
template<typename _Iterator2>
bool
operator()(_Iterator2 __it2)
- { return bool(_M_comp(*__it2, _M_ref)); }
+ { return bool(_M_comp(*__it2, *_M_it1)); }
};
template<typename _Compare, typename _Iterator>
template <typename _Dest = void, typename... _Types>
constexpr auto
make_array(_Types&&... __t)
- -> array<conditional_t<is_void_v<_Dest>,
- common_type_t<_Types...>,
- _Dest>,
+ -> array<typename conditional_t<is_void_v<_Dest>,
+ common_type<_Types...>,
+ common_type<_Dest>>::type,
sizeof...(_Types)>
{
static_assert(__or_<
::value,
"make_array cannot be used without an explicit target type "
"if any of the types given is a reference_wrapper");
- return {{forward<_Types>(__t)...}};
+ return {{ std::forward<_Types>(__t)... }};
}
template <typename _Tp, size_t _Nm, size_t... _Idx>
constexpr array<remove_cv_t<_Tp>, _Nm>
- __to_array(_Tp (&__a)[_Nm],
- index_sequence<_Idx...>)
+ __to_array(_Tp (&__a)[_Nm], index_sequence<_Idx...>)
{
return {{__a[_Idx]...}};
}
template <typename _Tp, size_t _Nm>
constexpr array<remove_cv_t<_Tp>, _Nm>
to_array(_Tp (&__a)[_Nm])
+ noexcept(is_nothrow_constructible<remove_cv_t<_Tp>, _Tp&>::value)
{
return __to_array(__a, make_index_sequence<_Nm>{});
}
enable_if<_TMC::template
_MoveConstructibleTuple<_U1, _U2>()
&& _TMC::template
- _ImplicitlyMoveConvertibleTuple<_U1, _U2>(),
+ _ImplicitlyMoveConvertibleTuple<_U1, _U2>()
+ && !is_same<typename decay<_U1>::type,
+ allocator_arg_t>::value,
bool>::type = true>
constexpr tuple(_U1&& __a1, _U2&& __a2)
: _Inherited(std::forward<_U1>(__a1), std::forward<_U2>(__a2)) { }
enable_if<_TMC::template
_MoveConstructibleTuple<_U1, _U2>()
&& !_TMC::template
- _ImplicitlyMoveConvertibleTuple<_U1, _U2>(),
+ _ImplicitlyMoveConvertibleTuple<_U1, _U2>()
+ && !is_same<typename decay<_U1>::type,
+ allocator_arg_t>::value,
bool>::type = false>
explicit constexpr tuple(_U1&& __a1, _U2&& __a2)
: _Inherited(std::forward<_U1>(__a1), std::forward<_U2>(__a2)) { }
--- /dev/null
+// { dg-do run { target c++14 } }
+
+// Copyright (C) 2016 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+
+// NOTE: This makes use of the fact that we know how moveable
+// is implemented on tuple. If the implementation changed
+// this test may begin to fail.
+
+#include <tuple>
+#include <experimental/any>
+#include <testsuite_hooks.h>
+
+using std::experimental::any;
+
+void test01()
+{
+ std::tuple<any, any> t(std::allocator_arg,
+ std::allocator<any>{});
+ VERIFY(std::get<0>(t).empty());
+ VERIFY(std::get<1>(t).empty());
+}
+
+int main()
+{
+ test01();
+}
-// Copyright (C) 2015-2016 Free Software Foundation, Inc.
+// Copyright (C) 2015-2017 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
#include <string>
#include <testsuite_hooks.h>
#include <testsuite_allocator.h>
+#include <ext/throw_allocator.h>
#if _GLIBCXX_USE_CXX11_ABI
using C = char;
VERIFY(1 == v5.get_allocator().get_personality());
}
+void test03()
+{
+ // PR libstdc++/79254
+ using throw_alloc = __gnu_cxx::throw_allocator_limit<C>;
+ typedef propagating_allocator<C, true, throw_alloc> alloc_type;
+ typedef std::basic_string<C, traits, alloc_type> test_type;
+ alloc_type a1(1), a2(2);
+ throw_alloc::set_limit(2); // Throw on third allocation (during assignment).
+ const C* s1 = "a string that is longer than a small string";
+ const C* s2 = "another string that is longer than a small string";
+ test_type v1(s1, a1);
+ test_type v2(s2, a2);
+ bool caught = false;
+ try {
+ v1 = v2;
+ } catch (__gnu_cxx::forced_error&) {
+ caught = true;
+ }
+ VERIFY( caught );
+ VERIFY( v1 == s1 );
+ VERIFY( v1.get_allocator() == a1 );
+
+ throw_alloc::set_limit(1); // Allow one more allocation (and no more).
+ test_type v3(s1, a1);
+ // No allocation when allocators are equal and capacity is sufficient:
+ VERIFY( v1.capacity() >= v3.size() );
+ v1 = v3;
+ // No allocation when the contents fit in the small-string buffer:
+ v2 = "sso";
+ v1 = v2;
+ VERIFY( v1.get_allocator() == a2 );
+}
+
int main()
{
test01();
test02();
+ test03();
return 0;
}
#else
-// Copyright (C) 2015-2016 Free Software Foundation, Inc.
+// Copyright (C) 2015-2017 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
#include <string>
#include <testsuite_hooks.h>
#include <testsuite_allocator.h>
+#include <ext/throw_allocator.h>
#if _GLIBCXX_USE_CXX11_ABI
using C = wchar_t;
VERIFY(1 == v5.get_allocator().get_personality());
}
+void test03()
+{
+ // PR libstdc++/79254
+ using throw_alloc = __gnu_cxx::throw_allocator_limit<C>;
+ typedef propagating_allocator<C, true, throw_alloc> alloc_type;
+ typedef std::basic_string<C, traits, alloc_type> test_type;
+ alloc_type a1(1), a2(2);
+ throw_alloc::set_limit(2); // Throw on third allocation (during assignment).
+ const C* s1 = L"a string that is longer than a small string";
+ const C* s2 = L"another string that is longer than a small string";
+ test_type v1(s1, a1);
+ test_type v2(s2, a2);
+ bool caught = false;
+ try {
+ v1 = v2;
+ } catch (__gnu_cxx::forced_error&) {
+ caught = true;
+ }
+ VERIFY( caught );
+ VERIFY( v1 == s1 );
+ VERIFY( v1.get_allocator() == a1 );
+
+ throw_alloc::set_limit(1); // Allow one more allocation (and no more).
+ test_type v3(s1, a1);
+ // No allocation when allocators are equal and capacity is sufficient:
+ VERIFY( v1.capacity() >= v3.size() );
+ v1 = v3;
+ // No allocation when the contents fit in the small-string buffer:
+ v2 = L"sso";
+ v1 = v2;
+ VERIFY( v1.get_allocator() == a2 );
+}
+
int main()
{
test01();
test02();
+ test03();
return 0;
}
#else
--- /dev/null
+// { dg-do run { target c++11 } }
+
+// Copyright (C) 2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// 23.2.2.4 list operations [lib.list.ops]
+
+#include <testsuite_hooks.h>
+
+#include <list>
+
+struct ThrowingComparator
+{
+ unsigned int throw_after = 0;
+ unsigned int count = 0;
+ bool operator()(int, int) {
+ if (++count >= throw_after) {
+ throw 666;
+ }
+ return true;
+ }
+};
+
+struct X
+{
+ X() = default;
+ X(int) {}
+};
+
+unsigned int throw_after_X = 0;
+unsigned int count_X = 0;
+
+bool operator<(const X&, const X&) {
+ if (++count_X >= throw_after_X) {
+ throw 666;
+ }
+ return true;
+}
+
+
+int main()
+{
+ std::list<int> a{1, 2, 3, 4};
+ std::list<int> b{5, 6, 7, 8, 9, 10, 11, 12};
+ try {
+ a.merge(b, ThrowingComparator{4});
+ } catch (...) {
+ }
+ VERIFY(a.size() == std::distance(a.begin(), a.end()) &&
+ b.size() == std::distance(b.begin(), b.end()));
+ std::list<X> ax{1, 2, 3, 4};
+ std::list<X> bx{5, 6, 7, 8, 9, 10, 11, 12};
+ throw_after_X = 4;
+ try {
+ ax.merge(bx);
+ } catch (...) {
+ }
+ VERIFY(ax.size() == std::distance(ax.begin(), ax.end()) &&
+ bx.size() == std::distance(bx.begin(), bx.end()));
+}
--- /dev/null
+// Copyright (C) 2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do run { target c++11 } }
+
+#include <algorithm>
+#include <testsuite_hooks.h>
+
+bool values[100];
+
+unsigned next_id()
+{
+ static unsigned counter = 0;
+ VERIFY(counter < 100);
+ return counter++;
+}
+
+struct value
+{
+ int val;
+ const unsigned id;
+
+ value(int i = 0) : val(i), id(next_id()) { values[id] = true; }
+ value(const value& v) : val(v.val), id(next_id()) { values[id] = true; }
+ value& operator=(const value& v) { val = v.val; return *this; }
+ ~value() { values[id] = false; }
+};
+
+bool operator<(const value& lhs, const value& rhs)
+{
+ if (!values[lhs.id])
+ throw lhs.id;
+ if (!values[rhs.id])
+ throw rhs.id;
+ return lhs.val < rhs.val;
+}
+
+bool operator==(const value& lhs, const value& rhs)
+{
+ if (!values[lhs.id])
+ throw lhs.id;
+ if (!values[rhs.id])
+ throw rhs.id;
+ return lhs.val == rhs.val;
+}
+
+// A forward iterator that fails to meet the requirement that for any
+// two dereferenceable forward iterators, a == b implies &*a == &*b
+struct stashing_iterator
+{
+ typedef std::forward_iterator_tag iterator_category;
+ typedef value value_type;
+ typedef value_type const* pointer;
+ typedef value_type const& reference;
+ typedef std::ptrdiff_t difference_type;
+
+ stashing_iterator() : ptr(), stashed() { }
+ stashing_iterator(pointer p) : ptr(p), stashed() { stash(); }
+ stashing_iterator(const stashing_iterator&) = default;
+ stashing_iterator& operator=(const stashing_iterator&) = default;
+
+ stashing_iterator& operator++()
+ {
+ ++ptr;
+ stash();
+ return *this;
+ }
+
+ stashing_iterator operator++(int)
+ {
+ stashing_iterator i = *this;
+ ++*this;
+ return i;
+ }
+
+ reference operator*() const { return stashed; }
+ pointer operator->() const { return &**this; }
+
+ bool operator==(const stashing_iterator& i) const { return ptr == i.ptr; }
+ bool operator!=(const stashing_iterator& i) const { return !(*this == i); }
+
+private:
+ void stash()
+ {
+ if (ptr)
+ stashed = *ptr;
+ }
+
+ pointer ptr;
+ value_type stashed;
+};
+
+void
+test01()
+{
+ value s[] = { 0, 1, 2, 3, 4, 5 };
+ std::search(s, s+6, stashing_iterator(s), stashing_iterator(s+4));
+}
+
+int
+main()
+{
+ test01();
+}
-// { dg-options "-std=gnu++14" }
-// { dg-do compile }
+// { dg-do compile { target c++14 } }
-// Copyright (C) 2015-2016 Free Software Foundation, Inc.
+// Copyright (C) 2015-2017 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// <http://www.gnu.org/licenses/>.
#include <experimental/array>
+#include <functional> // for std::ref and std::reference_wrapper
struct MoveOnly
{
MoveOnly& operator=(MoveOnly&&) = default;
};
-int main()
+void test01()
{
char x[42];
std::array<char, 42> y = std::experimental::to_array(x);
= std::experimental::make_array(1,2L, 3);
constexpr std::array<MoveOnly, 1> zzz2 = std::experimental::make_array(MoveOnly{});
}
+
+void test02()
+{
+ // PR libstdc++/79195
+ struct A {};
+ struct B : A {};
+ struct C : A {};
+ auto arr = std::experimental::make_array<A>(B{}, C{});
+ static_assert(std::is_same<decltype(arr), std::array<A, 2>>::value, "");
+}
Alloc& base() { return *this; }
const Alloc& base() const { return *this; }
- void swap_base(Alloc& b) { swap(b, this->base()); }
+ void swap_base(Alloc& b) { using std::swap; swap(b, this->base()); }
public:
typedef typename check_consistent_alloc_value_type<Tp, Alloc>::value_type