aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-17 14:03:10 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-17 14:03:10 +0000
commita7a27ac310788128a0bc0acb83fc8df2d853cfde (patch)
treed2d5cc286cf9e2b1f8d1c7776ca82e5f576669f8
parentd0fd9a0f3de12bc6aa6d450c3210436d9665d58a (diff)
parentf1af94c2a49dece759b2561caf52ef3fcf84b6ed (diff)
Merged r166086 through r168904 into branch.ix86/gcc-4_4-branch
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/ix86/gcc-4_4-branch@168905 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--fixincludes/ChangeLog9
-rw-r--r--fixincludes/fixincl.x53
-rw-r--r--fixincludes/inclhack.def18
-rw-r--r--fixincludes/tests/base/pthread.h7
-rw-r--r--gcc/ChangeLog241
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/builtins.c53
-rw-r--r--gcc/cfgloopmanip.c5
-rw-r--r--gcc/config/alpha/alpha.h6
-rw-r--r--gcc/config/alpha/osf-unwind.h329
-rw-r--r--gcc/config/alpha/osf.h12
-rw-r--r--gcc/config/arm/arm.c1
-rw-r--r--gcc/config/i386/avxintrin.h32
-rw-r--r--gcc/config/i386/i386.c125
-rw-r--r--gcc/config/i386/i386.h4
-rw-r--r--gcc/config/i386/i386.md44
-rw-r--r--gcc/config/i386/sol2.h5
-rw-r--r--gcc/config/i386/sse.md8
-rw-r--r--gcc/config/i386/xmmintrin.h12
-rw-r--r--gcc/config/mips/iris.h5
-rw-r--r--gcc/config/pa/pa.c181
-rw-r--r--gcc/config/pa/pa.md18
-rw-r--r--gcc/config/rs6000/rs6000.c11
-rw-r--r--gcc/config/rs6000/rs6000.md4
-rw-r--r--gcc/config/rs6000/sysv4.h2
-rwxr-xr-xgcc/configure12
-rw-r--r--gcc/configure.ac12
-rw-r--r--gcc/cp/ChangeLog9
-rw-r--r--gcc/cp/decl.c2
-rw-r--r--gcc/dse.c4
-rw-r--r--gcc/expr.c5
-rw-r--r--gcc/fortran/ChangeLog45
-rw-r--r--gcc/fortran/simplify.c8
-rw-r--r--gcc/fortran/target-memory.c11
-rw-r--r--gcc/fortran/trans-common.c1
-rw-r--r--gcc/fortran/trans-decl.c10
-rw-r--r--gcc/fortran/trans-expr.c23
-rw-r--r--gcc/fortran/trans-openmp.c38
-rw-r--r--gcc/gimplify.c7
-rw-r--r--gcc/jump.c8
-rw-r--r--gcc/rtl.c10
-rw-r--r--gcc/testsuite/ChangeLog166
-rwxr-xr-xgcc/testsuite/ada/acats/run_acats6
-rw-r--r--gcc/testsuite/c-c++-common/pr43690.c13
-rw-r--r--gcc/testsuite/g++.dg/cpp/_Pragma1.C2
-rw-r--r--gcc/testsuite/g++.dg/eh/spbp.C2
-rw-r--r--gcc/testsuite/g++.dg/other/error34.C6
-rw-r--r--gcc/testsuite/g++.dg/other/pragma-ep-1.C4
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr46107.c16
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr46534.c17
-rw-r--r--gcc/testsuite/gcc.dg/20061124-1.c1
-rw-r--r--gcc/testsuite/gcc.dg/vect/pr46663.c14
-rw-r--r--gcc/testsuite/gcc.target/arm/pr45447.c3
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-1.c31
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-2.c33
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-1.c7
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-2.c5
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-vmaskmovps-1.c31
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-vmaskmovps-2.c33
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-1.c5
-rw-r--r--gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-2.c5
-rw-r--r--gcc/testsuite/gcc.target/i386/i386.exp17
-rw-r--r--gcc/testsuite/gcc.target/i386/pr45852.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/pr46419.c39
-rw-r--r--gcc/testsuite/gcc.target/i386/pr46865-1.c31
-rw-r--r--gcc/testsuite/gcc.target/i386/pr46865-2.c32
-rw-r--r--gcc/testsuite/gcc.target/i386/pr46880.c28
-rw-r--r--gcc/testsuite/gfortran.dg/cray_pointers_2.f901
-rw-r--r--gcc/testsuite/gfortran.dg/derived_array_intrinisics_1.f9033
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_66.f9040
-rw-r--r--gcc/testsuite/gfortran.dg/power2.f9025
-rw-r--r--gcc/testsuite/gfortran.dg/transfer_simplify_10.f9034
-rw-r--r--gcc/testsuite/gfortran.dg/volatile12.f9016
-rw-r--r--gcc/testsuite/gnat.dg/aliasing2.adb2
-rw-r--r--gcc/testsuite/gnat.dg/pack9.adb2
-rw-r--r--gcc/testsuite/lib/prune.exp5
-rw-r--r--gcc/testsuite/objc.dg/dwarf-1.m2
-rw-r--r--gcc/testsuite/objc.dg/dwarf-2.m2
-rw-r--r--gcc/tree-vect-patterns.c3
-rw-r--r--libcpp/ChangeLog7
-rw-r--r--libcpp/directives.c9
-rw-r--r--libffi/ChangeLog7
-rwxr-xr-xlibffi/configure4
-rw-r--r--libffi/configure.ac4
-rw-r--r--libgfortran/ChangeLog14
-rw-r--r--libgfortran/io/list_read.c10
-rw-r--r--libgfortran/io/transfer.c3
-rw-r--r--libgomp/ChangeLog34
-rw-r--r--libgomp/configure.tgt4
-rw-r--r--libgomp/parallel.c3
-rw-r--r--libgomp/testsuite/libgomp.fortran/allocatable6.f9045
-rw-r--r--libgomp/testsuite/libgomp.fortran/pr46753.f9017
-rw-r--r--libgomp/testsuite/libgomp.fortran/vla8.f901
-rw-r--r--libjava/ChangeLog19
-rw-r--r--libjava/testsuite/libjava.jni/jni.exp4
-rw-r--r--libjava/testsuite/libjava.jvmti/jvmti-interp.exp4
-rw-r--r--libjava/testsuite/libjava.jvmti/jvmti.exp4
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/testsuite/lib/libstdc++.exp9
99 files changed, 2068 insertions, 259 deletions
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog
index 88e68304870..680bc3f9386 100644
--- a/fixincludes/ChangeLog
+++ b/fixincludes/ChangeLog
@@ -1,3 +1,12 @@
+2010-12-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ Backport from mainline:
+ 2010-11-09 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * inclhack.def (irix_pthread_init): New fix.
+ * fixincl.x: Regenerate.
+ * tests/base/pthread.h [IRIX_PTHREAD_INIT_CHECK]: New test.
+
2010-10-21 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Backport from mainline:
diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index 81f58fe9ff2..44b4c8fa1a8 100644
--- a/fixincludes/fixincl.x
+++ b/fixincludes/fixincl.x
@@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
- * It has been AutoGen-ed Wednesday October 20, 2010 at 07:49:38 PM MEST
+ * It has been AutoGen-ed Thursday December 9, 2010 at 04:55:48 PM MET
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT SVN-MERGE THIS FILE, EITHER Wed Oct 20 19:49:38 MEST 2010
+/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Dec 9 16:55:48 MET 2010
*
* You must regenerate it. Use the ./genfixes script.
*
@@ -15,7 +15,7 @@
* 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 184 fixup descriptions.
+ * This file contains 185 fixup descriptions.
*
* See README for more information.
*
@@ -3862,6 +3862,43 @@ static const char* apzIrix_Limits_ConstPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Irix_Pthread_Init fix
+ */
+tSCC zIrix_Pthread_InitName[] =
+ "irix_pthread_init";
+
+/*
+ * File name selection pattern
+ */
+tSCC zIrix_Pthread_InitList[] =
+ "pthread.h\0";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzIrix_Pthread_InitMachs[] = {
+ "mips-sgi-irix6.5",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zIrix_Pthread_InitSelect0[] =
+ "^(#define[ \t]+PTHREAD_.*_INITIALIZER[ \t]+)(\\{ 0 \\})";
+
+#define IRIX_PTHREAD_INIT_TEST_CT 1
+static tTestDesc aIrix_Pthread_InitTests[] = {
+ { TT_EGREP, zIrix_Pthread_InitSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Irix_Pthread_Init
+ */
+static const char* apzIrix_Pthread_InitPatch[] = {
+ "format",
+ "%1{ %2 }",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Irix_Socklen_T fix
*/
tSCC zIrix_Socklen_TName[] =
@@ -7469,9 +7506,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
-#define REGEX_COUNT 230
+#define REGEX_COUNT 231
#define MACH_LIST_SIZE_LIMIT 181
-#define FIX_COUNT 184
+#define FIX_COUNT 185
/*
* Enumerate the fixes
@@ -7571,6 +7608,7 @@ typedef enum {
IRIX_ASM_APOSTROPHE_FIXIDX,
IRIX_COMPLEX_FIXIDX,
IRIX_LIMITS_CONST_FIXIDX,
+ IRIX_PTHREAD_INIT_FIXIDX,
IRIX_SOCKLEN_T_FIXIDX,
IRIX_STDINT_C99_FIXIDX,
IRIX_STDIO_VA_LIST_FIXIDX,
@@ -8134,6 +8172,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
IRIX_LIMITS_CONST_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aIrix_Limits_ConstTests, apzIrix_Limits_ConstPatch, 0 },
+ { zIrix_Pthread_InitName, zIrix_Pthread_InitList,
+ apzIrix_Pthread_InitMachs,
+ IRIX_PTHREAD_INIT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aIrix_Pthread_InitTests, apzIrix_Pthread_InitPatch, 0 },
+
{ zIrix_Socklen_TName, zIrix_Socklen_TList,
apzIrix_Socklen_TMachs,
IRIX_SOCKLEN_T_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index c1d8a69d0f5..d08455c45d0 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -2102,6 +2102,24 @@ fix = {
/*
+ * IRIX 6.5 PTHREAD_*_INITIALIZER need an additional level of braces in
+ * <pthread.h>.
+ */
+fix = {
+ hackname = irix_pthread_init;
+ files = pthread.h;
+ select = "^(#define[ \t]+PTHREAD_.*_INITIALIZER[ \t]+)(\\{ 0 \\})";
+
+ mach = "mips-sgi-irix6.5";
+ c_fix = format;
+ c_fix_arg = "%1{ %2 }";
+ test_text = "#define PTHREAD_MUTEX_INITIALIZER { 0 }\n"
+ "#define PTHREAD_COND_INITIALIZER { 0 }\n"
+ "#define PTHREAD_RWLOCK_INITIALIZER { 0 }";
+};
+
+
+/*
* IRIX 6.5.1[78] <sys/socket.h> has a broken definition of socklen_t.
* Various socket function prototypes use different types instead,
* depending on the API in use (BSD, XPG4/5), but the socklen_t
diff --git a/fixincludes/tests/base/pthread.h b/fixincludes/tests/base/pthread.h
index 4f79fccaad1..9ff626c8b79 100644
--- a/fixincludes/tests/base/pthread.h
+++ b/fixincludes/tests/base/pthread.h
@@ -101,6 +101,13 @@ extern int __page_size;
#endif /* PTHREAD_PAGE_SIZE_CHECK */
+#if defined( IRIX_PTHREAD_INIT_CHECK )
+#define PTHREAD_MUTEX_INITIALIZER { { 0 } }
+#define PTHREAD_COND_INITIALIZER { { 0 } }
+#define PTHREAD_RWLOCK_INITIALIZER { { 0 } }
+#endif /* IRIX_PTHREAD_INIT_CHECK */
+
+
#if defined( PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_CHECK )
extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask);
#endif /* PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_CHECK */
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8679b06695a..412ceccfbff 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,232 @@
+2011-01-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ Backport from mainline
+ 2011-01-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/47318
+ * config/i386/avxintrin.h (_mm_maskload_pd): Change mask to
+ __m128i.
+ (_mm_maskstore_pd): Likewise.
+ (_mm_maskload_ps): Likewise.
+ (_mm_maskstore_ps): Likewise.
+ (_mm256_maskload_pd): Change mask to __m256i.
+ (_mm256_maskstore_pd): Likewise.
+ (_mm256_maskload_ps): Likewise.
+ (_mm256_maskstore_ps): Likewise.
+
+ * config/i386/i386-builtin-types.def: Updated.
+ (ix86_expand_special_args_builtin): Likewise.
+
+ * config/i386/i386.c (ix86_special_builtin_type): Remove
+ V8SF_FTYPE_PCV8SF_V8SF, V4DF_FTYPE_PCV4DF_V4DF,
+ V4SF_FTYPE_PCV4SF_V4SF, V2DF_FTYPE_PCV2DF_V2DF,
+ VOID_FTYPE_PV8SF_V8SF_V8SF, VOID_FTYPE_PV4DF_V4DF_V4DF,
+ VOID_FTYPE_PV4SF_V4SF_V4SF and VOID_FTYPE_PV2DF_V2DF_V2DF.
+ Add V8SF_FTYPE_PCV8SF_V8SI, V4DF_FTYPE_PCV4DF_V4DI,
+ V4SF_FTYPE_PCV4SF_V4SI, V2DF_FTYPE_PCV2DF_V2DI,
+ VOID_FTYPE_PV8SF_V8SI_V8SF, VOID_FTYPE_PV4DF_V4DI_V4DF,
+ VOID_FTYPE_PV4SF_V4SI_V4SF and VOID_FTYPE_PV2DF_V2DI_V2DF.
+ (bdesc_special_args): Update
+ __builtin_ia32_maskloadpd, __builtin_ia32_maskloadps,
+ __builtin_ia32_maskloadpd256, __builtin_ia32_maskloadps256,
+ __builtin_ia32_maskstorepd, __builtin_ia32_maskstoreps,
+ __builtin_ia32_maskstorepd256 and __builtin_ia32_maskstoreps256.
+ (ix86_init_mmx_sse_builtins): Updated.
+
+ * config/i386/sse.md (avx_maskload<ssemodesuffix><avxmodesuffix>):
+ Use <avxpermvecmode> on mask register.
+ (avx_maskstore<ssemodesuffix><avxmodesuffix>): Likewise.
+
+2011-01-16 Jakub Jelinek <jakub@redhat.com>
+
+ Backport from mainline
+ 2010-12-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/46880
+ * config/i386/sse.md (sse2_loadlpd, sse2_movsd): Fix shufpd source
+ operand.
+
+ PR middle-end/45852
+ * expr.c (store_expr): Ignore alt_rtl if equal to target,
+ but has side-effects.
+
+ 2010-12-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/46865
+ * rtl.c (rtx_equal_p_cb): For last operand of
+ ASM_OPERANDS and ASM_INPUT if integers are different,
+ call locator_eq.
+ * jump.c (rtx_renumbered_equal_p): Likewise.
+
+2011-01-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ Backport from mainline:
+ 2011-01-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR target/43309
+ * config/i386/i386.c (legitimize_tls_address)
+ <TLS_MODEL_INITIAL_EXEC>: Handle TARGET_64BIT && TARGET_SUN_TLS.
+ * config/i386/i386.md (UNSPEC_TLS_IE_SUN): Declare.
+ (tls_initial_exec_64_sun): New pattern.
+
+ 2010-03-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * config/i386/i386.c (override_options): Don't accept
+ -mtls-dialect=sun any longer.
+ * config/i386/i386.h (TARGET_SUN_TLS): Define as 0.
+ * config/i386/i386.md (*tls_global_dynamic_32_sun): Remove.
+ (*tls_local_dynamic_base_32_sun): Likewise.
+ * config/i386/sol2.h (TARGET_SUN_TLS): Redefine.
+
+2010-12-30 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * config/pa/pa.md: Add ",*" condition to 64-bit add/subtract boolean
+ patterns.
+
+2010-12-27 Yao Qi <yao@codesourcery.com>
+
+ Backport from mainline:
+ 2010-10-14 Yao Qi <yao@codesourcery.com>
+
+ PR target/45447
+ * config/arm/arm.c (arm_build_builtin_va_list): Assign
+ va_list_name to TYPE_STUB_DECL (va_list_type).
+
+2010-12-22 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ Backport from mainline:
+ 2010-12-18 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR target/46915
+ * config/pa/pa.c (branch_to_delay_slot_p): Use next_active_insn instead
+ of next_real_insn. Search forward checking for both ASM_INPUT and
+ ASM_OPERANDS asms until exit condition is found.
+ (branch_needs_nop_p): Likewise.
+ (use_skip_p): New function.
+ (output_cbranch): Use use_skip_p.
+ (output_bb, output_bvb): Likewise.
+
+ 2009-06-25 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR target/40468
+ * pa.c (branch_to_delay_slot_p, branch_needs_nop_p): New functions.
+ (output_cbranch): Use new functions.
+ (output_bb, output_bvb, output_dbra, output_movb): Likewise.
+
+2010-12-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ Backport from mainline:
+ 2010-09-15 Olivier Hainque <hainque@adacore.com>
+ Jose Ruiz <ruiz@adacore.com>
+
+ * config/alpha/osf.h (MD_UNWIND_SUPPORT): Define.
+ * config/alpha/osf-unwind.h: New file.
+
+ 2009-08-09 Olivier Hainque <hainque@adacore.com>
+ Douglas B Rupp <rupp@gnat.com>
+
+ * config/alpha/alpha.h (DWARF_FRAME_REGNUM): Define.
+
+2010-12-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ Backport from mainline:
+ 2010-04-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ PR target/22224
+ * config/alpha/osf.h (ASM_OUTPUT_LOCAL): Redefine.
+
+2010-12-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ Backport from mainline:
+ 2010-11-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * config/mips/iris.h [!IRIX_USING_GNU_LD]
+ (SUPPORTS_INIT_PRIORITY): Define.
+
+2010-12-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ Backport from mainline:
+ 2010-11-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac (*-*-irix6*): Disable set_have_as_tls.
+ (*-*-osf*): Likewise.
+ * configure: Regenerate.
+
+2010-12-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/46534
+ * builtins.c (expand_builtin_printf): Don't copy and modify string
+ before build_string_literal, instead modify what
+ build_string_literal returned.
+
+ Backport from mainline
+ 2010-11-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/46534
+ * builtins.c (fold_builtin_printf): Don't copy and modify string
+ before build_string_literal, instead modify what
+ build_string_literal returned.
+
+2010-12-05 Richard Guenther <rguenther@suse.de>
+ Ira Rosen <irar@il.ibm.com>
+
+ PR tree-optimization/46663
+ * tree-vect-patterns.c (vect_recog_pow_pattern): Check that
+ FUNCTION_DECL exists and that it's a builtin.
+
+2010-11-29 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR rtl-optimization/46337
+ Backport from mainline
+ 2009-04-20 Ian Lance Taylor <iant@google.com>
+
+ * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode.
+
+2010-11-12 Jakub Jelinek <jakub@redhat.com>
+
+ Backport from mainline
+ 2010-11-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/43690
+ * gimplify.c (gimplify_asm_expr): If a "m" input is a
+ {pre,post}{in,de}crement, fail.
+
+ 2010-11-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/46107
+ * cfgloopmanip.c (loop_version): Set irred_flag back into entry->flags
+ if cfg_hook_duplicate_loop_to_header_edge failed.
+
+2010-11-10 Uros Bizjak <ubizjak@gmail.com>
+
+ PR middle-end/46419
+ * config/i386/xmmintrin.h (_mm_cvtpi16_ps): Swap __hisi and __losi.
+ (_mm_cvtpu16_ps): Ditto.
+
+2010-11-04 Uros Bizjak <ubizjak@gmail.com>
+
+ Revert:
+ 2010-10-30 Uros Bizjak <ubizjak@gmail.com>
+
+ PR middle-end/44569
+ * lower-suberg.c (simplify_subreg_concatn): For VOIDmode elements,
+ determine the mode of a subreg by GET_MODE_INNER of CONCATN RTX.
+
+2010-11-04 Alan Modra <amodra@gmail.com>
+
+ * config/rs6000/rs6000.c (rs6000_pic_labelno): Make static.
+ (rs6000_emit_load_toc_table): Don't use rs6000_pic_labelno when
+ TARGET_SECURE_PLT.
+ * config/rs6000/sysv4.h (rs6000_pic_labelno): Don't declare.
+ * config/rs6000/rs6000.md (load_toc_v4_PIC_3b): Use "b" constraint
+ on input, "r" on output.
+
+2010-10-30 Uros Bizjak <ubizjak@gmail.com>
+
+ PR middle-end/44569
+ * lower-suberg.c (simplify_subreg_concatn): For VOIDmode elements,
+ determine the mode of a subreg by GET_MODE_INNER of CONCATN RTX.
+
2010-10-22 Uros Bizjak <ubizjak@gmail.com>
PR target/45946
@@ -32,7 +261,7 @@
INTVAL (XEXP (slot, 1)) as prev_size.
2010-06-21 Jakub Jelinek <jakub@redhat.com>
-
+
PR target/44575
* config/i386/i386.c (ix86_gimplify_va_arg): When copying
va_arg from a set of register save slots into a temporary,
@@ -157,9 +386,9 @@
2010-09-01 Ian Bolton <ian.bolton@arm.com>
* Makefile.in (tree-switch-conversion.o): Update dependencies.
-
+
2010-08-19 Ian Bolton <ian.bolton@arm.com>
-
+
PR target/45070
* config/arm/arm.c (arm_output_epilogue): Ensure that return
value of size 1-3 is handled correctly.
@@ -170,7 +399,7 @@
type for the conditional has wide enough range.
2010-08-07 Marcus Shawcroft <marcus.shawcroft@arm.com>
-
+
* config/arm/linux-atomic.c (SUBWORD_VAL_CAS): Instantiate with
'unsigned short' and 'unsigned char' instead of 'short' and 'char'.
(SUBWORD_BOOL_CAS): Likewise.
@@ -179,9 +408,9 @@
(FETCH_AND_OP_WORD): Parenthesise INF_OP
(SUBWORD_SYNC_OP): Likewise.
(OP_AND_FETCH_WORD): Likewise.
-
+
2010-09-02 Jakub Jelinek <jakub@redhat.com>
-
+
Backport from mainline
2010-08-30 Jakub Jelinek <jakub@redhat.com>
diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP
index 16107a57496..f6866212abd 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20101030
+20110117
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 5a84ed4d163..34a7d24f44b 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -5452,14 +5452,30 @@ expand_builtin_printf (tree exp, rtx target, enum machine_mode mode,
{
/* If the format specifier was "string\n", call puts("string"). */
size_t len = strlen (fmt_str);
- if ((unsigned char)fmt_str[len - 1] == target_newline)
+ if ((unsigned char)fmt_str[len - 1] == target_newline
+ && (size_t) (int) len == len
+ && (int) len > 0)
{
+ char *newstr;
+ tree offset_node, string_cst;
+
/* Create a NUL-terminated string that's one char shorter
than the original, stripping off the trailing '\n'. */
- char *newstr = XALLOCAVEC (char, len);
- memcpy (newstr, fmt_str, len - 1);
- newstr[len - 1] = 0;
- arg = build_string_literal (len, newstr);
+ arg = build_string_literal (len, fmt_str);
+ string_cst = string_constant (arg, &offset_node);
+#ifdef ENABLE_CHECKING
+ gcc_assert (string_cst
+ && (TREE_STRING_LENGTH (string_cst)
+ == (int) len)
+ && integer_zerop (offset_node)
+ && (unsigned char)
+ TREE_STRING_POINTER (string_cst)[len - 1]
+ == target_newline);
+#endif
+ /* build_string_literal creates a new STRING_CST,
+ modify it in place to avoid double copying. */
+ newstr = CONST_CAST (char *, TREE_STRING_POINTER (string_cst));
+ newstr[len - 1] = '\0';
if (fn_puts)
fn = build_call_expr (fn_puts, 1, arg);
}
@@ -12844,15 +12860,30 @@ fold_builtin_printf (tree fndecl, tree fmt, tree arg, bool ignore,
{
/* If the string was "string\n", call puts("string"). */
size_t len = strlen (str);
- if ((unsigned char)str[len - 1] == target_newline)
+ if ((unsigned char)str[len - 1] == target_newline
+ && (size_t) (int) len == len
+ && (int) len > 0)
{
+ char *newstr;
+ tree offset_node, string_cst;
+
/* Create a NUL-terminated string that's one char shorter
than the original, stripping off the trailing '\n'. */
- char *newstr = XALLOCAVEC (char, len);
- memcpy (newstr, str, len - 1);
- newstr[len - 1] = 0;
-
- newarg = build_string_literal (len, newstr);
+ newarg = build_string_literal (len, str);
+ string_cst = string_constant (newarg, &offset_node);
+#ifdef ENABLE_CHECKING
+ gcc_assert (string_cst
+ && (TREE_STRING_LENGTH (string_cst)
+ == (int) len)
+ && integer_zerop (offset_node)
+ && (unsigned char)
+ TREE_STRING_POINTER (string_cst)[len - 1]
+ == target_newline);
+#endif
+ /* build_string_literal creates a new STRING_CST,
+ modify it in place to avoid double copying. */
+ newstr = CONST_CAST (char *, TREE_STRING_POINTER (string_cst));
+ newstr[len - 1] = '\0';
if (fn_puts)
call = build_call_expr (fn_puts, 1, newarg);
}
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c
index 28cfa3cfc9a..267eb8f183c 100644
--- a/gcc/cfgloopmanip.c
+++ b/gcc/cfgloopmanip.c
@@ -1546,7 +1546,10 @@ loop_version (struct loop *loop,
/* Duplicate loop. */
if (!cfg_hook_duplicate_loop_to_header_edge (loop, entry, 1,
NULL, NULL, NULL, 0))
- return NULL;
+ {
+ entry->flags |= irred_flag;
+ return NULL;
+ }
/* After duplication entry edge now points to new loop head block.
Note down new head as second_head. */
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index 002be49da0a..05447193a13 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -913,6 +913,12 @@ do { \
#define RETURN_ADDR_RTX alpha_return_addr
+/* Provide a definition of DWARF_FRAME_REGNUM here so that fallback unwinders
+ can use DWARF_ALT_FRAME_RETURN_COLUMN defined below. This is just the same
+ as the default definition in dwarf2out.c. */
+#undef DWARF_FRAME_REGNUM
+#define DWARF_FRAME_REGNUM(REG) DBX_REGISTER_NUMBER (REG)
+
/* Before the prologue, RA lives in $26. */
#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, 26)
#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (26)
diff --git a/gcc/config/alpha/osf-unwind.h b/gcc/config/alpha/osf-unwind.h
new file mode 100644
index 00000000000..c649099349e
--- /dev/null
+++ b/gcc/config/alpha/osf-unwind.h
@@ -0,0 +1,329 @@
+/* DWARF2 EH unwinding support for Alpha Tru64.
+ Copyright (C) 2010 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC 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.
+
+GCC 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 GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
+
+/* This file implements the MD_FALLBACK_FRAME_STATE_FOR macro, triggered when
+ the GCC table based unwinding process hits a frame for which no unwind info
+ has been registered. This typically occurs when raising an exception from a
+ signal handler, because the handler is actually called from the OS kernel.
+
+ The basic idea is to detect that we are indeed trying to unwind past a
+ signal handler and to fill out the GCC internal unwinding structures for
+ the OS kernel frame as if it had been directly called from the interrupted
+ context.
+
+ This is all assuming that the code to set the handler asked the kernel to
+ pass a pointer to such context information. */
+
+/* --------------------------------------------------------------------------
+ -- Basic principles of operation:
+ --------------------------------------------------------------------------
+
+ 1/ We first need a way to detect if we are trying to unwind past a signal
+ handler.
+
+ The typical method that is used on most platforms is to look at the code
+ around the return address we have and check if it matches the OS code
+ calling a handler. To determine what this code is expected to be, get a
+ breakpoint into a real signal handler and look at the code around the
+ return address. Depending on the library versions the pattern of the
+ signal handler is different; this is the reason why we check against more
+ than one pattern.
+
+ On this target, the return address is right after the call and every
+ instruction is 4 bytes long. For the simple case of a null dereference in
+ a single-threaded app, it went like:
+
+ # Check that we indeed have something we expect: the instruction right
+ # before the return address is within a __sigtramp function and is a call.
+
+ [... run gdb and break at the signal handler entry ...]
+
+ (gdb) x /i $ra-4
+ <__sigtramp+160>: jsr ra,(a3),0x3ff800d0ed4 <_fpdata+36468>
+
+ # Look at the code around that return address, and eventually observe a
+ # significantly large chunk of *constant* code right before the call:
+
+ (gdb) x /10i $ra-44
+ <__sigtramp+120>: lda gp,-27988(gp)
+ <__sigtramp+124>: ldq at,-18968(gp)
+ <__sigtramp+128>: lda t0,-1
+ <__sigtramp+132>: stq t0,0(at)
+ <__sigtramp+136>: ldq at,-18960(gp)
+ <__sigtramp+140>: ldl t1,8(at)
+ <__sigtramp+144>: ldq at,-18960(gp)
+ <__sigtramp+148>: stl t1,12(at)
+ <__sigtramp+152>: ldq at,-18960(gp)
+ <__sigtramp+156>: stl t0,8(at)
+
+ # The hexadecimal equivalent that we will have to match is:
+
+ (gdb) x /10x $ra-44
+ <__sigtramp+120>: 0x23bd92ac 0xa79db5e8 0x203fffff 0xb43c0000
+ <__sigtramp+136>: 0xa79db5f0 0xa05c0008 0xa79db5f0 0xb05c000c
+ <__sigtramp+152>: 0xa79db5f0 0xb03c0008
+
+ The problem observed on this target with this approach is that although
+ we found a constant set of instruction patterns there were some
+ gp-related offsets that made the machine code to differ from one
+ installation to another. This problem could have been overcome by masking
+ these offsets, but we found that it would be simpler and more efficient to
+ check whether the return address was part of a signal handler, by comparing
+ it against some expected code offset from __sigtramp.
+
+ # Check that we indeed have something we expect: the instruction
+ # right before the return address is within a __sigtramp
+ # function and is a call. We also need to obtain the offset
+ # between the return address and the start address of __sigtramp.
+
+ [... run gdb and break at the signal handler entry ...]
+
+ (gdb) x /2i $ra-4
+ <__sigtramp+160>: jsr ra,(a3),0x3ff800d0ed4 <_fpdata+36468>
+ <__sigtramp+164>: ldah gp,16381(ra)
+
+ (gdb) p (long)$ra - (long)&__sigtramp
+ $2 = 164
+
+ --------------------------------------------------------------------------
+
+ 2/ Once we know we are going through a signal handler, we need a way to
+ retrieve information about the interrupted run-time context.
+
+ On this platform, the third handler's argument is a pointer to a structure
+ describing this context (struct sigcontext *). We unfortunately have no
+ direct way to transfer this value here, so a couple of tricks are required
+ to compute it.
+
+ As documented at least in some header files (e.g. sys/machine/context.h),
+ the structure the handler gets a pointer to is located on the stack. As of
+ today, while writing this macro, we have unfortunately not been able to
+ find a detailed description of the full stack layout at handler entry time,
+ so we'll have to resort to empirism :)
+
+ When unwinding here, we have the handler's CFA at hand, as part of the
+ current unwinding context which is one of our arguments. We presume that
+ for each call to a signal handler by the same kernel routine, the context's
+ structure location on the stack is always at the same offset from the
+ handler's CFA, and we compute that offset from bare observation:
+
+ For the simple case of a bare null dereference in a single-threaded app,
+ computing the offset was done using GNAT like this:
+
+ # Break on the first handler's instruction, before the prologue to have the
+ # CFA in $sp, and get there:
+
+ (gdb) b *&__gnat_error_handler
+ Breakpoint 1 at 0x120016090: file init.c, line 378.
+
+ (gdb) r
+ Program received signal SIGSEGV, Segmentation fault.
+
+ (gdb) c
+ Breakpoint 1, __gnat_error_handler (sig=..., sip=..., context=...)
+
+ # The displayed argument value are meaningless because we stopped before
+ # their final "homing". We know they are passed through $a0, $a1 and $a2
+ # from the ABI, though, so ...
+
+ # Observe that $sp and the context pointer are in the same (stack) area,
+ # and compute the offset:
+
+ (gdb) p /x $sp
+ $2 = 0x11fffbc80
+
+ (gdb) p /x $a2
+ $3 = 0x11fffbcf8
+
+ (gdb) p /x (long)$a2 - (long)$sp
+ $4 = 0x78
+
+ --------------------------------------------------------------------------
+
+ 3/ Once we know we are unwinding through a signal handler and have the
+ address of the structure describing the interrupted context at hand, we
+ have to fill the internal frame-state/unwind-context structures properly
+ to allow the unwinding process to proceed.
+
+ Roughly, we are provided with an *unwinding* CONTEXT, describing the state
+ of some point P in the call chain we are unwinding through. The macro we
+ implement has to fill a "frame state" structure FS that describe the P's
+ caller state, by way of *rules* to compute its CFA, return address, and
+ **saved** registers *locations*.
+
+ For the case we are going to deal with, the caller is some kernel code
+ calling a signal handler, and:
+
+ o The saved registers are all in the interrupted run-time context,
+
+ o The CFA is the stack pointer value when the kernel code is entered, that
+ is, the stack pointer value at the interruption point, also part of the
+ interrupted run-time context.
+
+ o We want the return address to appear as the address of the active
+ instruction at the interruption point, so that the unwinder proceeds as
+ if the interruption had been a regular call. This address is also part
+ of the interrupted run-time context.
+
+ --
+
+ Also, note that there is an important difference between the return address
+ we need to claim for the kernel frame and the value of the return address
+ register at the interruption point.
+
+ The latter might be required to be able to unwind past the interrupted
+ routine, for instance if it is interrupted before saving the incoming
+ register value in its own frame, which may typically happen during stack
+ probes for stack-checking purposes.
+
+ It is then essential that the rules stated to locate the kernel frame
+ return address don't clobber the rules describing where is saved the return
+ address register at the interruption point, so some scratch register state
+ entry should be used for the former. We have DWARF_ALT_FRAME_RETURN_COLUMN
+ at hand exactly for that purpose.
+
+ --------------------------------------------------------------------------
+
+ 4/ Depending on the context (single-threaded or multi-threaded app, ...),
+ the code calling the handler and the handler-cfa to interrupted-context
+ offset might change, so we use a simple generic data structure to track
+ the possible variants. */
+
+/* This is the structure to wrap information about each possible sighandler
+ caller we may have to identify. */
+
+typedef struct {
+ /* Expected return address when being called from a sighandler. */
+ void *ra_value;
+
+ /* Offset to get to the sigcontext structure from the handler's CFA
+ when the pattern matches. */
+ int cfa_to_context_offset;
+
+} sighandler_call_t;
+
+/* Helper macro for MD_FALLBACK_FRAME_STATE_FOR below.
+
+ Look at RA to see if it matches within a sighandler caller.
+ Set SIGCTX to the corresponding sigcontext structure (computed from
+ CFA) if it does, or to 0 otherwise. */
+
+#define COMPUTE_SIGCONTEXT_FOR(RA,CFA,SIGCTX) \
+do { \
+ /* Define and register the applicable patterns. */ \
+ extern void __sigtramp (void); \
+ \
+ sighandler_call_t sighandler_calls [] = { \
+ {__sigtramp + 164, 0x78} \
+ }; \
+ \
+ int n_patterns_to_match \
+ = sizeof (sighandler_calls) / sizeof (sighandler_call_t); \
+ \
+ int pn; /* pattern number */ \
+ \
+ int match = 0; /* Did last pattern match ? */ \
+ \
+ /* Try to match each pattern in turn. */ \
+ for (pn = 0; !match && pn < n_patterns_to_match; pn ++) \
+ match = ((RA) == sighandler_calls[pn].ra_value); \
+ \
+ (SIGCTX) = (struct sigcontext *) \
+ (match ? ((CFA) + sighandler_calls[pn - 1].cfa_to_context_offset) : 0); \
+} while (0);
+
+#include <sys/context_t.h>
+
+#define REG_SP 30 /* hard reg for stack pointer */
+#define REG_RA 26 /* hard reg for return address */
+
+#define MD_FALLBACK_FRAME_STATE_FOR alpha_fallback_frame_state
+
+static _Unwind_Reason_Code
+alpha_fallback_frame_state (struct _Unwind_Context *context,
+ _Unwind_FrameState *fs)
+{
+ /* Return address and CFA of the frame we're attempting to unwind through,
+ possibly a signal handler. */
+ void *ctx_ra = (void *)context->ra;
+ void *ctx_cfa = (void *)context->cfa;
+
+ /* CFA of the intermediate abstract kernel frame between the interrupted
+ code and the signal handler, if we're indeed unwinding through a signal
+ handler. */
+ void *k_cfa;
+
+ /* Pointer to the sigcontext structure pushed by the kernel when we're
+ unwinding through a signal handler. */
+ struct sigcontext *sigctx;
+ int i;
+
+ COMPUTE_SIGCONTEXT_FOR (ctx_ra, ctx_cfa, sigctx);
+
+ if (sigctx == 0)
+ return _URC_END_OF_STACK;
+
+ /* The kernel frame's CFA is exactly the stack pointer value at the
+ interruption point. */
+ k_cfa = (void *) sigctx->sc_regs [REG_SP];
+
+ /* State the rules to compute the CFA we have the value of: use the
+ previous CFA and offset by the difference between the two. See
+ uw_update_context_1 for the supporting details. */
+ fs->regs.cfa_how = CFA_REG_OFFSET;
+ fs->regs.cfa_reg = __builtin_dwarf_sp_column ();
+ fs->regs.cfa_offset = k_cfa - ctx_cfa;
+
+ /* Fill the internal frame_state structure with information stating
+ where each register of interest in the saved context can be found
+ from the CFA. */
+
+ /* The general registers are in sigctx->sc_regs. Leave out r31, which
+ is read-as-zero. It makes no sense restoring it, and we are going to
+ use the state entry for the kernel return address rule below.
+
+ This loop must cover at least all the callee-saved registers, and
+ we just don't bother specializing the set here. */
+ for (i = 0; i <= 30; i ++)
+ {
+ fs->regs.reg[i].how = REG_SAVED_OFFSET;
+ fs->regs.reg[i].loc.offset
+ = (void *) &sigctx->sc_regs[i] - (void *) k_cfa;
+ }
+
+ /* Ditto for the floating point registers in sigctx->sc_fpregs. */
+ for (i = 0; i <= 31; i ++)
+ {
+ fs->regs.reg[32+i].how = REG_SAVED_OFFSET;
+ fs->regs.reg[32+i].loc.offset
+ = (void *) &sigctx->sc_fpregs[i] - (void *) k_cfa;
+ }
+
+ /* State the rules to find the kernel's code "return address", which
+ is the address of the active instruction when the signal was caught,
+ in sigctx->sc_pc. Use DWARF_ALT_FRAME_RETURN_COLUMN since the return
+ address register is a general register and should be left alone. */
+ fs->retaddr_column = DWARF_ALT_FRAME_RETURN_COLUMN;
+ fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].how = REG_SAVED_OFFSET;
+ fs->regs.reg[DWARF_ALT_FRAME_RETURN_COLUMN].loc.offset
+ = (void *) &sigctx->sc_pc - (void *) k_cfa;
+ fs->signal_frame = 1;
+
+ return _URC_NO_REASON;
+}
diff --git a/gcc/config/alpha/osf.h b/gcc/config/alpha/osf.h
index 2b5165c0754..bb35120ca8a 100644
--- a/gcc/config/alpha/osf.h
+++ b/gcc/config/alpha/osf.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler, for DEC Alpha on OSF/1.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2001, 2002, 2003,
- 2004, 2007 Free Software Foundation, Inc.
+ 2004, 2007, 2010 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
This file is part of GCC.
@@ -185,6 +185,14 @@ __enable_execute_stack (void *addr) \
? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
: DW_EH_PE_aligned)
+/* The Tru64 UNIX assembler warns on .lcomm with SIZE 0, so use 1 in that
+ case. */
+#undef ASM_OUTPUT_LOCAL
+#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE,ROUNDED) \
+( fputs ("\t.lcomm ", (FILE)), \
+ assemble_name ((FILE), (NAME)), \
+ fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED"\n", (SIZE) ? (SIZE) : 1))
+
/* This is how we tell the assembler that a symbol is weak. */
#define ASM_OUTPUT_WEAK_ALIAS(FILE, NAME, VALUE) \
@@ -210,3 +218,5 @@ __enable_execute_stack (void *addr) \
/* Handle #pragma extern_prefix. Technically only needed for Tru64 5.x,
but easier to manipulate preprocessor bits from here. */
#define TARGET_HANDLE_PRAGMA_EXTERN_PREFIX 1
+
+#define MD_UNWIND_SUPPORT "config/alpha/osf-unwind.h"
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 7f7074419f1..eed5cfd1dab 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -964,6 +964,7 @@ arm_build_builtin_va_list (void)
va_list_type);
DECL_ARTIFICIAL (va_list_name) = 1;
TYPE_NAME (va_list_type) = va_list_name;
+ TYPE_STUB_DECL (va_list_type) = va_list_name;
/* Create the __ap field. */
ap_field = build_decl (FIELD_DECL,
get_identifier ("__ap"),
diff --git a/gcc/config/i386/avxintrin.h b/gcc/config/i386/avxintrin.h
index 26925fd7fbb..70bfce1a274 100644
--- a/gcc/config/i386/avxintrin.h
+++ b/gcc/config/i386/avxintrin.h
@@ -890,55 +890,55 @@ _mm256_storeu_si256 (__m256i *__P, __m256i __A)
}
extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-_mm_maskload_pd (double const *__P, __m128d __M)
+_mm_maskload_pd (double const *__P, __m128i __M)
{
return (__m128d) __builtin_ia32_maskloadpd ((const __v2df *)__P,
- (__v2df)__M);
+ (__v2di)__M);
}
extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-_mm_maskstore_pd (double *__P, __m128d __M, __m128d __A)
+_mm_maskstore_pd (double *__P, __m128i __M, __m128d __A)
{
- __builtin_ia32_maskstorepd ((__v2df *)__P, (__v2df)__M, (__v2df)__A);
+ __builtin_ia32_maskstorepd ((__v2df *)__P, (__v2di)__M, (__v2df)__A);
}
extern __inline __m256d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_maskload_pd (double const *__P, __m256d __M)
+_mm256_maskload_pd (double const *__P, __m256i __M)
{
return (__m256d) __builtin_ia32_maskloadpd256 ((const __v4df *)__P,
- (__v4df)__M);
+ (__v4di)__M);
}
extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_maskstore_pd (double *__P, __m256d __M, __m256d __A)
+_mm256_maskstore_pd (double *__P, __m256i __M, __m256d __A)
{
- __builtin_ia32_maskstorepd256 ((__v4df *)__P, (__v4df)__M, (__v4df)__A);
+ __builtin_ia32_maskstorepd256 ((__v4df *)__P, (__v4di)__M, (__v4df)__A);
}
extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-_mm_maskload_ps (float const *__P, __m128 __M)
+_mm_maskload_ps (float const *__P, __m128i __M)
{
return (__m128) __builtin_ia32_maskloadps ((const __v4sf *)__P,
- (__v4sf)__M);
+ (__v4si)__M);
}
extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-_mm_maskstore_ps (float *__P, __m128 __M, __m128 __A)
+_mm_maskstore_ps (float *__P, __m128i __M, __m128 __A)
{
- __builtin_ia32_maskstoreps ((__v4sf *)__P, (__v4sf)__M, (__v4sf)__A);
+ __builtin_ia32_maskstoreps ((__v4sf *)__P, (__v4si)__M, (__v4sf)__A);
}
extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_maskload_ps (float const *__P, __m256 __M)
+_mm256_maskload_ps (float const *__P, __m256i __M)
{
return (__m256) __builtin_ia32_maskloadps256 ((const __v8sf *)__P,
- (__v8sf)__M);
+ (__v8si)__M);
}
extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-_mm256_maskstore_ps (float *__P, __m256 __M, __m256 __A)
+_mm256_maskstore_ps (float *__P, __m256i __M, __m256 __A)
{
- __builtin_ia32_maskstoreps256 ((__v8sf *)__P, (__v8sf)__M, (__v8sf)__A);
+ __builtin_ia32_maskstoreps256 ((__v8sf *)__P, (__v8si)__M, (__v8sf)__A);
}
extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index b6f4e54c3e0..6d3729e3d4e 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -3137,8 +3137,6 @@ override_options (bool main_args_p)
ix86_tls_dialect = TLS_DIALECT_GNU;
else if (strcmp (ix86_tls_dialect_string, "gnu2") == 0)
ix86_tls_dialect = TLS_DIALECT_GNU2;
- else if (strcmp (ix86_tls_dialect_string, "sun") == 0)
- ix86_tls_dialect = TLS_DIALECT_SUN;
else
error ("bad value (%s) for %stls-dialect=%s %s",
ix86_tls_dialect_string, prefix, suffix, sw);
@@ -10030,6 +10028,17 @@ legitimize_tls_address (rtx x, enum tls_model model, int for_mov)
case TLS_MODEL_INITIAL_EXEC:
if (TARGET_64BIT)
{
+ if (TARGET_SUN_TLS)
+ {
+ /* The Sun linker took the AMD64 TLS spec literally
+ and can only handle %rax as destination of the
+ initial executable code sequence. */
+
+ dest = gen_reg_rtx (Pmode);
+ emit_insn (gen_tls_initial_exec_64_sun (dest, x));
+ return dest;
+ }
+
pic = NULL;
type = UNSPEC_GOTNTPOFF;
}
@@ -21263,12 +21272,12 @@ enum ix86_special_builtin_type
V4DF_FTYPE_PCDOUBLE,
V4SF_FTYPE_PCFLOAT,
V2DF_FTYPE_PCDOUBLE,
- V8SF_FTYPE_PCV8SF_V8SF,
- V4DF_FTYPE_PCV4DF_V4DF,
+ V8SF_FTYPE_PCV8SF_V8SI,
+ V4DF_FTYPE_PCV4DF_V4DI,
V4SF_FTYPE_V4SF_PCV2SF,
- V4SF_FTYPE_PCV4SF_V4SF,
+ V4SF_FTYPE_PCV4SF_V4SI,
V2DF_FTYPE_V2DF_PCDOUBLE,
- V2DF_FTYPE_PCV2DF_V2DF,
+ V2DF_FTYPE_PCV2DF_V2DI,
V2DI_FTYPE_PV2DI,
VOID_FTYPE_PV2SF_V4SF,
VOID_FTYPE_PV4DI_V4DI,
@@ -21281,10 +21290,10 @@ enum ix86_special_builtin_type
VOID_FTYPE_PDOUBLE_V2DF,
VOID_FTYPE_PDI_DI,
VOID_FTYPE_PINT_INT,
- VOID_FTYPE_PV8SF_V8SF_V8SF,
- VOID_FTYPE_PV4DF_V4DF_V4DF,
- VOID_FTYPE_PV4SF_V4SF_V4SF,
- VOID_FTYPE_PV2DF_V2DF_V2DF
+ VOID_FTYPE_PV8SF_V8SI_V8SF,
+ VOID_FTYPE_PV4DF_V4DI_V4DF,
+ VOID_FTYPE_PV4SF_V4SI_V4SF,
+ VOID_FTYPE_PV2DF_V2DI_V2DF
};
/* Builtin types */
@@ -21515,14 +21524,14 @@ static const struct builtin_description bdesc_special_args[] =
{ OPTION_MASK_ISA_AVX, CODE_FOR_avx_movntv4df, "__builtin_ia32_movntpd256", IX86_BUILTIN_MOVNTPD256, UNKNOWN, (int) VOID_FTYPE_PDOUBLE_V4DF },
{ OPTION_MASK_ISA_AVX, CODE_FOR_avx_movntv8sf, "__builtin_ia32_movntps256", IX86_BUILTIN_MOVNTPS256, UNKNOWN, (int) VOID_FTYPE_PFLOAT_V8SF },
- { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskloadpd, "__builtin_ia32_maskloadpd", IX86_BUILTIN_MASKLOADPD, UNKNOWN, (int) V2DF_FTYPE_PCV2DF_V2DF },
- { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskloadps, "__builtin_ia32_maskloadps", IX86_BUILTIN_MASKLOADPS, UNKNOWN, (int) V4SF_FTYPE_PCV4SF_V4SF },
- { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskloadpd256, "__builtin_ia32_maskloadpd256", IX86_BUILTIN_MASKLOADPD256, UNKNOWN, (int) V4DF_FTYPE_PCV4DF_V4DF },
- { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskloadps256, "__builtin_ia32_maskloadps256", IX86_BUILTIN_MASKLOADPS256, UNKNOWN, (int) V8SF_FTYPE_PCV8SF_V8SF },
- { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstorepd, "__builtin_ia32_maskstorepd", IX86_BUILTIN_MASKSTOREPD, UNKNOWN, (int) VOID_FTYPE_PV2DF_V2DF_V2DF },
- { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstoreps, "__builtin_ia32_maskstoreps", IX86_BUILTIN_MASKSTOREPS, UNKNOWN, (int) VOID_FTYPE_PV4SF_V4SF_V4SF },
- { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstorepd256, "__builtin_ia32_maskstorepd256", IX86_BUILTIN_MASKSTOREPD256, UNKNOWN, (int) VOID_FTYPE_PV4DF_V4DF_V4DF },
- { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstoreps256, "__builtin_ia32_maskstoreps256", IX86_BUILTIN_MASKSTOREPS256, UNKNOWN, (int) VOID_FTYPE_PV8SF_V8SF_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskloadpd, "__builtin_ia32_maskloadpd", IX86_BUILTIN_MASKLOADPD, UNKNOWN, (int) V2DF_FTYPE_PCV2DF_V2DI },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskloadps, "__builtin_ia32_maskloadps", IX86_BUILTIN_MASKLOADPS, UNKNOWN, (int) V4SF_FTYPE_PCV4SF_V4SI },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskloadpd256, "__builtin_ia32_maskloadpd256", IX86_BUILTIN_MASKLOADPD256, UNKNOWN, (int) V4DF_FTYPE_PCV4DF_V4DI },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskloadps256, "__builtin_ia32_maskloadps256", IX86_BUILTIN_MASKLOADPS256, UNKNOWN, (int) V8SF_FTYPE_PCV8SF_V8SI },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstorepd, "__builtin_ia32_maskstorepd", IX86_BUILTIN_MASKSTOREPD, UNKNOWN, (int) VOID_FTYPE_PV2DF_V2DI_V2DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstoreps, "__builtin_ia32_maskstoreps", IX86_BUILTIN_MASKSTOREPS, UNKNOWN, (int) VOID_FTYPE_PV4SF_V4SI_V4SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstorepd256, "__builtin_ia32_maskstorepd256", IX86_BUILTIN_MASKSTOREPD256, UNKNOWN, (int) VOID_FTYPE_PV4DF_V4DI_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstoreps256, "__builtin_ia32_maskstoreps256", IX86_BUILTIN_MASKSTOREPS256, UNKNOWN, (int) VOID_FTYPE_PV8SF_V8SI_V8SF },
};
/* Builtins with variable number of arguments. */
@@ -23077,40 +23086,40 @@ ix86_init_mmx_sse_builtins (void)
= build_pointer_type (build_type_variant (V8SF_type_node, 1, 0));
tree pcv4df_type_node
= build_pointer_type (build_type_variant (V4DF_type_node, 1, 0));
- tree v8sf_ftype_pcv8sf_v8sf
+ tree v8sf_ftype_pcv8sf_v8si
= build_function_type_list (V8SF_type_node,
- pcv8sf_type_node, V8SF_type_node,
+ pcv8sf_type_node, V8SI_type_node,
NULL_TREE);
- tree v4df_ftype_pcv4df_v4df
+ tree v4df_ftype_pcv4df_v4di
= build_function_type_list (V4DF_type_node,
- pcv4df_type_node, V4DF_type_node,
+ pcv4df_type_node, V4DI_type_node,
NULL_TREE);
- tree v4sf_ftype_pcv4sf_v4sf
+ tree v4sf_ftype_pcv4sf_v4si
= build_function_type_list (V4SF_type_node,
- pcv4sf_type_node, V4SF_type_node,
+ pcv4sf_type_node, V4SI_type_node,
NULL_TREE);
- tree v2df_ftype_pcv2df_v2df
+ tree v2df_ftype_pcv2df_v2di
= build_function_type_list (V2DF_type_node,
- pcv2df_type_node, V2DF_type_node,
+ pcv2df_type_node, V2DI_type_node,
NULL_TREE);
- tree void_ftype_pv8sf_v8sf_v8sf
+ tree void_ftype_pv8sf_v8si_v8sf
= build_function_type_list (void_type_node,
- pv8sf_type_node, V8SF_type_node,
+ pv8sf_type_node, V8SI_type_node,
V8SF_type_node,
NULL_TREE);
- tree void_ftype_pv4df_v4df_v4df
+ tree void_ftype_pv4df_v4di_v4df
= build_function_type_list (void_type_node,
- pv4df_type_node, V4DF_type_node,
+ pv4df_type_node, V4DI_type_node,
V4DF_type_node,
NULL_TREE);
- tree void_ftype_pv4sf_v4sf_v4sf
+ tree void_ftype_pv4sf_v4si_v4sf
= build_function_type_list (void_type_node,
- pv4sf_type_node, V4SF_type_node,
+ pv4sf_type_node, V4SI_type_node,
V4SF_type_node,
NULL_TREE);
- tree void_ftype_pv2df_v2df_v2df
+ tree void_ftype_pv2df_v2di_v2df
= build_function_type_list (void_type_node,
- pv2df_type_node, V2DF_type_node,
+ pv2df_type_node, V2DI_type_node,
V2DF_type_node,
NULL_TREE);
tree v4df_ftype_v2df
@@ -23216,23 +23225,23 @@ ix86_init_mmx_sse_builtins (void)
case V2DF_FTYPE_PCDOUBLE:
type = v2df_ftype_pcdouble;
break;
- case V8SF_FTYPE_PCV8SF_V8SF:
- type = v8sf_ftype_pcv8sf_v8sf;
+ case V8SF_FTYPE_PCV8SF_V8SI:
+ type = v8sf_ftype_pcv8sf_v8si;
break;
- case V4DF_FTYPE_PCV4DF_V4DF:
- type = v4df_ftype_pcv4df_v4df;
+ case V4DF_FTYPE_PCV4DF_V4DI:
+ type = v4df_ftype_pcv4df_v4di;
break;
case V4SF_FTYPE_V4SF_PCV2SF:
type = v4sf_ftype_v4sf_pcv2sf;
break;
- case V4SF_FTYPE_PCV4SF_V4SF:
- type = v4sf_ftype_pcv4sf_v4sf;
+ case V4SF_FTYPE_PCV4SF_V4SI:
+ type = v4sf_ftype_pcv4sf_v4si;
break;
case V2DF_FTYPE_V2DF_PCDOUBLE:
type = v2df_ftype_v2df_pcdouble;
break;
- case V2DF_FTYPE_PCV2DF_V2DF:
- type = v2df_ftype_pcv2df_v2df;
+ case V2DF_FTYPE_PCV2DF_V2DI:
+ type = v2df_ftype_pcv2df_v2di;
break;
case VOID_FTYPE_PV2SF_V4SF:
type = void_ftype_pv2sf_v4sf;
@@ -23267,17 +23276,17 @@ ix86_init_mmx_sse_builtins (void)
case VOID_FTYPE_PINT_INT:
type = void_ftype_pint_int;
break;
- case VOID_FTYPE_PV8SF_V8SF_V8SF:
- type = void_ftype_pv8sf_v8sf_v8sf;
+ case VOID_FTYPE_PV8SF_V8SI_V8SF:
+ type = void_ftype_pv8sf_v8si_v8sf;
break;
- case VOID_FTYPE_PV4DF_V4DF_V4DF:
- type = void_ftype_pv4df_v4df_v4df;
+ case VOID_FTYPE_PV4DF_V4DI_V4DF:
+ type = void_ftype_pv4df_v4di_v4df;
break;
- case VOID_FTYPE_PV4SF_V4SF_V4SF:
- type = void_ftype_pv4sf_v4sf_v4sf;
+ case VOID_FTYPE_PV4SF_V4SI_V4SF:
+ type = void_ftype_pv4sf_v4si_v4sf;
break;
- case VOID_FTYPE_PV2DF_V2DF_V2DF:
- type = void_ftype_pv2df_v2df_v2df;
+ case VOID_FTYPE_PV2DF_V2DI_V2DF:
+ type = void_ftype_pv2df_v2di_v2df;
break;
default:
gcc_unreachable ();
@@ -25107,18 +25116,18 @@ ix86_expand_special_args_builtin (const struct builtin_description *d,
klass = load;
memory = 1;
break;
- case V8SF_FTYPE_PCV8SF_V8SF:
- case V4DF_FTYPE_PCV4DF_V4DF:
- case V4SF_FTYPE_PCV4SF_V4SF:
- case V2DF_FTYPE_PCV2DF_V2DF:
+ case V8SF_FTYPE_PCV8SF_V8SI:
+ case V4DF_FTYPE_PCV4DF_V4DI:
+ case V4SF_FTYPE_PCV4SF_V4SI:
+ case V2DF_FTYPE_PCV2DF_V2DI:
nargs = 2;
klass = load;
memory = 0;
break;
- case VOID_FTYPE_PV8SF_V8SF_V8SF:
- case VOID_FTYPE_PV4DF_V4DF_V4DF:
- case VOID_FTYPE_PV4SF_V4SF_V4SF:
- case VOID_FTYPE_PV2DF_V2DF_V2DF:
+ case VOID_FTYPE_PV8SF_V8SI_V8SF:
+ case VOID_FTYPE_PV4DF_V4DI_V4DF:
+ case VOID_FTYPE_PV4SF_V4SI_V4SF:
+ case VOID_FTYPE_PV2DF_V2DI_V2DF:
nargs = 2;
klass = store;
/* Reserve memory operand for target. */
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index e2b24cac43d..7b50d2fa0ad 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GCC for IA-32.
Copyright (C) 1988, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GCC.
@@ -426,7 +426,7 @@ extern int x86_prefetch_sse;
#define TARGET_GNU_TLS (ix86_tls_dialect == TLS_DIALECT_GNU)
#define TARGET_GNU2_TLS (ix86_tls_dialect == TLS_DIALECT_GNU2)
#define TARGET_ANY_GNU_TLS (TARGET_GNU_TLS || TARGET_GNU2_TLS)
-#define TARGET_SUN_TLS (ix86_tls_dialect == TLS_DIALECT_SUN)
+#define TARGET_SUN_TLS 0
extern int ix86_isa_flags;
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index f12e1ed84d9..8ac63d57e2c 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -1,6 +1,6 @@
;; GCC machine description for IA-32 and x86-64.
;; Copyright (C) 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
;; Free Software Foundation, Inc.
;; Mostly by William Schelter.
;; x86_64 support added by Jan Hubicka
@@ -75,6 +75,7 @@
(UNSPEC_TLS_GD 21)
(UNSPEC_TLS_LD_BASE 22)
(UNSPEC_TLSDESC 23)
+ (UNSPEC_TLS_IE_SUN 24)
; Other random patterns
(UNSPEC_EH_RETURN 29)
@@ -15958,21 +15959,6 @@
[(set_attr "type" "multi")
(set_attr "length" "12")])
-(define_insn "*tls_global_dynamic_32_sun"
- [(set (match_operand:SI 0 "register_operand" "=a")
- (unspec:SI [(match_operand:SI 1 "register_operand" "b")
- (match_operand:SI 2 "tls_symbolic_operand" "")
- (match_operand:SI 3 "call_insn_operand" "")]
- UNSPEC_TLS_GD))
- (clobber (match_scratch:SI 4 "=d"))
- (clobber (match_scratch:SI 5 "=c"))
- (clobber (reg:CC FLAGS_REG))]
- "!TARGET_64BIT && TARGET_SUN_TLS"
- "lea{l}\t{%a2@DTLNDX(%1), %4|%4, %a2@DTLNDX[%1]}
- push{l}\t%4\;call\t%a2@TLSPLT\;pop{l}\t%4\;nop"
- [(set_attr "type" "multi")
- (set_attr "length" "14")])
-
(define_expand "tls_global_dynamic_32"
[(parallel [(set (match_operand:SI 0 "register_operand" "")
(unspec:SI
@@ -16041,20 +16027,6 @@
[(set_attr "type" "multi")
(set_attr "length" "11")])
-(define_insn "*tls_local_dynamic_base_32_sun"
- [(set (match_operand:SI 0 "register_operand" "=a")
- (unspec:SI [(match_operand:SI 1 "register_operand" "b")
- (match_operand:SI 2 "call_insn_operand" "")]
- UNSPEC_TLS_LD_BASE))
- (clobber (match_scratch:SI 3 "=d"))
- (clobber (match_scratch:SI 4 "=c"))
- (clobber (reg:CC FLAGS_REG))]
- "!TARGET_64BIT && TARGET_SUN_TLS"
- "lea{l}\t{%&@TMDNX(%1), %3|%3, %&@TMDNX[%1]}
- push{l}\t%3\;call\t%&@TLSPLT\;pop{l}\t%3"
- [(set_attr "type" "multi")
- (set_attr "length" "13")])
-
(define_expand "tls_local_dynamic_base_32"
[(parallel [(set (match_operand:SI 0 "register_operand" "")
(unspec:SI [(match_dup 1) (match_dup 2)]
@@ -16180,6 +16152,18 @@
(set_attr "memory" "load")
(set_attr "imm_disp" "false")])
+;; The Sun linker took the AMD64 TLS spec literally and can only handle
+;; %rax as destination of the initial executable code sequence.
+(define_insn "tls_initial_exec_64_sun"
+ [(set (match_operand:DI 0 "register_operand" "=a")
+ (unspec:DI
+ [(match_operand:DI 1 "tls_symbolic_operand" "")]
+ UNSPEC_TLS_IE_SUN))
+ (clobber (reg:CC FLAGS_REG))]
+ "TARGET_64BIT && TARGET_SUN_TLS"
+ "mov{q}\t{%%fs:0, %0|%0, QWORD PTR fs:0}\n\tadd{q}\t{%a1@gottpoff(%%rip), %0|%0, %a1@gottpoff[rip]}"
+ [(set_attr "type" "multi")])
+
;; GNU2 TLS patterns can be split.
(define_expand "tls_dynamic_gnu2_32"
diff --git a/gcc/config/i386/sol2.h b/gcc/config/i386/sol2.h
index b4e12b5f592..fc85fca3ca3 100644
--- a/gcc/config/i386/sol2.h
+++ b/gcc/config/i386/sol2.h
@@ -91,6 +91,11 @@ along with GCC; see the file COPYING3. If not see
} \
} while (0)
+/* Follow Sun requirements for TLS code sequences and use Sun assembler TLS
+ syntax. */
+#undef TARGET_SUN_TLS
+#define TARGET_SUN_TLS 1
+
/* The Solaris assembler cannot grok .stabd directives. */
#undef NO_DBX_BNSYM_ENSYM
#define NO_DBX_BNSYM_ENSYM 1
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index b152b81e586..ae00c3af6f0 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -4468,7 +4468,7 @@
movsd\t{%2, %0|%0, %2}
movlpd\t{%2, %0|%0, %2}
movsd\t{%2, %0|%0, %2}
- shufpd\t{$2, %2, %0|%0, %2, 2}
+ shufpd\t{$2, %1, %0|%0, %1, 2}
movhpd\t{%H1, %0|%0, %H1}
#
#
@@ -4545,7 +4545,7 @@
movsd\t{%2, %0|%0, %2}
movlpd\t{%2, %0|%0, %2}
movlpd\t{%2, %0|%0, %2}
- shufpd\t{$2, %2, %0|%0, %2, 2}
+ shufpd\t{$2, %1, %0|%0, %1, 2}
movhps\t{%H1, %0|%0, %H1}
movhps\t{%1, %H0|%H0, %1}"
[(set_attr "type" "ssemov,ssemov,ssemov,sselog,ssemov,ssemov")
@@ -11693,7 +11693,7 @@
[(set (match_operand:AVXMODEF2P 0 "register_operand" "=x")
(unspec:AVXMODEF2P
[(match_operand:AVXMODEF2P 1 "memory_operand" "m")
- (match_operand:AVXMODEF2P 2 "register_operand" "x")
+ (match_operand:<avxpermvecmode> 2 "register_operand" "x")
(match_dup 0)]
UNSPEC_MASKLOAD))]
"TARGET_AVX"
@@ -11705,7 +11705,7 @@
(define_insn "avx_maskstorep<avxmodesuffixf2c><avxmodesuffix>"
[(set (match_operand:AVXMODEF2P 0 "memory_operand" "=m")
(unspec:AVXMODEF2P
- [(match_operand:AVXMODEF2P 1 "register_operand" "x")
+ [(match_operand:<avxpermvecmode> 1 "register_operand" "x")
(match_operand:AVXMODEF2P 2 "register_operand" "x")
(match_dup 0)]
UNSPEC_MASKSTORE))]
diff --git a/gcc/config/i386/xmmintrin.h b/gcc/config/i386/xmmintrin.h
index 544577ecaf0..8bec3744035 100644
--- a/gcc/config/i386/xmmintrin.h
+++ b/gcc/config/i386/xmmintrin.h
@@ -626,13 +626,13 @@ _mm_cvtpi16_ps (__m64 __A)
__sign = __builtin_ia32_pcmpgtw ((__v4hi)0LL, (__v4hi)__A);
/* Convert the four words to doublewords. */
- __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, __sign);
__losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, __sign);
+ __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, __sign);
/* Convert the doublewords to floating point two at a time. */
__zero = (__v4sf) _mm_setzero_ps ();
- __ra = __builtin_ia32_cvtpi2ps (__zero, __hisi);
- __rb = __builtin_ia32_cvtpi2ps (__ra, __losi);
+ __ra = __builtin_ia32_cvtpi2ps (__zero, __losi);
+ __rb = __builtin_ia32_cvtpi2ps (__ra, __hisi);
return (__m128) __builtin_ia32_movlhps (__ra, __rb);
}
@@ -645,13 +645,13 @@ _mm_cvtpu16_ps (__m64 __A)
__v4sf __zero, __ra, __rb;
/* Convert the four words to doublewords. */
- __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, (__v4hi)0LL);
__losi = (__v2si) __builtin_ia32_punpcklwd ((__v4hi)__A, (__v4hi)0LL);
+ __hisi = (__v2si) __builtin_ia32_punpckhwd ((__v4hi)__A, (__v4hi)0LL);
/* Convert the doublewords to floating point two at a time. */
__zero = (__v4sf) _mm_setzero_ps ();
- __ra = __builtin_ia32_cvtpi2ps (__zero, __hisi);
- __rb = __builtin_ia32_cvtpi2ps (__ra, __losi);
+ __ra = __builtin_ia32_cvtpi2ps (__zero, __losi);
+ __rb = __builtin_ia32_cvtpi2ps (__ra, __hisi);
return (__m128) __builtin_ia32_movlhps (__ra, __rb);
}
diff --git a/gcc/config/mips/iris.h b/gcc/config/mips/iris.h
index fce82174e66..cd2e75614d5 100644
--- a/gcc/config/mips/iris.h
+++ b/gcc/config/mips/iris.h
@@ -163,6 +163,11 @@ along with GCC; see the file COPYING3. If not see
library search directories. */
#define LINK_ELIMINATE_DUPLICATE_LDIRECTORIES 1
+/* The SGI linker doesn't understand constructor priorities. */
+#ifndef IRIX_USING_GNU_LD
+#define SUPPORTS_INIT_PRIORITY 0
+#endif
+
/* Add -g to mips.h default to avoid confusing gas with local symbols
generated from stabs info. */
#undef NM_FLAGS
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 72a61d17e5e..801b01e4561 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -6094,6 +6094,95 @@ pa_scalar_mode_supported_p (enum machine_mode mode)
}
}
+/* Return TRUE if INSN, a jump insn, has an unfilled delay slot and
+ it branches into the delay slot. Otherwise, return FALSE. */
+
+static bool
+branch_to_delay_slot_p (rtx insn)
+{
+ rtx jump_insn;
+
+ if (dbr_sequence_length ())
+ return FALSE;
+
+ jump_insn = next_active_insn (JUMP_LABEL (insn));
+ while (insn)
+ {
+ insn = next_active_insn (insn);
+ if (jump_insn == insn)
+ return TRUE;
+
+ /* We can't rely on the length of asms. So, we return FALSE when
+ the branch is followed by an asm. */
+ if (!insn
+ || GET_CODE (PATTERN (insn)) == ASM_INPUT
+ || asm_noperands (PATTERN (insn)) >= 0
+ || get_attr_length (insn) > 0)
+ break;
+ }
+
+ return FALSE;
+}
+
+/* Return TRUE if INSN, a forward jump insn, needs a nop in its delay slot.
+
+ This occurs when INSN has an unfilled delay slot and is followed
+ by an asm. Disaster can occur if the asm is empty and the jump
+ branches into the delay slot. So, we add a nop in the delay slot
+ when this occurs. */
+
+static bool
+branch_needs_nop_p (rtx insn)
+{
+ rtx jump_insn;
+
+ if (dbr_sequence_length ())
+ return FALSE;
+
+ jump_insn = next_active_insn (JUMP_LABEL (insn));
+ while (insn)
+ {
+ insn = next_active_insn (insn);
+ if (!insn || jump_insn == insn)
+ return TRUE;
+
+ if (!(GET_CODE (PATTERN (insn)) == ASM_INPUT
+ || asm_noperands (PATTERN (insn)) >= 0)
+ && get_attr_length (insn) > 0)
+ break;
+ }
+
+ return FALSE;
+}
+
+/* Return TRUE if INSN, a forward jump insn, can use nullification
+ to skip the following instruction. This avoids an extra cycle due
+ to a mis-predicted branch when we fall through. */
+
+static bool
+use_skip_p (rtx insn)
+{
+ rtx jump_insn = next_active_insn (JUMP_LABEL (insn));
+
+ while (insn)
+ {
+ insn = next_active_insn (insn);
+
+ /* We can't rely on the length of asms, so we can't skip asms. */
+ if (!insn
+ || GET_CODE (PATTERN (insn)) == ASM_INPUT
+ || asm_noperands (PATTERN (insn)) >= 0)
+ break;
+ if (get_attr_length (insn) == 4
+ && jump_insn == next_active_insn (insn))
+ return TRUE;
+ if (get_attr_length (insn) > 0)
+ break;
+ }
+
+ return FALSE;
+}
+
/* This routine handles all the normal conditional branch sequences we
might need to generate. It handles compare immediate vs compare
register, nullification of delay slots, varying length branches,
@@ -6105,7 +6194,7 @@ const char *
output_cbranch (rtx *operands, int negated, rtx insn)
{
static char buf[100];
- int useskip = 0;
+ bool useskip;
int nullify = INSN_ANNULLED_BRANCH_P (insn);
int length = get_attr_length (insn);
int xdelay;
@@ -6119,7 +6208,7 @@ output_cbranch (rtx *operands, int negated, rtx insn)
slot and the same branch target as this branch. We could check
for this but jump optimization should eliminate nop jumps. It
is always safe to emit a nop. */
- if (next_real_insn (JUMP_LABEL (insn)) == next_real_insn (insn))
+ if (branch_to_delay_slot_p (insn))
return "nop";
/* The doubleword form of the cmpib instruction doesn't have the LEU
@@ -6143,12 +6232,7 @@ output_cbranch (rtx *operands, int negated, rtx insn)
/* A forward branch over a single nullified insn can be done with a
comclr instruction. This avoids a single cycle penalty due to
mis-predicted branch if we fall through (branch not taken). */
- if (length == 4
- && next_real_insn (insn) != 0
- && get_attr_length (next_real_insn (insn)) == 4
- && JUMP_LABEL (insn) == next_nonnote_insn (next_real_insn (insn))
- && nullify)
- useskip = 1;
+ useskip = (length == 4 && nullify) ? use_skip_p (insn) : FALSE;
switch (length)
{
@@ -6168,7 +6252,12 @@ output_cbranch (rtx *operands, int negated, rtx insn)
if (useskip)
strcat (buf, " %2,%r1,%%r0");
else if (nullify)
- strcat (buf, ",n %2,%r1,%0");
+ {
+ if (branch_needs_nop_p (insn))
+ strcat (buf, ",n %2,%r1,%0%#");
+ else
+ strcat (buf, ",n %2,%r1,%0");
+ }
else
strcat (buf, " %2,%r1,%0");
break;
@@ -6431,7 +6520,7 @@ const char *
output_bb (rtx *operands ATTRIBUTE_UNUSED, int negated, rtx insn, int which)
{
static char buf[100];
- int useskip = 0;
+ bool useskip;
int nullify = INSN_ANNULLED_BRANCH_P (insn);
int length = get_attr_length (insn);
int xdelay;
@@ -6441,7 +6530,7 @@ output_bb (rtx *operands ATTRIBUTE_UNUSED, int negated, rtx insn, int which)
is only used when optimizing; jump optimization should eliminate the
jump. But be prepared just in case. */
- if (next_real_insn (JUMP_LABEL (insn)) == next_real_insn (insn))
+ if (branch_to_delay_slot_p (insn))
return "nop";
/* If this is a long branch with its delay slot unfilled, set `nullify'
@@ -6457,13 +6546,7 @@ output_bb (rtx *operands ATTRIBUTE_UNUSED, int negated, rtx insn, int which)
/* A forward branch over a single nullified insn can be done with a
extrs instruction. This avoids a single cycle penalty due to
mis-predicted branch if we fall through (branch not taken). */
-
- if (length == 4
- && next_real_insn (insn) != 0
- && get_attr_length (next_real_insn (insn)) == 4
- && JUMP_LABEL (insn) == next_nonnote_insn (next_real_insn (insn))
- && nullify)
- useskip = 1;
+ useskip = (length == 4 && nullify) ? use_skip_p (insn) : FALSE;
switch (length)
{
@@ -6487,11 +6570,21 @@ output_bb (rtx *operands ATTRIBUTE_UNUSED, int negated, rtx insn, int which)
if (useskip)
strcat (buf, " %0,%1,1,%%r0");
else if (nullify && negated)
- strcat (buf, ",n %0,%1,%3");
+ {
+ if (branch_needs_nop_p (insn))
+ strcat (buf, ",n %0,%1,%3%#");
+ else
+ strcat (buf, ",n %0,%1,%3");
+ }
else if (nullify && ! negated)
- strcat (buf, ",n %0,%1,%2");
+ {
+ if (branch_needs_nop_p (insn))
+ strcat (buf, ",n %0,%1,%2%#");
+ else
+ strcat (buf, ",n %0,%1,%2");
+ }
else if (! nullify && negated)
- strcat (buf, "%0,%1,%3");
+ strcat (buf, " %0,%1,%3");
else if (! nullify && ! negated)
strcat (buf, " %0,%1,%2");
break;
@@ -6612,7 +6705,7 @@ const char *
output_bvb (rtx *operands ATTRIBUTE_UNUSED, int negated, rtx insn, int which)
{
static char buf[100];
- int useskip = 0;
+ bool useskip;
int nullify = INSN_ANNULLED_BRANCH_P (insn);
int length = get_attr_length (insn);
int xdelay;
@@ -6622,7 +6715,7 @@ output_bvb (rtx *operands ATTRIBUTE_UNUSED, int negated, rtx insn, int which)
is only used when optimizing; jump optimization should eliminate the
jump. But be prepared just in case. */
- if (next_real_insn (JUMP_LABEL (insn)) == next_real_insn (insn))
+ if (branch_to_delay_slot_p (insn))
return "nop";
/* If this is a long branch with its delay slot unfilled, set `nullify'
@@ -6638,13 +6731,7 @@ output_bvb (rtx *operands ATTRIBUTE_UNUSED, int negated, rtx insn, int which)
/* A forward branch over a single nullified insn can be done with a
extrs instruction. This avoids a single cycle penalty due to
mis-predicted branch if we fall through (branch not taken). */
-
- if (length == 4
- && next_real_insn (insn) != 0
- && get_attr_length (next_real_insn (insn)) == 4
- && JUMP_LABEL (insn) == next_nonnote_insn (next_real_insn (insn))
- && nullify)
- useskip = 1;
+ useskip = (length == 4 && nullify) ? use_skip_p (insn) : FALSE;
switch (length)
{
@@ -6668,11 +6755,21 @@ output_bvb (rtx *operands ATTRIBUTE_UNUSED, int negated, rtx insn, int which)
if (useskip)
strcat (buf, "{ %0,1,%%r0| %0,%%sar,1,%%r0}");
else if (nullify && negated)
- strcat (buf, "{,n %0,%3|,n %0,%%sar,%3}");
+ {
+ if (branch_needs_nop_p (insn))
+ strcat (buf, "{,n %0,%3%#|,n %0,%%sar,%3%#}");
+ else
+ strcat (buf, "{,n %0,%3|,n %0,%%sar,%3}");
+ }
else if (nullify && ! negated)
- strcat (buf, "{,n %0,%2|,n %0,%%sar,%2}");
+ {
+ if (branch_needs_nop_p (insn))
+ strcat (buf, "{,n %0,%2%#|,n %0,%%sar,%2%#}");
+ else
+ strcat (buf, "{,n %0,%2|,n %0,%%sar,%2}");
+ }
else if (! nullify && negated)
- strcat (buf, "{%0,%3|%0,%%sar,%3}");
+ strcat (buf, "{ %0,%3| %0,%%sar,%3}");
else if (! nullify && ! negated)
strcat (buf, "{ %0,%2| %0,%%sar,%2}");
break;
@@ -6794,7 +6891,7 @@ output_dbra (rtx *operands, rtx insn, int which_alternative)
/* A conditional branch to the following instruction (e.g. the delay slot) is
asking for a disaster. Be prepared! */
- if (next_real_insn (JUMP_LABEL (insn)) == next_real_insn (insn))
+ if (branch_to_delay_slot_p (insn))
{
if (which_alternative == 0)
return "ldo %1(%0),%0";
@@ -6831,7 +6928,12 @@ output_dbra (rtx *operands, rtx insn, int which_alternative)
{
case 4:
if (nullify)
- return "addib,%C2,n %1,%0,%3";
+ {
+ if (branch_needs_nop_p (insn))
+ return "addib,%C2,n %1,%0,%3%#";
+ else
+ return "addib,%C2,n %1,%0,%3";
+ }
else
return "addib,%C2 %1,%0,%3";
@@ -6939,7 +7041,7 @@ output_movb (rtx *operands, rtx insn, int which_alternative,
/* A conditional branch to the following instruction (e.g. the delay slot) is
asking for a disaster. Be prepared! */
- if (next_real_insn (JUMP_LABEL (insn)) == next_real_insn (insn))
+ if (branch_to_delay_slot_p (insn))
{
if (which_alternative == 0)
return "copy %1,%0";
@@ -6977,7 +7079,12 @@ output_movb (rtx *operands, rtx insn, int which_alternative,
{
case 4:
if (nullify)
- return "movb,%C2,n %1,%0,%3";
+ {
+ if (branch_needs_nop_p (insn))
+ return "movb,%C2,n %1,%0,%3%#";
+ else
+ return "movb,%C2,n %1,%0,%3";
+ }
else
return "movb,%C2 %1,%0,%3";
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 473d129423f..a2c3da0cce8 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -998,7 +998,7 @@
(match_operand:DI 3 "arith11_operand" "rI"))
(match_operand:DI 1 "register_operand" "r")))]
"TARGET_64BIT"
- "sub%I3 %3,%2,%%r0\;add,dc %%r0,%1,%0"
+ "sub%I3,* %3,%2,%%r0\;add,dc %%r0,%1,%0"
[(set_attr "type" "binary")
(set_attr "length" "8")])
@@ -1020,7 +1020,7 @@
(match_operand:DI 3 "register_operand" "r"))
(match_operand:DI 1 "register_operand" "r")))]
"TARGET_64BIT"
- "sub %2,%3,%%r0\;add,dc %%r0,%1,%0"
+ "sub,* %2,%3,%%r0\;add,dc %%r0,%1,%0"
[(set_attr "type" "binary")
(set_attr "length" "8")])
@@ -1043,7 +1043,7 @@
(match_operand:DI 3 "int11_operand" "I"))
(match_operand:DI 1 "register_operand" "r")))]
"TARGET_64BIT"
- "addi %k3,%2,%%r0\;add,dc %%r0,%1,%0"
+ "addi,* %k3,%2,%%r0\;add,dc %%r0,%1,%0"
[(set_attr "type" "binary")
(set_attr "length" "8")])
@@ -1089,7 +1089,7 @@
(gtu:DI (match_operand:DI 2 "register_operand" "r")
(match_operand:DI 3 "arith11_operand" "rI"))))]
"TARGET_64BIT"
- "sub%I3 %3,%2,%%r0\;sub,db %1,%%r0,%0"
+ "sub%I3,* %3,%2,%%r0\;sub,db %1,%%r0,%0"
[(set_attr "type" "binary")
(set_attr "length" "8")])
@@ -1111,7 +1111,7 @@
(match_operand:DI 3 "arith11_operand" "rI")))
(match_operand:DI 4 "register_operand" "r")))]
"TARGET_64BIT"
- "sub%I3 %3,%2,%%r0\;sub,db %1,%4,%0"
+ "sub%I3,* %3,%2,%%r0\;sub,db %1,%4,%0"
[(set_attr "type" "binary")
(set_attr "length" "8")])
@@ -1133,7 +1133,7 @@
(ltu:DI (match_operand:DI 2 "register_operand" "r")
(match_operand:DI 3 "register_operand" "r"))))]
"TARGET_64BIT"
- "sub %2,%3,%%r0\;sub,db %1,%%r0,%0"
+ "sub,* %2,%3,%%r0\;sub,db %1,%%r0,%0"
[(set_attr "type" "binary")
(set_attr "length" "8")])
@@ -1155,7 +1155,7 @@
(match_operand:DI 3 "register_operand" "r")))
(match_operand:DI 4 "register_operand" "r")))]
"TARGET_64BIT"
- "sub %2,%3,%%r0\;sub,db %1,%4,%0"
+ "sub,* %2,%3,%%r0\;sub,db %1,%4,%0"
[(set_attr "type" "binary")
(set_attr "length" "8")])
@@ -1178,7 +1178,7 @@
(leu:DI (match_operand:DI 2 "register_operand" "r")
(match_operand:DI 3 "int11_operand" "I"))))]
"TARGET_64BIT"
- "addi %k3,%2,%%r0\;sub,db %1,%%r0,%0"
+ "addi,* %k3,%2,%%r0\;sub,db %1,%%r0,%0"
[(set_attr "type" "binary")
(set_attr "length" "8")])
@@ -1200,7 +1200,7 @@
(match_operand:DI 3 "int11_operand" "I")))
(match_operand:DI 4 "register_operand" "r")))]
"TARGET_64BIT"
- "addi %k3,%2,%%r0\;sub,db %1,%4,%0"
+ "addi,* %k3,%2,%%r0\;sub,db %1,%4,%0"
[(set_attr "type" "binary")
(set_attr "length" "8")])
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index ee6c09f90cd..63f8ef91c4e 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -199,7 +199,7 @@ int rs6000_compare_fp_p;
/* Label number of label created for -mrelocatable, to call to so we can
get the address of the GOT section */
-int rs6000_pic_labelno;
+static int rs6000_pic_labelno;
#ifdef USING_ELFOS_H
/* Which abi to adhere to */
@@ -15330,7 +15330,8 @@ rs6000_emit_load_toc_table (int fromprolog)
char buf[30];
rtx lab, tmp1, tmp2, got;
- ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno);
+ lab = gen_label_rtx ();
+ ASM_GENERATE_INTERNAL_LABEL (buf, "L", CODE_LABEL_NUMBER (lab));
lab = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf));
if (flag_pic == 2)
got = gen_rtx_SYMBOL_REF (Pmode, toc_label_name);
@@ -15343,8 +15344,7 @@ rs6000_emit_load_toc_table (int fromprolog)
tmp2 = gen_reg_rtx (Pmode);
}
emit_insn (gen_load_toc_v4_PIC_1 (lab));
- emit_move_insn (tmp1,
- gen_rtx_REG (Pmode, LR_REGNO));
+ emit_move_insn (tmp1, gen_rtx_REG (Pmode, LR_REGNO));
emit_insn (gen_load_toc_v4_PIC_3b (tmp2, tmp1, got, lab));
emit_insn (gen_load_toc_v4_PIC_3c (dest, tmp2, got, lab));
}
@@ -15371,8 +15371,7 @@ rs6000_emit_load_toc_table (int fromprolog)
symL = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf));
emit_insn (gen_load_toc_v4_PIC_1 (symF));
- emit_move_insn (dest,
- gen_rtx_REG (Pmode, LR_REGNO));
+ emit_move_insn (dest, gen_rtx_REG (Pmode, LR_REGNO));
emit_insn (gen_load_toc_v4_PIC_2 (temp0, dest, symL, symF));
}
else
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 30aac3ec094..3a5226853a1 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -10737,8 +10737,8 @@
[(set_attr "type" "load")])
(define_insn "load_toc_v4_PIC_3b"
- [(set (match_operand:SI 0 "gpc_reg_operand" "=b")
- (plus:SI (match_operand:SI 1 "gpc_reg_operand" "r")
+ [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
+ (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
(high:SI
(minus:SI (match_operand:SI 2 "symbol_ref_operand" "s")
(match_operand:SI 3 "symbol_ref_operand" "s")))))]
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index a878a53ffa9..58b5bcd0818 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -416,8 +416,6 @@ do { \
Some svr4 assemblers need to also have something extra said about the
function's return value. We allow for that here. */
-extern int rs6000_pic_labelno;
-
/* Override elfos.h definition. */
#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
diff --git a/gcc/configure b/gcc/configure
index db362053b06..987adbb4d75 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -22442,6 +22442,18 @@ if test $gcc_cv_as_tls = yes; then
set_have_as_tls=yes
fi
fi
+case "$target" in
+ *-*-irix6*)
+ # IRIX 6.5 rld and libc.so lack TLS support, so even if gas and gld
+ # with TLS support are in use, native TLS cannot work.
+ set_have_as_tls=no
+ ;;
+ *-*-osf*)
+ # Tru64 UNIX loader and libc.so lack TLS support, so even if gas and
+ # gld with TLS support are in use, native TLS cannot work.
+ set_have_as_tls=no
+ ;;
+esac
if test $set_have_as_tls = yes ; then
cat >>confdefs.h <<\_ACEOF
diff --git a/gcc/configure.ac b/gcc/configure.ac
index a1078d27086..3dd7cbc5733 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2852,6 +2852,18 @@ else
[$tls_first_major,$tls_first_minor,0], [$tls_as_opt], [$conftest_s],,
[set_have_as_tls=yes])
fi
+case "$target" in
+ *-*-irix6*)
+ # IRIX 6.5 rld and libc.so lack TLS support, so even if gas and gld
+ # with TLS support are in use, native TLS cannot work.
+ set_have_as_tls=no
+ ;;
+ *-*-osf*)
+ # Tru64 UNIX loader and libc.so lack TLS support, so even if gas and
+ # gld with TLS support are in use, native TLS cannot work.
+ set_have_as_tls=no
+ ;;
+esac
if test $set_have_as_tls = yes ; then
AC_DEFINE(HAVE_AS_TLS, 1,
[Define if your assembler supports thread-local storage.])
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 1b491594c71..e780d2a25ba 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,12 @@
+2010-12-07 Jakub Jelinek <jakub@redhat.com>
+
+ Backport from mainline
+ 2010-11-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/46538
+ * decl.c (cp_make_fname_decl): Return error_mark_node if
+ current_binding_level has already sk_function_parms kind.
+
2010-10-01 Release Manager
* GCC 4.4.5 released.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 6f208764ea5..5b05d5627c6 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -3536,6 +3536,8 @@ cp_make_fname_decl (tree id, int type_dep)
if (current_function_decl)
{
struct cp_binding_level *b = current_binding_level;
+ if (b->kind == sk_function_parms)
+ return error_mark_node;
while (b->level_chain->kind != sk_function_parms)
b = b->level_chain;
pushdecl_with_scope (decl, b, /*is_friend=*/false);
diff --git a/gcc/dse.c b/gcc/dse.c
index 3d347cefbc6..844fd51c96c 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -826,7 +826,7 @@ replace_inc_dec (rtx *r, void *d)
case POST_INC:
{
rtx r1 = XEXP (x, 0);
- rtx c = gen_int_mode (Pmode, data->size);
+ rtx c = gen_int_mode (data->size, Pmode);
emit_insn_before (gen_rtx_SET (Pmode, r1,
gen_rtx_PLUS (Pmode, r1, c)),
data->insn);
@@ -837,7 +837,7 @@ replace_inc_dec (rtx *r, void *d)
case POST_DEC:
{
rtx r1 = XEXP (x, 0);
- rtx c = gen_int_mode (Pmode, -data->size);
+ rtx c = gen_int_mode (-data->size, Pmode);
emit_insn_before (gen_rtx_SET (Pmode, r1,
gen_rtx_PLUS (Pmode, r1, c)),
data->insn);
diff --git a/gcc/expr.c b/gcc/expr.c
index b6bc529ff72..fd678890561 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4662,7 +4662,10 @@ store_expr (tree exp, rtx target, int call_param_p, bool nontemporal)
/* If store_expr stores a DECL whose DECL_RTL(exp) == TARGET,
but TARGET is not valid memory reference, TEMP will differ
from TARGET although it is really the same location. */
- && !(alt_rtl && rtx_equal_p (alt_rtl, target))
+ && !(alt_rtl
+ && rtx_equal_p (alt_rtl, target)
+ && !side_effects_p (alt_rtl)
+ && !side_effects_p (target))
/* If there's nothing to copy, don't bother. Don't call
expr_size unless necessary, because some front-ends (C++)
expr_size-hook must not be given objects that are not
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 6ef44f743a0..cfa2b947093 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,48 @@
+2011-01-16 Jakub Jelinek <jakub@redhat.com>
+
+ Backport from mainline
+ 2010-12-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/46874
+ * trans-openmp.c (gfc_trans_omp_array_reduction): Handle allocatable
+ dummy variables.
+
+2010-12-09 Daniel Kraft <d@domob.eu>
+
+ PR fortran/46794
+ * trans-expr.c (gfc_conv_power_op): Handle kind of result expression
+ correctly for integer kind 1 and 2 operands.
+
+2010-12-09 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/45081
+ * simplify.c (is_constant_array_expr): Allow structure array
+ elements as well as constants.
+ (gfc_simplify_reshape): Copy the derived type of source to
+ the result.
+
+2010-12-07 Jakub Jelinek <jakub@redhat.com>
+
+ Backport from mainline
+ 2010-12-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/46753
+ * trans-openmp.c (gfc_trans_omp_do): Use build2_loc instead of
+ fold_build2_loc for OMP_FOR conditions.
+
+2010-11-25 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/46638
+ * target-memory.c (gfc_interpret_derived): Correctly handle
+ component offset.
+
+2010-11-13 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/45742
+ * trans-common.c (build_field): Add TREE_SIDE_EFFECTS for volatile.
+ * trans-decl.c (gfc_finish_var_decl): Ditto.
+ (create_function_arglist): Handle volatile dummy arguments.
+
2010-10-25 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/46140
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index 8b84d65f8e8..3688c8f031e 100644
--- a/gcc/fortran/simplify.c
+++ b/gcc/fortran/simplify.c
@@ -3448,7 +3448,8 @@ is_constant_array_expr (gfc_expr *e)
return false;
for (c = e->value.constructor; c; c = c->next)
- if (c->expr->expr_type != EXPR_CONSTANT)
+ if (c->expr->expr_type != EXPR_CONSTANT
+ && c->expr->expr_type != EXPR_STRUCTURE)
return false;
return true;
@@ -3679,6 +3680,11 @@ inc:
e->ts = source->ts;
e->rank = rank;
+ if (source->ts.type == BT_CHARACTER)
+ e->ts.cl = source->ts.cl;
+ else if (source->ts.type == BT_DERIVED)
+ e->ts.derived = source->ts.derived;
+
return e;
bad_reshape:
diff --git a/gcc/fortran/target-memory.c b/gcc/fortran/target-memory.c
index dc10b53d926..baac1efd0c2 100644
--- a/gcc/fortran/target-memory.c
+++ b/gcc/fortran/target-memory.c
@@ -484,7 +484,16 @@ gfc_interpret_derived (unsigned char *buffer, size_t buffer_size, gfc_expr *resu
}
}
- ptr = TREE_INT_CST_LOW (DECL_FIELD_OFFSET (cmp->backend_decl));
+ /* Calculate the offset, which consists of the the FIELD_OFFSET in
+ bytes, which appears in multiples of DECL_OFFSET_ALIGN-bit-sized,
+ and additional bits of FIELD_BIT_OFFSET. The code assumes that all
+ sizes of the components are multiples of BITS_PER_UNIT,
+ i.e. there are, e.g., no bit fields. */
+
+ ptr = TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (cmp->backend_decl));
+ gcc_assert (ptr % 8 == 0);
+ ptr = ptr/8 + TREE_INT_CST_LOW (DECL_FIELD_OFFSET (cmp->backend_decl));
+
gfc_target_interpret_expr (&buffer[ptr], buffer_size - ptr,
tail->expr);
diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c
index 92edd208dae..203d802130e 100644
--- a/gcc/fortran/trans-common.c
+++ b/gcc/fortran/trans-common.c
@@ -323,6 +323,7 @@ build_field (segment_info *h, tree union_type, record_layout_info rli)
{
tree new_type;
TREE_THIS_VOLATILE (field) = 1;
+ TREE_SIDE_EFFECTS (field) = 1;
new_type = build_qualified_type (TREE_TYPE (field), TYPE_QUAL_VOLATILE);
TREE_TYPE (field) = new_type;
}
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index cc7912f6404..abcf5f0029b 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -539,6 +539,7 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym)
if (sym->attr.volatile_)
{
TREE_THIS_VOLATILE (decl) = 1;
+ TREE_SIDE_EFFECTS (decl) = 1;
new_type = build_qualified_type (TREE_TYPE (decl), TYPE_QUAL_VOLATILE);
TREE_TYPE (decl) = new_type;
}
@@ -1655,10 +1656,19 @@ create_function_arglist (gfc_symbol * sym)
if (f->sym->attr.proc_pointer)
type = build_pointer_type (type);
+
+ if (f->sym->attr.volatile_)
+ type = build_qualified_type (type, TYPE_QUAL_VOLATILE);
/* Build the argument declaration. */
parm = build_decl (PARM_DECL, gfc_sym_identifier (f->sym), type);
+ if (f->sym->attr.volatile_)
+ {
+ TREE_THIS_VOLATILE (parm) = 1;
+ TREE_SIDE_EFFECTS (parm) = 1;
+ }
+
/* Fill in arg stuff. */
DECL_CONTEXT (parm) = fndecl;
DECL_ARG_TYPE (parm) = TREE_VALUE (typelist);
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 27feea3004e..a68cfdcc50c 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -917,6 +917,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
tree gfc_int4_type_node;
int kind;
int ikind;
+ int res_ikind_1, res_ikind_2;
gfc_se lse;
gfc_se rse;
tree fndecl;
@@ -937,6 +938,13 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
gfc_int4_type_node = gfc_get_int_type (4);
+ /* In case of integer operands with kinds 1 or 2, we call the integer kind 4
+ library routine. But in the end, we have to convert the result back
+ if this case applies -- with res_ikind_K, we keep track whether operand K
+ falls into this case. */
+ res_ikind_1 = -1;
+ res_ikind_2 = -1;
+
kind = expr->value.op.op1->ts.kind;
switch (expr->value.op.op2->ts.type)
{
@@ -947,6 +955,7 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
case 1:
case 2:
rse.expr = convert (gfc_int4_type_node, rse.expr);
+ res_ikind_2 = ikind;
/* Fall through. */
case 4:
@@ -969,7 +978,10 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
case 1:
case 2:
if (expr->value.op.op1->ts.type == BT_INTEGER)
- lse.expr = convert (gfc_int4_type_node, lse.expr);
+ {
+ lse.expr = convert (gfc_int4_type_node, lse.expr);
+ res_ikind_1 = kind;
+ }
else
gcc_unreachable ();
/* Fall through. */
@@ -1080,6 +1092,15 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
}
se->expr = build_call_expr (fndecl, 2, lse.expr, rse.expr);
+
+ /* Convert the result back if it is of wrong integer kind. */
+ if (res_ikind_1 != -1 && res_ikind_2 != -1)
+ {
+ /* We want the maximum of both operand kinds as result. */
+ if (res_ikind_1 < res_ikind_2)
+ res_ikind_1 = res_ikind_2;
+ se->expr = convert (gfc_get_int_type (res_ikind_1), se->expr);
+ }
}
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index de24f0fcd30..d09034db789 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -477,13 +477,23 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where)
gfc_symbol init_val_sym, outer_sym, intrinsic_sym;
gfc_expr *e1, *e2, *e3, *e4;
gfc_ref *ref;
- tree decl, backend_decl, stmt;
+ tree decl, backend_decl, stmt, type, outer_decl;
locus old_loc = gfc_current_locus;
const char *iname;
gfc_try t;
decl = OMP_CLAUSE_DECL (c);
gfc_current_locus = where;
+ type = TREE_TYPE (decl);
+ outer_decl = create_tmp_var_raw (type, NULL);
+ if (TREE_CODE (decl) == PARM_DECL
+ && TREE_CODE (type) == REFERENCE_TYPE
+ && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (type))
+ && GFC_TYPE_ARRAY_AKIND (TREE_TYPE (type)) == GFC_ARRAY_ALLOCATABLE)
+ {
+ decl = build_fold_indirect_ref (decl);
+ type = TREE_TYPE (type);
+ }
/* Create a fake symbol for init value. */
memset (&init_val_sym, 0, sizeof (init_val_sym));
@@ -502,7 +512,9 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where)
outer_sym.attr.dummy = 0;
outer_sym.attr.result = 0;
outer_sym.attr.flavor = FL_VARIABLE;
- outer_sym.backend_decl = create_tmp_var_raw (TREE_TYPE (decl), NULL);
+ outer_sym.backend_decl = outer_decl;
+ if (decl != OMP_CLAUSE_DECL (c))
+ outer_sym.backend_decl = build_fold_indirect_ref (outer_decl);
/* Create fake symtrees for it. */
symtree1 = gfc_new_symtree (&root1, sym->name);
@@ -619,12 +631,12 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where)
/* Create the init statement list. */
pushlevel (0);
- if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl))
- && GFC_TYPE_ARRAY_AKIND (TREE_TYPE (decl)) == GFC_ARRAY_ALLOCATABLE)
+ if (GFC_DESCRIPTOR_TYPE_P (type)
+ && GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_ALLOCATABLE)
{
/* If decl is an allocatable array, it needs to be allocated
with the same bounds as the outer var. */
- tree type = TREE_TYPE (decl), rank, size, esize, ptr;
+ tree rank, size, esize, ptr;
stmtblock_t block;
gfc_start_block (&block);
@@ -660,8 +672,8 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where)
/* Create the merge statement list. */
pushlevel (0);
- if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (decl))
- && GFC_TYPE_ARRAY_AKIND (TREE_TYPE (decl)) == GFC_ARRAY_ALLOCATABLE)
+ if (GFC_DESCRIPTOR_TYPE_P (type)
+ && GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_ALLOCATABLE)
{
/* If decl is an allocatable array, it needs to be deallocated
afterwards. */
@@ -681,7 +693,7 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where)
OMP_CLAUSE_REDUCTION_MERGE (c) = stmt;
/* And stick the placeholder VAR_DECL into the clause as well. */
- OMP_CLAUSE_REDUCTION_PLACEHOLDER (c) = outer_sym.backend_decl;
+ OMP_CLAUSE_REDUCTION_PLACEHOLDER (c) = outer_decl;
gfc_current_locus = old_loc;
@@ -1240,8 +1252,9 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock,
if (simple)
{
TREE_VEC_ELT (init, i) = build2_v (MODIFY_EXPR, dovar, from);
- TREE_VEC_ELT (cond, i) = fold_build2 (simple > 0 ? LE_EXPR : GE_EXPR,
- boolean_type_node, dovar, to);
+ /* The condition should not be folded. */
+ TREE_VEC_ELT (cond, i) = build2 (simple > 0 ? LE_EXPR : GE_EXPR,
+ boolean_type_node, dovar, to);
TREE_VEC_ELT (incr, i) = fold_build2 (PLUS_EXPR, type, dovar, step);
TREE_VEC_ELT (incr, i) = fold_build2 (MODIFY_EXPR, type, dovar,
TREE_VEC_ELT (incr, i));
@@ -1262,8 +1275,9 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock,
count = gfc_create_var (type, "count");
TREE_VEC_ELT (init, i) = build2_v (MODIFY_EXPR, count,
build_int_cst (type, 0));
- TREE_VEC_ELT (cond, i) = fold_build2 (LT_EXPR, boolean_type_node,
- count, tmp);
+ /* The condition should not be folded. */
+ TREE_VEC_ELT (cond, i) = build2 (LT_EXPR, boolean_type_node,
+ count, tmp);
TREE_VEC_ELT (incr, i) = fold_build2 (PLUS_EXPR, type, count,
build_int_cst (type, 1));
TREE_VEC_ELT (incr, i) = fold_build2 (MODIFY_EXPR, type,
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index ea4f26d5456..94bae9c83f2 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -4842,6 +4842,13 @@ gimplify_asm_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
/* If the operand is a memory input, it should be an lvalue. */
if (!allows_reg && allows_mem)
{
+ tree inputv = TREE_VALUE (link);
+ STRIP_NOPS (inputv);
+ if (TREE_CODE (inputv) == PREDECREMENT_EXPR
+ || TREE_CODE (inputv) == PREINCREMENT_EXPR
+ || TREE_CODE (inputv) == POSTDECREMENT_EXPR
+ || TREE_CODE (inputv) == POSTINCREMENT_EXPR)
+ TREE_VALUE (link) = error_mark_node;
tret = gimplify_expr (&TREE_VALUE (link), pre_p, post_p,
is_gimple_lvalue, fb_lvalue | fb_mayfail);
mark_addressable (TREE_VALUE (link));
diff --git a/gcc/jump.c b/gcc/jump.c
index 2b9a9545223..cc024a80e78 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -1670,7 +1670,13 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
case 'i':
if (XINT (x, i) != XINT (y, i))
- return 0;
+ {
+ if (((code == ASM_OPERANDS && i == 5)
+ || (code == ASM_INPUT && i == 1))
+ && locator_eq (XINT (x, i), XINT (y, i)))
+ break;
+ return 0;
+ }
break;
case 't':
diff --git a/gcc/rtl.c b/gcc/rtl.c
index c275091ad77..09700d0b654 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -405,7 +405,15 @@ rtx_equal_p_cb (const_rtx x, const_rtx y, rtx_equal_p_callback_function cb)
case 'n':
case 'i':
if (XINT (x, i) != XINT (y, i))
- return 0;
+ {
+#ifndef GENERATOR_FILE
+ if (((code == ASM_OPERANDS && i == 5)
+ || (code == ASM_INPUT && i == 1))
+ && locator_eq (XINT (x, i), XINT (y, i)))
+ break;
+#endif
+ return 0;
+ }
break;
case 'V':
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 21471b7d22d..c5c80e5af2e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,163 @@
+2011-01-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ Backport from mainline
+ 2011-01-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/47318
+ * gcc.target/i386/avx-vmaskmovpd-1.c: New.
+ * gcc.target/i386/avx-vmaskmovpd-2.c: Likewise.
+ * gcc.target/i386/avx-vmaskmovps-1.c: Likewise.
+ * gcc.target/i386/avx-vmaskmovps-1.c: Likewise.
+
+ * gcc.target/i386/avx-vmaskmovpd-256-1.c (avx_test): Load mask
+ as __m256i.
+ * gcc.target/i386/avx-vmaskmovpd-256-2.c (avx_test): Likewise.
+ * gcc.target/i386/avx-vmaskmovps-256-1.c (avx_test): Likewise.
+ * gcc.target/i386/avx-vmaskmovps-256-2.c (avx_test): Likewise.
+
+2011-01-16 Jakub Jelinek <jakub@redhat.com>
+
+ Backport from mainline
+ 2010-12-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/46880
+ * gcc.target/i386/pr46880.c: New test.
+
+ PR middle-end/45852
+ * gcc.target/i386/pr45852.c: New test.
+
+ 2010-12-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/46865
+ * gcc.target/i386/pr46865-1.c: New test.
+ * gcc.target/i386/pr46865-2.c: New test.
+
+2011-01-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * gfortran.dg/cray_pointers_2.f90: Use dg-timeout-factor 4.
+
+2011-01-12 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR testsuite/33033
+ * gcc.dg/20061124-1.c: Pass -mcpu=v9 on the SPARC.
+
+2010-12-27 Yao Qi <yao@codesourcery.com>
+
+ Backport from mainline:
+ 2010-10-14 Yao Qi <yao@codesourcery.com>
+
+ PR target/45447
+ * gcc.target/arm/pr45447.c: New test.
+
+2010-12-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ Backport from mainline:
+ 2010-04-01 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * g++.dg/cpp/_Pragma1.C: Skip on alpha*-dec-osf*.
+ * g++.dg/eh/spbp.C: Likewise.
+ * g++.dg/other/pragma-ep-1.C: Properly define p, remove
+ superfluous casts.
+ * objc.dg/dwarf-1.m: Skip on alpha*-dec-osf*.
+ * objc.dg/dwarf-2.m: Likewise.
+
+2010-12-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ Backport from mainline:
+ 2010-11-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * lib/prune.exp (prune_gcc_output): Ignore IRIX 6 linker multiline
+ warning.
+ * g++.dg/cpp/_Pragma1.C: Skip on mips-sgi-irix*.
+
+2010-12-09 Daniel Kraft <d@domob.eu>
+
+ PR fortran/46794
+ * gfortran.dg/power2.f90: New test.
+
+2010-12-09 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/45081
+ * gfortran.dg/derived_array_intrinsics_1.f90 : New test.
+
+2010-12-07 Jakub Jelinek <jakub@redhat.com>
+
+ Backport from mainline
+ 2010-11-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/46538
+ * g++.dg/other/error34.C: New test.
+
+ 2010-11-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/46534
+ * gcc.c-torture/compile/pr46534.c: New test.
+
+2010-12-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * ada/acats/run_acats (which): Assign output to temporary
+ variable, only use if successful.
+ Use last field of type output.
+
+2010-12-05 Richard Guenther <rguenther@suse.de>
+ Ira Rosen <irar@il.ibm.com>
+
+ PR tree-optimization/46663
+ * gcc.dg/vect/pr46663.c: New test.
+
+2010-11-28 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/aliasing2.adb (dg-final): Robustify pattern matching.
+ * gnat.dg/pack9.adb (dg-final): Likewise.
+
+2010-11-27 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/46638
+ PR fortran/46668
+ * gfortran.dg/transfer_simplify_10.f90: Fix endian issue.
+
+2010-11-25 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/46638
+ * gfortran.dg/transfer_simplify_10.f90: New.
+
+2010-11-13 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/45742
+ * gfortran.dg/volatile12.f90: New.
+
+2010-11-12 Jakub Jelinek <jakub@redhat.com>
+
+ Backport from mainline
+ 2010-11-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/43690
+ * c-c++-common/pr43690.c: New test.
+
+ 2010-11-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/46107
+ * gcc.c-torture/compile/pr46107.c: New test.
+
+2010-11-10 Uros Bizjak <ubizjak@gmail.com>
+
+ PR target/46419
+ * gcc-target/i386/pr46419.c: New test.
+
+2010-11-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ Backport from mainline:
+ 2010-11-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * gcc.target/i386/i386.exp (FLAGS): Remove.
+ Wrap gcc_target_compile with $clearcap_ldflags added to options.
+
+2010-11-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ Backport from mainline:
+ PR libgfortran/46010
+ * gfortran.dg/namelist_66.f90: New test.
+
2010-10-22 Uros Bizjak <ubizjak@gmail.com>
H.J. Lu <hongjiu.lu@intel.com>
@@ -195,7 +355,7 @@
PR middle-end/40386
* gcc.c-torture/execute/{pr40386.c,pr40386.x}: New testcase.
-
+
2010-09-08 Jakub Jelinek <jakub@redhat.com>
PR fortran/45595
@@ -205,14 +365,14 @@
Backport from mainline
2010-08-19 Ian Bolton <ian.bolton@arm.com>
-
+
PR target/45070
* gcc.c-torture/execute/pr45070.c: New.
2010-08-19 Ian Bolton <ian.bolton@arm.com>
* g++.dg/pr44328.C: New test.
-
+
2010-08-07 Marcus Shawcroft <marcus.shawcroft@arm.com>
* lib/target-supports.exp: (check_effective_target_sync_int_long):
diff --git a/gcc/testsuite/ada/acats/run_acats b/gcc/testsuite/ada/acats/run_acats
index 9a9bdc2a318..8f4852465dc 100755
--- a/gcc/testsuite/ada/acats/run_acats
+++ b/gcc/testsuite/ada/acats/run_acats
@@ -14,9 +14,9 @@ fi
# Fall back to whence which ksh88 and ksh93 provide, but bash does not.
which () {
- type -p $* 2>/dev/null && return 0
- type $* 2>/dev/null | awk '{print $3}' && return 0
- whence $* 2>/dev/null && return 0
+ path=`type -p $* 2>/dev/null` && { echo $path; return 0; }
+ path=`type $* 2>/dev/null | awk '{print $NF}'` && { echo $path; return 0; }
+ path=`whence $* 2>/dev/null` && { echo $path; return 0; }
return 1
}
diff --git a/gcc/testsuite/c-c++-common/pr43690.c b/gcc/testsuite/c-c++-common/pr43690.c
new file mode 100644
index 00000000000..67c6cb0f88c
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/pr43690.c
@@ -0,0 +1,13 @@
+/* PR middle-end/43690 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void
+foo (char *x)
+{
+ asm ("" : : "m" (x++)); /* { dg-error "is not directly addressable" } */
+ asm ("" : : "m" (++x)); /* { dg-error "is not directly addressable" } */
+ asm ("" : : "m" (x--)); /* { dg-error "is not directly addressable" } */
+ asm ("" : : "m" (--x)); /* { dg-error "is not directly addressable" } */
+ asm ("" : : "m" (x + 1)); /* { dg-error "is not directly addressable" } */
+}
diff --git a/gcc/testsuite/g++.dg/cpp/_Pragma1.C b/gcc/testsuite/g++.dg/cpp/_Pragma1.C
index e44709b4570..60627df1cc6 100644
--- a/gcc/testsuite/g++.dg/cpp/_Pragma1.C
+++ b/gcc/testsuite/g++.dg/cpp/_Pragma1.C
@@ -2,7 +2,7 @@
// This is supposed to succeed only if
// the target defines HANDLE_PRAGMA_PACK_PUSH_POP
// and doesn't define HANDLE_PRAGMA_PACK_WITH_EXPANSION.
-// { dg-do compile { target { ! { powerpc-ibm-aix* *-*-solaris2* fido-*-* m68k-*-* sh*-[us]*-elf m32c-*-* } } } }
+// { dg-do compile { target { ! { powerpc-ibm-aix* *-*-solaris2* fido-*-* m68k-*-* mips-sgi-irix* sh*-[us]*-elf m32c-*-* alpha*-dec-osf* } } } }
#define push bar
#define foo _Pragma ("pack(push)")
diff --git a/gcc/testsuite/g++.dg/eh/spbp.C b/gcc/testsuite/g++.dg/eh/spbp.C
index 181e65d213f..a781622ef4e 100644
--- a/gcc/testsuite/g++.dg/eh/spbp.C
+++ b/gcc/testsuite/g++.dg/eh/spbp.C
@@ -1,6 +1,6 @@
/* { dg-do run } */
/* { dg-options "-gdwarf-2" } */
-/* { dg-skip-if "No Dwarf" { { *-*-aix* hppa*-*-hpux* } && { ! hppa*64*-*-* } } { "*" } { "" } } */
+/* { dg-skip-if "No Dwarf" { { *-*-aix* alpha*-dec-osf* hppa*-*-hpux* } && { ! hppa*64*-*-* } } { "*" } { "" } } */
/* This was a bug on x86-darwin, where the register numbering for SP
and BP was swapped (it's easy to do because on that port it's
diff --git a/gcc/testsuite/g++.dg/other/error34.C b/gcc/testsuite/g++.dg/other/error34.C
new file mode 100644
index 00000000000..10a782d387d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/error34.C
@@ -0,0 +1,6 @@
+// PR c++/46538
+// { dg-do compile }
+// { dg-options "" }
+
+S () : str(__PRETTY_FUNCTION__) {} // { dg-error "forbids declaration" }
+// { dg-error "only constructors" "" { target *-*-* } 5 }
diff --git a/gcc/testsuite/g++.dg/other/pragma-ep-1.C b/gcc/testsuite/g++.dg/other/pragma-ep-1.C
index 151003cb153..9362943a527 100644
--- a/gcc/testsuite/g++.dg/other/pragma-ep-1.C
+++ b/gcc/testsuite/g++.dg/other/pragma-ep-1.C
@@ -22,6 +22,6 @@ extern "C" int three(void);
extern "C" int four(void);
-void *p[] = {
- (void *) one, (void *) two, (void *) three, (void *) four
+int (*p[])(void) = {
+ one, two, three, four
};
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr46107.c b/gcc/testsuite/gcc.c-torture/compile/pr46107.c
new file mode 100644
index 00000000000..41582b8a161
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr46107.c
@@ -0,0 +1,16 @@
+/* PR tree-optimization/46107 */
+
+int foo (void) __attribute__ ((noreturn));
+
+void
+bar (int x, int *y, int z)
+{
+ static void *j[] = { &&l1, &&l2 };
+l1:
+ if (*y)
+ goto *j[z];
+ foo ();
+l2:
+ *y ^= (x & 1) ? -1 : 0;
+ goto *j[x];
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr46534.c b/gcc/testsuite/gcc.c-torture/compile/pr46534.c
new file mode 100644
index 00000000000..3023ad9f996
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr46534.c
@@ -0,0 +1,17 @@
+/* PR middle-end/46534 */
+
+extern int printf (const char *, ...);
+
+#define S1 " "
+#define S2 S1 S1 S1 S1 S1 S1 S1 S1 S1 S1
+#define S3 S2 S2 S2 S2 S2 S2 S2 S2 S2 S2
+#define S4 S3 S3 S3 S3 S3 S3 S3 S3 S3 S3
+#define S5 S4 S4 S4 S4 S4 S4 S4 S4 S4 S4
+#define S6 S5 S5 S5 S5 S5 S5 S5 S5 S5 S5
+#define S7 S6 S6 S6 S6 S6 S6 S6 S6 S6 S6
+
+void
+foo (void)
+{
+ printf (S7 "\n");
+}
diff --git a/gcc/testsuite/gcc.dg/20061124-1.c b/gcc/testsuite/gcc.dg/20061124-1.c
index dab57ef4806..26c35f75a00 100644
--- a/gcc/testsuite/gcc.dg/20061124-1.c
+++ b/gcc/testsuite/gcc.dg/20061124-1.c
@@ -1,5 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target sync_char_short } */
+/* { dg-options "-mcpu=v9" { target sparc*-*-* } } */
/* This testcase failed on s390 because no compare instruction for
the check of FLAG was emitted. */
diff --git a/gcc/testsuite/gcc.dg/vect/pr46663.c b/gcc/testsuite/gcc.dg/vect/pr46663.c
new file mode 100644
index 00000000000..42a1ffbbc4b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/pr46663.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-vectorize -fdump-tree-vect-details -fexceptions" } */
+
+typedef __attribute__ ((const)) int (*bart) (void);
+
+int foo (bart bar, int m)
+{
+ int i, j = 0;
+ for (i = 0; i < m; i++)
+ j += bar();
+ return j;
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.target/arm/pr45447.c b/gcc/testsuite/gcc.target/arm/pr45447.c
new file mode 100644
index 00000000000..cb4a4427511
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/pr45447.c
@@ -0,0 +1,3 @@
+/* { dg-do compile } */
+/* { dg-options "-g -femit-struct-debug-baseonly" } */
+typedef __builtin_va_list x;
diff --git a/gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-1.c b/gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-1.c
new file mode 100644
index 00000000000..6204ebd2872
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-1.c
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-require-effective-target avx } */
+/* { dg-options "-O2 -mavx" } */
+
+#include "avx-check.h"
+
+#ifndef MASK
+#define MASK 7
+#endif
+
+#define mask_v(pos) (((MASK & (0x1ULL << (pos))) >> (pos)) << 63)
+
+void static
+avx_test (void)
+{
+ int i;
+ long long m[2] = {mask_v(0), mask_v(1)};
+ double s[2] = {1.1, 2.2};
+ union128d u;
+ union128i_q mask;
+ double e[2] = {0.0};
+
+ mask.x = _mm_loadu_si128 ((__m128i *)m);
+ u.x = _mm_maskload_pd (s, mask.x);
+
+ for (i = 0 ; i < 2; i++)
+ e[i] = m[i] ? s[i] : 0;
+
+ if (check_union128d (u, e))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-2.c b/gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-2.c
new file mode 100644
index 00000000000..6bc620755f9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-2.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+/* { dg-require-effective-target avx } */
+/* { dg-options "-O2 -mavx" } */
+
+#include "avx-check.h"
+
+#ifndef MASK
+#define MASK 6
+#endif
+
+#define mask_v(pos) (((MASK & (0x1ULL << (pos))) >> (pos)) << 63)
+
+void static
+avx_test (void)
+{
+ int i;
+ long long m[2] = {mask_v(0), mask_v(1)};
+ double s[2] = {1.1, 2.2};
+ double e[2] = {0.0};
+ double d[2] = {0.0};
+ union128d src;
+ union128i_q mask;
+
+ src.x = _mm_loadu_pd (s);
+ mask.x = _mm_loadu_si128 ((__m128i *)m);
+ _mm_maskstore_pd (d, mask.x, src.x);
+
+ for (i = 0 ; i < 2; i++)
+ e[i] = m[i] ? s[i] : 0;
+
+ if (checkVd (d, e, 2))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-1.c
index f29826bbbd4..e591c05c8e8 100644
--- a/gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-1.c
@@ -14,12 +14,13 @@ void static
avx_test (void)
{
int i;
- long long m[8] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3)};
+ long long m[4] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3)};
double s[4] = {1.1, 2.2, 3.3, 4.4};
- union256d u, mask;
+ union256d u;
+ union256i_q mask;
double e [4] = {0.0};
- mask.x = _mm256_loadu_pd ((double*)m);
+ mask.x = _mm256_loadu_si256 ((__m256i *)m);
u.x = _mm256_maskload_pd (s, mask.x);
for (i = 0 ; i < 4; i++)
diff --git a/gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-2.c b/gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-2.c
index 1e574b6993b..5df2f94ee5f 100644
--- a/gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-2.c
+++ b/gcc/testsuite/gcc.target/i386/avx-vmaskmovpd-256-2.c
@@ -18,10 +18,11 @@ avx_test (void)
double s[4] = {1.1, 2.2, 3.3, 4.4};
double e [4] = {0.0};
double d [4] = {0.0};
- union256d src, mask;
+ union256d src;
+ union256i_q mask;
src.x = _mm256_loadu_pd (s);
- mask.x = _mm256_loadu_pd ((double*)m);
+ mask.x = _mm256_loadu_si256 ((__m256i *)m);
_mm256_maskstore_pd (d, mask.x, src.x);
for (i = 0 ; i < 4; i++)
diff --git a/gcc/testsuite/gcc.target/i386/avx-vmaskmovps-1.c b/gcc/testsuite/gcc.target/i386/avx-vmaskmovps-1.c
new file mode 100644
index 00000000000..360a04dbaaa
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx-vmaskmovps-1.c
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-require-effective-target avx } */
+/* { dg-options "-O2 -mavx" } */
+
+#include "avx-check.h"
+
+#ifndef MASK
+#define MASK 134
+#endif
+
+#define mask_v(pos) (((MASK & (0x1 << (pos))) >> (pos)) << 31)
+
+void static
+avx_test (void)
+{
+ int i;
+ int m[4] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3)};
+ float s[4] = {1,2,3,4};
+ union128 u;
+ union128i_d mask;
+ float e[4] = {0.0};
+
+ mask.x = _mm_loadu_si128 ((__m128i *)m);
+ u.x = _mm_maskload_ps (s, mask.x);
+
+ for (i = 0 ; i < 4; i++)
+ e[i] = m[i] ? s[i] : 0;
+
+ if (check_union128 (u, e))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx-vmaskmovps-2.c b/gcc/testsuite/gcc.target/i386/avx-vmaskmovps-2.c
new file mode 100644
index 00000000000..3dde96557c0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx-vmaskmovps-2.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+/* { dg-require-effective-target avx } */
+/* { dg-options "-O2 -mavx" } */
+
+#include "avx-check.h"
+
+#ifndef MASK
+#define MASK 214
+#endif
+
+#define mask_v(pos) (((MASK & (0x1 << (pos))) >> (pos)) << 31)
+
+void static
+avx_test (void)
+{
+ int i;
+ int m[4] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3)};
+ float s[4] = {1,2,3,4};
+ union128 src;
+ union128i_d mask;
+ float e[4] = {0.0};
+ float d[4] = {0.0};
+
+ src.x = _mm_loadu_ps (s);
+ mask.x = _mm_loadu_si128 ((__m128i *)m);
+ _mm_maskstore_ps (d, mask.x, src.x);
+
+ for (i = 0 ; i < 4; i++)
+ e[i] = m[i] ? s[i] : 0;
+
+ if (checkVf (d, e, 4))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-1.c b/gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-1.c
index 9e6c7f91d91..647ce3f6e61 100644
--- a/gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-1.c
+++ b/gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-1.c
@@ -16,10 +16,11 @@ avx_test (void)
int i;
int m[8] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3), mask_v(4), mask_v(5), mask_v(6), mask_v(7)};
float s[8] = {1,2,3,4,5,6,7,8};
- union256 u, mask;
+ union256 u;
+ union256i_d mask;
float e [8] = {0.0};
- mask.x = _mm256_loadu_ps ((float*)m);
+ mask.x = _mm256_loadu_si256 ((__m256i *)m);
u.x = _mm256_maskload_ps (s, mask.x);
for (i = 0 ; i < 8; i++)
diff --git a/gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-2.c b/gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-2.c
index 90d91a06a6d..016904d4638 100644
--- a/gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-2.c
+++ b/gcc/testsuite/gcc.target/i386/avx-vmaskmovps-256-2.c
@@ -16,12 +16,13 @@ avx_test (void)
int i;
int m[8] = {mask_v(0), mask_v(1), mask_v(2), mask_v(3), mask_v(4), mask_v(5), mask_v(6), mask_v(7)};
float s[8] = {1,2,3,4,5,6,7,8};
- union256 src, mask;
+ union256 src;
+ union256i_d mask;
float e [8] = {0.0};
float d [8] = {0.0};
src.x = _mm256_loadu_ps (s);
- mask.x = _mm256_loadu_ps ((float *)m);
+ mask.x = _mm256_loadu_si256 ((__m256i *)m);
_mm256_maskstore_ps (d, mask.x, src.x);
for (i = 0 ; i < 8; i++)
diff --git a/gcc/testsuite/gcc.target/i386/i386.exp b/gcc/testsuite/gcc.target/i386/i386.exp
index 30bb376c1a2..22e26dbc741 100644
--- a/gcc/testsuite/gcc.target/i386/i386.exp
+++ b/gcc/testsuite/gcc.target/i386/i386.exp
@@ -161,13 +161,24 @@ proc check_effective_target_sse5 { } {
# If the linker used understands -M <mapfile>, pass it to clear hardware
# capabilities set by the Sun assembler.
-set FLAGS ""
set clearcap_ldflags "-Wl,-M,$srcdir/$subdir/clearcap.map"
if [check_no_compiler_messages mapfile executable {
int main (void) { return 0; }
} $clearcap_ldflags ] {
- set FLAGS $clearcap_ldflags
+
+ if { [info procs gcc_target_compile] != [list] \
+ && [info procs saved_gcc_target_compile] == [list] } {
+ rename gcc_target_compile saved_gcc_target_compile
+
+ proc gcc_target_compile { source dest type options } {
+ global clearcap_ldflags
+ # Always pass -Wl,-M,<mapfile>, but don't let it show up in gcc.sum.
+ lappend options "additional_flags=$clearcap_ldflags"
+
+ return [saved_gcc_target_compile $source $dest $type $options]
+ }
+ }
}
# If a testcase doesn't have special options, use these.
@@ -194,7 +205,7 @@ set tests [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]]
set tests [prune $tests $srcdir/$subdir/vect-args.c]
# Main loop.
-dg-runtest $tests $FLAGS $DEFAULT_CFLAGS
+dg-runtest $tests "" $DEFAULT_CFLAGS
# All done.
dg-finish
diff --git a/gcc/testsuite/gcc.target/i386/pr45852.c b/gcc/testsuite/gcc.target/i386/pr45852.c
new file mode 100644
index 00000000000..b0ba0935deb
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr45852.c
@@ -0,0 +1,16 @@
+/* PR middle-end/45852 */
+/* { dg-options "-O2 -mcmodel=small" } */
+/* { dg-do compile { target { { i?86-*-linux* x86_64-*-linux* } && lp64 } } } */
+/* { dg-require-visibility "" } */
+
+struct S { int s; };
+
+volatile struct S globvar __attribute__((visibility ("hidden"))) = { -6 };
+
+void
+foo (void)
+{
+ globvar = globvar;
+}
+
+/* { dg-final { scan-assembler-times "globvar.%?rip" 2 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr46419.c b/gcc/testsuite/gcc.target/i386/pr46419.c
new file mode 100644
index 00000000000..3b722283ef3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr46419.c
@@ -0,0 +1,39 @@
+/* { dg-do run } */
+/* { dg-options "-O2 -msse" } */
+/* { dg-require-effective-target sse } */
+
+#include "sse-check.h"
+
+#include <xmmintrin.h>
+
+void __attribute__((noinline))
+sse_test (void)
+{
+ char image[4];
+ __m128 image4;
+ float out[4] __attribute__ ((aligned (16)));
+ int i;
+
+ for (i = 0; i < 4; i++)
+ image[i] = i + 1;
+
+ image4 =
+ _mm_cvtpi8_ps (_mm_setr_pi8
+ (image[0], image[1], image[2], image[3], 0, 0, 0, 0));
+ _mm_store_ps (out, image4);
+ _mm_empty ();
+
+ for (i = 0; i < 4; i++)
+ if (out[i] != (float) (i + 1))
+ abort ();
+
+ image4 =
+ _mm_cvtpu8_ps (_mm_setr_pi8
+ (image[0], image[1], image[2], image[3], 0, 0, 0, 0));
+ _mm_store_ps (out, image4);
+ _mm_empty ();
+
+ for (i = 0; i < 4; i++)
+ if (out[i] != (float) (i + 1))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr46865-1.c b/gcc/testsuite/gcc.target/i386/pr46865-1.c
new file mode 100644
index 00000000000..220a1c0778b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr46865-1.c
@@ -0,0 +1,31 @@
+/* PR rtl-optimization/46865 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern unsigned long f;
+
+#define m1(f) \
+ if (f & 1) \
+ asm volatile ("nop /* asmnop */\n"); \
+ else \
+ asm volatile ("nop /* asmnop */\n");
+
+#define m2(f) \
+ if (f & 1) \
+ asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx"); \
+ else \
+ asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx");
+
+void
+foo (void)
+{
+ m1 (f);
+}
+
+void
+bar (void)
+{
+ m2 (f);
+}
+
+/* { dg-final { scan-assembler-times "asmnop" 2 } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr46865-2.c b/gcc/testsuite/gcc.target/i386/pr46865-2.c
new file mode 100644
index 00000000000..4a91f7c962b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr46865-2.c
@@ -0,0 +1,32 @@
+/* PR rtl-optimization/46865 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -save-temps" } */
+
+extern unsigned long f;
+
+#define m1(f) \
+ if (f & 1) \
+ asm volatile ("nop /* asmnop */\n"); \
+ else \
+ asm volatile ("nop /* asmnop */\n");
+
+#define m2(f) \
+ if (f & 1) \
+ asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx"); \
+ else \
+ asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx");
+
+void
+foo (void)
+{
+ m1 (f);
+}
+
+void
+bar (void)
+{
+ m2 (f);
+}
+
+/* { dg-final { scan-assembler-times "asmnop" 2 } } */
+/* { dg-final { cleanup-saved-temps } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr46880.c b/gcc/testsuite/gcc.target/i386/pr46880.c
new file mode 100644
index 00000000000..4b8544e5ced
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr46880.c
@@ -0,0 +1,28 @@
+/* PR target/46880 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-strict-aliasing -msse2" } */
+/* { dg-require-effective-target sse2_runtime } */
+
+typedef double __m128d __attribute__ ((__vector_size__ (16), __may_alias__));
+typedef double (*T)[2];
+
+static __attribute__ ((noinline)) __m128d
+foo (__m128d c, __m128d d)
+{
+ T cp = (T) &c;
+ T dp = (T) &d;
+ __m128d e = { (*cp)[1], (*dp)[1] };
+ return e;
+}
+
+int
+main ()
+{
+ __m128d c = { 1.0, 2.0 };
+ __m128d d = { 3.0, 4.0 };
+ union { __m128d x; double d[2]; } u;
+ u.x = foo (c, d);
+ if (u.d[0] != 2.0 || u.d[1] != 4.0)
+ __builtin_abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gfortran.dg/cray_pointers_2.f90 b/gcc/testsuite/gfortran.dg/cray_pointers_2.f90
index 42cdf9b0b48..cbebad6addf 100644
--- a/gcc/testsuite/gfortran.dg/cray_pointers_2.f90
+++ b/gcc/testsuite/gfortran.dg/cray_pointers_2.f90
@@ -1,5 +1,6 @@
! { dg-do run }
! { dg-options "-fcray-pointer -fbounds-check" }
+! { dg-timeout-factor 4 }
! Series of routines for testing a Cray pointer implementation
program craytest
common /errors/errors(400)
diff --git a/gcc/testsuite/gfortran.dg/derived_array_intrinisics_1.f90 b/gcc/testsuite/gfortran.dg/derived_array_intrinisics_1.f90
new file mode 100644
index 00000000000..7d8bbce3f0b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/derived_array_intrinisics_1.f90
@@ -0,0 +1,33 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-original" }
+! Test the fix for PR45081 in which derived type array valued intrinsics failed
+! to simplify, which caused an ICE in trans-array.c
+!
+! Contributed by Thorsten Ohl <ohl@physik.uni-wuerzburg.de>
+!
+! Modified for GCC 4.4, which does not support (UN)PACK, TRANSPOSE or SPEAD
+! as initialization expressions.
+
+ module m
+ implicit none
+ integer :: i
+ type t
+ integer :: i
+ end type t
+ type(t), dimension(4), parameter :: t1 = [( t(i), i = 1, 4)]
+ type(t), dimension(4), parameter :: t2 = [( t(i), i = 8, 11)]
+ type(t), dimension(2,2), parameter :: a = reshape ( t1, [ 2, 2 ] )
+ type(t), dimension(2,2), parameter :: b = a !transpose (a)
+ type(t), dimension(4), parameter :: c = reshape ( b, [ 4 ] )
+ type(t), dimension(2), parameter :: d = c([2,4]) !pack ( c, [.false.,.true.,.false.,.true.])
+ type(t), dimension(4), parameter :: e = c !unpack (d, [.false.,.true.,.false.,.true.], t2)
+ type(t), dimension(4,2), parameter :: f = reshape([c,c],[4,2]) !spread (e, 2, 2)
+ type(t), dimension(8), parameter :: g = reshape ( f, [ 8 ] )
+ integer, parameter :: total = g(3)%i
+ end module m
+
+ use m
+ integer :: j
+ j = total
+ end
+! { dg-final { scan-tree-dump-times "j = 3" 1 "original" } }
diff --git a/gcc/testsuite/gfortran.dg/namelist_66.f90 b/gcc/testsuite/gfortran.dg/namelist_66.f90
new file mode 100644
index 00000000000..912261b4dc6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/namelist_66.f90
@@ -0,0 +1,40 @@
+! { dg-do run }
+! PR46010 Failure to read these two examples of namelists
+type ptracer
+ character(len = 2) :: sname
+ logical :: lini
+end type ptracer
+type(ptracer) , dimension(3) :: tracer
+namelist/naml1/ tracer
+
+type qptracer
+ character(len = 20) :: sname = ""!: short name
+ character(len = 45 ) :: lname = ""!: long name
+ character(len = 20 ) :: sunit = "" !: unit
+ logical :: lini !: read in a file or not
+ logical :: lsav !: ouput the tracer or not
+end type qptracer
+type(qptracer) , dimension(3) :: qtracer
+namelist/naml2/ qtracer
+
+open (99, file='nml.dat', status="replace")
+write(99,*) "&naml1"
+write(99,*) " tracer(1) = 'aa', .true."
+write(99,*) " tracer(2) = 'bb', .true."
+write(99,*) " tracer(3) = 'cc', .true."
+write(99,*) "/"
+rewind(99)
+read (99, nml=naml1)
+write (*, nml=naml1)
+rewind(99)
+write(99,*) "&naml2 ! just some stuff"
+write(99,*) " qtracer(1) = 'dic ' , 'dissolved inorganic concentration ', 'mol-c/l' , .true. , .true.,"
+write(99,*) " qtracer(2) = 'alkalini' , 'total alkalinity concentration ', 'eq/l ' , .true. , .true.,"
+write(99,*) "/"
+rewind(99)
+read (99, nml=naml2)
+write (*, nml=naml2)
+rewind(99)
+
+close (99, status="delete")
+end
diff --git a/gcc/testsuite/gfortran.dg/power2.f90 b/gcc/testsuite/gfortran.dg/power2.f90
new file mode 100644
index 00000000000..5e2cf0440fc
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/power2.f90
@@ -0,0 +1,25 @@
+! { dg-do compile }
+! PR fortran/46794
+
+! Check that results of powers of integers with kinds 1 and 2 are
+! correctly converted back; this used to ICE because a conversion
+! from kind 4 to the correct one was missing.
+
+! Contributed by Daniel Kraft, d@domob.eu.
+
+PROGRAM main
+ IMPLICIT NONE
+
+ INTEGER(KIND=1) :: k1
+ INTEGER(KIND=2) :: k2
+
+ k1 = 1_1
+ k2 = 1_2
+
+ k1 = 1_1 + 1_1**k1
+ k2 = 1_2 + 1_2**k2
+
+ k2 = 1_1 + 1_1**k2
+ k2 = 1_1 + 1_2**k1
+ k2 = 1_1 + 1_2**k2
+END PROGRAM main
diff --git a/gcc/testsuite/gfortran.dg/transfer_simplify_10.f90 b/gcc/testsuite/gfortran.dg/transfer_simplify_10.f90
new file mode 100644
index 00000000000..3a56e65a6cc
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/transfer_simplify_10.f90
@@ -0,0 +1,34 @@
+! { dg-do run }
+!
+! PR fortran/46638
+!
+! Contributed by James Van Buskirk
+!
+program test5
+ use ISO_C_BINDING
+ implicit none
+ type, bind(C) :: CPUID_type
+ integer(C_INT32_T) eax
+ integer(C_INT32_T) ebx
+ integer(C_INT32_T) edx
+ integer(C_INT32_T) ecx
+ integer(C_INT32_T) bbb
+ end type CPUID_type
+ type(CPUID_TYPE) result
+ result = transfer(achar(10)//achar(0)//achar(0)//achar(0)//'GenuineIntel'//'abcd',result)
+
+ if(( int(z'0000000A') /= result%eax &
+ .or. int(z'756E6547') /= result%ebx &
+ .or. int(z'49656E69') /= result%edx &
+ .or. int(z'6C65746E') /= result%ecx &
+ .or. int(z'64636261') /= result%bbb) &
+ .and. & ! Big endian
+ ( int(z'0A000000') /= result%eax &
+ .or. int(z'47656E75') /= result%ebx &
+ .or. int(z'696E6549') /= result%edx &
+ .or. int(z'6E74656C') /= result%ecx &
+ .or. int(z'61626364') /= result%bbb)) then
+ write(*,'(5(z8.8:1x))') result
+ call abort()
+ end if
+end program test5
diff --git a/gcc/testsuite/gfortran.dg/volatile12.f90 b/gcc/testsuite/gfortran.dg/volatile12.f90
new file mode 100644
index 00000000000..1e85a2b8edf
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/volatile12.f90
@@ -0,0 +1,16 @@
+! { dg-do compile }
+! { dg-options "-fdump-tree-optimized -O3" }
+!
+! PR fortran/45742
+!
+
+subroutine sub(arg)
+ integer, volatile :: arg
+ if (arg /= arg) call I_dont_exist()
+end
+
+! { dg-final { scan-tree-dump "integer.kind=.. . volatile arg" "optimized" } }
+! { dg-final { scan-tree-dump-times " =.v. arg;" 2 "optimized" } }
+! { dg-final { scan-tree-dump "i_dont_exist" "optimized" } }
+! { dg-final { cleanup-tree-dump "optimized" } }
+
diff --git a/gcc/testsuite/gnat.dg/aliasing2.adb b/gcc/testsuite/gnat.dg/aliasing2.adb
index abfc6e11a3f..a73cc5d4514 100644
--- a/gcc/testsuite/gnat.dg/aliasing2.adb
+++ b/gcc/testsuite/gnat.dg/aliasing2.adb
@@ -18,5 +18,5 @@ package body Aliasing2 is
end Aliasing2;
--- { dg-final { scan-tree-dump-not "__gnat_rcheck" "final_cleanup" } }
+-- { dg-final { scan-tree-dump-not "gnat_rcheck" "final_cleanup" } }
-- { dg-final { cleanup-tree-dump "final_cleanup" } }
diff --git a/gcc/testsuite/gnat.dg/pack9.adb b/gcc/testsuite/gnat.dg/pack9.adb
index 894ecd6bb06..367fc46e8cb 100644
--- a/gcc/testsuite/gnat.dg/pack9.adb
+++ b/gcc/testsuite/gnat.dg/pack9.adb
@@ -14,5 +14,5 @@ package body Pack9 is
end Pack9;
--- { dg-final { scan-tree-dump-not "__gnat_rcheck" "final_cleanup" } }
+-- { dg-final { scan-tree-dump-not "gnat_rcheck" "final_cleanup" } }
-- { dg-final { cleanup-tree-dump "final_cleanup" } }
diff --git a/gcc/testsuite/lib/prune.exp b/gcc/testsuite/lib/prune.exp
index 5a835098e25..72b27f4ce70 100644
--- a/gcc/testsuite/lib/prune.exp
+++ b/gcc/testsuite/lib/prune.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997, 1999, 2000, 2002, 2004, 2007, 2008
+# Copyright (C) 1997, 1999, 2000, 2002, 2004, 2007, 2008, 2010
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -37,6 +37,9 @@ proc prune_gcc_output { text } {
regsub -all "(^|\n)\[^\n\]*: Additional NOP may be necessary to workaround Itanium processor A/B step errata" $text "" text
regsub -all "(^|\n)\[^\n*\]*: Assembler messages:\[^\n\]*" $text "" text
+ # Ignore second line of IRIX 6 linker multiline message.
+ regsub -all "(^|\n)\[ \t\]*that might degrade performance on an older version \\(rev. 2.2\\) R4000 processor.\[^\n\]*" $text "" text
+
# It would be nice to avoid passing anything to gcc that would cause it to
# issue these messages (since ignoring them seems like a hack on our part),
# but that's too difficult in the general case. For example, sometimes
diff --git a/gcc/testsuite/objc.dg/dwarf-1.m b/gcc/testsuite/objc.dg/dwarf-1.m
index 3bfabbae475..c04b613502e 100644
--- a/gcc/testsuite/objc.dg/dwarf-1.m
+++ b/gcc/testsuite/objc.dg/dwarf-1.m
@@ -1,6 +1,6 @@
/* { dg-options "-gdwarf-2 -dA" } */
/* { dg-final { scan-assembler "\"id.0\".*DW_AT_name" } } */
-/* { dg-skip-if "No Dwarf" { { *-*-aix* hppa*-*-hpux* } && { ! hppa*64*-*-* } } { "*" } { "" } } */
+/* { dg-skip-if "No Dwarf" { { *-*-aix* alpha*-dec-osf* hppa*-*-hpux* } && { ! hppa*64*-*-* } } { "*" } { "" } } */
@interface foo
id x;
@end
diff --git a/gcc/testsuite/objc.dg/dwarf-2.m b/gcc/testsuite/objc.dg/dwarf-2.m
index f85a750ee25..bcbe578619d 100644
--- a/gcc/testsuite/objc.dg/dwarf-2.m
+++ b/gcc/testsuite/objc.dg/dwarf-2.m
@@ -1,4 +1,4 @@
/* { dg-options "-gdwarf-2 -dA" } */
/* { dg-final { scan-assembler "0x10\[^0-9a-f\].*DW_AT_language" } } */
-/* { dg-skip-if "No Dwarf" { { *-*-aix* hppa*-*-hpux* } && { ! hppa*64*-*-* } } { "*" } { "" } } */
+/* { dg-skip-if "No Dwarf" { { *-*-aix* alpha*-dec-osf* hppa*-*-hpux* } && { ! hppa*64*-*-* } } { "*" } { "" } } */
int x;
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index 8486775ab77..1515318bbc1 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -475,6 +475,9 @@ vect_recog_pow_pattern (gimple last_stmt, tree *type_in, tree *type_out)
type = gimple_expr_type (last_stmt);
fn = gimple_call_fndecl (last_stmt);
+ if (fn == NULL_TREE || DECL_BUILT_IN_CLASS (fn) != BUILT_IN_NORMAL)
+ return NULL;
+
switch (DECL_FUNCTION_CODE (fn))
{
case BUILT_IN_POWIF:
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index e5f50399bff..cb493c6c557 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,10 @@
+2011-11-04 Eric Botcazou <ebotcazou@adacore.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR preprocessor/39213
+ * directives.c (end_directive): Call _cpp_remove_overlay for deferred
+ pragmas as well in traditional mode.
+
2010-10-01 Release Manager
* GCC 4.4.5 released.
diff --git a/libcpp/directives.c b/libcpp/directives.c
index 49f70b54da1..412a214a2d7 100644
--- a/libcpp/directives.c
+++ b/libcpp/directives.c
@@ -276,16 +276,17 @@ start_directive (cpp_reader *pfile)
static void
end_directive (cpp_reader *pfile, int skip_line)
{
- if (pfile->state.in_deferred_pragma)
- ;
- else if (CPP_OPTION (pfile, traditional))
+ if (CPP_OPTION (pfile, traditional))
{
/* Revert change of prepare_directive_trad. */
- pfile->state.prevent_expansion--;
+ if (!pfile->state.in_deferred_pragma)
+ pfile->state.prevent_expansion--;
if (pfile->directive != &dtable[T_DEFINE])
_cpp_remove_overlay (pfile);
}
+ else if (pfile->state.in_deferred_pragma)
+ ;
/* We don't skip for an assembler #. */
else if (skip_line)
{
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index d70405e4d34..e4f77628bd1 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,10 @@
+2010-12-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.ac (libffi_cv_as_ascii_pseudo_op): Use double
+ backslashes.
+ (libffi_cv_as_string_pseudo_op): Likewise.
+ * configure: Regenerate.
+
2010-10-01 Jakub Jelinek <jakub@redhat.com>
* testsuite/libffi.call/many2.c: Don't use uint8_t.
diff --git a/libffi/configure b/libffi/configure
index 94538a45f8a..05188df092b 100755
--- a/libffi/configure
+++ b/libffi/configure
@@ -13301,7 +13301,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-asm (".ascii \"string\"");
+asm (".ascii \\"string\\"");
int
main ()
{
@@ -13366,7 +13366,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-asm (".string \"string\"");
+asm (".string \\"string\\"");
int
main ()
{
diff --git a/libffi/configure.ac b/libffi/configure.ac
index 88e06baf138..eac654a9aed 100644
--- a/libffi/configure.ac
+++ b/libffi/configure.ac
@@ -258,7 +258,7 @@ if test x$TARGET = xX86 || test x$TARGET = xX86_64; then
libffi_cv_as_ascii_pseudo_op, [
libffi_cv_as_ascii_pseudo_op=unknown
# Check if we have .ascii
- AC_TRY_COMPILE([asm (".ascii \"string\"");],,
+ AC_TRY_COMPILE([asm (".ascii \\"string\\"");],,
[libffi_cv_as_ascii_pseudo_op=yes],
[libffi_cv_as_ascii_pseudo_op=no])
])
@@ -271,7 +271,7 @@ if test x$TARGET = xX86 || test x$TARGET = xX86_64; then
libffi_cv_as_string_pseudo_op, [
libffi_cv_as_string_pseudo_op=unknown
# Check if we have .string
- AC_TRY_COMPILE([asm (".string \"string\"");],,
+ AC_TRY_COMPILE([asm (".string \\"string\\"");],,
[libffi_cv_as_string_pseudo_op=yes],
[libffi_cv_as_string_pseudo_op=no])
])
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 100645678f2..8a0ed507496 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,17 @@
+2010-11-10 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/46373
+ Backport from mainline:
+ * io/transfer.c (data_transfer_init): Do not call flush_if_preconnected
+ if this is an internal unit.
+
+2010-11-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/46010
+ Backport from mainline:
+ * io/list_read.c (nml_parse_qualifier): Add additional conditions for
+ setting the end index for loop specification. Fix some whitespace.
+
2010-10-16 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Backport from mainline:
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index a52278ede8e..e560f1209b9 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -2077,8 +2077,10 @@ nml_parse_qualifier (st_parameter_dt *dtp, descriptor_dimension *ad,
/* If -std=f95/2003 or an array section is specified,
do not allow excess data to be processed. */
- if (is_array_section == 1
- || compile_options.allow_std < GFC_STD_GNU)
+ if (is_array_section == 1
+ || !(compile_options.allow_std & GFC_STD_GNU)
+ || !dtp->u.p.ionml->touched
+ || dtp->u.p.ionml->type == GFC_DTYPE_DERIVED)
ls[dim].end = ls[dim].start;
else
dtp->u.p.expanded_read = 1;
@@ -2093,12 +2095,12 @@ nml_parse_qualifier (st_parameter_dt *dtp, descriptor_dimension *ad,
}
if (is_array_section == 1 && dtp->u.p.expanded_read == 1)
- {
+ {
int i;
dtp->u.p.expanded_read = 0;
for (i = 0; i < dim; i++)
ls[i].end = ls[i].start;
- }
+ }
/* Check the values of the triplet indices. */
if ((ls[dim].start > (ssize_t)ad[dim].ubound)
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index f647941f1aa..96a44f524e3 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -2450,7 +2450,8 @@ data_transfer_init (st_parameter_dt *dtp, int read_flag)
}
/* Bugware for badly written mixed C-Fortran I/O. */
- flush_if_preconnected(dtp->u.p.current_unit->s);
+ if (!is_internal_unit (dtp))
+ flush_if_preconnected(dtp->u.p.current_unit->s);
dtp->u.p.current_unit->mode = dtp->u.p.mode;
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 1751aa0b668..d2fe407bbb1 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,37 @@
+2011-01-16 Jakub Jelinek <jakub@redhat.com>
+
+ Backport from mainline
+ 2010-12-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/46874
+ * libgomp.fortran/allocatable6.f90: New test.
+
+2010-12-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ Backport from mainline:
+ 2010-12-01 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * configure.tgt (mips-sgi-irix6*): Add -lpthread to XLDFLAGS.
+
+2010-12-07 Jakub Jelinek <jakub@redhat.com>
+
+ Backport from mainline
+ 2010-12-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/46753
+ * libgomp.fortran/pr46753.f90: New test.
+
+ PR libgomp/45240
+ * parallel.c (GOMP_parallel_end): Unlock gomp_remaining_threads_lock
+ at the end if sync builtins aren't supported.
+
+2010-12-03 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ Backport from mainline:
+ 2010-12-01 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * testsuite/libgomp.fortran/vla8.f90: Use dg-timeout-factor 2.0.
+
2010-10-01 Release Manager
* GCC 4.4.5 released.
diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt
index d66899fbf5f..e093724b1c3 100644
--- a/libgomp/configure.tgt
+++ b/libgomp/configure.tgt
@@ -115,6 +115,10 @@ case "${target}" in
config_path="bsd posix"
;;
+ mips-sgi-irix6*)
+ # Need to link with -lpthread so libgomp.so is self-contained.
+ XLDFLAGS="${XLDFLAGS} -lpthread"
+ ;;
*)
;;
diff --git a/libgomp/parallel.c b/libgomp/parallel.c
index d83d1698fd5..c0966df9f9a 100644
--- a/libgomp/parallel.c
+++ b/libgomp/parallel.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@redhat.com>.
This file is part of the GNU OpenMP Library (libgomp).
@@ -123,6 +123,7 @@ GOMP_parallel_end (void)
#else
gomp_mutex_lock (&gomp_remaining_threads_lock);
gomp_remaining_threads_count -= team->nthreads - 1;
+ gomp_mutex_unlock (&gomp_remaining_threads_lock);
#endif
}
}
diff --git a/libgomp/testsuite/libgomp.fortran/allocatable6.f90 b/libgomp/testsuite/libgomp.fortran/allocatable6.f90
new file mode 100644
index 00000000000..47b67aa56d0
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/allocatable6.f90
@@ -0,0 +1,45 @@
+! PR fortran/46874
+! { dg-do run }
+
+ interface
+ subroutine sub (a, b, c, d, n)
+ integer :: n
+ integer, allocatable :: a(:), b(:), c(:), d(:)
+ end subroutine
+ end interface
+
+ integer, allocatable :: a(:), b(:), c(:), d(:)
+ integer :: i, j
+ allocate (a(50), b(50), c(50), d(50))
+ do i = 1, 50
+ a(i) = 2 + modulo (i, 7)
+ b(i) = 179 - modulo (i, 11)
+ end do
+ c = 0
+ d = 2147483647
+ call sub (a, b, c, d, 50)
+ do i = 1, 50
+ j = 0
+ if (i .eq. 3) then
+ j = 8
+ else if (i .gt. 1 .and. i .lt. 9) then
+ j = 7
+ end if
+ if (c(i) .ne. j) call abort
+ j = 179 - modulo (i, 11)
+ if (i .gt. 1 .and. i .lt. 9) j = i
+ if (d(i) .ne. j) call abort
+ end do
+ deallocate (a, b, c, d)
+end
+
+subroutine sub (a, b, c, d, n)
+ integer :: n
+ integer, allocatable :: a(:), b(:), c(:), d(:)
+!$omp parallel do shared(a, b) reduction(+:c) reduction(min:d)
+ do i = 1, n
+ c(a(i)) = c(a(i)) + 1
+ d(i) = min(d(i), b(i))
+ d(a(i)) = min(d(a(i)), a(i))
+ end do
+end
diff --git a/libgomp/testsuite/libgomp.fortran/pr46753.f90 b/libgomp/testsuite/libgomp.fortran/pr46753.f90
new file mode 100644
index 00000000000..f4833abc845
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/pr46753.f90
@@ -0,0 +1,17 @@
+! PR fortran/46753
+! { dg-do run }
+
+ integer :: i, j
+ j = 0
+!$omp parallel do reduction(+:j)
+ do i = 2147483636, 2147483646
+ j = j + 1
+ end do
+ if (j.ne.11) call abort
+ j = 0
+!$omp parallel do reduction(+:j)
+ do i = -2147483637, -2147483647, -1
+ j = j + 1
+ end do
+ if (j.ne.11) call abort
+end
diff --git a/libgomp/testsuite/libgomp.fortran/vla8.f90 b/libgomp/testsuite/libgomp.fortran/vla8.f90
index f66fe84a375..b06a6f4be5d 100644
--- a/libgomp/testsuite/libgomp.fortran/vla8.f90
+++ b/libgomp/testsuite/libgomp.fortran/vla8.f90
@@ -1,4 +1,5 @@
! { dg-do run }
+! { dg-timeout-factor 2.0 }
call test
contains
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index a3f39ff437f..c084e051b7f 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,22 @@
+2011-01-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ Backport from mainline:
+ 2011-01-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * testsuite/libjava.jni/jni.exp (gcj_jni_get_cxxflags_invocation):
+ Add -shared-libgcc to cxxflags for *-*-solaris*.
+ Remove -lsocket.
+
+2010-12-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ Backport from mainline:
+ 2010-11-09 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * testsuite/libjava.jvmti/jvmti.exp (gcj_jvmti_compile_cxx_to_o):
+ Add -pthread on alpha*-dec-osf*.
+ * testsuite/libjava.jvmti/jvmti-interp.exp
+ (gcj_jni_compile_c_to_so): Likewise.
+
2010-10-01 Release Manager
* GCC 4.4.5 released.
diff --git a/libjava/testsuite/libjava.jni/jni.exp b/libjava/testsuite/libjava.jni/jni.exp
index af14e9426e1..8ecd6339d0b 100644
--- a/libjava/testsuite/libjava.jni/jni.exp
+++ b/libjava/testsuite/libjava.jni/jni.exp
@@ -265,8 +265,10 @@ proc gcj_jni_get_cxxflags_invocation {} {
lappend cxxflags -shared-libgcc -lgcj -liconv
}
+ # Make sure libgcc unwinder is used on 64-bit Solaris 10+/x86 rather than
+ # the libc one.
if { [istarget "*-*-solaris*"] } {
- lappend cxxflags "-lsocket"
+ lappend cxxflags "-shared-libgcc"
}
return $cxxflags
diff --git a/libjava/testsuite/libjava.jvmti/jvmti-interp.exp b/libjava/testsuite/libjava.jvmti/jvmti-interp.exp
index 951b41017fe..658acbf8409 100644
--- a/libjava/testsuite/libjava.jvmti/jvmti-interp.exp
+++ b/libjava/testsuite/libjava.jvmti/jvmti-interp.exp
@@ -34,6 +34,10 @@ proc gcj_jni_compile_c_to_so {file {options {}}} {
if { [istarget "arm*"] } {
lappend options "additional_flags=-Wno-abi"
}
+ # Tru64 UNIX requires <pthread.h> to be compiled with -pthread.
+ if { [istarget "alpha*-dec-osf*"] } {
+ lappend options "additional_flags=-pthread"
+ }
set filename [file tail $file]
set name [file rootname $filename]
diff --git a/libjava/testsuite/libjava.jvmti/jvmti.exp b/libjava/testsuite/libjava.jvmti/jvmti.exp
index 571952e807c..2d939852e5e 100644
--- a/libjava/testsuite/libjava.jvmti/jvmti.exp
+++ b/libjava/testsuite/libjava.jvmti/jvmti.exp
@@ -20,6 +20,10 @@ proc gcj_jvmti_compile_cxx_to_o {file {options {}}} {
if { [istarget "arm*"] } {
lappend options "additional_flags=-Wno-abi"
}
+ # Tru64 UNIX requires <pthread.h> to be compiled with -pthread.
+ if { [istarget "alpha*-dec-osf*"] } {
+ lappend options "additional_flags=-pthread"
+ }
set x [libjava_prune_warnings \
[target_compile $file $oname object $options]]
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index eaee85c144b..dd90a2fb4e7 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2010-12-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * testsuite/lib/libstdc++.exp (v3-build_support): Delete
+ libtestc++.a before creation.
+
2010-10-01 Release Manager
* GCC 4.4.5 released.
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index 45e92d756ec..2344885bfc5 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -554,6 +554,15 @@ proc v3-build_support { } {
}
# Collect into libtestc++.a
+ # Delete libtestc++.a first. Mixed 32 and 64-bit archives cannot be
+ # linked on IRIX 6.
+ # Use same procedure as gcc-dg.exp (remove-build-file).
+ if [is_remote host] {
+ # Ensure the host knows the file is gone by deleting there
+ # first.
+ remote_file host delete "./libtestc++.a"
+ }
+ remote_file build delete "./libtestc++.a"
if [info exists env(AR)] {
set ar $env(AR)
} else {