X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=gcc-branch.diff;h=6dc898c8f92f676c8b98a802fcb560db20b24a4f;hb=e4492d812a11ae6150c6a3c0ad0608d6501b19f2;hp=bc5227dc41ae21ee3208107c68249839cfae095f;hpb=7a6e13b7c210dd35129541d43a2c7f6ef6869c4a;p=packages%2Fgcc.git diff --git a/gcc-branch.diff b/gcc-branch.diff index bc5227d..6dc898c 100644 --- a/gcc-branch.diff +++ b/gcc-branch.diff @@ -1,1272 +1,2149 @@ -Index: gcc/targhooks.c +Index: libstdc++-v3/ChangeLog =================================================================== ---- gcc/targhooks.c (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/targhooks.c (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -529,6 +529,7 @@ - case scalar_to_vec: - case cond_branch_not_taken: - case vec_perm: -+ case vec_promote_demote: - return 1; - - case unaligned_load: -Index: gcc/DATESTAMP +--- libstdc++-v3/ChangeLog (.../tags/gcc_4_7_3_release) (revision 198690) ++++ libstdc++-v3/ChangeLog (.../branches/gcc-4_7-branch) (revision 198690) +@@ -1,3 +1,20 @@ ++2013-04-15 Jack Howarth ++ ++ Backport from mainline ++ ++ 2012-10-10 Jack Howarth ++ Jonathan Wakely ++ ++ PR libstdc++/54847 ++ * config/os/bsd/darwin/os_defines.h: Define _GLIBCXX_USE_NANOSLEEP ++ and _GLIBCXX_USE_SCHED_YIELD. ++ * acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Add comment. ++ ++2013-04-15 Rainer Orth ++ ++ * testsuite/30_threads/condition_variable/members/53841.cc: Add ++ -std=gnu++0x -pthread on alpha*-*-osf*, mips-sgi-irix6*. ++ + 2013-04-11 Release Manager + + * GCC 4.7.3 released. +Index: libstdc++-v3/testsuite/30_threads/condition_variable/members/53841.cc =================================================================== ---- gcc/DATESTAMP (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/DATESTAMP (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -1 +1 @@ --20120301 -+20120315 -Index: gcc/target.h +--- libstdc++-v3/testsuite/30_threads/condition_variable/members/53841.cc (.../tags/gcc_4_7_3_release) (revision 198690) ++++ libstdc++-v3/testsuite/30_threads/condition_variable/members/53841.cc (.../branches/gcc-4_7-branch) (revision 198690) +@@ -1,5 +1,5 @@ + // { dg-do compile } +-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* hppa*-hp-hpux11* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* hppa*-hp-hpux11* } } + // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } + // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } + // { dg-require-cstdint "" } +Index: libstdc++-v3/config/os/bsd/darwin/os_defines.h =================================================================== ---- gcc/target.h (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/target.h (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -128,7 +128,8 @@ - scalar_to_vec, - cond_branch_not_taken, - cond_branch_taken, -- vec_perm -+ vec_perm, -+ vec_promote_demote - }; +--- libstdc++-v3/config/os/bsd/darwin/os_defines.h (.../tags/gcc_4_7_3_release) (revision 198690) ++++ libstdc++-v3/config/os/bsd/darwin/os_defines.h (.../branches/gcc-4_7-branch) (revision 198690) +@@ -42,4 +42,9 @@ + // Static initializer macro is buggy in darwin, see libstdc++/51906 + #define _GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC + ++// Configure checks for nanosleep fail on Darwin, but nanosleep and ++// sched_yield are always available, so use them. ++#define _GLIBCXX_USE_NANOSLEEP 1 ++#define _GLIBCXX_USE_SCHED_YIELD 1 ++ + #endif +Index: libstdc++-v3/acinclude.m4 +=================================================================== +--- libstdc++-v3/acinclude.m4 (.../tags/gcc_4_7_3_release) (revision 198690) ++++ libstdc++-v3/acinclude.m4 (.../branches/gcc-4_7-branch) (revision 198690) +@@ -1132,6 +1132,11 @@ + dnl --disable-libstdcxx-time + dnl disables the checks completely + dnl ++dnl N.B. Darwin provides nanosleep but doesn't support the whole POSIX ++dnl Timers option, so doesn't define _POSIX_TIMERS. Because the test ++dnl below fails Darwin unconditionally defines _GLIBCXX_USE_NANOSLEEP in ++dnl os_defines.h and also defines _GLIBCXX_USE_SCHED_YIELD. ++dnl + AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_TIME], [ + + AC_MSG_CHECKING([for clock_gettime, nanosleep and sched_yield]) +Index: libgcc/ChangeLog +=================================================================== +--- libgcc/ChangeLog (.../tags/gcc_4_7_3_release) (revision 198690) ++++ libgcc/ChangeLog (.../branches/gcc-4_7-branch) (revision 198690) +@@ -1,3 +1,10 @@ ++2013-04-11 Julian Brown ++ ++ * config/arm/linux-atomic.c (SUBWORD_SYNC_OP, SUBWORD_VAL_CAS) ++ (SUBWORD_TEST_AND_SET): Use signed char/short types instead of ++ unsigned char/unsigned short. ++ (__sync_val_compare_and_swap_{1,2}): Handle signed argument. ++ + 2013-04-11 Release Manager - /* Sets of optimization levels at which an option may be enabled by -Index: gcc/DEV-PHASE + * GCC 4.7.3 released. +Index: libgcc/config/arm/linux-atomic.c =================================================================== ---- gcc/DEV-PHASE (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/DEV-PHASE (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -0,0 +1 @@ -+prerelease +--- libgcc/config/arm/linux-atomic.c (.../tags/gcc_4_7_3_release) (revision 198690) ++++ libgcc/config/arm/linux-atomic.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -97,19 +97,19 @@ + return (RETURN & mask) >> shift; \ + } + +-SUBWORD_SYNC_OP (add, , +, unsigned short, 2, oldval) +-SUBWORD_SYNC_OP (sub, , -, unsigned short, 2, oldval) +-SUBWORD_SYNC_OP (or, , |, unsigned short, 2, oldval) +-SUBWORD_SYNC_OP (and, , &, unsigned short, 2, oldval) +-SUBWORD_SYNC_OP (xor, , ^, unsigned short, 2, oldval) +-SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, oldval) ++SUBWORD_SYNC_OP (add, , +, short, 2, oldval) ++SUBWORD_SYNC_OP (sub, , -, short, 2, oldval) ++SUBWORD_SYNC_OP (or, , |, short, 2, oldval) ++SUBWORD_SYNC_OP (and, , &, short, 2, oldval) ++SUBWORD_SYNC_OP (xor, , ^, short, 2, oldval) ++SUBWORD_SYNC_OP (nand, ~, &, short, 2, oldval) + +-SUBWORD_SYNC_OP (add, , +, unsigned char, 1, oldval) +-SUBWORD_SYNC_OP (sub, , -, unsigned char, 1, oldval) +-SUBWORD_SYNC_OP (or, , |, unsigned char, 1, oldval) +-SUBWORD_SYNC_OP (and, , &, unsigned char, 1, oldval) +-SUBWORD_SYNC_OP (xor, , ^, unsigned char, 1, oldval) +-SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, oldval) ++SUBWORD_SYNC_OP (add, , +, signed char, 1, oldval) ++SUBWORD_SYNC_OP (sub, , -, signed char, 1, oldval) ++SUBWORD_SYNC_OP (or, , |, signed char, 1, oldval) ++SUBWORD_SYNC_OP (and, , &, signed char, 1, oldval) ++SUBWORD_SYNC_OP (xor, , ^, signed char, 1, oldval) ++SUBWORD_SYNC_OP (nand, ~, &, signed char, 1, oldval) + + #define OP_AND_FETCH_WORD(OP, PFX_OP, INF_OP) \ + int HIDDEN \ +@@ -132,19 +132,19 @@ + OP_AND_FETCH_WORD (xor, , ^) + OP_AND_FETCH_WORD (nand, ~, &) + +-SUBWORD_SYNC_OP (add, , +, unsigned short, 2, newval) +-SUBWORD_SYNC_OP (sub, , -, unsigned short, 2, newval) +-SUBWORD_SYNC_OP (or, , |, unsigned short, 2, newval) +-SUBWORD_SYNC_OP (and, , &, unsigned short, 2, newval) +-SUBWORD_SYNC_OP (xor, , ^, unsigned short, 2, newval) +-SUBWORD_SYNC_OP (nand, ~, &, unsigned short, 2, newval) ++SUBWORD_SYNC_OP (add, , +, short, 2, newval) ++SUBWORD_SYNC_OP (sub, , -, short, 2, newval) ++SUBWORD_SYNC_OP (or, , |, short, 2, newval) ++SUBWORD_SYNC_OP (and, , &, short, 2, newval) ++SUBWORD_SYNC_OP (xor, , ^, short, 2, newval) ++SUBWORD_SYNC_OP (nand, ~, &, short, 2, newval) + +-SUBWORD_SYNC_OP (add, , +, unsigned char, 1, newval) +-SUBWORD_SYNC_OP (sub, , -, unsigned char, 1, newval) +-SUBWORD_SYNC_OP (or, , |, unsigned char, 1, newval) +-SUBWORD_SYNC_OP (and, , &, unsigned char, 1, newval) +-SUBWORD_SYNC_OP (xor, , ^, unsigned char, 1, newval) +-SUBWORD_SYNC_OP (nand, ~, &, unsigned char, 1, newval) ++SUBWORD_SYNC_OP (add, , +, signed char, 1, newval) ++SUBWORD_SYNC_OP (sub, , -, signed char, 1, newval) ++SUBWORD_SYNC_OP (or, , |, signed char, 1, newval) ++SUBWORD_SYNC_OP (and, , &, signed char, 1, newval) ++SUBWORD_SYNC_OP (xor, , ^, signed char, 1, newval) ++SUBWORD_SYNC_OP (nand, ~, &, signed char, 1, newval) + + int HIDDEN + __sync_val_compare_and_swap_4 (int *ptr, int oldval, int newval) +@@ -181,7 +181,7 @@ + actual_oldval = *wordptr; \ + \ + if (__builtin_expect (((actual_oldval & mask) >> shift) != \ +- (unsigned int) oldval, 0)) \ ++ ((unsigned int) oldval & MASK_##WIDTH), 0)) \ + return (actual_oldval & mask) >> shift; \ + \ + actual_newval = (actual_oldval & ~mask) \ +@@ -195,8 +195,8 @@ + } \ + } + +-SUBWORD_VAL_CAS (unsigned short, 2) +-SUBWORD_VAL_CAS (unsigned char, 1) ++SUBWORD_VAL_CAS (short, 2) ++SUBWORD_VAL_CAS (signed char, 1) + + typedef unsigned char bool; + +@@ -217,8 +217,8 @@ + return (oldval == actual_oldval); \ + } + +-SUBWORD_BOOL_CAS (unsigned short, 2) +-SUBWORD_BOOL_CAS (unsigned char, 1) ++SUBWORD_BOOL_CAS (short, 2) ++SUBWORD_BOOL_CAS (signed char, 1) + + void HIDDEN + __sync_synchronize (void) +@@ -260,8 +260,8 @@ + return (oldval & mask) >> shift; \ + } + +-SUBWORD_TEST_AND_SET (unsigned short, 2) +-SUBWORD_TEST_AND_SET (unsigned char, 1) ++SUBWORD_TEST_AND_SET (short, 2) ++SUBWORD_TEST_AND_SET (signed char, 1) + + #define SYNC_LOCK_RELEASE(TYPE, WIDTH) \ + void HIDDEN \ +Index: gcc/doc/tm.texi +=================================================================== +--- gcc/doc/tm.texi (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/doc/tm.texi (.../branches/gcc-4_7-branch) (revision 198690) +@@ -9495,6 +9495,10 @@ + True if the @code{.debug_pubtypes} and @code{.debug_pubnames} sections should be emitted. These sections are not used on most platforms, and in particular GDB does not use them. + @end deftypevr + ++@deftypevr {Target Hook} bool TARGET_FORCE_AT_COMP_DIR ++True if the @code{DW_AT_comp_dir} attribute should be emitted for each compilation unit. This attribute is required for the darwin linker to emit debug information. ++@end deftypevr ++ + @deftypevr {Target Hook} bool TARGET_DELAY_SCHED2 + True if sched2 is not to be run at its normal place. This usually means it will be run as part of machine-specific reorg. + @end deftypevr +Index: gcc/doc/tm.texi.in +=================================================================== +--- gcc/doc/tm.texi.in (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/doc/tm.texi.in (.../branches/gcc-4_7-branch) (revision 198690) +@@ -9388,6 +9388,8 @@ + + @hook TARGET_WANT_DEBUG_PUB_SECTIONS + ++@hook TARGET_FORCE_AT_COMP_DIR ++ + @hook TARGET_DELAY_SCHED2 + + @hook TARGET_DELAY_VARTRACK +Index: gcc/target.def +=================================================================== +--- gcc/target.def (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/target.def (.../branches/gcc-4_7-branch) (revision 198690) +@@ -2758,6 +2758,13 @@ + bool, false) + + DEFHOOKPOD ++(force_at_comp_dir, ++ "True if the @code{DW_AT_comp_dir} attribute should be emitted for each \ ++ compilation unit. This attribute is required for the darwin linker \ ++ to emit debug information.", ++ bool, false) ++ ++DEFHOOKPOD + (delay_sched2, "True if sched2 is not to be run at its normal place. \ + This usually means it will be run as part of machine-specific reorg.", + bool, false) +Index: gcc/DATESTAMP +=================================================================== +--- gcc/DATESTAMP (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/DATESTAMP (.../branches/gcc-4_7-branch) (revision 198690) +@@ -1 +1 @@ +-20130411 ++20130507 +Index: gcc/builtins.c +=================================================================== +--- gcc/builtins.c (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/builtins.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -9692,7 +9692,16 @@ + case rvc_inf: + /* If arg is Inf or NaN and we're logb, return it. */ + if (TREE_CODE (rettype) == REAL_TYPE) +- return fold_convert_loc (loc, rettype, arg); ++ { ++ /* For logb(-Inf) we have to return +Inf. */ ++ if (real_isinf (value) && real_isneg (value)) ++ { ++ REAL_VALUE_TYPE tem; ++ real_inf (&tem); ++ return build_real (rettype, tem); ++ } ++ return fold_convert_loc (loc, rettype, arg); ++ } + /* Fall through... */ + case rvc_zero: + /* Zero may set errno and/or raise an exception for logb, also Index: gcc/ChangeLog =================================================================== ---- gcc/ChangeLog (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/ChangeLog (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -1,3 +1,101 @@ -+2012-03-15 Chung-Lin Tang +--- gcc/ChangeLog (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/ChangeLog (.../branches/gcc-4_7-branch) (revision 198690) +@@ -1,3 +1,115 @@ ++2013-05-03 Marek Polacek + + Backport from mainline -+ 2012-03-10 Chung-Lin Tang ++ 2013-04-25 Marek Polacek + -+ PR rtl-optimization/52528 -+ * combine.c (can_combine_p): Add setting of subst_low_luid -+ before call to expand_field_assignment(). ++ PR tree-optimization/57066 ++ * builtins.c (fold_builtin_logb): Return +Inf for -Inf. + -+2012-03-12 John David Anglin ++2013-04-30 Uros Bizjak + + Backport from mainline -+ 2011-09-03 John David Anglin ++ 2013-04-29 Uros Bizjak + -+ PR Bug middle-end/50232 -+ * config/pa/pa.md (return): Define "return" insn pattern. -+ (epilogue): Use it when no epilogue is needed. -+ * config/pa/pa.c (pa_can_use_return_insn): New function. -+ * config/pa/pa-protos.h (pa_can_use_return_insn): Declare. ++ PR target/44578 ++ * config/i386/i386.md (*zero_extendsidi2_rex64): Add "!" to m->?*y ++ alternative. ++ (*zero_extendsidi2): Ditto. + -+ Backport for mainline -+ 2012-01-28 John David Anglin ++ Backport from mainline ++ 2013-04-29 Uros Bizjak + -+ PR target/51871 -+ * config/pa/pa.c (pa_return_addr_rtx): Add support for PA2.0 export -+ stubs. ++ PR target/57098 ++ * config/i386/i386.c (ix86_expand_vec_perm): Validize constant memory. + -+2012-03-06 Michael Meissner ++2013-04-29 Christian Bruel + -+ Backport from mainline -+ PR target/50310 -+ * config/rs6000/vector.md (vector_uneq): Add support for -+ UNEQ, LTGT, ORDERED, and UNORDERED IEEE vector comparisons. -+ (vector_ltgt): Likewise. -+ (vector_ordered): Likewise. -+ (vector_unordered): Likewise. -+ * config/rs6000/rs6000.c (rs6000_emit_vector_compare_inner): -+ Likewise. ++ PR target/57108 ++ * sh.md (tstsi_t_zero_extract_eq): Set mode for operand 0. ++ ++2013-04-27 Jakub Jelinek ++ ++ PR target/56866 ++ * config/i386/sse.md (xop_rotr3): Fix up computation of ++ the immediate rotate count. ++ ++2013-04-21 Eric Botcazou + -+2012-03-04 John David Anglin ++ * cfgexpand.c (avoid_complex_debug_insns): Fix C++ism. ++ ++2013-04-19 Matthias Klose ++ ++ PR middle-end/56848 ++ Re-apply ++ 2013-04-01 Andrey Belevantsev + + Backport from mainline -+ 2012-03-01 John David Anglin ++ 2013-02-25 Andrey Belevantsev ++ Alexander Monakov ++ ++ PR middle-end/56077 ++ * sched-deps.c (sched_analyze_insn): When reg_pending_barrier, ++ flush pending lists also on non-jumps. Adjust comment. ++ ++ Backport from 4.8: ++ 2012-08-27 Maxim Kuvyrkov + -+ PR target/52408 -+ * config/pa/pa.md (zvdep_imm32): Change type of variable x from int to -+ unsigned HOST_WIDE_INT. -+ (zvdep_imm64): Likewise. -+ (vdepi_ior): Change type of variable x from int to HOST_WIDE_INT. -+ (vdepi_and): Likewise. -+ Likewise for unamed 64-bit patterns. -+ * config/pa/predicates.md (lhs_lshift_cint_operand): Update comment. ++ * sched-deps.c (add_dependence_list_and_free): Simplify. ++ (flush_pending_list_and_free): Fix a hack that was fixing a hack. Free ++ lists when add_dependence_list_and_free doesn't free them. + -+2012-03-03 Eric Botcazou ++2013-04-19 Marek Polacek + -+ PR target/52425 + Backport from mainline -+ 2011-05-22 Eric Botcazou ++ 2013-01-08 Steven Bosscher ++ Jakub Jelinek + -+ * config/sparc/sparc.c (sparc_delegitimize_address): Handle -+ UNSPEC_MOVE_PIC pattern. ++ PR tree-optimization/48189 ++ * predict.c (predict_loops): If max is 0, don't call compare_tree_int. ++ If nitercst is 0, don't predict the exit edge. + -+2012-03-02 Peter Bergner ++2013-04-16 Jack Howarth + + Backport from mainline -+ 2012-03-02 Peter Bergner -+ -+ * config/rs6000/vsx.md (vsx_set_): Reorder operands. -+ -+2012-03-02 Bill Schmidt -+ Ira Rosen -+ -+ PR tree-optimization/50031 -+ PR tree-optimization/50969 -+ * targhooks.c (default_builtin_vectorization_cost): Handle -+ vec_promote_demote. -+ * target.h (enum vect_cost_for_stmt): Add vec_promote_demote. -+ * tree-vect-loop.c (vect_get_single_scalar_iteraion_cost): Handle -+ all types of reduction and pattern statements. -+ (vect_estimate_min_profitable_iters): Likewise. -+ * tree-vect-stmts.c (vect_model_promotion_demotion_cost): New function. -+ (vect_model_store_cost): Use vec_perm rather than vector_stmt for -+ statement cost. -+ (vect_model_load_cost): Likewise. -+ (vect_get_load_cost): Likewise; add dump logic for explicit realigns. -+ (vectorizable_type_demotion): Call vect_model_promotion_demotion_cost. -+ (vectorizable_type_promotion): Likewise. -+ * config/spu/spu.c (spu_builtin_vectorization_cost): Handle -+ vec_promote_demote. -+ * config/i386/i386.c (ix86_builtin_vectorization_cost): Likewise. -+ * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): Update -+ vec_perm for VSX and handle vec_promote_demote. -+ -+2012-03-01 Jakub Jelinek -+ -+ * BASE-VER: Set to 4.6.4. ++ 2012-05-29 Jack Howarth ++ * config/darwin.h (STARTFILE_SPEC): Use -no_new_main with -lgcrt1.o ++ on Darwin >= 12. ++ (DARWIN_CRT1_SPEC): Use -lcrt1.10.6.o when Darwin >= 10 and < 12. ++ ++ ++ 2012-05-29 Jack Howarth ++ PR debug/53453 ++ * doc/tm.texi: Update. ++ * doc/tm.texi.in (SDB and DWARF) : Add @hook. ++ * target.def (force_at_comp_dir): New hook. ++ * config/darwin.h (TARGET_FORCE_AT_COMP_DIR): Define. ++ * dwarf2out.c (dwarf2out_finish): Check targetm.force_at_comp_dir. ++ ++2013-04-15 Eric Botcazou ++ ++ PR target/56890 ++ * config/sparc/sparc.c (enum sparc_mode_class): Add H_MODE value. ++ (S_MODES): Set H_MODE bit. ++ (SF_MODES): Set only S_MODE and SF_MODE bits. ++ (DF_MODES): Set SF_MODES and only D_MODE and DF_MODE bits. ++ (sparc_init_modes) : Set H_MODE bit for sub-word modes. ++ : Do not set SF_MODE for sub-word modes. ++ : Likewise. ++ ++2013-04-13 John David Anglin ++ ++ Backport from mainline: ++ 2013-04-06 John David Anglin ++ ++ PR target/55487 ++ * config/pa/pa.c (legitimize_pic_address): Before incrementing label ++ nuses, make sure we have a label. ++ ++2013-04-11 Richard Biener ++ ++ * BASE-VER: Set to 4.7.4. + * DEV-PHASE: Set to prerelease. + - 2012-03-01 Release Manager + 2013-04-11 Release Manager - * GCC 4.6.3 released. -Index: gcc/testsuite/gcc.target/powerpc/pr52457.c + * GCC 4.7.3 released. +Index: gcc/testsuite/gcc.target/i386/pr44578.c =================================================================== ---- gcc/testsuite/gcc.target/powerpc/pr52457.c (.../tags/gcc_4_6_3_release) (wersja 0) -+++ gcc/testsuite/gcc.target/powerpc/pr52457.c (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -0,0 +1,34 @@ -+/* { dg-do run { target { powerpc*-*-linux* } } } */ -+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ -+/* { dg-skip-if "" { powerpc*-*-*spe* } { "*" } { "" } } */ -+/* { dg-require-effective-target vsx_hw } */ -+/* { dg-options "-O1 -mcpu=power7" } */ +--- gcc/testsuite/gcc.target/i386/pr44578.c (.../tags/gcc_4_7_3_release) (revision 0) ++++ gcc/testsuite/gcc.target/i386/pr44578.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -0,0 +1,31 @@ ++/* { dg-do run } */ ++/* { dg-options "-O2 -mtune=athlon64" } */ + +extern void abort (void); + -+typedef long long T; -+typedef T vl_t __attribute__((vector_size(2 * sizeof (T)))); -+ -+vl_t -+buggy_func (T x) ++long double ++__attribute__((noinline, noclone)) ++test (float num) +{ -+ vl_t w; -+ T *p = (T *)&w; -+ p[0] = p[1] = x; -+ return w; ++ unsigned int i; ++ ++ if (num < 0.0) ++ num = 0.0; ++ ++ __builtin_memcpy (&i, &num, sizeof(unsigned int)); ++ ++ return (long double)(unsigned long long) i; +} + +int -+main(void) ++main () +{ -+ vl_t rval; -+ T *pl; ++ long double x; + -+ pl = (T *) &rval; -+ rval = buggy_func (2); ++ x = test (0.0); + -+ if (pl[0] != 2 || pl[1] != 2) ++ if (x != 0.0) + abort (); + + return 0; +} -Index: gcc/testsuite/gfortran.dg/intrinsic_8.f90 +Index: gcc/testsuite/gcc.target/i386/pr56866.c =================================================================== ---- gcc/testsuite/gfortran.dg/intrinsic_8.f90 (.../tags/gcc_4_6_3_release) (wersja 0) -+++ gcc/testsuite/gfortran.dg/intrinsic_8.f90 (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -0,0 +1,23 @@ +--- gcc/testsuite/gcc.target/i386/pr56866.c (.../tags/gcc_4_7_3_release) (revision 0) ++++ gcc/testsuite/gcc.target/i386/pr56866.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -0,0 +1,16 @@ ++/* PR target/56866 */ ++/* { dg-do run } */ ++/* { dg-require-effective-target xop } */ ++/* { dg-options "-O3 -mxop" } */ ++ ++#define main xop_test_main ++#include "../../gcc.c-torture/execute/pr56866.c" ++#undef main ++ ++#include "xop-check.h" ++ ++static void ++xop_test (void) ++{ ++ xop_test_main (); ++} +Index: gcc/testsuite/gcc.target/i386/pr57098.c +=================================================================== +--- gcc/testsuite/gcc.target/i386/pr57098.c (.../tags/gcc_4_7_3_release) (revision 0) ++++ gcc/testsuite/gcc.target/i386/pr57098.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -0,0 +1,10 @@ ++/* { dg-do compile } */ ++/* { dg-require-effective-target lp64 } */ ++/* { dg-options "-msse4 -mcmodel=large" } */ ++ ++typedef int V __attribute__((vector_size(16))); ++ ++void foo (V *p, V *mask) ++{ ++ *p = __builtin_shuffle (*p, *mask); ++} +Index: gcc/testsuite/gcc.target/sh/pr57108.c +=================================================================== +--- gcc/testsuite/gcc.target/sh/pr57108.c (.../tags/gcc_4_7_3_release) (revision 0) ++++ gcc/testsuite/gcc.target/sh/pr57108.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -0,0 +1,19 @@ ++/* { dg-do compile { target "sh*-*-*" } } */ ++/* { dg-options "-O1" } */ ++ ++void __assert_func (void) __attribute__ ((__noreturn__)) ; ++ ++void ATATransfer (int num, int buffer) ++{ ++ int wordCount; ++ ++ while (num > 0) ++ { ++ wordCount = num * 512 / sizeof (int); ++ ++ ((0 == (buffer & 63)) ? (void)0 : __assert_func () ); ++ ((0 == (wordCount & 31)) ? (void)0 : __assert_func ()); ++ } ++ ++ ++ } +Index: gcc/testsuite/gfortran.dg/size_kind_3.f90 +=================================================================== +--- gcc/testsuite/gfortran.dg/size_kind_3.f90 (.../tags/gcc_4_7_3_release) (revision 0) ++++ gcc/testsuite/gfortran.dg/size_kind_3.f90 (.../branches/gcc-4_7-branch) (revision 198690) +@@ -0,0 +1,11 @@ +! { dg-do compile } +! -+! PR fortran/52452 ++! PR fortran/57142 +! -+! Contributed by Roger Ferrer Ibanez ++integer :: B(huge(1)+3_8,2_8) ++integer(8) :: var1(2), var2, var3 ++ ++var1 = shape(B) ! { dg-error "SHAPE overflows its kind" } ++var2 = size(B) ! { dg-error "SIZE overflows its kind" } ++var3 = size(B,dim=1) ! { dg-error "SIZE overflows its kind" } ++end +Index: gcc/testsuite/gfortran.dg/transfer_check_4.f90 +=================================================================== +--- gcc/testsuite/gfortran.dg/transfer_check_4.f90 (.../tags/gcc_4_7_3_release) (revision 0) ++++ gcc/testsuite/gfortran.dg/transfer_check_4.f90 (.../branches/gcc-4_7-branch) (revision 198690) +@@ -0,0 +1,44 @@ ++! { dg-do compile } ++! { dg-options "-Wall" } ++ ++! PR 57022: [4.7/4.8/4.9 Regression] Inappropriate warning for use of TRANSFER with arrays ++! Contributed by William Clodius ++ ++subroutine transfers (test) ++ ++ use, intrinsic :: iso_fortran_env ++ ++ integer, intent(in) :: test ++ ++ integer(int8) :: test8(8) = 0 ++ integer(int16) :: test16(4) = 0 ++ integer(int32) :: test32(2) = 0 ++ integer(int64) :: test64 = 0 ++ ++ select case(test) ++ case(0) ++ test64 = transfer(test8, test64) ++ case(1) ++ test64 = transfer(test16, test64) ++ case(2) ++ test64 = transfer(test32, test64) ++ case(3) ++ test8 = transfer(test64, test8, 8) ++ case(4) ++ test16 = transfer(test64, test16, 4) ++ case(5) ++ test32 = transfer(test64, test32, 2) ++ end select ++ ++end subroutine ++ ++ ++! PR 53685: surprising warns about transfer with explicit character range ++! Contributed by Jos de Kloe ++ ++subroutine mytest(byte_array,val) ++ integer, parameter :: r8_ = Selected_Real_Kind(15,307) ! = real*8 ++ character(len=1), dimension(16), intent(in) :: byte_array ++ real(r8_),intent(out) :: val ++ val = transfer(byte_array(1:8),val) ++end subroutine +Index: gcc/testsuite/gfortran.dg/namelist_77.f90 +=================================================================== +--- gcc/testsuite/gfortran.dg/namelist_77.f90 (.../tags/gcc_4_7_3_release) (revision 0) ++++ gcc/testsuite/gfortran.dg/namelist_77.f90 (.../branches/gcc-4_7-branch) (revision 198690) +@@ -0,0 +1,49 @@ ++! { dg-do run } +! -+PROGRAM test_etime -+ IMPLICIT NONE -+ INTRINSIC :: etime -+ REAL(4) :: tarray(1:2) -+ REAL(4) :: result -+ -+ CALL etime(tarray, result) -+END PROGRAM test_etime -+ -+subroutine test_etime2 -+ IMPLICIT NONE -+ INTRINSIC :: etime -+ REAL(4) :: tarray(1:2) -+ REAL(4) :: result -+ -+ result = etime(tarray) -+END subroutine test_etime2 -Index: gcc/testsuite/gfortran.dg/proc_ptr_34.f90 ++! PR libfortran/51825 - Fortran runtime error: Cannot match namelist object name ++! Test case derived from PR. ++ ++module local_mod ++ ++ type mytype1 ++ integer :: int1 ++ end type ++ ++ type mytype2 ++ integer :: n_x ++ integer :: n_px ++ end type ++ ++ type beam_init_struct ++ character(16) :: chars(1) = '' ++ type (mytype1) dummy ++ type (mytype2) grid(1) ++ end type ++ ++end module ++ ++program error_namelist ++ ++ use local_mod ++ ++ implicit none ++ ++ type (beam_init_struct) beam_init ++ ++ namelist / error_params / beam_init ++ ++ open (10, status='scratch') ++ write (10, '(a)') "&error_params" ++ write (10, '(a)') " beam_init%chars(1)='JUNK'" ++ write (10, '(a)') " beam_init%grid(1)%n_x=3" ++ write (10, '(a)') " beam_init%grid(1)%n_px=2" ++ write (10, '(a)') "/" ++ rewind(10) ++ read(10, nml=error_params) ++ close (10) ++ ++ if (beam_init%chars(1) /= 'JUNK') call abort ++ if (beam_init%grid(1)%n_x /= 3) call abort ++ if (beam_init%grid(1)%n_px /= 2) call abort ++ ++end program +Index: gcc/testsuite/gfortran.dg/namelist_79.f90 =================================================================== ---- gcc/testsuite/gfortran.dg/proc_ptr_34.f90 (.../tags/gcc_4_6_3_release) (wersja 0) -+++ gcc/testsuite/gfortran.dg/proc_ptr_34.f90 (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -0,0 +1,79 @@ +--- gcc/testsuite/gfortran.dg/namelist_79.f90 (.../tags/gcc_4_7_3_release) (revision 0) ++++ gcc/testsuite/gfortran.dg/namelist_79.f90 (.../branches/gcc-4_7-branch) (revision 198690) +@@ -0,0 +1,43 @@ ++! { dg-do run } ++! PR libfortran/52512 - Cannot match namelist object name ++! Test case derived from PR. ++ ++program testje ++ ++ implicit none ++ ++ integer :: getal, jn ++ type ptracer ++ character(len = 8) :: sname !: short name ++ logical :: lini !: read in a file or not ++ end type ptracer ++ type(ptracer) , dimension(3) :: tracer ++ namelist/namtoptrc/ getal,tracer ++ ++ ! standard values ++ getal = 9999 ++ do jn = 1, 3 ++ tracer(jn)%sname = 'default_name' ++ tracer(jn)%lini = .false. ++ end do ++ ++ open (10, status='scratch') ++ write (10, '(a)') "&namtoptrc" ++ write (10, '(a)') " getal = 7" ++ write (10, '(a)') " tracer(1) = 'DIC ', .true." ++ write (10, '(a)') " tracer(2) = 'Alkalini', .true." ++ write (10, '(a)') " tracer(3) = 'O2 ', .true." ++ write (10, '(a)') "/" ++ rewind(10) ++ read(10, nml=namtoptrc) ++ close (10) ++ ++ if (getal /= 7) call abort ++ if (tracer(1)%sname /= 'DIC ') call abort ++ if (tracer(2)%sname /= 'Alkalini') call abort ++ if (tracer(3)%sname /= 'O2 ') call abort ++ if (.not. tracer(1)%lini) call abort ++ if (.not. tracer(2)%lini) call abort ++ if (.not. tracer(3)%lini) call abort ++ ++end program testje +Index: gcc/testsuite/gfortran.dg/size_kind_2.f90 +=================================================================== +--- gcc/testsuite/gfortran.dg/size_kind_2.f90 (.../tags/gcc_4_7_3_release) (revision 0) ++++ gcc/testsuite/gfortran.dg/size_kind_2.f90 (.../branches/gcc-4_7-branch) (revision 198690) +@@ -0,0 +1,17 @@ +! { dg-do compile } ++! { dg-options "-fdump-tree-original" } +! -+! PR fortran/52469 ++! PR fortran/57142 +! -+! This was failing as the DECL of the proc pointer "func" -+! was used for the interface of the proc-pointer component "my_f_ptr" -+! rather than the decl of the proc-pointer target ++integer :: B(huge(1)+3_8,2_8) ++integer(8) :: var1(2), var2, var3 ++ ++var1 = shape(B,kind=8) ++var2 = size(B,kind=8) ++var3 = size(B,dim=1,kind=8) ++end ++ ++! { dg-final { scan-tree-dump "static integer.kind=8. A..\\\[2\\\] = \\\{2147483650, 2\\\};" "original" } } ++! { dg-final { scan-tree-dump "var2 = 4294967300;" "original" } } ++! { dg-final { scan-tree-dump "var3 = 2147483650;" "original" } } ++! { dg-final { cleanup-tree-dump "original" } } +Index: gcc/testsuite/gfortran.dg/proc_ptr_41.f90 +=================================================================== +--- gcc/testsuite/gfortran.dg/proc_ptr_41.f90 (.../tags/gcc_4_7_3_release) (revision 0) ++++ gcc/testsuite/gfortran.dg/proc_ptr_41.f90 (.../branches/gcc-4_7-branch) (revision 198690) +@@ -0,0 +1,37 @@ ++! { dg-do compile } +! -+! Contributed by palott@gmail.com ++! PR 56968: [4.7/4.8/4.9 Regression] [F03] Issue with a procedure defined with a generic name returning procedure pointer +! ++! Contributed by Samuel Debionne + -+module ExampleFuncs -+ implicit none ++module test + -+ ! NOTE: "func" is a procedure pointer! -+ pointer :: func -+ interface -+ function func (z) -+ real :: func -+ real, intent (in) :: z -+ end function func ++ interface generic_name_get_proc_ptr ++ module procedure specific_name_get_proc_ptr ++ end interface ++ ++ abstract interface ++ double precision function foo(arg1) ++ real, intent(in) :: arg1 ++ end function + end interface + -+ type Contains_f_ptr -+ procedure (func), pointer, nopass :: my_f_ptr -+ end type Contains_f_ptr +contains + -+function f1 (x) -+ real :: f1 -+ real, intent (in) :: x ++ function specific_name_get_proc_ptr() result(res) ++ procedure(foo), pointer :: res ++ end function + -+ f1 = 2.0 * x ++end module test + -+ return -+end function f1 ++program crash_test ++ use :: test + -+function f2 (x) -+ real :: f2 -+ real, intent (in) :: x ++ procedure(foo), pointer :: ptr + -+ f2 = 3.0 * x**2 ++ ptr => specific_name_get_proc_ptr() ++ ptr => generic_name_get_proc_ptr() + -+ return -+end function f2 ++end program + -+function fancy (func, x) -+ real :: fancy -+ real, intent (in) :: x ++! { dg-final { cleanup-modules "test" } } +Index: gcc/testsuite/gfortran.dg/namelist_81.f90 +=================================================================== +--- gcc/testsuite/gfortran.dg/namelist_81.f90 (.../tags/gcc_4_7_3_release) (revision 0) ++++ gcc/testsuite/gfortran.dg/namelist_81.f90 (.../branches/gcc-4_7-branch) (revision 198690) +@@ -0,0 +1,43 @@ ++! { dg-do run } ++! PR56786 Error on embedded spaces ++integer :: i(3) ++namelist /nml/ i ++ ++i = -42 ++open(99,status='scratch') ++write(99,'(a)') '&nml i(3 ) = 5 /' ++rewind(99) ++read(99,nml=nml) ++close(99) ++if (i(1)/=-42 .or. i(2)/=-42 .or. i(3)/=5) call abort() ++ ++! Shorten the file so the read hits EOF ++ ++open(99,status='scratch') ++write(99,'(a)') '&nml i(3 ) = 5 ' ++rewind(99) ++read(99,nml=nml, end=30) ++call abort() ++! Shorten some more ++ 30 close(99) ++open(99,status='scratch') ++write(99,'(a)') '&nml i(3 ) =' ++rewind(99) ++read(99,nml=nml, end=40) ++call abort() ++! Shorten some more ++ 40 close(99) ++open(99,status='scratch') ++write(99,'(a)') '&nml i(3 )' ++rewind(99) ++read(99,nml=nml, end=50) ++call abort() ++! Shorten some more ++ 50 close(99) ++open(99,status='scratch') ++write(99,'(a)') '&nml i(3 ' ++rewind(99) ++read(99,nml=nml, end=60) ++call abort() ++ 60 close(99) ++end +Index: gcc/testsuite/gfortran.dg/namelist_78.f90 +=================================================================== +--- gcc/testsuite/gfortran.dg/namelist_78.f90 (.../tags/gcc_4_7_3_release) (revision 0) ++++ gcc/testsuite/gfortran.dg/namelist_78.f90 (.../branches/gcc-4_7-branch) (revision 198690) +@@ -0,0 +1,34 @@ ++! { dg-do run } ++! ++! PR libfortran/51825 ++! Test case regarding namelist problems with derived types ++ ++program namelist ++ ++ type d1 ++ integer :: j = 0 ++ end type d1 ++ ++ type d2 ++ type(d1) k ++ end type d2 ++ ++ type d3 ++ type(d2) d(2) ++ end type d3 ++ ++ type(d3) der ++ namelist /nmlst/ der ++ ++ open (10, status='scratch') ++ write (10, '(a)') "&NMLST" ++ write (10, '(a)') " DER%D(1)%K%J = 1," ++ write (10, '(a)') " DER%D(2)%K%J = 2," ++ write (10, '(a)') "/" ++ rewind(10) ++ read(10, nml=nmlst) ++ close (10) ++ ++ if (der%d(1)%k%j /= 1) call abort ++ if (der%d(2)%k%j /= 2) call abort ++end program namelist +Index: gcc/testsuite/gcc.c-torture/execute/pr56866.c +=================================================================== +--- gcc/testsuite/gcc.c-torture/execute/pr56866.c (.../tags/gcc_4_7_3_release) (revision 0) ++++ gcc/testsuite/gcc.c-torture/execute/pr56866.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -0,0 +1,45 @@ ++/* PR target/56866 */ + -+ interface AFunc -+ function func (y) -+ real :: func -+ real, intent (in) ::y -+ end function func -+ end interface AFunc ++int ++main () ++{ ++#if __CHAR_BIT__ == 8 && __SIZEOF_LONG_LONG__ == 8 && __SIZEOF_INT__ == 4 && __SIZEOF_SHORT__ == 2 ++ unsigned long long wq[256], rq[256]; ++ unsigned int wi[256], ri[256]; ++ unsigned short ws[256], rs[256]; ++ unsigned char wc[256], rc[256]; ++ int t; ++ ++ __builtin_memset (wq, 0, sizeof wq); ++ __builtin_memset (wi, 0, sizeof wi); ++ __builtin_memset (ws, 0, sizeof ws); ++ __builtin_memset (wc, 0, sizeof wc); ++ wq[0] = 0x0123456789abcdefULL; ++ wi[0] = 0x01234567; ++ ws[0] = 0x4567; ++ wc[0] = 0x73; ++ ++ asm volatile ("" : : "g" (wq), "g" (wi), "g" (ws), "g" (wc) : "memory"); ++ ++ for (t = 0; t < 256; ++t) ++ rq[t] = (wq[t] >> 8) | (wq[t] << (sizeof (wq[0]) * __CHAR_BIT__ - 8)); ++ for (t = 0; t < 256; ++t) ++ ri[t] = (wi[t] >> 8) | (wi[t] << (sizeof (wi[0]) * __CHAR_BIT__ - 8)); ++ for (t = 0; t < 256; ++t) ++ rs[t] = (ws[t] >> 9) | (ws[t] << (sizeof (ws[0]) * __CHAR_BIT__ - 9)); ++ for (t = 0; t < 256; ++t) ++ rc[t] = (wc[t] >> 5) | (wc[t] << (sizeof (wc[0]) * __CHAR_BIT__ - 5)); ++ ++ asm volatile ("" : : "g" (rq), "g" (ri), "g" (rs), "g" (rc) : "memory"); ++ ++ if (rq[0] != 0xef0123456789abcdULL || rq[1]) ++ __builtin_abort (); ++ if (ri[0] != 0x67012345 || ri[1]) ++ __builtin_abort (); ++ if (rs[0] != 0xb3a2 || rs[1]) ++ __builtin_abort (); ++ if (rc[0] != 0x9b || rc[1]) ++ __builtin_abort (); ++#endif ++ return 0; ++} +Index: gcc/testsuite/gcc.dg/pr56890-2.c +=================================================================== +--- gcc/testsuite/gcc.dg/pr56890-2.c (.../tags/gcc_4_7_3_release) (revision 0) ++++ gcc/testsuite/gcc.dg/pr56890-2.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -0,0 +1,19 @@ ++/* PR target/56890 */ ++/* Reported by Rainer Jung */ + -+ fancy = func (x) + 3.3 * x -+end function fancy ++/* { dg-do assemble } */ ++/* { dg-options "-O" } */ + -+end module ExampleFuncs ++unsigned int buggy(unsigned int min, unsigned int max) ++{ ++ unsigned int number; ++ if (max < 16384) { ++ unsigned short num16; ++ num16 = min + (long) ((double) (max - min + 1.0) * (num16 / (65535 + 1.0))); ++ return num16; ++ } ++ else { ++ (number) = min + (long) ((double) (max - min + 1.0) * (number / (4294967295U + 1.0))); ++ } ++ return number; ++} +Index: gcc/testsuite/gcc.dg/pr48189.c +=================================================================== +--- gcc/testsuite/gcc.dg/pr48189.c (.../tags/gcc_4_7_3_release) (revision 0) ++++ gcc/testsuite/gcc.dg/pr48189.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -0,0 +1,13 @@ ++/* PR tree-optimization/48189 */ ++/* { dg-do compile } */ ++/* { dg-options "-O --param max-predicted-iterations=0" } */ ++ ++struct S { int s[8]; }; ++ ++void ++foo (int *x, struct S *y) ++{ ++ int i; ++ for (i = 0; y[i].s[i]; i++) ++ *x++ = y[i].s[i]; ++} +Index: gcc/testsuite/gcc.dg/torture/builtin-logb-1.c +=================================================================== +--- gcc/testsuite/gcc.dg/torture/builtin-logb-1.c (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/testsuite/gcc.dg/torture/builtin-logb-1.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -48,25 +48,25 @@ + /* Test if FUNCRES(FUNC(NEG FUNCARG(ARGARG))) is false. Check the + sign as well. */ + #ifndef __SPU__ +-#define TESTIT3(FUNC,NEG,FUNCARG,ARGARG,FUNCRES) do { \ ++#define TESTIT3(FUNC,NEG,FUNCARG,ARGARG,FUNCRES,NEG2) do { \ + if (!__builtin_##FUNCRES##f(__builtin_##FUNC(NEG __builtin_##FUNCARG##f(ARGARG))) \ +- || CKSGN_F(__builtin_##FUNC##f(NEG __builtin_##FUNCARG##f(ARGARG)), NEG __builtin_##FUNCARG##f(ARGARG))) \ ++ || CKSGN_F(__builtin_##FUNC##f(NEG __builtin_##FUNCARG##f(ARGARG)), NEG2 __builtin_##FUNCARG##f(ARGARG))) \ + link_error(__LINE__); \ + if (!__builtin_##FUNCRES(__builtin_##FUNC(NEG __builtin_##FUNCARG(ARGARG))) \ +- || CKSGN(__builtin_##FUNC(NEG __builtin_##FUNCARG(ARGARG)), NEG __builtin_##FUNCARG(ARGARG))) \ ++ || CKSGN(__builtin_##FUNC(NEG __builtin_##FUNCARG(ARGARG)), NEG2 __builtin_##FUNCARG(ARGARG))) \ + link_error(__LINE__); \ + if (!__builtin_##FUNCRES##l(__builtin_##FUNC##l(NEG __builtin_##FUNCARG##l(ARGARG))) \ +- || CKSGN_L(__builtin_##FUNC##l(NEG __builtin_##FUNCARG##l(ARGARG)), NEG __builtin_##FUNCARG##l(ARGARG))) \ ++ || CKSGN_L(__builtin_##FUNC##l(NEG __builtin_##FUNCARG##l(ARGARG)), NEG2 __builtin_##FUNCARG##l(ARGARG))) \ + link_error(__LINE__); \ + } while (0) + #else +-#define TESTIT3(FUNC,NEG,FUNCARG,ARGARG,FUNCRES) do { \ ++#define TESTIT3(FUNC,NEG,FUNCARG,ARGARG,FUNCRES,NEG2) do { \ + /* SPU single-precision floating point format does not support Inf or Nan. */ \ + if (!__builtin_##FUNCRES(__builtin_##FUNC(NEG __builtin_##FUNCARG(ARGARG))) \ +- || CKSGN(__builtin_##FUNC(NEG __builtin_##FUNCARG(ARGARG)), NEG __builtin_##FUNCARG(ARGARG))) \ ++ || CKSGN(__builtin_##FUNC(NEG __builtin_##FUNCARG(ARGARG)), NEG2 __builtin_##FUNCARG(ARGARG))) \ + link_error(__LINE__); \ + if (!__builtin_##FUNCRES##l(__builtin_##FUNC##l(NEG __builtin_##FUNCARG##l(ARGARG))) \ +- || CKSGN_L(__builtin_##FUNC##l(NEG __builtin_##FUNCARG##l(ARGARG)), NEG __builtin_##FUNCARG##l(ARGARG))) \ ++ || CKSGN_L(__builtin_##FUNC##l(NEG __builtin_##FUNCARG##l(ARGARG)), NEG2 __builtin_##FUNCARG##l(ARGARG))) \ + link_error(__LINE__); \ + } while (0) + #endif +@@ -173,15 +173,15 @@ + + /* Test for f(+-Inf) -> +-Inf and f(+-NaN) -> +-NaN, regardless of + the radix. */ +- TESTIT3 (logb, ,inf, , isinf); +- TESTIT3 (logb, - ,inf, , isinf); +- TESTIT3 (logb, ,nan, "", isnan); +- TESTIT3 (logb, - ,nan, "", isnan); ++ TESTIT3 (logb, ,inf, , isinf, ); ++ TESTIT3 (logb, - ,inf, , isinf, ); ++ TESTIT3 (logb, ,nan, "", isnan, ); ++ TESTIT3 (logb, - ,nan, "", isnan, -); + +- TESTIT3 (significand, ,inf, , isinf); +- TESTIT3 (significand, - ,inf, , isinf); +- TESTIT3 (significand, ,nan, "", isnan); +- TESTIT3 (significand, - ,nan, "", isnan); ++ TESTIT3 (significand, ,inf, , isinf, ); ++ TESTIT3 (significand, - ,inf, , isinf, -); ++ TESTIT3 (significand, ,nan, "", isnan, ); ++ TESTIT3 (significand, - ,nan, "", isnan, -); + } + + int main() +Index: gcc/testsuite/gcc.dg/torture/pr53922.c +=================================================================== +--- gcc/testsuite/gcc.dg/torture/pr53922.c (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/testsuite/gcc.dg/torture/pr53922.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -1,6 +1,7 @@ + /* { dg-do run } */ + /* { dg-require-weak "" } */ +-/* { dg-skip-if "No undefined weak" { hppa*-*-hpux* && { ! lp64 } } { "*" } { "" } } */ ++/* { dg-skip-if "No undefined weak" { alpha*-*-osf* } } */ ++/* { dg-skip-if "No undefined weak" { hppa*-*-hpux* && { ! lp64 } } } */ + + int x(int a) + { +Index: gcc/testsuite/gcc.dg/pr56890-1.c +=================================================================== +--- gcc/testsuite/gcc.dg/pr56890-1.c (.../tags/gcc_4_7_3_release) (revision 0) ++++ gcc/testsuite/gcc.dg/pr56890-1.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -0,0 +1,15 @@ ++/* PR target/56890 */ ++/* Reported by Rainer Jung */ + ++/* { dg-do assemble } */ ++/* { dg-options "-O2" } */ + -+program test_proc_ptr -+ use ExampleFuncs -+ implicit none ++unsigned int buggy(unsigned int min, unsigned int max) ++{ ++ if (max < 16384) { ++ unsigned short num16 = 0; ++ num16 = min + (long) ((double) (max - min + 1.0) * (num16 / (65535 + 1.0))); ++ return num16; ++ } ++ return 0; ++} +Index: gcc/testsuite/ChangeLog +=================================================================== +--- gcc/testsuite/ChangeLog (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/testsuite/ChangeLog (.../branches/gcc-4_7-branch) (revision 198690) +@@ -1,3 +1,97 @@ ++2013-05-07 Tobias Burnus + -+ type (Contains_f_ptr), dimension (2) :: NewType -+ -+ !NewType(1) % my_f_ptr => f1 -+ NewType(2) % my_f_ptr => f2 ++ Backport from mainline ++ 2013-05-02 Tobias Burnus + -+ !write (*, *) NewType(1) % my_f_ptr (3.0), NewType(2) % my_f_ptr (3.0) -+ write (6, *) NewType(2) % my_f_ptr (3.0) ! < Shall print '27.0' ++ PR fortran/57142 ++ * gfortran.dg/size_kind_2.f90: New. ++ * gfortran.dg/size_kind_3.f90: New. + -+ stop -+end program test_proc_ptr ++2013-05-03 Marek Polacek + -+! { dg-final { cleanup-modules "examplefuncs" } } -Index: gcc/testsuite/ChangeLog -=================================================================== ---- gcc/testsuite/ChangeLog (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/testsuite/ChangeLog (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -1,3 +1,23 @@ -+2012-03-10 Tobias Burnus ++ Backport from mainline ++ 2013-04-25 Marek Polacek ++ ++ PR tree-optimization/57066 ++ * gcc.dg/torture/builtin-logb-1.c: Adjust testcase. ++ ++2013-04-30 Uros Bizjak + -+ PR fortran/52469 -+ * gfortran.dg/proc_ptr_34.f90: New. ++ Backport from mainline ++ 2013-04-29 Uros Bizjak + -+2012-03-06 Tobias Burnus ++ PR target/44578 ++ * gcc.target/i386/pr44578.c: New test. + + Backport from mainline -+ 2012-03-02 Tobias Burnus ++ 2013-04-29 Uros Bizjak ++ ++ PR target/57098 ++ * gcc.target/i386/pr57098.c: New test. ++ ++2013-04-29 Christian Bruel + -+ PR fortran/52452 -+ * gfortran.dg/intrinsic_8.f90: New. ++ PR target/57108 ++ * gcc.target/sh/pr57108.c: New test. + -+2012-03-02 Peter Bergner ++2013-04-28 Jerry DeLisle ++ ++ Backport from trunk: ++ ++ PR fortran/51825 ++ * gfortran.dg/namelist_77.f90: New test. ++ * gfortran.dg/namelist_78.f90: New test. ++ ++2013-04-28 Jerry DeLisle ++ ++ Backport from trunk: ++ ++ PR fortran/56786 ++ * gfortran.dg/namelist_81.f90: New test. ++ ++2013-04-28 Jerry DeLisle ++ ++ Backport from trunk: ++ ++ PR fortran/52512 ++ * gfortran.dg/namelist_79.f90: New test. ++ ++2013-04-27 Jakub Jelinek ++ ++ PR target/56866 ++ * gcc.c-torture/execute/pr56866.c: New test. ++ * gcc.target/i386/pr56866.c: New test. ++ ++2013-04-26 Janus Weil ++ ++ Backports from trunk: ++ ++ PR fortran/56968 ++ * gfortran.dg/proc_ptr_41.f90: New. ++ ++ PR fortran/53685 ++ PR fortran/57022 ++ * gfortran.dg/transfer_check_4.f90: New. ++ ++2013-04-19 Marek Polacek + + Backport from mainline -+ 2012-03-02 Peter Bergner ++ 2013-01-08 Steven Bosscher ++ Jakub Jelinek ++ ++ PR tree-optimization/48189 ++ * gcc.dg/pr48189.c: New test. ++ ++2013-04-15 Rainer Orth + -+ * gcc.target/powerpc/pr52457.c: New test. ++ * gcc.dg/torture/pr53922.c: Skip on alpha*-*-osf*. ++ Remove dg-skip-if default args. + - 2012-03-01 Release Manager ++2013-04-15 Eric Botcazou ++ ++ * gcc.dg/pr56890-1.c: New test. ++ * gcc.dg/pr56890-2.c: Likewise. ++ + 2013-04-11 Release Manager - * GCC 4.6.3 released. -Index: gcc/fortran/ChangeLog + * GCC 4.7.3 released. +Index: gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh3.C =================================================================== ---- gcc/fortran/ChangeLog (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/fortran/ChangeLog (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -1,3 +1,18 @@ -+2012-03-10 Tobias Burnus +--- gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh3.C (.../tags/gcc_4_7_3_release) (revision 0) ++++ gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh3.C (.../branches/gcc-4_7-branch) (revision 198690) +@@ -0,0 +1,14 @@ ++// PR c++/56388 ++// { dg-require-effective-target c++11 } + -+ PR fortran/52469 -+ * trans-types.c (gfc_get_function_type): Handle backend_decl -+ of a procedure pointer. ++int main() ++{ ++ bool /*const*/ condition = false; ++ ++ [&]{ ++ try{} ++ catch(...){ ++ if(condition){} ++ } ++ }(); ++} +Index: gcc/cp/ChangeLog +=================================================================== +--- gcc/cp/ChangeLog (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/cp/ChangeLog (.../branches/gcc-4_7-branch) (revision 198690) +@@ -1,3 +1,13 @@ ++2013-04-21 Eric Botcazou + -+2012-03-06 Tobias Burnus ++ * parser.c (cp_parser_late_return_type_opt): Fix C++ism. + -+ Backport from mainline -+ 2012-03-02 Tobias Burnus ++2013-04-15 Jason Merrill + -+ PR fortran/52452 -+ * resolve.c (resolve_intrinsic): Don't search for a -+ function if we know that it is a subroutine. ++ PR c++/56388 ++ * semantics.c (insert_capture_proxy): Just use index 1 in the ++ stmt_list_stack. + - 2012-03-01 Release Manager + 2013-04-11 Release Manager - * GCC 4.6.3 released. -Index: gcc/fortran/trans-types.c + * GCC 4.7.3 released. +Index: gcc/cp/semantics.c =================================================================== ---- gcc/fortran/trans-types.c (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/fortran/trans-types.c (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -2519,7 +2519,11 @@ - || sym->attr.flavor == FL_PROGRAM); +--- gcc/cp/semantics.c (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/cp/semantics.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -8959,13 +8959,12 @@ + insert_capture_proxy (tree var) + { + cp_binding_level *b; +- int skip; + tree stmt_list; - if (sym->backend_decl) -- return TREE_TYPE (sym->backend_decl); -+ { -+ if (sym->attr.proc_pointer) -+ return TREE_TYPE (TREE_TYPE (sym->backend_decl)); -+ return TREE_TYPE (sym->backend_decl); -+ } + /* Put the capture proxy in the extra body block so that it won't clash + with a later local variable. */ + b = current_binding_level; +- for (skip = 0; ; ++skip) ++ for (;;) + { + cp_binding_level *n = b->level_chain; + if (n->kind == sk_function_parms) +@@ -8976,8 +8975,7 @@ - alternate_return = 0; - typelist = NULL_TREE; -Index: gcc/fortran/resolve.c + /* And put a DECL_EXPR in the STATEMENT_LIST for the same block. */ + var = build_stmt (DECL_SOURCE_LOCATION (var), DECL_EXPR, var); +- stmt_list = VEC_index (tree, stmt_list_stack, +- VEC_length (tree, stmt_list_stack) - 1 - skip); ++ stmt_list = VEC_index (tree, stmt_list_stack, 1); + gcc_assert (stmt_list); + append_to_statement_list_force (var, &stmt_list); + } +Index: gcc/cp/parser.c =================================================================== ---- gcc/fortran/resolve.c (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/fortran/resolve.c (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -1452,7 +1452,7 @@ - - if (sym->intmod_sym_id) - isym = gfc_intrinsic_function_by_id ((gfc_isym_id) sym->intmod_sym_id); -- else -+ else if (!sym->attr.subroutine) - isym = gfc_find_function (sym->name); - - if (isym) -Index: gcc/BASE-VER +--- gcc/cp/parser.c (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/cp/parser.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -16691,7 +16691,7 @@ + cp_parser_late_return_type_opt (cp_parser* parser, cp_cv_quals quals) + { + cp_token *token; +- tree type; ++ tree type, save_ccp, save_ccr; + + /* Peek at the next token. */ + token = cp_lexer_peek_token (parser->lexer); +@@ -16702,8 +16702,8 @@ + /* Consume the ->. */ + cp_lexer_consume_token (parser->lexer); + +- tree save_ccp = current_class_ptr; +- tree save_ccr = current_class_ref; ++ save_ccp = current_class_ptr; ++ save_ccr = current_class_ref; + if (quals >= 0) + { + /* DR 1207: 'this' is in scope in the trailing return type. */ +Index: gcc/dwarf2out.c =================================================================== ---- gcc/BASE-VER (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/BASE-VER (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -1 +1 @@ --4.6.3 -+4.6.4 -Index: gcc/tree-vect-loop.c +--- gcc/dwarf2out.c (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/dwarf2out.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -22538,7 +22538,7 @@ + /* Add the name for the main input file now. We delayed this from + dwarf2out_init to avoid complications with PCH. */ + add_name_attribute (comp_unit_die (), remap_debug_filename (filename)); +- if (!IS_ABSOLUTE_PATH (filename)) ++ if (!IS_ABSOLUTE_PATH (filename) || targetm.force_at_comp_dir) + add_comp_dir_attribute (comp_unit_die ()); + else if (get_AT (comp_unit_die (), DW_AT_comp_dir) == NULL) + { +Index: gcc/predict.c =================================================================== ---- gcc/tree-vect-loop.c (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/tree-vect-loop.c (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -2104,7 +2104,8 @@ - if (stmt_info - && !STMT_VINFO_RELEVANT_P (stmt_info) - && (!STMT_VINFO_LIVE_P (stmt_info) -- || STMT_VINFO_DEF_TYPE (stmt_info) != vect_reduction_def)) -+ || !VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (stmt_info))) -+ && !STMT_VINFO_IN_PATTERN_P (stmt_info)) - continue; - - if (STMT_VINFO_DATA_REF (vinfo_for_stmt (stmt))) -@@ -2251,11 +2252,19 @@ - { - gimple stmt = gsi_stmt (si); - stmt_vec_info stmt_info = vinfo_for_stmt (stmt); -+ -+ if (STMT_VINFO_IN_PATTERN_P (stmt_info)) -+ { -+ stmt = STMT_VINFO_RELATED_STMT (stmt_info); -+ stmt_info = vinfo_for_stmt (stmt); -+ } -+ - /* Skip stmts that are not vectorized inside the loop. */ - if (!STMT_VINFO_RELEVANT_P (stmt_info) - && (!STMT_VINFO_LIVE_P (stmt_info) -- || STMT_VINFO_DEF_TYPE (stmt_info) != vect_reduction_def)) -+ || !VECTORIZABLE_CYCLE_DEF (STMT_VINFO_DEF_TYPE (stmt_info)))) +--- gcc/predict.c (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/predict.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -983,7 +983,8 @@ + if (TREE_CODE (niter) == INTEGER_CST) + { + if (host_integerp (niter, 1) +- && compare_tree_int (niter, max-1) == -1) ++ && max ++ && compare_tree_int (niter, max - 1) == -1) + nitercst = tree_low_cst (niter, 1) + 1; + else + nitercst = max; +@@ -1005,6 +1006,11 @@ + else continue; + ++ /* If the prediction for number of iterations is zero, do not ++ predict the exit edges. */ ++ if (nitercst == 0) ++ continue; ++ + probability = ((REG_BR_PROB_BASE + nitercst / 2) / nitercst); + predict_edge (ex, predictor, probability); + } +Index: gcc/fortran/ChangeLog +=================================================================== +--- gcc/fortran/ChangeLog (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/fortran/ChangeLog (.../branches/gcc-4_7-branch) (revision 198690) +@@ -1,3 +1,39 @@ ++2013-05-07 Tobias Burnus ++ ++ Backport from mainline ++ 2013-05-02 Tobias Burnus ++ ++ PR fortran/57142 ++ * simplify.c (gfc_simplify_size): Renamed from ++ simplify_size; fix kind=8 handling. ++ (gfc_simplify_size): New function. ++ (gfc_simplify_shape): Add range check. ++ * resolve.c (resolve_function): Fix handling ++ for ISYM_SIZE. ++ ++2013-04-26 Janus Weil + - vec_inside_cost += STMT_VINFO_INSIDE_OF_LOOP_COST (stmt_info) * factor; - /* FIXME: for stmts in the inner-loop in outer-loop vectorization, - some of the "outside" costs are generated inside the outer-loop. */ -Index: gcc/tree-vect-stmts.c ++ Backports from trunk: ++ ++ PR fortran/56968 ++ * expr.c (gfc_check_pointer_assign): Handle generic functions returning ++ procedure pointers. ++ ++ PR fortran/53685 ++ PR fortran/57022 ++ * check.c (gfc_calculate_transfer_sizes): Fix for array-valued SOURCE ++ expressions. ++ * target-memory.h (gfc_element_size): New prototype. ++ * target-memory.c (size_array): Remove. ++ (gfc_element_size): New function. ++ (gfc_target_expr_size): Modified to always return the full size of the ++ expression. ++ ++2013-04-18 Tobias Burnus ++ ++ PR fortran/56994 ++ * invoke.texi (NEAREST): S argument is not optional. ++ + 2013-04-11 Release Manager + + * GCC 4.7.3 released. +Index: gcc/fortran/expr.c =================================================================== ---- gcc/tree-vect-stmts.c (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/tree-vect-stmts.c (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -623,6 +623,46 @@ +--- gcc/fortran/expr.c (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/fortran/expr.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -3493,8 +3493,12 @@ + } + else if (rvalue->expr_type == EXPR_FUNCTION) + { +- s2 = rvalue->symtree->n.sym->result; +- name = rvalue->symtree->n.sym->result->name; ++ if (rvalue->value.function.esym) ++ s2 = rvalue->value.function.esym->result; ++ else ++ s2 = rvalue->symtree->n.sym->result; ++ ++ name = s2->name; + } + else + { +Index: gcc/fortran/resolve.c +=================================================================== +--- gcc/fortran/resolve.c (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/fortran/resolve.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -3155,6 +3155,7 @@ + for (arg = expr->value.function.actual; arg; arg = arg->next) + { + if ((GENERIC_ID == GFC_ISYM_UBOUND || GENERIC_ID == GFC_ISYM_SIZE) ++ && arg == expr->value.function.actual + && arg->next != NULL && arg->next->expr) + { + if (arg->next->expr->expr_type != EXPR_CONSTANT) +Index: gcc/fortran/target-memory.c +=================================================================== +--- gcc/fortran/target-memory.c (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/fortran/target-memory.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -35,17 +35,7 @@ + /* --------------------------------------------------------------- */ + /* Calculate the size of an expression. */ + +-static size_t +-size_array (gfc_expr *e) +-{ +- mpz_t array_size; +- gfc_constructor *c = gfc_constructor_first (e->value.constructor); +- size_t elt_size = gfc_target_expr_size (c->expr); + +- gfc_array_size (e, &array_size); +- return (size_t)mpz_get_ui (array_size) * elt_size; +-} +- + static size_t + size_integer (int kind) + { +@@ -82,16 +72,14 @@ } -+/* Model cost for type demotion and promotion operations. PWR is normally -+ zero for single-step promotions and demotions. It will be one if -+ two-step promotion/demotion is required, and so on. Each additional -+ step doubles the number of instructions required. */ ++/* Return the size of a single element of the given expression. ++ Identical to gfc_target_expr_size for scalars. */ + -+static void -+vect_model_promotion_demotion_cost (stmt_vec_info stmt_info, -+ enum vect_def_type *dt, int pwr) -+{ -+ int i, tmp; -+ int inside_cost = 0, outside_cost = 0, single_stmt_cost; + size_t +-gfc_target_expr_size (gfc_expr *e) ++gfc_element_size (gfc_expr *e) + { + tree type; + +- gcc_assert (e != NULL); +- +- if (e->expr_type == EXPR_ARRAY) +- return size_array (e); +- + switch (e->ts.type) + { + case BT_INTEGER: +@@ -130,12 +118,36 @@ + return int_size_in_bytes (type); + } + default: +- gfc_internal_error ("Invalid expression in gfc_target_expr_size."); ++ gfc_internal_error ("Invalid expression in gfc_element_size."); + return 0; + } + } + + ++/* Return the size of an expression in its target representation. */ + -+ /* The SLP costs were already calculated during SLP tree build. */ -+ if (PURE_SLP_STMT (stmt_info)) -+ return; ++size_t ++gfc_target_expr_size (gfc_expr *e) ++{ ++ mpz_t tmp; ++ size_t asz; + -+ single_stmt_cost = vect_get_stmt_cost (vec_promote_demote); -+ for (i = 0; i < pwr + 1; i++) -+ { -+ tmp = (STMT_VINFO_TYPE (stmt_info) == type_promotion_vec_info_type) ? -+ (i + 1) : i; -+ inside_cost += vect_pow2 (tmp) * single_stmt_cost; -+ } ++ gcc_assert (e != NULL); + -+ /* FORNOW: Assuming maximum 2 args per stmts. */ -+ for (i = 0; i < 2; i++) ++ if (e->rank) + { -+ if (dt[i] == vect_constant_def || dt[i] == vect_external_def) -+ outside_cost += vect_get_stmt_cost (vector_stmt); ++ if (gfc_array_size (e, &tmp)) ++ asz = mpz_get_ui (tmp); ++ else ++ asz = 0; + } ++ else ++ asz = 1; + -+ if (vect_print_dump_info (REPORT_COST)) -+ fprintf (vect_dump, "vect_model_promotion_demotion_cost: inside_cost = %d, " -+ "outside_cost = %d .", inside_cost, outside_cost); -+ -+ /* Set the costs in STMT_INFO. */ -+ stmt_vinfo_set_inside_of_loop_cost (stmt_info, NULL, inside_cost); -+ stmt_vinfo_set_outside_of_loop_cost (stmt_info, NULL, outside_cost); ++ return asz * gfc_element_size (e); +} + - /* Function vect_cost_strided_group_size ++ + /* The encode_* functions export a value into a buffer, and + return the number of bytes of the buffer that have been + used. */ +Index: gcc/fortran/target-memory.h +=================================================================== +--- gcc/fortran/target-memory.h (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/fortran/target-memory.h (.../branches/gcc-4_7-branch) (revision 198690) +@@ -25,7 +25,7 @@ + /* Convert a BOZ to REAL or COMPLEX. */ + bool gfc_convert_boz (gfc_expr *, gfc_typespec *); - For strided load or store, return the group_size only if it is the first -@@ -691,7 +731,7 @@ - { - /* Uses a high and low interleave operation for each needed permute. */ - inside_cost = ncopies * exact_log2(group_size) * group_size -- * vect_get_stmt_cost (vector_stmt); -+ * vect_get_stmt_cost (vec_perm); - - if (vect_print_dump_info (REPORT_COST)) - fprintf (vect_dump, "vect_model_store_cost: strided group_size = %d .", -@@ -795,7 +835,7 @@ - { - /* Uses an even and odd extract operations for each needed permute. */ - inside_cost = ncopies * exact_log2(group_size) * group_size -- * vect_get_stmt_cost (vector_stmt); -+ * vect_get_stmt_cost (vec_perm); - - if (vect_print_dump_info (REPORT_COST)) - fprintf (vect_dump, "vect_model_load_cost: strided group_size = %d .", -@@ -855,7 +895,7 @@ - case dr_explicit_realign: - { - *inside_cost += ncopies * (2 * vect_get_stmt_cost (vector_load) -- + vect_get_stmt_cost (vector_stmt)); -+ + vect_get_stmt_cost (vec_perm)); +-/* Return the size of an expression in its target representation. */ ++size_t gfc_element_size (gfc_expr *); + size_t gfc_target_expr_size (gfc_expr *); - /* FIXME: If the misalignment remains fixed across the iterations of - the containing loop, the following cost should be added to the -@@ -863,6 +903,9 @@ - if (targetm.vectorize.builtin_mask_for_load) - *inside_cost += vect_get_stmt_cost (vector_stmt); + /* Write a constant expression in binary form to a target buffer. */ +Index: gcc/fortran/check.c +=================================================================== +--- gcc/fortran/check.c (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/fortran/check.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -3988,8 +3988,6 @@ + size_t *result_length_p) + { + size_t result_elt_size; +- mpz_t tmp; +- gfc_expr *mold_element; -+ if (vect_print_dump_info (REPORT_COST)) -+ fprintf (vect_dump, "vect_model_load_cost: explicit realign"); -+ - break; - } - case dr_explicit_realign_optimized: -@@ -886,7 +929,12 @@ - } + if (source->expr_type == EXPR_FUNCTION) + return FAILURE; +@@ -3998,20 +3996,12 @@ + return FAILURE; + + /* Calculate the size of the source. */ +- if (source->expr_type == EXPR_ARRAY +- && gfc_array_size (source, &tmp) == FAILURE) +- return FAILURE; +- + *source_size = gfc_target_expr_size (source); + if (*source_size == 0) + return FAILURE; + +- mold_element = mold->expr_type == EXPR_ARRAY +- ? gfc_constructor_first (mold->value.constructor)->expr +- : mold; +- + /* Determine the size of the element. */ +- result_elt_size = gfc_target_expr_size (mold_element); ++ result_elt_size = gfc_element_size (mold); + if (result_elt_size == 0) + return FAILURE; + +Index: gcc/fortran/intrinsic.texi +=================================================================== +--- gcc/fortran/intrinsic.texi (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/fortran/intrinsic.texi (.../branches/gcc-4_7-branch) (revision 198690) +@@ -9209,7 +9209,7 @@ + @item @emph{Arguments}: + @multitable @columnfractions .15 .70 + @item @var{X} @tab Shall be of type @code{REAL}. +-@item @var{S} @tab (Optional) shall be of type @code{REAL} and ++@item @var{S} @tab Shall be of type @code{REAL} and + not equal to zero. + @end multitable + +Index: gcc/fortran/simplify.c +=================================================================== +--- gcc/fortran/simplify.c (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/fortran/simplify.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -32,7 +32,9 @@ + + gfc_expr gfc_bad_expr; + ++static gfc_expr *simplify_size (gfc_expr *, gfc_expr *, int); - *inside_cost += ncopies * (vect_get_stmt_cost (vector_load) -- + vect_get_stmt_cost (vector_stmt)); -+ + vect_get_stmt_cost (vec_perm)); -+ -+ if (vect_print_dump_info (REPORT_COST)) -+ fprintf (vect_dump, -+ "vect_model_load_cost: explicit realign optimized"); + - break; - } + /* Note that 'simplification' is not just transforming expressions. + For functions that are not simplified at compile time, range + checking is done if possible. +@@ -3240,7 +3242,7 @@ + gfc_expr* dim = result; + mpz_set_si (dim->value.integer, d); -@@ -2919,7 +2967,7 @@ - STMT_VINFO_TYPE (stmt_info) = type_demotion_vec_info_type; - if (vect_print_dump_info (REPORT_DETAILS)) - fprintf (vect_dump, "=== vectorizable_demotion ==="); -- vect_model_simple_cost (stmt_info, ncopies, dt, NULL); -+ vect_model_promotion_demotion_cost (stmt_info, dt, multi_step_cvt); - return true; +- result = gfc_simplify_size (array, dim, kind); ++ result = simplify_size (array, dim, k); + gfc_free_expr (dim); + if (!result) + goto returnNull; +@@ -5493,15 +5495,12 @@ + e = gfc_get_constant_expr (BT_INTEGER, k, &source->where); + + if (t == SUCCESS) +- { +- mpz_set (e->value.integer, shape[n]); +- mpz_clear (shape[n]); +- } ++ mpz_set (e->value.integer, shape[n]); + else + { + mpz_set_ui (e->value.integer, n + 1); + +- f = gfc_simplify_size (source, e, NULL); ++ f = simplify_size (source, e, k); + gfc_free_expr (e); + if (f == NULL) + { +@@ -5512,24 +5511,31 @@ + e = f; + } + ++ if (e == &gfc_bad_expr || range_check (e, "SHAPE") == &gfc_bad_expr) ++ { ++ gfc_free_expr (result); ++ if (t) ++ gfc_clear_shape (shape, source->rank); ++ return &gfc_bad_expr; ++ } ++ + gfc_constructor_append_expr (&result->value.constructor, e, NULL); } -@@ -3217,7 +3265,7 @@ - STMT_VINFO_TYPE (stmt_info) = type_promotion_vec_info_type; - if (vect_print_dump_info (REPORT_DETAILS)) - fprintf (vect_dump, "=== vectorizable_promotion ==="); -- vect_model_simple_cost (stmt_info, 2*ncopies, dt, NULL); -+ vect_model_promotion_demotion_cost (stmt_info, dt, multi_step_cvt); - return true; ++ if (t) ++ gfc_clear_shape (shape, source->rank); ++ + return result; + } + + +-gfc_expr * +-gfc_simplify_size (gfc_expr *array, gfc_expr *dim, gfc_expr *kind) ++static gfc_expr * ++simplify_size (gfc_expr *array, gfc_expr *dim, int k) + { + mpz_t size; + gfc_expr *return_value; + int d; +- int k = get_kind (BT_INTEGER, kind, "SIZE", gfc_default_integer_kind); + +- if (k == -1) +- return &gfc_bad_expr; +- + /* For unary operations, the size of the result is given by the size + of the operand. For binary ones, it's the size of the first operand + unless it is scalar, then it is the size of the second. */ +@@ -5558,7 +5564,7 @@ + replacement = array->value.op.op1; + else + { +- simplified = gfc_simplify_size (array->value.op.op1, dim, kind); ++ simplified = simplify_size (array->value.op.op1, dim, k); + if (simplified) + return simplified; + +@@ -5568,18 +5574,20 @@ + } + + /* Try to reduce it directly if possible. */ +- simplified = gfc_simplify_size (replacement, dim, kind); ++ simplified = simplify_size (replacement, dim, k); + + /* Otherwise, we build a new SIZE call. This is hopefully at least + simpler than the original one. */ + if (!simplified) +- simplified = gfc_build_intrinsic_call (gfc_current_ns, +- GFC_ISYM_SIZE, "size", +- array->where, 3, +- gfc_copy_expr (replacement), +- gfc_copy_expr (dim), +- gfc_copy_expr (kind)); +- ++ { ++ gfc_expr *kind = gfc_get_int_expr (gfc_default_integer_kind, NULL, k); ++ simplified = gfc_build_intrinsic_call (gfc_current_ns, ++ GFC_ISYM_SIZE, "size", ++ array->where, 3, ++ gfc_copy_expr (replacement), ++ gfc_copy_expr (dim), ++ kind); ++ } + return simplified; } -Index: gcc/combine.c -=================================================================== ---- gcc/combine.c (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/combine.c (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -1788,6 +1788,10 @@ - if (set == 0) - return 0; +@@ -5598,13 +5606,32 @@ + return NULL; + } -+ /* The simplification in expand_field_assignment may call back to -+ get_last_value, so set safe guard here. */ -+ subst_low_luid = DF_INSN_LUID (insn); +- return_value = gfc_get_int_expr (k, &array->where, mpz_get_si (size)); ++ return_value = gfc_get_constant_expr (BT_INTEGER, k, &array->where); ++ mpz_set (return_value->value.integer, size); + mpz_clear (size); + - set = expand_field_assignment (set); - src = SET_SRC (set), dest = SET_DEST (set); + return return_value; + } -Index: gcc/config/spu/spu.c + + gfc_expr * ++gfc_simplify_size (gfc_expr *array, gfc_expr *dim, gfc_expr *kind) ++{ ++ gfc_expr *result; ++ int k = get_kind (BT_INTEGER, kind, "SIZE", gfc_default_integer_kind); ++ ++ if (k == -1) ++ return &gfc_bad_expr; ++ ++ result = simplify_size (array, dim, k); ++ if (result == NULL || result == &gfc_bad_expr) ++ return result; ++ ++ return range_check (result, "SIZE"); ++} ++ ++ ++gfc_expr * + gfc_simplify_sign (gfc_expr *x, gfc_expr *y) + { + gfc_expr *result; +Index: gcc/cfgexpand.c =================================================================== ---- gcc/config/spu/spu.c (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/config/spu/spu.c (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -6794,6 +6794,7 @@ - case scalar_to_vec: - case cond_branch_not_taken: - case vec_perm: -+ case vec_promote_demote: - return 1; - - case scalar_store: -Index: gcc/config/sparc/sparc.c +--- gcc/cfgexpand.c (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/cfgexpand.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -3646,6 +3646,8 @@ + avoid_complex_debug_insns (rtx insn, rtx *exp_p, int depth) + { + rtx exp = *exp_p; ++ const char *format_ptr; ++ int i, j; + + if (exp == NULL_RTX) + return; +@@ -3668,8 +3670,7 @@ + return; + } + +- const char *format_ptr = GET_RTX_FORMAT (GET_CODE (exp)); +- int i, j; ++ format_ptr = GET_RTX_FORMAT (GET_CODE (exp)); + for (i = 0; i < GET_RTX_LENGTH (GET_CODE (exp)); i++) + switch (*format_ptr++) + { +Index: gcc/sched-deps.c =================================================================== ---- gcc/config/sparc/sparc.c (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/config/sparc/sparc.c (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -3658,13 +3658,17 @@ +--- gcc/sched-deps.c (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/sched-deps.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -1563,24 +1563,15 @@ + add_dependence_list_and_free (struct deps_desc *deps, rtx insn, rtx *listp, + int uncond, enum reg_note dep_type) { - x = delegitimize_mem_from_attrs (x); +- rtx list, next; ++ add_dependence_list (insn, *listp, uncond, dep_type); -- if (GET_CODE (x) == LO_SUM -- && GET_CODE (XEXP (x, 1)) == UNSPEC -- && XINT (XEXP (x, 1), 1) == UNSPEC_TLSLE) + /* We don't want to short-circuit dependencies involving debug + insns, because they may cause actual dependencies to be + disregarded. */ + if (deps->readonly || DEBUG_INSN_P (insn)) - { -- x = XVECEXP (XEXP (x, 1), 0, 0); -- gcc_assert (GET_CODE (x) == SYMBOL_REF); +- add_dependence_list (insn, *listp, uncond, dep_type); +- return; - } -+ if (GET_CODE (x) == LO_SUM && GET_CODE (XEXP (x, 1)) == UNSPEC) -+ switch (XINT (XEXP (x, 1), 1)) -+ { -+ case UNSPEC_MOVE_PIC: -+ case UNSPEC_TLSLE: -+ x = XVECEXP (XEXP (x, 1), 0, 0); -+ gcc_assert (GET_CODE (x) == SYMBOL_REF); -+ break; -+ default: -+ break; -+ } - - return x; ++ return; + +- for (list = *listp, *listp = NULL; list ; list = next) +- { +- next = XEXP (list, 1); +- if (uncond || ! sched_insns_conditions_mutex_p (insn, XEXP (list, 0))) +- add_dependence (insn, XEXP (list, 0), dep_type); +- free_INSN_LIST_node (list); +- } ++ free_INSN_LIST_list (listp); } -Index: gcc/config/i386/i386.c -=================================================================== ---- gcc/config/i386/i386.c (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/config/i386/i386.c (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -32823,7 +32823,8 @@ - return ix86_cost->cond_not_taken_branch_cost; - - case vec_perm: -- return 1; -+ case vec_promote_demote: -+ return ix86_cost->vec_stmt_cost; - - default: - gcc_unreachable (); -Index: gcc/config/rs6000/vector.md + + /* Remove all occurences of INSN from LIST. Return the number of +@@ -1764,6 +1755,15 @@ + add_dependence_list_and_free (deps, insn, &deps->pending_jump_insns, 1, + REG_DEP_ANTI); + ++ if (DEBUG_INSN_P (insn)) ++ { ++ if (for_write) ++ free_INSN_LIST_list (&deps->pending_read_insns); ++ free_INSN_LIST_list (&deps->pending_write_insns); ++ free_INSN_LIST_list (&deps->last_pending_memory_flush); ++ free_INSN_LIST_list (&deps->pending_jump_insns); ++ } ++ + if (!deps->readonly) + { + free_EXPR_LIST_list (&deps->pending_write_mems); +@@ -3262,9 +3262,9 @@ + SET_REGNO_REG_SET (&deps->reg_last_in_use, i); + } + +- /* Flush pending lists on jumps, but not on speculative checks. */ +- if (JUMP_P (insn) && !(sel_sched_p () +- && sel_insn_is_speculation_check (insn))) ++ /* Don't flush pending lists on speculative checks for ++ selective scheduling. */ ++ if (!sel_sched_p () || !sel_insn_is_speculation_check (insn)) + flush_pending_lists (deps, insn, true, true); + + reg_pending_barrier = NOT_A_BARRIER; +Index: gcc/config/sparc/sparc.c =================================================================== ---- gcc/config/rs6000/vector.md (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/config/rs6000/vector.md (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -448,6 +448,94 @@ - "VECTOR_UNIT_ALTIVEC_P (mode)" - "") - -+(define_insn_and_split "*vector_uneq" -+ [(set (match_operand:VEC_F 0 "vfloat_operand" "") -+ (uneq:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "") -+ (match_operand:VEC_F 2 "vfloat_operand" "")))] -+ "VECTOR_UNIT_ALTIVEC_OR_VSX_P (mode)" -+ "#" -+ "" -+ [(set (match_dup 3) -+ (gt:VEC_F (match_dup 1) -+ (match_dup 2))) -+ (set (match_dup 4) -+ (gt:VEC_F (match_dup 2) -+ (match_dup 1))) -+ (set (match_dup 0) -+ (not:VEC_F (ior:VEC_F (match_dup 3) -+ (match_dup 4))))] -+ " -+{ -+ operands[3] = gen_reg_rtx (mode); -+ operands[4] = gen_reg_rtx (mode); -+}") -+ -+(define_insn_and_split "*vector_ltgt" -+ [(set (match_operand:VEC_F 0 "vfloat_operand" "") -+ (ltgt:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "") -+ (match_operand:VEC_F 2 "vfloat_operand" "")))] -+ "VECTOR_UNIT_ALTIVEC_OR_VSX_P (mode)" -+ "#" -+ "" -+ [(set (match_dup 3) -+ (gt:VEC_F (match_dup 1) -+ (match_dup 2))) -+ (set (match_dup 4) -+ (gt:VEC_F (match_dup 2) -+ (match_dup 1))) -+ (set (match_dup 0) -+ (ior:VEC_F (match_dup 3) -+ (match_dup 4)))] -+ " -+{ -+ operands[3] = gen_reg_rtx (mode); -+ operands[4] = gen_reg_rtx (mode); -+}") -+ -+(define_insn_and_split "*vector_ordered" -+ [(set (match_operand:VEC_F 0 "vfloat_operand" "") -+ (ordered:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "") -+ (match_operand:VEC_F 2 "vfloat_operand" "")))] -+ "VECTOR_UNIT_ALTIVEC_OR_VSX_P (mode)" -+ "#" -+ "" -+ [(set (match_dup 3) -+ (ge:VEC_F (match_dup 1) -+ (match_dup 2))) -+ (set (match_dup 4) -+ (ge:VEC_F (match_dup 2) -+ (match_dup 1))) -+ (set (match_dup 0) -+ (ior:VEC_F (match_dup 3) -+ (match_dup 4)))] -+ " -+{ -+ operands[3] = gen_reg_rtx (mode); -+ operands[4] = gen_reg_rtx (mode); -+}") -+ -+(define_insn_and_split "*vector_unordered" -+ [(set (match_operand:VEC_F 0 "vfloat_operand" "") -+ (unordered:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "") -+ (match_operand:VEC_F 2 "vfloat_operand" "")))] -+ "VECTOR_UNIT_ALTIVEC_OR_VSX_P (mode)" -+ "#" -+ "" -+ [(set (match_dup 3) -+ (ge:VEC_F (match_dup 1) -+ (match_dup 2))) -+ (set (match_dup 4) -+ (ge:VEC_F (match_dup 2) -+ (match_dup 1))) -+ (set (match_dup 0) -+ (not:VEC_F (ior:VEC_F (match_dup 3) -+ (match_dup 4))))] -+ " -+{ -+ operands[3] = gen_reg_rtx (mode); -+ operands[4] = gen_reg_rtx (mode); -+}") -+ - ;; Note the arguments for __builtin_altivec_vsel are op2, op1, mask - ;; which is in the reverse order that we want - (define_expand "vector_select_" -Index: gcc/config/rs6000/rs6000.c +--- gcc/config/sparc/sparc.c (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/config/sparc/sparc.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -4207,13 +4207,14 @@ + mapped into one sparc_mode_class mode. */ + + enum sparc_mode_class { +- S_MODE, D_MODE, T_MODE, O_MODE, ++ H_MODE, S_MODE, D_MODE, T_MODE, O_MODE, + SF_MODE, DF_MODE, TF_MODE, OF_MODE, + CC_MODE, CCFP_MODE + }; + + /* Modes for single-word and smaller quantities. */ +-#define S_MODES ((1 << (int) S_MODE) | (1 << (int) SF_MODE)) ++#define S_MODES \ ++ ((1 << (int) H_MODE) | (1 << (int) S_MODE) | (1 << (int) SF_MODE)) + + /* Modes for double-word and smaller quantities. */ + #define D_MODES (S_MODES | (1 << (int) D_MODE) | (1 << DF_MODE)) +@@ -4224,13 +4225,11 @@ + /* Modes for 8-word and smaller quantities. */ + #define O_MODES (T_MODES | (1 << (int) O_MODE) | (1 << (int) OF_MODE)) + +-/* Modes for single-float quantities. We must allow any single word or +- smaller quantity. This is because the fix/float conversion instructions +- take integer inputs/outputs from the float registers. */ +-#define SF_MODES (S_MODES) ++/* Modes for single-float quantities. */ ++#define SF_MODES ((1 << (int) S_MODE) | (1 << (int) SF_MODE)) + + /* Modes for double-float and smaller quantities. */ +-#define DF_MODES (D_MODES) ++#define DF_MODES (SF_MODES | (1 << (int) D_MODE) | (1 << DF_MODE)) + + /* Modes for quad-float and smaller quantities. */ + #define TF_MODES (DF_MODES | (1 << (int) TF_MODE)) +@@ -4326,7 +4325,9 @@ + case MODE_INT: + case MODE_PARTIAL_INT: + case MODE_COMPLEX_INT: +- if (GET_MODE_SIZE (i) <= 4) ++ if (GET_MODE_SIZE (i) < 4) ++ sparc_mode_class[i] = 1 << (int) H_MODE; ++ else if (GET_MODE_SIZE (i) == 4) + sparc_mode_class[i] = 1 << (int) S_MODE; + else if (GET_MODE_SIZE (i) == 8) + sparc_mode_class[i] = 1 << (int) D_MODE; +@@ -4338,14 +4339,16 @@ + sparc_mode_class[i] = 0; + break; + case MODE_VECTOR_INT: +- if (GET_MODE_SIZE (i) <= 4) +- sparc_mode_class[i] = 1 << (int)SF_MODE; ++ if (GET_MODE_SIZE (i) == 4) ++ sparc_mode_class[i] = 1 << (int) SF_MODE; + else if (GET_MODE_SIZE (i) == 8) +- sparc_mode_class[i] = 1 << (int)DF_MODE; ++ sparc_mode_class[i] = 1 << (int) DF_MODE; ++ else ++ sparc_mode_class[i] = 0; + break; + case MODE_FLOAT: + case MODE_COMPLEX_FLOAT: +- if (GET_MODE_SIZE (i) <= 4) ++ if (GET_MODE_SIZE (i) == 4) + sparc_mode_class[i] = 1 << (int) SF_MODE; + else if (GET_MODE_SIZE (i) == 8) + sparc_mode_class[i] = 1 << (int) DF_MODE; +Index: gcc/config/i386/i386.md =================================================================== ---- gcc/config/rs6000/rs6000.c (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/config/rs6000/rs6000.c (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -3695,12 +3695,23 @@ - case vec_to_scalar: - case scalar_to_vec: - case cond_branch_not_taken: -- case vec_perm: - return 1; - - case cond_branch_taken: - return 3; - -+ case vec_perm: -+ if (TARGET_VSX) -+ return 4; -+ else -+ return 1; -+ -+ case vec_promote_demote: -+ if (TARGET_VSX) -+ return 5; -+ else -+ return 1; -+ - case unaligned_load: - if (TARGET_VSX && TARGET_ALLOW_MOVMISALIGN) - { -@@ -17229,6 +17240,10 @@ - case EQ: - case GT: - case GTU: -+ case ORDERED: -+ case UNORDERED: -+ case UNEQ: -+ case LTGT: - mask = gen_reg_rtx (mode); - emit_insn (gen_rtx_SET (VOIDmode, - mask, -Index: gcc/config/rs6000/vsx.md +--- gcc/config/i386/i386.md (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/config/i386/i386.md (.../branches/gcc-4_7-branch) (revision 198690) +@@ -3444,9 +3444,9 @@ + }) + + (define_insn "*zero_extendsidi2_rex64" +- [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o,?*Ym,?*y,?*Yi,*x") ++ [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o,?*Ym,?!*y,?*Yi,*x") + (zero_extend:DI +- (match_operand:SI 1 "nonimmediate_operand" "rm,0,r ,m ,r ,m")))] ++ (match_operand:SI 1 "nonimmediate_operand" "rm,0,r ,m ,r ,m")))] + "TARGET_64BIT" + "@ + mov{l}\t{%1, %k0|%k0, %1} +@@ -3469,9 +3469,9 @@ + + ;; %%% Kill me once multi-word ops are sane. + (define_insn "zero_extendsidi2_1" +- [(set (match_operand:DI 0 "nonimmediate_operand" "=r,?r,?o,?*Ym,?*y,?*Yi,*x") ++ [(set (match_operand:DI 0 "nonimmediate_operand" "=r,?r,?o,?*Ym,?!*y,?*Yi,*x") + (zero_extend:DI +- (match_operand:SI 1 "nonimmediate_operand" "0,rm,r ,r ,m ,r ,m"))) ++ (match_operand:SI 1 "nonimmediate_operand" "0,rm,r ,r ,m ,r ,m"))) + (clobber (reg:CC FLAGS_REG))] + "!TARGET_64BIT" + "@ +Index: gcc/config/i386/sse.md =================================================================== ---- gcc/config/rs6000/vsx.md (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/config/rs6000/vsx.md (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -1006,9 +1006,9 @@ - "VECTOR_MEM_VSX_P (mode)" +--- gcc/config/i386/sse.md (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/config/i386/sse.md (.../branches/gcc-4_7-branch) (revision 198690) +@@ -11167,7 +11167,8 @@ + (match_operand:SI 2 "const_0_to__operand" "n")))] + "TARGET_XOP" { - if (INTVAL (operands[3]) == 0) -- return \"xxpermdi %x0,%x1,%x2,1\"; -+ return \"xxpermdi %x0,%x2,%x1,1\"; - else if (INTVAL (operands[3]) == 1) -- return \"xxpermdi %x0,%x2,%x1,0\"; -+ return \"xxpermdi %x0,%x1,%x2,0\"; - else - gcc_unreachable (); +- operands[3] = GEN_INT (( * 8) - INTVAL (operands[2])); ++ operands[3] ++ = GEN_INT (GET_MODE_BITSIZE (mode) - INTVAL (operands[2])); + return \"vprot\t{%3, %1, %0|%0, %1, %3}\"; } -Index: gcc/config/pa/predicates.md + [(set_attr "type" "sseishft") +Index: gcc/config/i386/i386.c =================================================================== ---- gcc/config/pa/predicates.md (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/config/pa/predicates.md (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -421,9 +421,9 @@ - (ior (match_operand 0 "register_operand") - (match_operand 0 "cint_ior_operand"))) - --;; True iff OP is a CONST_INT of the forms 0...0xxxx or --;; 0...01...1xxxx. Such values can be the left hand side x in (x << --;; r), using the zvdepi instruction. -+;; True iff OP is a CONST_INT of the forms 0...0xxxx, 0...01...1xxxx, -+;; or 1...1xxxx. Such values can be the left hand side x in (x << r), -+;; using the zvdepi instruction. - - (define_predicate "lhs_lshift_cint_operand" - (match_code "const_int") -Index: gcc/config/pa/pa.md +--- gcc/config/i386/i386.c (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/config/i386/i386.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -20026,7 +20026,7 @@ + vec[i * 2 + 1] = const1_rtx; + } + vt = gen_rtx_CONST_VECTOR (maskmode, gen_rtvec_v (w, vec)); +- vt = force_const_mem (maskmode, vt); ++ vt = validize_mem (force_const_mem (maskmode, vt)); + t1 = expand_simple_binop (maskmode, PLUS, t1, vt, t1, 1, + OPTAB_DIRECT); + +@@ -20223,7 +20223,7 @@ + for (i = 0; i < 16; ++i) + vec[i] = GEN_INT (i/e * e); + vt = gen_rtx_CONST_VECTOR (V16QImode, gen_rtvec_v (16, vec)); +- vt = force_const_mem (V16QImode, vt); ++ vt = validize_mem (force_const_mem (V16QImode, vt)); + if (TARGET_XOP) + emit_insn (gen_xop_pperm (mask, mask, mask, vt)); + else +@@ -20234,7 +20234,7 @@ + for (i = 0; i < 16; ++i) + vec[i] = GEN_INT (i % e); + vt = gen_rtx_CONST_VECTOR (V16QImode, gen_rtvec_v (16, vec)); +- vt = force_const_mem (V16QImode, vt); ++ vt = validize_mem (force_const_mem (V16QImode, vt)); + emit_insn (gen_addv16qi3 (mask, mask, vt)); + } + +Index: gcc/config/sh/sh.md =================================================================== ---- gcc/config/pa/pa.md (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/config/pa/pa.md (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -6348,7 +6348,7 @@ - "" - "* - { -- int x = INTVAL (operands[1]); -+ unsigned HOST_WIDE_INT x = UINTVAL (operands[1]); - operands[2] = GEN_INT (4 + exact_log2 ((x >> 4) + 1)); - operands[1] = GEN_INT ((x & 0xf) - 0x10); - return \"{zvdepi %1,%2,%0|depwi,z %1,%%sar,%2,%0}\"; -@@ -6366,7 +6366,7 @@ - "exact_log2 (INTVAL (operands[1]) + 1) > 0" - "* - { -- int x = INTVAL (operands[1]); -+ HOST_WIDE_INT x = INTVAL (operands[1]); - operands[2] = GEN_INT (exact_log2 (x + 1)); - return \"{vdepi -1,%2,%0|depwi -1,%%sar,%2,%0}\"; - }" -@@ -6383,7 +6383,7 @@ - "INTVAL (operands[1]) == -2" - "* - { -- int x = INTVAL (operands[1]); -+ HOST_WIDE_INT x = INTVAL (operands[1]); - operands[2] = GEN_INT (exact_log2 ((~x) + 1)); - return \"{vdepi 0,%2,%0|depwi 0,%%sar,%2,%0}\"; - }" -@@ -6447,7 +6447,7 @@ - "TARGET_64BIT" - "* - { -- int x = INTVAL (operands[1]); -+ unsigned HOST_WIDE_INT x = UINTVAL (operands[1]); - operands[2] = GEN_INT (4 + exact_log2 ((x >> 4) + 1)); - operands[1] = GEN_INT ((x & 0x1f) - 0x20); - return \"depdi,z %1,%%sar,%2,%0\"; -@@ -6465,7 +6465,7 @@ - "TARGET_64BIT && exact_log2 (INTVAL (operands[1]) + 1) > 0" - "* - { -- int x = INTVAL (operands[1]); -+ HOST_WIDE_INT x = INTVAL (operands[1]); - operands[2] = GEN_INT (exact_log2 (x + 1)); - return \"depdi -1,%%sar,%2,%0\"; - }" -@@ -6482,7 +6482,7 @@ - "TARGET_64BIT && INTVAL (operands[1]) == -2" - "* - { -- int x = INTVAL (operands[1]); -+ HOST_WIDE_INT x = INTVAL (operands[1]); - operands[2] = GEN_INT (exact_log2 ((~x) + 1)); - return \"depdi 0,%%sar,%2,%0\"; - }" -@@ -6671,6 +6671,20 @@ - - ;; Unconditional and other jump instructions. - -+;; Trivial return used when no epilogue is needed. -+(define_insn "return" -+ [(return) -+ (use (reg:SI 2))] -+ "pa_can_use_return_insn ()" -+ "* -+{ -+ if (TARGET_PA_20) -+ return \"bve%* (%%r2)\"; -+ return \"bv%* %%r0(%%r2)\"; -+}" -+ [(set_attr "type" "branch") -+ (set_attr "length" "4")]) -+ - ;; This is used for most returns. - (define_insn "return_internal" - [(return) -@@ -6719,11 +6733,8 @@ - rtx x; - - /* Try to use the trivial return first. Else use the full epilogue. */ -- if (reload_completed -- && !frame_pointer_needed -- && !df_regs_ever_live_p (2) -- && (compute_frame_size (get_frame_size (), 0) ? 0 : 1)) -- x = gen_return_internal (); -+ if (pa_can_use_return_insn ()) -+ x = gen_return (); - else - { - hppa_expand_epilogue (); -Index: gcc/config/pa/pa-protos.h +--- gcc/config/sh/sh.md (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/config/sh/sh.md (.../branches/gcc-4_7-branch) (revision 198690) +@@ -654,7 +654,7 @@ + + (define_insn "tstsi_t_zero_extract_eq" + [(set (reg:SI T_REG) +- (eq:SI (zero_extract:SI (match_operand 0 "logical_operand" "z") ++ (eq:SI (zero_extract:SI (match_operand:SI 0 "logical_operand" "z") + (match_operand:SI 1 "const_int_operand") + (match_operand:SI 2 "const_int_operand")) + (const_int 0)))] +Index: gcc/config/darwin.h =================================================================== ---- gcc/config/pa/pa-protos.h (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/config/pa/pa-protos.h (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -136,6 +136,7 @@ - extern int cint_ok_for_move (HOST_WIDE_INT); - extern void hppa_expand_prologue (void); - extern void hppa_expand_epilogue (void); -+extern bool pa_can_use_return_insn (void); - extern int ior_mask_p (unsigned HOST_WIDE_INT); - extern void compute_zdepdi_operands (unsigned HOST_WIDE_INT, - unsigned *); +--- gcc/config/darwin.h (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/config/darwin.h (.../branches/gcc-4_7-branch) (revision 198690) +@@ -356,7 +356,9 @@ + %{!Zbundle:%{pg:%{static:-lgcrt0.o} \ + %{!static:%{object:-lgcrt0.o} \ + %{!object:%{preload:-lgcrt0.o} \ +- %{!preload:-lgcrt1.o %(darwin_crt2)}}}} \ ++ %{!preload:-lgcrt1.o \ ++ %:version-compare(>= 10.8 mmacosx-version-min= -no_new_main) \ ++ %(darwin_crt2)}}}} \ + %{!pg:%{static:-lcrt0.o} \ + %{!static:%{object:-lcrt0.o} \ + %{!object:%{preload:-lcrt0.o} \ +@@ -379,7 +381,7 @@ + #define DARWIN_CRT1_SPEC \ + "%:version-compare(!> 10.5 mmacosx-version-min= -lcrt1.o) \ + %:version-compare(>< 10.5 10.6 mmacosx-version-min= -lcrt1.10.5.o) \ +- %:version-compare(>= 10.6 mmacosx-version-min= -lcrt1.10.6.o) \ ++ %:version-compare(>< 10.6 10.8 mmacosx-version-min= -lcrt1.10.6.o) \ + %{fgnu-tm: -lcrttms.o}" + + /* Default Darwin ASM_SPEC, very simple. */ +@@ -414,6 +416,8 @@ + + #define TARGET_WANT_DEBUG_PUB_SECTIONS true + ++#define TARGET_FORCE_AT_COMP_DIR true ++ + /* When generating stabs debugging, use N_BINCL entries. */ + + #define DBX_USE_BINCL Index: gcc/config/pa/pa.c =================================================================== ---- gcc/config/pa/pa.c (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ gcc/config/pa/pa.c (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -4442,6 +4442,24 @@ - } - } - -+bool -+pa_can_use_return_insn (void) -+{ -+ if (!reload_completed) -+ return false; +--- gcc/config/pa/pa.c (.../tags/gcc_4_7_3_release) (revision 198690) ++++ gcc/config/pa/pa.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -790,7 +790,9 @@ + /* Extract CODE_LABEL. */ + orig = XEXP (orig, 0); + add_reg_note (insn, REG_LABEL_OPERAND, orig); +- LABEL_NUSES (orig)++; ++ /* Make sure we have label and not a note. */ ++ if (LABEL_P (orig)) ++ LABEL_NUSES (orig)++; + } + crtl->uses_pic_offset_table = 1; + return reg; +Index: libgfortran/ChangeLog +=================================================================== +--- libgfortran/ChangeLog (.../tags/gcc_4_7_3_release) (revision 198690) ++++ libgfortran/ChangeLog (.../branches/gcc-4_7-branch) (revision 198690) +@@ -1,3 +1,38 @@ ++2013-04-28 Jerry DeLisle + -+ if (frame_pointer_needed) -+ return false; ++ Backport from mainline: ++ 2013-03-20 Tilo Schwarz + -+ if (df_regs_ever_live_p (2)) -+ return false; ++ PR libfortran/51825 ++ * io/list_read.c (nml_read_obj): Don't end the component loop on a ++ nested derived type, but continue with the next loop iteration. ++ (nml_get_obj_data): Don't move the first_nl pointer further in the ++ list if a qualifier was found. + -+ if (crtl->profile) -+ return false; ++2013-04-28 Jerry DeLisle + -+ return compute_frame_size (get_frame_size (), 0) == 0; -+} ++ Backport from mainline: ++ ++ PR libfortran/56786 ++ * io/list_read.c (nml_parse_qualifier): Remove spurious next_char call ++ when checking for EOF. Use error return mechanism when EOF detected. ++ Do not return FAILURE unless parse_err_msg and parse_err_msg_size have ++ been set. Use hit_eof. ++ (nml_get_obj_data): Likewise use the correct error mechanism. ++ * io/transfer.c (hit_eof): Do not set AFTER_ENDFILE if in namelist ++ mode. ++ ++2013-04-28 Jerry DeLisle ++ ++ Backport from mainline: ++ 2013-03-25 Tilo Schwarz ++ ++ PR libfortran/52512 ++ * io/list_read.c (nml_parse_qualifier): To check for a derived type ++ don't use the namelist head element type but the current element type. ++ (nml_get_obj_data): Add current namelist element type to ++ nml_parse_qualifier call. + - rtx - hppa_pic_save_rtx (void) + 2013-04-11 Release Manager + + * GCC 4.7.3 released. +Index: libgfortran/io/list_read.c +=================================================================== +--- libgfortran/io/list_read.c (.../tags/gcc_4_7_3_release) (revision 198690) ++++ libgfortran/io/list_read.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -2028,8 +2028,8 @@ + + static try + nml_parse_qualifier (st_parameter_dt *dtp, descriptor_dimension *ad, +- array_loop_spec *ls, int rank, char *parse_err_msg, +- size_t parse_err_msg_size, ++ array_loop_spec *ls, int rank, bt nml_elem_type, ++ char *parse_err_msg, size_t parse_err_msg_size, + int *parsed_rank) { -@@ -4586,7 +4604,7 @@ - rtx saved_rp; - rtx ins; + int dim; +@@ -2053,7 +2053,7 @@ + /* The next character in the stream should be the '('. */ -- /* Instruction stream at the normal return address for the export stub: -+ /* The instruction stream at the return address of a PA1.X export stub is: + if ((c = next_char (dtp)) == EOF) +- return FAILURE; ++ goto err_ret; - 0x4bc23fd1 | stub+8: ldw -18(sr0,sp),rp - 0x004010a1 | stub+12: ldsid (sr0,rp),r1 -@@ -4594,11 +4612,17 @@ - 0xe0400002 | stub+20: be,n 0(sr0,rp) + /* Process the qualifier, by dimension and triplet. */ - 0xe0400002 must be specified as -532676606 so that it won't be -- rejected as an invalid immediate operand on 64-bit hosts. */ -+ rejected as an invalid immediate operand on 64-bit hosts. +@@ -2067,7 +2067,7 @@ -- HOST_WIDE_INT insns[4] = {0x4bc23fd1, 0x004010a1, 0x00011820, -532676606}; -- int i; -+ The instruction stream at the return address of a PA2.0 export stub is: + /* Process a potential sign. */ + if ((c = next_char (dtp)) == EOF) +- return FAILURE; ++ goto err_ret; + switch (c) + { + case '-': +@@ -2085,11 +2085,12 @@ + /* Process characters up to the next ':' , ',' or ')'. */ + for (;;) + { +- if ((c = next_char (dtp)) == EOF) +- return FAILURE; +- ++ c = next_char (dtp); + switch (c) + { ++ case EOF: ++ goto err_ret; ++ + case ':': + is_array_section = 1; + break; +@@ -2112,10 +2113,8 @@ + push_char (dtp, c); + continue; -+ 0x4bc23fd1 | stub+8: ldw -18(sr0,sp),rp -+ 0xe840d002 | stub+12: bve,n (rp) -+ */ -+ -+ HOST_WIDE_INT insns[4]; -+ int i, len; -+ - if (count != 0) - return NULL_RTX; +- case ' ': case '\t': ++ case ' ': case '\t': case '\r': case '\n': + eat_spaces (dtp); +- if ((c = next_char (dtp) == EOF)) +- return FAILURE; + break; + + default: +@@ -2204,7 +2203,7 @@ + do not allow excess data to be processed. */ + if (is_array_section == 1 + || !(compile_options.allow_std & GFC_STD_GNU) +- || dtp->u.p.ionml->type == BT_DERIVED) ++ || nml_elem_type == BT_DERIVED) + ls[dim].end = ls[dim].start; + else + dtp->u.p.expanded_read = 1; +@@ -2257,6 +2256,15 @@ -@@ -4620,11 +4644,26 @@ - ins = copy_to_reg (gen_rtx_AND (Pmode, rp, MASK_RETURN_ADDR)); - label = gen_label_rtx (); + err_ret: -+ if (TARGET_PA_20) ++ /* The EOF error message is issued by hit_eof. Return true so that the ++ caller does not use parse_err_msg and parse_err_msg_size to generate ++ an unrelated error message. */ ++ if (c == EOF) + { -+ insns[0] = 0x4bc23fd1; -+ insns[1] = -398405630; -+ len = 2; ++ hit_eof (dtp); ++ dtp->u.p.input_complete = 1; ++ return SUCCESS; + } -+ else -+ { -+ insns[0] = 0x4bc23fd1; -+ insns[1] = 0x004010a1; -+ insns[2] = 0x00011820; -+ insns[3] = -532676606; -+ len = 4; + return FAILURE; + } + +@@ -2553,17 +2561,17 @@ + since a single object can have multiple reads. */ + dtp->u.p.expanded_read = 0; + +- /* Now loop over the components. Update the component pointer +- with the return value from nml_write_obj. This loop jumps +- past nested derived types by testing if the potential +- component name contains '%'. */ ++ /* Now loop over the components. */ + + for (cmp = nl->next; + cmp && +- !strncmp (cmp->var_name, obj_name, obj_name_len) && +- !strchr (cmp->var_name + obj_name_len, '%'); ++ !strncmp (cmp->var_name, obj_name, obj_name_len); + cmp = cmp->next) + { ++ /* Jump over nested derived type by testing if the potential ++ component name contains '%'. */ ++ if (strchr (cmp->var_name + obj_name_len, '%')) ++ continue; + + if (nml_read_obj (dtp, cmp, (index_type)(pdata - nl->mem_pos), + pprev_nl, nml_err_msg, nml_err_msg_size, +@@ -2726,12 +2734,12 @@ + return SUCCESS; + + if ((c = next_char (dtp)) == EOF) +- return FAILURE; ++ goto nml_err_ret; + switch (c) + { + case '=': + if ((c = next_char (dtp)) == EOF) +- return FAILURE; ++ goto nml_err_ret; + if (c != '?') + { + snprintf (nml_err_msg, nml_err_msg_size, +@@ -2781,8 +2789,9 @@ + if (!is_separator (c)) + push_char (dtp, tolower(c)); + if ((c = next_char (dtp)) == EOF) +- return FAILURE; +- } while (!( c=='=' || c==' ' || c=='\t' || c =='(' || c =='%' )); ++ goto nml_err_ret; + } -+ - /* Check the instruction stream at the normal return address for the - export stub. If it is an export stub, than our return address is - really in -24[frameaddr]. */ ++ while (!( c=='=' || c==' ' || c=='\t' || c =='(' || c =='%' )); + + unget_char (dtp, c); -- for (i = 0; i < 3; i++) -+ for (i = 0; i < len; i++) +@@ -2842,7 +2851,7 @@ { - rtx op0 = gen_rtx_MEM (SImode, plus_constant (ins, i * 4)); - rtx op1 = GEN_INT (insns[i]); -Index: libstdc++-v3/include/debug/safe_iterator.h -=================================================================== ---- libstdc++-v3/include/debug/safe_iterator.h (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ libstdc++-v3/include/debug/safe_iterator.h (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -1,6 +1,6 @@ - // Safe iterator implementation -*- C++ -*- - --// Copyright (C) 2003, 2004, 2005, 2006, 2009, 2010, 2011 -+// Copyright (C) 2003, 2004, 2005, 2006, 2009, 2010, 2011, 2012 - // Free Software Foundation, Inc. - // - // This file is part of the GNU ISO C++ Library. This library is free -@@ -142,7 +142,25 @@ - ._M_iterator(__x, "other")); - } + parsed_rank = 0; + if (nml_parse_qualifier (dtp, nl->dim, nl->ls, nl->var_rank, +- nml_err_msg, nml_err_msg_size, ++ nl->type, nml_err_msg, nml_err_msg_size, + &parsed_rank) == FAILURE) + { + char *nml_err_msg_end = strchr (nml_err_msg, '\0'); +@@ -2857,7 +2866,7 @@ + qualifier_flag = 1; -+#ifdef __GXX_EXPERIMENTAL_CXX0X__ - /** -+ * @brief Move construction. -+ * @post __x is singular and unattached -+ */ -+ _Safe_iterator(_Safe_iterator&& __x) : _M_current() -+ { -+ _GLIBCXX_DEBUG_VERIFY(!__x._M_singular() -+ || __x._M_current == _Iterator(), -+ _M_message(__msg_init_copy_singular) -+ ._M_iterator(*this, "this") -+ ._M_iterator(__x, "other")); -+ std::swap(_M_current, __x._M_current); -+ this->_M_attach(__x._M_sequence); -+ __x._M_detach(); -+ } -+#endif -+ -+ /** - * @brief Converting constructor from a mutable iterator to a - * constant iterator. - */ -@@ -181,7 +199,28 @@ - return *this; - } + if ((c = next_char (dtp)) == EOF) +- return FAILURE; ++ goto nml_err_ret; + unget_char (dtp, c); + } + else if (nl->var_rank > 0) +@@ -2876,14 +2885,15 @@ + goto nml_err_ret; + } -+#ifdef __GXX_EXPERIMENTAL_CXX0X__ - /** -+ * @brief Move assignment. -+ * @post __x is singular and unattached -+ */ -+ _Safe_iterator& -+ operator=(_Safe_iterator&& __x) -+ { -+ _GLIBCXX_DEBUG_VERIFY(!__x._M_singular() -+ || __x._M_current == _Iterator(), -+ _M_message(__msg_copy_singular) -+ ._M_iterator(*this, "this") -+ ._M_iterator(__x, "other")); -+ _M_current = __x._M_current; -+ _M_attach(__x._M_sequence); -+ __x._M_detach(); -+ __x._M_current = _Iterator(); -+ return *this; -+ } -+#endif -+ -+ /** - * @brief Iterator dereference. - * @pre iterator is dereferenceable - */ -@@ -415,7 +454,9 @@ - /// Is this iterator equal to the sequence's before_begin() iterator if - /// any? - bool _M_is_before_begin() const -- { return _BeforeBeginHelper<_Sequence>::_M_Is(base(), _M_get_sequence()); } -+ { -+ return _BeforeBeginHelper<_Sequence>::_M_Is(base(), _M_get_sequence()); -+ } - }; - - template -Index: libstdc++-v3/ChangeLog -=================================================================== ---- libstdc++-v3/ChangeLog (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ libstdc++-v3/ChangeLog (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -1,3 +1,10 @@ -+2012-03-08 Jonathan Wakely -+ -+ PR libstdc++/52433 -+ * include/debug/safe_iterator.h (_Safe_iterator): Add move -+ constructor and move assignment operator. -+ * testsuite/23_containers/vector/debug/52433.cc: New. -+ - 2012-03-01 Release Manager +- if (*pprev_nl == NULL || !component_flag) ++ /* Don't move first_nl further in the list if a qualifier was found. */ ++ if ((*pprev_nl == NULL && !qualifier_flag) || !component_flag) + first_nl = nl; - * GCC 4.6.3 released. -Index: libstdc++-v3/testsuite/23_containers/vector/debug/52433.cc -=================================================================== ---- libstdc++-v3/testsuite/23_containers/vector/debug/52433.cc (.../tags/gcc_4_6_3_release) (wersja 0) -+++ libstdc++-v3/testsuite/23_containers/vector/debug/52433.cc (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -0,0 +1,43 @@ -+// Copyright (C) 2012 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+// -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+// -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING3. If not see -+// . -+// -+// { dg-require-debug-mode "" } -+// { dg-options "-std=gnu++0x" } -+// { dg-do compile } -+ -+// PR libstdc++/52433 -+ -+#include -+ -+struct X -+{ -+ std::vector::iterator i; -+ -+ X() = default; -+ X(const X&) = default; -+ X(X&&) = default; -+ X& operator=(const X&) = default; -+ X& operator=(X&&) = default; -+}; -+ -+X test01() -+{ -+ X x; -+ x = X(); -+ return x; -+} -+ -Index: boehm-gc/configure.ac -=================================================================== ---- boehm-gc/configure.ac (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ boehm-gc/configure.ac (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -392,6 +392,7 @@ - oldLIBS="$LIBS" - LIBS="$LIBS $THREADLIBS" - AC_CHECK_FUNCS([pthread_getattr_np]) -+AC_CHECK_FUNCS([pthread_get_stackaddr_np]) - LIBS="$oldLIBS" - - # Configuration of machine-dependent code -Index: boehm-gc/include/gc_config.h.in -=================================================================== ---- boehm-gc/include/gc_config.h.in (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ boehm-gc/include/gc_config.h.in (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -87,6 +87,9 @@ - /* Define to 1 if you have the `pthread_getattr_np' function. */ - #undef HAVE_PTHREAD_GETATTR_NP + root_nl = nl; -+/* Define to 1 if you have the `pthread_get_stackaddr_np_np' function. */ -+#undef HAVE_PTHREAD_GET_STACKADDR_NP -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_STDINT_H + component_flag = 1; + if ((c = next_char (dtp)) == EOF) +- return FAILURE; ++ goto nml_err_ret; + goto get_name; + } -Index: boehm-gc/include/private/gcconfig.h -=================================================================== ---- boehm-gc/include/private/gcconfig.h (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ boehm-gc/include/private/gcconfig.h (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -1331,7 +1331,11 @@ - These aren't used when dyld support is enabled (it is by default) */ - # define DATASTART ((ptr_t) get_etext()) - # define DATAEND ((ptr_t) get_end()) --# define STACKBOTTOM ((ptr_t) 0xc0000000) -+# ifdef HAVE_PTHREAD_GET_STACKADDR_NP -+# define STACKBOTTOM (ptr_t)pthread_get_stackaddr_np(pthread_self()) -+# else -+# define STACKBOTTOM ((ptr_t) 0xc0000000) -+# endif - # define USE_MMAP - # define USE_MMAP_ANON - # define USE_ASM_PUSH_REGS -@@ -2011,7 +2015,11 @@ - These aren't used when dyld support is enabled (it is by default) */ - # define DATASTART ((ptr_t) get_etext()) - # define DATAEND ((ptr_t) get_end()) --# define STACKBOTTOM ((ptr_t) 0x7fff5fc00000) -+# ifdef HAVE_PTHREAD_GET_STACKADDR_NP -+# define STACKBOTTOM (ptr_t)pthread_get_stackaddr_np(pthread_self()) -+# else -+# define STACKBOTTOM ((ptr_t) 0x7fff5fc00000) -+# endif - # define USE_MMAP - # define USE_MMAP_ANON - # ifdef GC_DARWIN_THREADS -Index: boehm-gc/ChangeLog -=================================================================== ---- boehm-gc/ChangeLog (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ boehm-gc/ChangeLog (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -1,3 +1,17 @@ -+2012-03-02 Jack Howarth -+ -+ Backport from mainline -+ 2012-02-23 Patrick Marlier -+ Jack Howarth -+ -+ PR boehm-gc/52179 -+ * include/gc_config.h.in: Undefine HAVE_PTHREAD_GET_STACKADDR_NP. -+ * include/private/gcconfig.h (DARWIN): Define STACKBOTTOM with -+ pthread_get_stackaddr_np when available. -+ * configure.ac (THREADS): Check availability of -+ pthread_get_stackaddr_np. -+ * configure: Regenerate. -+ - 2012-03-01 Release Manager +@@ -2898,8 +2908,8 @@ + descriptor_dimension chd[1] = { {1, clow, nl->string_length} }; + array_loop_spec ind[1] = { {1, clow, nl->string_length, 1} }; - * GCC 4.6.3 released. -Index: boehm-gc/configure -=================================================================== ---- boehm-gc/configure (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ boehm-gc/configure (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -15246,6 +15246,17 @@ - fi - done - -+for ac_func in pthread_get_stackaddr_np -+do : -+ ac_fn_c_check_func "$LINENO" "pthread_get_stackaddr_np" "ac_cv_func_pthread_get_stackaddr_np" -+if test "x$ac_cv_func_pthread_get_stackaddr_np" = x""yes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_PTHREAD_GET_STACKADDR_NP 1 -+_ACEOF -+ -+fi -+done -+ - LIBS="$oldLIBS" - - # Configuration of machine-dependent code -Index: libjava/configure.ac -=================================================================== ---- libjava/configure.ac (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ libjava/configure.ac (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -886,14 +886,9 @@ - SYSTEMSPEC="-lunicows $SYSTEMSPEC" - fi - ;; -- *-*-darwin9*) -+ *-*-darwin[[912]]*) - SYSTEMSPEC="%{!Zdynamiclib:%{!Zbundle:-allow_stack_execute}}" - ;; -- *-*-darwin[[12]]*) -- # Something is incompatible with pie, would be nice to fix it and -- # remove -no_pie. PR49461 -- SYSTEMSPEC="-no_pie %{!Zdynamiclib:%{!Zbundle:-allow_stack_execute}}" -- ;; - *) - SYSTEMSPEC= - ;; -Index: libjava/ChangeLog -=================================================================== ---- libjava/ChangeLog (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ libjava/ChangeLog (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -1,3 +1,13 @@ -+2012-03-02 Jack Howarth -+ -+ Backport from mainline -+ 2012-02-23 Patrick Marlier -+ Jack Howarth -+ -+ PR target/49461 -+ * configure.ac (SYSTEMSPEC): No longer pass -no_pie for darwin11. -+ * configure: Regenerate. +- if (nml_parse_qualifier (dtp, chd, ind, -1, nml_err_msg, +- nml_err_msg_size, &parsed_rank) ++ if (nml_parse_qualifier (dtp, chd, ind, -1, nl->type, ++ nml_err_msg, nml_err_msg_size, &parsed_rank) + == FAILURE) + { + char *nml_err_msg_end = strchr (nml_err_msg, '\0'); +@@ -2921,7 +2931,7 @@ + } + + if ((c = next_char (dtp)) == EOF) +- return FAILURE; ++ goto nml_err_ret; + unget_char (dtp, c); + } + +@@ -2961,7 +2971,7 @@ + return SUCCESS; + + if ((c = next_char (dtp)) == EOF) +- return FAILURE; ++ goto nml_err_ret; + + if (c != '=') + { +@@ -2996,6 +3006,17 @@ + + nml_err_ret: + ++ /* The EOF error message is issued by hit_eof. Return true so that the ++ caller does not use nml_err_msg and nml_err_msg_size to generate ++ an unrelated error message. */ ++ if (c == EOF) ++ { ++ dtp->u.p.input_complete = 1; ++ unget_char (dtp, c); ++ hit_eof (dtp); ++ return SUCCESS; ++ } + - 2012-03-01 Release Manager + return FAILURE; + } - * GCC 4.6.3 released. -Index: libjava/configure +Index: libgfortran/io/transfer.c =================================================================== ---- libjava/configure (.../tags/gcc_4_6_3_release) (wersja 185440) -+++ libjava/configure (.../branches/gcc-4_6-branch) (wersja 185440) -@@ -19775,14 +19775,9 @@ - SYSTEMSPEC="-lunicows $SYSTEMSPEC" - fi - ;; -- *-*-darwin9*) -+ *-*-darwin[912]*) - SYSTEMSPEC="%{!Zdynamiclib:%{!Zbundle:-allow_stack_execute}}" - ;; -- *-*-darwin[12]*) -- # Something is incompatible with pie, would be nice to fix it and -- # remove -no_pie. PR49461 -- SYSTEMSPEC="-no_pie %{!Zdynamiclib:%{!Zbundle:-allow_stack_execute}}" -- ;; - *) - SYSTEMSPEC= - ;; +--- libgfortran/io/transfer.c (.../tags/gcc_4_7_3_release) (revision 198690) ++++ libgfortran/io/transfer.c (.../branches/gcc-4_7-branch) (revision 198690) +@@ -3748,7 +3748,7 @@ + case NO_ENDFILE: + case AT_ENDFILE: + generate_error (&dtp->common, LIBERROR_END, NULL); +- if (!is_internal_unit (dtp)) ++ if (!is_internal_unit (dtp) && !dtp->u.p.namelist_mode) + { + dtp->u.p.current_unit->endfile = AFTER_ENDFILE; + dtp->u.p.current_unit->current_record = 0;