X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=gcc-branch.diff;h=6dc898c8f92f676c8b98a802fcb560db20b24a4f;hb=e4492d812a11ae6150c6a3c0ad0608d6501b19f2;hp=622f26d331e323c18876c17510f40ecec5d3b700;hpb=7be242a0caba90b393d2cc7bfcc49c2cc217e273;p=packages%2Fgcc.git diff --git a/gcc-branch.diff b/gcc-branch.diff index 622f26d..6dc898c 100644 --- a/gcc-branch.diff +++ b/gcc-branch.diff @@ -1,2117 +1,2149 @@ -Index: libgomp/fortran.c +Index: libstdc++-v3/ChangeLog =================================================================== ---- libgomp/fortran.c (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ libgomp/fortran.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -1,4 +1,4 @@ --/* Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc. -+/* Copyright (C) 2005, 2007, 2008, 2009, 2011 Free Software Foundation, Inc. - Contributed by Jakub Jelinek . - - This file is part of the GNU OpenMP Library (libgomp). -@@ -27,6 +27,7 @@ - #include "libgomp.h" - #include "libgomp_f.h" - #include -+#include - - #ifdef HAVE_ATTRIBUTE_ALIAS - /* Use internal aliases if possible. */ -@@ -244,6 +245,8 @@ - omp_lock_symver (omp_test_nest_lock_) - #endif - -+#define TO_INT(x) ((x) > INT_MIN ? (x) < INT_MAX ? (x) : INT_MAX : INT_MIN) +--- 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 + - void - omp_set_dynamic_ (const int32_t *set) - { -@@ -253,7 +256,7 @@ - void - omp_set_dynamic_8_ (const int64_t *set) - { -- omp_set_dynamic (*set); -+ omp_set_dynamic (!!*set); - } - - void -@@ -265,7 +268,7 @@ - void - omp_set_nested_8_ (const int64_t *set) - { -- omp_set_nested (*set); -+ omp_set_nested (!!*set); - } - - void -@@ -277,7 +280,7 @@ - void - omp_set_num_threads_8_ (const int64_t *set) - { -- omp_set_num_threads (*set); -+ omp_set_num_threads (TO_INT (*set)); - } - - int32_t -@@ -343,7 +346,7 @@ - void - omp_set_schedule_8_ (const int32_t *kind, const int64_t *modifier) - { -- omp_set_schedule (*kind, *modifier); -+ omp_set_schedule (*kind, TO_INT (*modifier)); - } - - void -@@ -381,7 +384,7 @@ - void - omp_set_max_active_levels_8_ (const int64_t *levels) - { -- omp_set_max_active_levels (*levels); -+ omp_set_max_active_levels (TO_INT (*levels)); - } - - int32_t -@@ -405,7 +408,7 @@ - int32_t - omp_get_ancestor_thread_num_8_ (const int64_t *level) - { -- return omp_get_ancestor_thread_num (*level); -+ return omp_get_ancestor_thread_num (TO_INT (*level)); - } - - int32_t -@@ -417,7 +420,7 @@ - int32_t - omp_get_team_size_8_ (const int64_t *level) - { -- return omp_get_team_size (*level); -+ return omp_get_team_size (TO_INT (*level)); - } ++ 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 - int32_t -Index: libgomp/ChangeLog + * GCC 4.7.3 released. +Index: libstdc++-v3/testsuite/30_threads/condition_variable/members/53841.cc =================================================================== ---- libgomp/ChangeLog (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ libgomp/ChangeLog (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -1,3 +1,15 @@ -+2011-05-06 Jakub Jelinek -+ -+ PR fortran/48894 -+ * fortran.c: Include limits.h. -+ (TO_INT): Define. -+ (omp_set_dynamic_8_, omp_set_num_threads_8_): Use !!*set instead of -+ *set. -+ (omp_set_num_threads_8_, omp_set_schedule_8_, -+ omp_set_max_active_levels_8_, omp_get_ancestor_thread_num_8_, -+ omp_get_team_size_8_): Use TO_INT macro. -+ * testsuite/libgomp.fortran/pr48894.f90: New test. -+ - 2011-04-28 Release Manager - - * GCC 4.5.3 released. -Index: libgomp/testsuite/libgomp.fortran/pr48894.f90 -=================================================================== ---- libgomp/testsuite/libgomp.fortran/pr48894.f90 (.../tags/gcc_4_5_3_release) (wersja 0) -+++ libgomp/testsuite/libgomp.fortran/pr48894.f90 (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -0,0 +1,23 @@ -+! PR fortran/48894 -+! { dg-do run } -+! { dg-options "-fdefault-integer-8" } -+ -+ use omp_lib -+ integer, parameter :: zero = 0 -+ integer :: err -+ logical :: l -+ err = 0 -+ !$omp parallel -+ !$omp parallel private (l) -+ l = omp_get_ancestor_thread_num (-HUGE (zero)) .ne. -1 -+ l = l .or. (omp_get_ancestor_thread_num (HUGE (zero)) .ne. -1) -+ l = l .or. (omp_get_team_size (-HUGE (zero)) .ne. -1) -+ l = l .or. (omp_get_team_size (HUGE (zero)) .ne. -1) -+ if (l) then -+ !$omp atomic -+ err = err + 1 -+ endif -+ !$omp end parallel -+ !$omp end parallel -+ if (err .ne. 0) call abort -+end -Index: gcc/fwprop.c +--- 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/fwprop.c (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/fwprop.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -228,8 +228,11 @@ +--- 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 - process_uses (df_get_artificial_uses (bb_index), DF_REF_AT_TOP); - process_defs (df_get_artificial_defs (bb_index), DF_REF_AT_TOP); -- df_simulate_initialize_forwards (bb, local_lr); - -+ /* We don't call df_simulate_initialize_forwards, as it may overestimate -+ the live registers if there are unused artificial defs. We prefer -+ liveness to be underestimated. */ ++// 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 + - FOR_BB_INSNS (bb, insn) - if (INSN_P (insn)) - { -Index: gcc/DATESTAMP + #endif +Index: libstdc++-v3/acinclude.m4 =================================================================== ---- gcc/DATESTAMP (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/DATESTAMP (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -1 +1 @@ --20110428 -+20110515 -Index: gcc/tree-tailcall.c +--- 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 =================================================================== ---- gcc/tree-tailcall.c (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/tree-tailcall.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -1007,6 +1007,14 @@ - integer_one_node); - } - -+ if (a_acc || m_acc) -+ { -+ /* When the tail call elimination using accumulators is performed, -+ statements adding the accumulated value are inserted at all exits. -+ This turns all other tail calls to non-tail ones. */ -+ opt_tailcalls = false; -+ } +--- 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 + - for (; tailcalls; tailcalls = next) - { - next = tailcalls->next; -Index: gcc/final.c -=================================================================== ---- gcc/final.c (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/final.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -2241,6 +2241,11 @@ - location_t loc; - expanded_location expanded; - -+ /* Make sure we flush any queued register saves in case this -+ clobbers affected registers. */ -+ if (dwarf2out_do_frame ()) -+ dwarf2out_frame_debug (insn, false); ++ * 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. + - /* There's no telling what that did to the condition codes. */ - CC_STATUS_INIT; + 2013-04-11 Release Manager -Index: gcc/fold-const.c + * GCC 4.7.3 released. +Index: libgcc/config/arm/linux-atomic.c +=================================================================== +--- 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/fold-const.c (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/fold-const.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -2784,8 +2784,6 @@ +--- 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 @@ - case VOID_TYPE: - tem = fold_ignored_result (arg); -- if (TREE_CODE (tem) == MODIFY_EXPR) -- goto fold_convert_exit; - return fold_build1_loc (loc, NOP_EXPR, type, tem); + @hook TARGET_WANT_DEBUG_PUB_SECTIONS - default: -Index: gcc/DEV-PHASE ++@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/DEV-PHASE (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/DEV-PHASE (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -0,0 +1 @@ -+prerelease +--- 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_5_3_release) (wersja 173771) -+++ gcc/ChangeLog (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -1,3 +1,177 @@ -+2011-05-11 Michael Meissner +--- 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 -+ 2011-05-10 Michael Meissner -+ -+ PR target/48857, 48495 -+ * config/rs6000/rs6000.h (VSX_SCALAR_MODE): Delete. -+ (VSX_MODE): Ditto. -+ (VSX_MOVE_MODE): Ditto. -+ (ALTIVEC_OR_VSX_VECTOR_MODE): New macro, combine all Altivec and -+ VSX vector types. Add V2DImode. -+ (HARD_REGNO_CALLER_SAVE_MODE): Use it instead of -+ ALTIVEC_VECTOR_MODE and VSX_VECTOR_MODE calls. -+ (MODES_TIEABLE_P): Ditto. ++ 2013-04-25 Marek Polacek + -+ * config/rs6000/rs6000.c (rs6000_emit_move): Use -+ ALTIVEC_OR_VSX_MODE instead of ALTIVEC_VECTOR_MODE and -+ VSX_VECTOR_MODE. -+ (init_cumulative_args): Ditto. -+ (rs6000_function_arg_boundary): Ditto. -+ (rs6000_function_arg_advance_1): Ditto. -+ (rs6000_function_arg): Ditto. -+ (rs6000_function_ok_for_sibcall): Ditto. -+ (emit_frame_save): Ditto. -+ (rs6000_function_value): Ditto. -+ (rs6000_libcall_value): Ditto. ++ PR tree-optimization/57066 ++ * builtins.c (fold_builtin_logb): Return +Inf for -Inf. + -+2011-05-10 Jakub Jelinek ++2013-04-30 Uros Bizjak + -+ Backported from mainline -+ 2011-05-07 Zdenek Dvorak -+ -+ PR tree-optimization/48837 -+ * tree-tailcall.c (tree_optimize_tail_calls_1): Do not mark tailcalls -+ when accumulator transformation is performed. -+ -+2011-05-09 Eric Botcazou ++ Backport from mainline ++ 2013-04-29 Uros Bizjak + -+ * var-tracking.c (find_mem_expr_in_1pdv): Fix thinko. -+ (dataflow_set_preserve_mem_locs): Likewise. ++ PR target/44578 ++ * config/i386/i386.md (*zero_extendsidi2_rex64): Add "!" to m->?*y ++ alternative. ++ (*zero_extendsidi2): Ditto. + -+2011-05-07 Alan Modra ++ Backport from mainline ++ 2013-04-29 Uros Bizjak + -+ PR target/48900 -+ * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Use -+ const0_rtx as the arg to the dummy __tls_get_addr libcall. ++ PR target/57098 ++ * config/i386/i386.c (ix86_expand_vec_perm): Validize constant memory. + -+2011-05-05 Jason Merrill ++2013-04-29 Christian Bruel + -+ PR c++/40975 -+ * tree-inline.c (copy_tree_r): Handle STATEMENT_LIST. ++ PR target/57108 ++ * sh.md (tstsi_t_zero_extract_eq): Set mode for operand 0. + -+2011-05-05 Julian Brown ++2013-04-27 Jakub Jelinek + -+ * config/arm/neon.md (vec_set_internal): Fix misplaced -+ parenthesis in D-register case. ++ PR target/56866 ++ * config/i386/sse.md (xop_rotr3): Fix up computation of ++ the immediate rotate count. + -+2011-05-05 Ira Rosen ++2013-04-21 Eric Botcazou + -+ Backport from mainline: -+ 2011-04-18 Ulrich Weigand -+ Ira Rosen ++ * cfgexpand.c (avoid_complex_debug_insns): Fix C++ism. + -+ PR target/48252 -+ * config/arm/arm.c (neon_emit_pair_result_insn): Swap arguments -+ to match neon_vzip/vuzp/vtrn_internal. -+ * config/arm/neon.md (neon_vtrn_internal): Make both -+ outputs explicitly dependent on both inputs. -+ (neon_vzip_internal, neon_vuzp_internal): Likewise. ++2013-04-19 Matthias Klose + -+2011-05-04 Uros Bizjak ++ PR middle-end/56848 ++ Re-apply ++ 2013-04-01 Andrey Belevantsev + + Backport from mainline -+ 2011-04-21 Uros Bizjak -+ -+ PR target/48708 -+ * config/i386/i386.c (ix86_expand_vector_set) : Generate -+ vec_extract and vec_concat for non-SSE4_1 targets. -+ -+2011-05-04 Uros Bizjak ++ 2013-02-25 Andrey Belevantsev ++ Alexander Monakov + -+ * config/i386/i386.md (*movdi_internal_rex64) : -+ Use %v prefix in insn mnemonic to handle TARGET_AVX. -+ (*movdi_internal): Use "maybe_vex" instead of "vex" in "prefix" -+ attribute calculation. -+ (*movdf_internal): Output AVX mnemonics. Add "prefix" attribute. -+ * config/i386/sse.md (*sse2_storeq_rex64): Do not emit %v prefix -+ for mov{q} mnemonic. -+ (*vec_extractv2di_1_rex64_avx): Ditto. -+ (*vec_concatv2di_rex64_sse4_1): Use %vmovd for reg<->xmm moves. -+ (*vec_concatv2di_rex64_sse): Use movd for reg<->xmm moves. -+ * config/i386/mmx.md (*mov_internal_rex64): Ditto. ++ PR middle-end/56077 ++ * sched-deps.c (sched_analyze_insn): When reg_pending_barrier, ++ flush pending lists also on non-jumps. Adjust comment. + -+2011-05-03 Uros Bizjak -+ Jakub Jelinek ++ Backport from 4.8: ++ 2012-08-27 Maxim Kuvyrkov + -+ PR target/48774 -+ * config/i386/i386.c (ix86_match_ccmode): For CC{A,C,O,S}mode -+ only succeed if req_mode is the same as set_mode. ++ * 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. + -+2011-05-03 Jakub Jelinek ++2013-04-19 Marek Polacek + + Backport from mainline -+ 2011-04-30 Jakub Jelinek ++ 2013-01-08 Steven Bosscher ++ Jakub Jelinek + -+ PR tree-optimization/48809 -+ * tree-switch-conversion.c (build_arrays): Compute tidx in unsigned -+ type. -+ (gen_inbound_check): Don't compute index_expr - range_min in utype -+ again, instead reuse SSA_NAME initialized in build_arrays. -+ Remove two useless gsi_for_stmt calls. ++ 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. + -+ 2011-04-28 Jakub Jelinek ++2013-04-16 Jack Howarth + -+ PR middle-end/48597 -+ * final.c (final_scan_insn): Call dwarf2out_frame_debug even for -+ inline asm. ++ Backport from mainline ++ 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. + -+ 2011-04-27 Jakub Jelinek + -+ PR c/48742 -+ * c-typeck.c (build_binary_op): Don't wrap arguments if -+ int_operands is true. ++ 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. + -+ 2011-04-23 Jakub Jelinek ++2013-04-15 Eric Botcazou + -+ PR c/48685 -+ * fold-const.c (fold_convert_loc): Add NOP_EXPR when casting -+ to VOID_TYPE even around MODIFY_EXPR. ++ 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. + -+2011-05-02 Ulrich Weigand ++2013-04-13 John David Anglin + -+ PR middle-end/43085 + Backport from mainline: ++ 2013-04-06 John David Anglin + -+ 2010-04-29 Bernd Schmidt -+ -+ From Dominique d'Humieres -+ PR bootstrap/43858 -+ * ifcvt.c (dead_or_predicable): Use df_simulate_find_defs to compute -+ test_set. -+ -+ 2010-04-26 Bernd Schmidt -+ -+ * df-problems.c (df_simulate_initialize_forwards): Set, don't clear, -+ bits for artificial defs at the top of the block. -+ * fwprop.c (single_def_use_enter_block): Don't call it. ++ PR target/55487 ++ * config/pa/pa.c (legitimize_pic_address): Before incrementing label ++ nuses, make sure we have a label. + -+ 2010-04-22 Bernd Schmidt ++2013-04-11 Richard Biener + -+ * ifcvt.c (dead_or_predicable): Use df_simulate_find_defs and -+ df_simulate_find_noclobber_defs as appropriate. Keep track of an -+ extra set merge_set_noclobber, and use it to relax the final test -+ slightly. -+ * df.h (df_simulate_find_noclobber_defs): Declare. -+ * df-problems.c (df_simulate_find_defs): Don't ignore partial or -+ conditional defs. -+ (df_simulate_find_noclobber_defs): New function. ++ * BASE-VER: Set to 4.7.4. ++ * DEV-PHASE: Set to prerelease. + -+2011-04-29 John David Anglin -+ -+ PR target/48288 -+ * config/pa/predicates.md (ior_operand): Delete predicate. -+ (cint_ior_operand, reg_or_cint_ior_operand): New predicates. -+ * config/pa/pa.md (iordi3): Use reg_or_cint_ior_operand predicate in -+ expander. Use cint_ior_operand in unnamed insn. -+ (iorsi3): Likewise. -+ * config/pa/pa-protos.h (ior_operand): Delete declarations. -+ -+2011-04-28 Richard Guenther -+ -+ * DEV-PHASE: Set back to prerelease. -+ * BASE-VER: Bump to 4.5.4. -+ - 2011-04-28 Release Manager + 2013-04-11 Release Manager - * GCC 4.5.3 released. -Index: gcc/testsuite/gcc.c-torture/execute/pr48809.c + * GCC 4.7.3 released. +Index: gcc/testsuite/gcc.target/i386/pr44578.c =================================================================== ---- gcc/testsuite/gcc.c-torture/execute/pr48809.c (.../tags/gcc_4_5_3_release) (wersja 0) -+++ gcc/testsuite/gcc.c-torture/execute/pr48809.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -0,0 +1,60 @@ -+/* PR tree-optimization/48809 */ +--- 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); + -+int -+foo (signed char x) ++long double ++__attribute__((noinline, noclone)) ++test (float num) +{ -+ int y = 0; -+ switch (x) -+ { -+ case 0: y = 1; break; -+ case 1: y = 7; break; -+ case 2: y = 2; break; -+ case 3: y = 19; break; -+ case 4: y = 5; break; -+ case 5: y = 17; break; -+ case 6: y = 31; break; -+ case 7: y = 8; break; -+ case 8: y = 28; break; -+ case 9: y = 16; break; -+ case 10: y = 31; break; -+ case 11: y = 12; break; -+ case 12: y = 15; break; -+ case 13: y = 111; break; -+ case 14: y = 17; break; -+ case 15: y = 10; break; -+ case 16: y = 31; break; -+ case 17: y = 7; break; -+ case 18: y = 2; break; -+ case 19: y = 19; break; -+ case 20: y = 5; break; -+ case 21: y = 107; break; -+ case 22: y = 31; break; -+ case 23: y = 8; break; -+ case 24: y = 28; break; -+ case 25: y = 106; break; -+ case 26: y = 31; break; -+ case 27: y = 102; break; -+ case 28: y = 105; break; -+ case 29: y = 111; break; -+ case 30: y = 17; break; -+ case 31: y = 10; break; -+ case 32: y = 31; break; -+ case 98: y = 18; break; -+ case -62: y = 19; break; -+ } -+ return y; ++ 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 () +{ -+ if (foo (98) != 18 || foo (97) != 0 || foo (99) != 0) -+ abort (); -+ if (foo (-62) != 19 || foo (-63) != 0 || foo (-61) != 0) -+ abort (); -+ if (foo (28) != 105 || foo (27) != 102 || foo (29) != 111) ++ long double x; ++ ++ x = test (0.0); ++ ++ if (x != 0.0) + abort (); ++ + return 0; +} -Index: gcc/testsuite/gcc.c-torture/compile/pr48742.c +Index: gcc/testsuite/gcc.target/i386/pr56866.c =================================================================== ---- gcc/testsuite/gcc.c-torture/compile/pr48742.c (.../tags/gcc_4_5_3_release) (wersja 0) -+++ gcc/testsuite/gcc.c-torture/compile/pr48742.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -0,0 +1,15 @@ -+/* PR c/48742 */ +--- 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" } */ + -+void baz (int); ++#define main xop_test_main ++#include "../../gcc.c-torture/execute/pr56866.c" ++#undef main + -+int -+foo (void) -+{ -+ return 1 / 0 > 0; -+} ++#include "xop-check.h" + -+void -+bar (void) ++static void ++xop_test (void) +{ -+ baz (1 <= 2 % (3 >> 1 > 5 / 6 == 3)); ++ xop_test_main (); +} -Index: gcc/testsuite/gcc.target/arm/neon-vset_lanes8.c +Index: gcc/testsuite/gcc.target/i386/pr57098.c =================================================================== ---- gcc/testsuite/gcc.target/arm/neon-vset_lanes8.c (.../tags/gcc_4_5_3_release) (wersja 0) -+++ gcc/testsuite/gcc.target/arm/neon-vset_lanes8.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -0,0 +1,21 @@ -+/* Test the `vset_lane_s8' ARM Neon intrinsic. */ -+ -+/* { dg-do run } */ -+/* { dg-require-effective-target arm_neon_hw } */ -+/* { dg-options "-O0" } */ -+/* { dg-add-options arm_neon } */ -+ -+#include "arm_neon.h" -+#include -+#include +--- 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" } */ + -+int8x8_t x = { 1, 2, 3, 4, 5, 6, 7, 8 }; -+int8x8_t y = { 1, 2, 3, 16, 5, 6, 7, 8 }; ++typedef int V __attribute__((vector_size(16))); + -+int main (void) ++void foo (V *p, V *mask) +{ -+ x = vset_lane_s8 (16, x, 3); -+ if (memcmp (&x, &y, sizeof (x)) != 0) -+ abort(); -+ return 0; ++ *p = __builtin_shuffle (*p, *mask); +} -Index: gcc/testsuite/gcc.target/arm/pr48252.c +Index: gcc/testsuite/gcc.target/sh/pr57108.c =================================================================== ---- gcc/testsuite/gcc.target/arm/pr48252.c (.../tags/gcc_4_5_3_release) (wersja 0) -+++ gcc/testsuite/gcc.target/arm/pr48252.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -0,0 +1,31 @@ -+/* { dg-do run } */ -+/* { dg-require-effective-target arm_neon_hw } */ -+/* { dg-options "-O2" } */ -+/* { dg-add-options arm_neon } */ +--- 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" } */ + -+#include "arm_neon.h" -+#include ++void __assert_func (void) __attribute__ ((__noreturn__)) ; + -+int main(void) ++void ATATransfer (int num, int buffer) +{ -+ uint8x8_t v1 = {1, 1, 1, 1, 1, 1, 1, 1}; -+ uint8x8_t v2 = {2, 2, 2, 2, 2, 2, 2, 2}; -+ uint8x8x2_t vd1, vd2; -+ union {uint8x8_t v; uint8_t buf[8];} d1, d2, d3, d4; -+ int i; ++ int wordCount; + -+ vd1 = vzip_u8(v1, vdup_n_u8(0)); -+ vd2 = vzip_u8(v2, vdup_n_u8(0)); ++ while (num > 0) ++ { ++ wordCount = num * 512 / sizeof (int); + -+ vst1_u8(d1.buf, vd1.val[0]); -+ vst1_u8(d2.buf, vd1.val[1]); -+ vst1_u8(d3.buf, vd2.val[0]); -+ vst1_u8(d4.buf, vd2.val[1]); ++ ((0 == (buffer & 63)) ? (void)0 : __assert_func () ); ++ ((0 == (wordCount & 31)) ? (void)0 : __assert_func ()); ++ } + -+ for (i = 0; i < 8; i++) -+ if ((i % 2 == 0 && d4.buf[i] != 2) -+ || (i % 2 == 1 && d4.buf[i] != 0)) -+ abort (); + -+ return 0; -+} -Index: gcc/testsuite/gcc.target/powerpc/pr48857.c ++ } +Index: gcc/testsuite/gfortran.dg/size_kind_3.f90 =================================================================== ---- gcc/testsuite/gcc.target/powerpc/pr48857.c (.../tags/gcc_4_5_3_release) (wersja 0) -+++ gcc/testsuite/gcc.target/powerpc/pr48857.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -0,0 +1,25 @@ -+/* { dg-do compile { target { powerpc*-*-* } } } */ -+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ -+/* { dg-require-effective-target powerpc_vsx_ok } */ -+/* { dg-options "-O2 -mcpu=power7 -mabi=altivec" } */ -+/* { dg-final { scan-assembler-times "lxvd2x" 1 } } */ -+/* { dg-final { scan-assembler-times "stxvd2x" 1 } } */ -+/* { dg-final { scan-assembler-not "ld" } } */ -+/* { dg-final { scan-assembler-not "lwz" } } */ -+/* { dg-final { scan-assembler-not "stw" } } */ -+/* { dg-final { scan-assembler-not "addi" } } */ -+ -+typedef vector long long v2di_type; -+ -+v2di_type -+return_v2di (v2di_type *ptr) -+{ -+ return *ptr; /* should generate lxvd2x 34,0,3. */ -+} +--- 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/57142 ++! ++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 } ++! ++! PR libfortran/51825 - Fortran runtime error: Cannot match namelist object name ++! Test case derived from PR. + -+void -+pass_v2di (v2di_type arg, v2di_type *ptr) -+{ -+ *ptr = arg; /* should generate stxvd2x 34,0,{3,5}. */ -+} ++module local_mod + -Index: gcc/testsuite/gcc.target/i386/pr48708.c -=================================================================== ---- gcc/testsuite/gcc.target/i386/pr48708.c (.../tags/gcc_4_5_3_release) (wersja 0) -+++ gcc/testsuite/gcc.target/i386/pr48708.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -0,0 +1,15 @@ -+/* { dg-do compile } */ -+/* { dg-options "-O2 -msse2" } */ ++ type mytype1 ++ integer :: int1 ++ end type + -+#include ++ type mytype2 ++ integer :: n_x ++ integer :: n_px ++ end type + -+typedef long long T __attribute__((may_alias)); -+struct S { __m128i d; }; ++ type beam_init_struct ++ character(16) :: chars(1) = '' ++ type (mytype1) dummy ++ type (mytype2) grid(1) ++ end type + -+__m128i -+foo (long long *x, struct S *y, __m128i *z) -+{ -+ struct S s = *y; -+ ((T *) &s.d)[0] = *x; -+ return _mm_cmpeq_epi16 (s.d, *z); -+} -Index: gcc/testsuite/gcc.target/i386/sse2-init-v2di-2.c ++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/gcc.target/i386/sse2-init-v2di-2.c (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/testsuite/gcc.target/i386/sse2-init-v2di-2.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -1,6 +1,6 @@ - /* { dg-do compile } */ - /* { dg-require-effective-target lp64 } */ --/* { dg-options "-O2 -msse4 -march=core2" } */ -+/* { dg-options "-O2 -msse4 -march=core2 -dp" } */ - - #include - -@@ -10,4 +10,4 @@ - return _mm_cvtsi64_si128 (b); - } - --/* { dg-final { scan-assembler "movq" } } */ -+/* { dg-final { scan-assembler-times "\\*vec_concatv2di_rex64_sse4_1/3" 1 } } */ -Index: gcc/testsuite/gcc.dg/pr48774.c +--- 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/gcc.dg/pr48774.c (.../tags/gcc_4_5_3_release) (wersja 0) -+++ gcc/testsuite/gcc.dg/pr48774.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -0,0 +1,38 @@ -+/* PR target/48774 */ -+/* { dg-do run } */ -+/* { dg-options "-O2 -funroll-loops" } */ +--- 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/57142 ++! ++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 + -+extern void abort (void); -+unsigned long int s[24] -+ = { 12, ~1, 12, ~2, 12, ~4, 12, ~8, 12, ~16, 12, ~32, -+ 12, ~64, 12, ~128, 12, ~256, 12, ~512, 12, ~1024, 12, ~2048 }; -+struct { int n; unsigned long *e[12]; } g -+ = { 12, { &s[0], &s[2], &s[4], &s[6], &s[8], &s[10], &s[12], &s[14], -+ &s[16], &s[18], &s[20], &s[22] } }; -+int c[12]; -+ -+__attribute__((noinline, noclone)) void -+foo (void) -+{ -+ int i, j; -+ for (i = 0; i < g.n; i++) -+ for (j = 0; j < g.n; j++) -+ { -+ if (i == j && j < g.e[0][0] && (g.e[i][1] & (1UL << j))) -+ abort (); -+ if (j < g.e[0][0] && (g.e[i][1] & (1UL << j))) -+ c[i]++; -+ } -+} ++! { 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 } ++! ++! 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 test ++ ++ 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 ++ ++contains ++ ++ function specific_name_get_proc_ptr() result(res) ++ procedure(foo), pointer :: res ++ end function ++ ++end module test ++ ++program crash_test ++ use :: test ++ ++ procedure(foo), pointer :: ptr ++ ++ ptr => specific_name_get_proc_ptr() ++ ptr => generic_name_get_proc_ptr() ++ ++end program ++ ++! { 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 */ + +int +main () +{ -+ int i; -+ asm volatile ("" : "+m" (s), "+m" (g), "+m" (c)); -+ foo (); -+ for (i = 0; i < 12; i++) -+ if (c[i] != 11) -+ abort (); ++#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/pr48837.c +Index: gcc/testsuite/gcc.dg/pr56890-2.c =================================================================== ---- gcc/testsuite/gcc.dg/pr48837.c (.../tags/gcc_4_5_3_release) (wersja 0) -+++ gcc/testsuite/gcc.dg/pr48837.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -0,0 +1,30 @@ -+/* PR tree-optimization/48837 */ -+/* { dg-do run } */ -+/* { dg-options "-O2" } */ +--- 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 */ + -+void abort (void); -+ -+__attribute__((noinline)) -+int baz(void) -+{ -+ return 1; -+} -+ -+inline const int *bar(const int *a, const int *b) -+{ -+ return *a ? a : b; -+} ++/* { dg-do assemble } */ ++/* { dg-options "-O" } */ + -+int foo(int a, int b) ++unsigned int buggy(unsigned int min, unsigned int max) +{ -+ return a || b ? baz() : foo(*bar(&a, &b), 1) + foo(1, 0); ++ 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" } */ + -+int main(void) ++struct S { int s[8]; }; ++ ++void ++foo (int *x, struct S *y) +{ -+ if (foo(0, 0) != 2) -+ abort(); -+ -+ return 0; ++ int i; ++ for (i = 0; y[i].s[i]; i++) ++ *x++ = y[i].s[i]; +} -+ -Index: gcc/testsuite/gcc.dg/pr48685.c +Index: gcc/testsuite/gcc.dg/torture/builtin-logb-1.c =================================================================== ---- gcc/testsuite/gcc.dg/pr48685.c (.../tags/gcc_4_5_3_release) (wersja 0) -+++ gcc/testsuite/gcc.dg/pr48685.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -0,0 +1,11 @@ -+/* PR c/48685 */ -+/* { dg-do compile } */ +--- 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" } */ + -+int -+main () ++unsigned int buggy(unsigned int min, unsigned int max) +{ -+ int v = 1; -+ (void) (1 == 2 ? (void) 0 : (v = 0)); -+ return v; ++ 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_5_3_release) (wersja 173771) -+++ gcc/testsuite/ChangeLog (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -1,3 +1,82 @@ -+2011-05-11 Michael Meissner +--- 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 + + Backport from mainline -+ 2011-05-10 Michael Meissner ++ 2013-05-02 Tobias Burnus + -+ PR target/48857 -+ * gcc.target/powerpc/pr48857.c: New file, make sure V2DI arguments -+ are passed and returned in vector registers. ++ PR fortran/57142 ++ * gfortran.dg/size_kind_2.f90: New. ++ * gfortran.dg/size_kind_3.f90: New. + -+2011-05-10 Jakub Jelinek ++2013-05-03 Marek Polacek + -+ Backported from mainline -+ 2011-05-07 Zdenek Dvorak ++ Backport from mainline ++ 2013-04-25 Marek Polacek + -+ PR tree-optimization/48837 -+ * gcc.dg/pr48837.c: New testcase. ++ PR tree-optimization/57066 ++ * gcc.dg/torture/builtin-logb-1.c: Adjust testcase. + -+2011-05-09 Jason Merrill ++2013-04-30 Uros Bizjak + -+ * g++.dg/template/nontype23.C: New. ++ Backport from mainline ++ 2013-04-29 Uros Bizjak + -+2011-05-05 Jason Merrill ++ PR target/44578 ++ * gcc.target/i386/pr44578.c: New test. + -+ * g++.dg/init/new30.C: New. ++ Backport from mainline ++ 2013-04-29 Uros Bizjak + -+2011-05-05 Julian Brown ++ PR target/57098 ++ * gcc.target/i386/pr57098.c: New test. + -+ * gcc.target/arm/neon-vset_lanes8.c: New test. ++2013-04-29 Christian Bruel + -+2011-05-05 Ira Rosen ++ PR target/57108 ++ * gcc.target/sh/pr57108.c: New test. + -+ Backport from mainline: -+ 2011-04-18 Ulrich Weigand -+ Ira Rosen ++2013-04-28 Jerry DeLisle + -+ PR target/48252 -+ * gcc.target/arm/pr48252.c: New test. ++ Backport from trunk: + -+2011-05-04 Uros Bizjak ++ PR fortran/51825 ++ * gfortran.dg/namelist_77.f90: New test. ++ * gfortran.dg/namelist_78.f90: New test. + -+ Backport from mainline -+ 2011-04-21 Uros Bizjak ++2013-04-28 Jerry DeLisle + -+ PR target/48708 -+ * gcc.target/i386/pr48708.c: New test. ++ Backport from trunk: + -+2011-05-04 Uros Bizjak ++ PR fortran/56786 ++ * gfortran.dg/namelist_81.f90: New test. + -+ Backport from mainline -+ 2010-12-08 H.J. Lu ++2013-04-28 Jerry DeLisle + -+ * gcc.target/i386/sse2-init-v2di-2.c: Add "-dp" and update -+ expected scan. ++ Backport from trunk: + -+2011-05-03 Jakub Jelinek ++ PR fortran/52512 ++ * gfortran.dg/namelist_79.f90: New test. + -+ PR target/48774 -+ * gcc.dg/pr48774.c: New test. ++2013-04-27 Jakub Jelinek + -+ Backport from mainline -+ 2011-04-30 Jakub Jelinek -+ -+ PR tree-optimization/48809 -+ * gcc.c-torture/execute/pr48809.c: New test. ++ PR target/56866 ++ * gcc.c-torture/execute/pr56866.c: New test. ++ * gcc.target/i386/pr56866.c: New test. + -+ 2011-04-27 Jakub Jelinek ++2013-04-26 Janus Weil + -+ PR c/48742 -+ * gcc.c-torture/compile/pr48742.c: New test. ++ Backports from trunk: + -+ 2011-04-23 Jakub Jelinek ++ PR fortran/56968 ++ * gfortran.dg/proc_ptr_41.f90: New. + -+ PR c/48685 -+ * gcc.dg/pr48685.c: New test. ++ PR fortran/53685 ++ PR fortran/57022 ++ * gfortran.dg/transfer_check_4.f90: New. + -+2011-04-27 Jason Merrill ++2013-04-19 Marek Polacek + -+ * g++.dg/parse/ambig6.C: New. -+ - 2011-04-28 Release Manager - - * GCC 4.5.3 released. -Index: gcc/testsuite/g++.dg/parse/ambig6.C -=================================================================== ---- gcc/testsuite/g++.dg/parse/ambig6.C (.../tags/gcc_4_5_3_release) (wersja 0) -+++ gcc/testsuite/g++.dg/parse/ambig6.C (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -0,0 +1,12 @@ -+// PR c++/48046 ++ Backport from mainline ++ 2013-01-08 Steven Bosscher ++ Jakub Jelinek + -+namespace N1 { typedef int T; } // { dg-error "" } -+namespace N2 { typedef float T; } // { dg-error "" } ++ PR tree-optimization/48189 ++ * gcc.dg/pr48189.c: New test. + -+int main() -+{ -+ using namespace N1; -+ using namespace N2; ++2013-04-15 Rainer Orth + -+ static T t; // { dg-error "" } -+} -Index: gcc/testsuite/g++.dg/init/new30.C -=================================================================== ---- gcc/testsuite/g++.dg/init/new30.C (.../tags/gcc_4_5_3_release) (wersja 0) -+++ gcc/testsuite/g++.dg/init/new30.C (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -0,0 +1,15 @@ -+// PR c++/40975 ++ * gcc.dg/torture/pr53922.c: Skip on alpha*-*-osf*. ++ Remove dg-skip-if default args. + -+struct data_type -+{ -+ // constructor required to reproduce compiler bug -+ data_type() {} -+}; ++2013-04-15 Eric Botcazou + -+struct ptr_type -+{ -+ // array new as default argument required to reproduce compiler bug -+ ptr_type (data_type* ptr = new data_type[1]) { delete[] ptr; } -+}; ++ * gcc.dg/pr56890-1.c: New test. ++ * gcc.dg/pr56890-2.c: Likewise. + -+ptr_type obj; -Index: gcc/testsuite/g++.dg/template/nontype23.C + 2013-04-11 Release Manager + + * GCC 4.7.3 released. +Index: gcc/testsuite/g++.dg/cpp0x/lambda/lambda-eh3.C =================================================================== ---- gcc/testsuite/g++.dg/template/nontype23.C (.../tags/gcc_4_5_3_release) (wersja 0) -+++ gcc/testsuite/g++.dg/template/nontype23.C (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -0,0 +1,9 @@ -+// PR c++/48936 +--- 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 } + -+template int foo (void); -+template struct S ++int main() +{ -+ static const unsigned int a = sizeof (T); -+ enum { c = sizeof (foo <(a == 0)> ()) }; -+}; -+S x; ++ bool /*const*/ condition = false; ++ ++ [&]{ ++ try{} ++ catch(...){ ++ if(condition){} ++ } ++ }(); ++} Index: gcc/cp/ChangeLog =================================================================== ---- gcc/cp/ChangeLog (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/cp/ChangeLog (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -1,3 +1,15 @@ -+2011-05-09 Jason Merrill +--- 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 + -+ PR c++/48936 -+ * decl2.c (mark_used): Instantiate constant variables even -+ in unevaluated context. ++ * parser.c (cp_parser_late_return_type_opt): Fix C++ism. + -+2011-04-27 Jason Merrill ++2013-04-15 Jason Merrill + -+ PR c++/48046 -+ * parser.c (cp_parser_diagnose_invalid_type_name): Commit -+ to tentative parse sooner. ++ PR c++/56388 ++ * semantics.c (insert_capture_proxy): Just use index 1 in the ++ stmt_list_stack. + - 2011-04-28 Release Manager + 2013-04-11 Release Manager - * GCC 4.5.3 released. -Index: gcc/cp/decl2.c + * GCC 4.7.3 released. +Index: gcc/cp/semantics.c =================================================================== ---- gcc/cp/decl2.c (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/cp/decl2.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -3991,8 +3991,6 @@ - void - mark_used (tree decl) +--- 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) { -- HOST_WIDE_INT saved_processing_template_decl = 0; -- - /* If DECL is a BASELINK for a single function, then treat it just - like the DECL for the function. Otherwise, if the BASELINK is - for an overloaded function, we don't know which function was -@@ -4029,9 +4027,6 @@ - error ("used here"); - return; - } -- /* If we don't need a value, then we don't need to synthesize DECL. */ -- if (cp_unevaluated_operand != 0) -- return; - - /* We can only check DECL_ODR_USED on variables or functions with - DECL_LANG_SPECIFIC set, and these are also the only decls that we -@@ -4059,9 +4054,10 @@ - DECL. However, if DECL is a static data member initialized with - a constant, we need the value right now because a reference to - such a data member is not value-dependent. */ -- if (TREE_CODE (decl) == VAR_DECL -- && DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl) -- && DECL_CLASS_SCOPE_P (decl)) -+ if (DECL_INTEGRAL_CONSTANT_VAR_P (decl) -+ && !DECL_INITIAL (decl) -+ && DECL_LANG_SPECIFIC (decl) -+ && DECL_TEMPLATE_INSTANTIATION (decl)) + cp_binding_level *b; +- int skip; + tree stmt_list; + + /* 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 (;;) { - /* Don't try to instantiate members of dependent types. We - cannot just use dependent_type_p here because this function -@@ -4071,12 +4067,14 @@ - if (CLASSTYPE_TEMPLATE_INFO ((DECL_CONTEXT (decl))) - && uses_template_parms (CLASSTYPE_TI_ARGS (DECL_CONTEXT (decl)))) - return; -- /* Pretend that we are not in a template, even if we are, so -- that the static data member initializer will be processed. */ -- saved_processing_template_decl = processing_template_decl; -- processing_template_decl = 0; -+ instantiate_decl (decl, /*defer_ok=*/false, -+ /*expl_inst_class_mem_p=*/false); - } - -+ /* If we don't need a value, then we don't need to synthesize DECL. */ -+ if (cp_unevaluated_operand != 0) -+ return; -+ - if (processing_template_decl) - return; - -@@ -4149,8 +4147,6 @@ - need. Therefore, we always try to defer instantiation. */ - instantiate_decl (decl, /*defer_ok=*/true, - /*expl_inst_class_mem_p=*/false); -- -- processing_template_decl = saved_processing_template_decl; + cp_binding_level *n = b->level_chain; + if (n->kind == sk_function_parms) +@@ -8976,8 +8975,7 @@ + + /* 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); } - - #include "gt-cp-decl2.h" Index: gcc/cp/parser.c =================================================================== ---- gcc/cp/parser.c (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/cp/parser.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -2333,6 +2333,7 @@ - location_t location) +--- 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) { - tree decl, old_scope; -+ cp_parser_commit_to_tentative_parse (parser); - /* Try to lookup the identifier. */ - old_scope = parser->scope; - parser->scope = scope; -@@ -2423,7 +2424,6 @@ - else - gcc_unreachable (); - } -- cp_parser_commit_to_tentative_parse (parser); - } - - /* Check for a common situation where a type-name should be present, -Index: gcc/ifcvt.c + 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/ifcvt.c (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/ifcvt.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -3818,7 +3818,7 @@ - basic_block other_bb, basic_block new_dest, int reversep) - { - rtx head, end, jump, earliest = NULL_RTX, old_dest, new_label = NULL_RTX; -- bitmap merge_set = NULL; -+ bitmap merge_set = NULL, merge_set_noclobber = NULL; - /* Number of pending changes. */ - int n_validated_changes = 0; - -@@ -3951,11 +3951,14 @@ - - /* Collect: - MERGE_SET = set of registers set in MERGE_BB -+ MERGE_SET_NOCLOBBER = like MERGE_SET, but only includes registers -+ that are really set, not just clobbered. - TEST_LIVE = set of registers live at EARLIEST -- TEST_SET = set of registers set between EARLIEST and the -- end of the block. */ -+ TEST_SET = set of registers set between EARLIEST and the -+ end of the block. */ - - merge_set = BITMAP_ALLOC (®_obstack); -+ merge_set_noclobber = BITMAP_ALLOC (®_obstack); - - /* If we allocated new pseudos (e.g. in the conditional move - expander called from noce_emit_cmove), we must resize the -@@ -3967,13 +3970,8 @@ - { - if (NONDEBUG_INSN_P (insn)) +--- 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/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) { -- unsigned int uid = INSN_UID (insn); -- df_ref *def_rec; -- for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++) -- { -- df_ref def = *def_rec; -- bitmap_set_bit (merge_set, DF_REF_REGNO (def)); -- } -+ df_simulate_find_defs (insn, merge_set); -+ df_simulate_find_noclobber_defs (insn, merge_set_noclobber); - } + 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 ++ ++ 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 -@@ -3984,7 +3982,7 @@ - unsigned i; - bitmap_iterator bi; - -- EXECUTE_IF_SET_IN_BITMAP (merge_set, 0, i, bi) -+ EXECUTE_IF_SET_IN_BITMAP (merge_set_noclobber, 0, i, bi) - { - if (i < FIRST_PSEUDO_REGISTER - && ! fixed_regs[i] -@@ -4015,12 +4013,14 @@ + * GCC 4.7.3 released. +Index: gcc/fortran/expr.c +=================================================================== +--- 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 @@ } - - /* We can perform the transformation if -- MERGE_SET & (TEST_SET | TEST_LIVE) -+ MERGE_SET_NOCLOBBER & TEST_SET - and -+ MERGE_SET & TEST_LIVE -+ and - TEST_SET & DF_LIVE_IN (merge_bb) - are empty. */ - -- if (bitmap_intersect_p (merge_set, test_set) -+ if (bitmap_intersect_p (merge_set_noclobber, test_set) - || bitmap_intersect_p (merge_set, test_live) - || bitmap_intersect_p (test_set, df_get_live_in (merge_bb))) - intersect = true; -@@ -4104,10 +4104,11 @@ - unsigned i; - bitmap_iterator bi; - -- EXECUTE_IF_SET_IN_BITMAP (merge_set, 0, i, bi) -+ EXECUTE_IF_SET_IN_BITMAP (merge_set_noclobber, 0, i, bi) - remove_reg_equal_equiv_notes_for_regno (i); - - BITMAP_FREE (merge_set); -+ BITMAP_FREE (merge_set_noclobber); + 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; } - - reorder_insns (head, end, PREV_INSN (earliest)); -@@ -4128,7 +4129,10 @@ - cancel_changes (0); - fail: - if (merge_set) -- BITMAP_FREE (merge_set); -+ { -+ BITMAP_FREE (merge_set); -+ BITMAP_FREE (merge_set_noclobber); -+ } - return FALSE; - } - -Index: gcc/BASE-VER -=================================================================== ---- gcc/BASE-VER (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/BASE-VER (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -1 +1 @@ --4.5.3 -+4.5.4 -Index: gcc/df.h -=================================================================== ---- gcc/df.h (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/df.h (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -978,6 +978,7 @@ - extern void df_md_add_problem (void); - extern void df_md_simulate_artificial_defs_at_top (basic_block, bitmap); - extern void df_md_simulate_one_insn (basic_block, rtx, bitmap); -+extern void df_simulate_find_noclobber_defs (rtx, bitmap); - extern void df_simulate_find_defs (rtx, bitmap); - extern void df_simulate_defs (rtx, bitmap); - extern void df_simulate_uses (rtx, bitmap); -Index: gcc/c-typeck.c -=================================================================== ---- gcc/c-typeck.c (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/c-typeck.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -9800,7 +9800,7 @@ - warn_for_sign_compare (location, orig_op0_folded, - orig_op1_folded, op0, op1, - result_type, resultcode); -- if (!in_late_binary_op) -+ if (!in_late_binary_op && !int_operands) - { - if (!op0_maybe_const || TREE_CODE (op0) != INTEGER_CST) - op0 = c_wrap_maybe_const (op0, !op0_maybe_const); -Index: gcc/tree-inline.c -=================================================================== ---- gcc/tree-inline.c (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/tree-inline.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -4179,14 +4179,16 @@ - CONSTRUCTOR_ELTS (*tp)); - *tp = new_tree; - } -+ else if (code == STATEMENT_LIST) -+ /* We used to just abort on STATEMENT_LIST, but we can run into them -+ with statement-expressions (c++/40975). */ -+ copy_statement_list (tp); - else if (TREE_CODE_CLASS (code) == tcc_type) - *walk_subtrees = 0; - else if (TREE_CODE_CLASS (code) == tcc_declaration) - *walk_subtrees = 0; - else if (TREE_CODE_CLASS (code) == tcc_constant) - *walk_subtrees = 0; -- else -- gcc_assert (code != STATEMENT_LIST); - return NULL_TREE; - } - -Index: gcc/var-tracking.c + else + { +Index: gcc/fortran/resolve.c =================================================================== ---- gcc/var-tracking.c (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/var-tracking.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -4134,8 +4134,9 @@ - VALUE_RECURSED_INTO (val) = true; - - for (node = var->var_part[0].loc_chain; node; node = node->next) -- if (MEM_P (node->loc) && MEM_EXPR (node->loc) == expr -- && MEM_OFFSET (node->loc) == 0) -+ if (MEM_P (node->loc) -+ && MEM_EXPR (node->loc) == expr -+ && INT_MEM_OFFSET (node->loc) == 0) - { - where = node; - break; -@@ -4198,11 +4199,10 @@ +--- 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) { - for (loc = var->var_part[0].loc_chain; loc; loc = loc->next) - { -- /* We want to remove dying MEMs that doesn't refer to -- DECL. */ -+ /* We want to remove dying MEMs that doesn't refer to DECL. */ - if (GET_CODE (loc->loc) == MEM - && (MEM_EXPR (loc->loc) != decl -- || MEM_OFFSET (loc->loc)) -+ || INT_MEM_OFFSET (loc->loc) != 0) - && !mem_dies_at_call (loc->loc)) - break; - /* We want to move here MEMs that do refer to DECL. */ -@@ -4246,7 +4246,7 @@ - - if (GET_CODE (loc->loc) != MEM - || (MEM_EXPR (loc->loc) == decl -- && MEM_OFFSET (loc->loc) == 0) -+ && INT_MEM_OFFSET (loc->loc) == 0) - || !mem_dies_at_call (loc->loc)) + if ((GENERIC_ID == GFC_ISYM_UBOUND || GENERIC_ID == GFC_ISYM_SIZE) ++ && arg == expr->value.function.actual + && arg->next != NULL && arg->next->expr) { - if (old_loc != loc->loc && emit_notes) -Index: gcc/df-problems.c + if (arg->next->expr->expr_type != EXPR_CONSTANT) +Index: gcc/fortran/target-memory.c =================================================================== ---- gcc/df-problems.c (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/df-problems.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -3748,9 +3748,22 @@ - for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++) - { - df_ref def = *def_rec; -- /* If the def is to only part of the reg, it does -- not kill the other defs that reach here. */ -- if (!(DF_REF_FLAGS (def) & (DF_REF_PARTIAL | DF_REF_CONDITIONAL))) -+ bitmap_set_bit (defs, DF_REF_REGNO (def)); -+ } -+} -+ -+/* Find the set of real DEFs, which are not clobbers, for INSN. */ -+ -+void -+df_simulate_find_noclobber_defs (rtx insn, bitmap defs) -+{ -+ df_ref *def_rec; -+ unsigned int uid = INSN_UID (insn); -+ -+ for (def_rec = DF_INSN_UID_DEFS (uid); *def_rec; def_rec++) -+ { -+ df_ref def = *def_rec; -+ if (!(DF_REF_FLAGS (def) & (DF_REF_MUST_CLOBBER | DF_REF_MAY_CLOBBER))) - bitmap_set_bit (defs, DF_REF_REGNO (def)); - } +--- 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 @@ } -@@ -3903,13 +3916,9 @@ - the block, starting with the first one. - ----------------------------------------------------------------------------*/ - --/* Apply the artificial uses and defs at the top of BB in a forwards -- direction. ??? This is wrong; defs mark the point where a pseudo -- becomes live when scanning forwards (unless a def is unused). Since -- there are no REG_UNUSED notes for artificial defs, passes that -- require artificial defs probably should not call this function -- unless (as is the case for fwprop) they are correct when liveness -- bitmaps are *under*estimated. */ -+/* Initialize the LIVE bitmap, which should be copied from DF_LIVE_IN or -+ DF_LR_IN for basic block BB, for forward scanning by marking artificial -+ defs live. */ - - void - df_simulate_initialize_forwards (basic_block bb, bitmap live) -@@ -3921,7 +3930,7 @@ + + ++/* Return the size of a single element of the given expression. ++ Identical to gfc_target_expr_size for scalars. */ ++ + 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) { - df_ref def = *def_rec; - if (DF_REF_FLAGS (def) & DF_REF_AT_TOP) -- bitmap_clear_bit (live, DF_REF_REGNO (def)); -+ bitmap_set_bit (live, DF_REF_REGNO (def)); + 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; } } -@@ -3942,7 +3951,7 @@ - while here the scan is performed forwards! So, first assume that the - def is live, and if this is not true REG_UNUSED notes will rectify the - situation. */ -- df_simulate_find_defs (insn, live); -+ df_simulate_find_noclobber_defs (insn, live); - /* Clear all of the registers that go dead. */ - for (link = REG_NOTES (insn); link; link = XEXP (link, 1)) -Index: gcc/tree-switch-conversion.c ++/* Return the size of an expression in its target representation. */ ++ ++size_t ++gfc_target_expr_size (gfc_expr *e) ++{ ++ mpz_t tmp; ++ size_t asz; ++ ++ gcc_assert (e != NULL); ++ ++ if (e->rank) ++ { ++ if (gfc_array_size (e, &tmp)) ++ asz = mpz_get_ui (tmp); ++ else ++ asz = 0; ++ } ++ else ++ asz = 1; ++ ++ return asz * gfc_element_size (e); ++} ++ ++ + /* 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/tree-switch-conversion.c (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/tree-switch-conversion.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -549,7 +549,7 @@ - build_arrays (gimple swtch) +--- 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 *); + +-/* 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 *); + + /* 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) { - tree arr_index_type; -- tree tidx, sub, tmp; -+ tree tidx, sub, tmp, utype; - gimple stmt; - gimple_stmt_iterator gsi; - int i; -@@ -557,14 +557,20 @@ - - gsi = gsi_for_stmt (swtch); - -+ /* Make sure we do not generate arithmetics in a subrange. */ -+ utype = TREE_TYPE (info.index_expr); -+ if (TREE_TYPE (utype)) -+ utype = lang_hooks.types.type_for_mode (TYPE_MODE (TREE_TYPE (utype)), 1); -+ else -+ utype = lang_hooks.types.type_for_mode (TYPE_MODE (utype), 1); -+ - arr_index_type = build_index_type (info.range_size); -- tmp = create_tmp_var (TREE_TYPE (info.index_expr), "csti"); -+ tmp = create_tmp_var (utype, "csui"); - add_referenced_var (tmp); - tidx = make_ssa_name (tmp, NULL); -- sub = fold_build2_loc (loc, MINUS_EXPR, -- TREE_TYPE (info.index_expr), info.index_expr, -- fold_convert_loc (loc, TREE_TYPE (info.index_expr), -- info.range_min)); -+ sub = fold_build2_loc (loc, MINUS_EXPR, utype, -+ fold_convert_loc (loc, utype, info.index_expr), -+ fold_convert_loc (loc, utype, info.range_min)); - sub = force_gimple_operand_gsi (&gsi, sub, - false, NULL, true, GSI_SAME_STMT); - stmt = gimple_build_assign (tidx, sub); -@@ -673,12 +679,7 @@ - tree label_decl2 = create_artificial_label (UNKNOWN_LOCATION); - tree label_decl3 = create_artificial_label (UNKNOWN_LOCATION); - gimple label1, label2, label3; + size_t result_elt_size; +- mpz_t tmp; +- gfc_expr *mold_element; + + 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; - -- tree utype; -- tree tmp_u_1, tmp_u_2, tmp_u_var; -- tree cast; -- gimple cast_assign, minus_assign; -- tree ulb, minus; -+ tree utype, tidx; - tree bound; - - gimple cond_stmt; -@@ -692,49 +693,24 @@ - gcc_assert (info.default_values); - bb0 = gimple_bb (swtch); - -- /* Make sure we do not generate arithmetics in a subrange. */ -- if (TREE_TYPE (TREE_TYPE (info.index_expr))) -- utype = lang_hooks.types.type_for_mode -- (TYPE_MODE (TREE_TYPE (TREE_TYPE (info.index_expr))), 1); -- else -- utype = lang_hooks.types.type_for_mode -- (TYPE_MODE (TREE_TYPE (info.index_expr)), 1); -+ tidx = gimple_assign_lhs (info.arr_ref_first); -+ utype = TREE_TYPE (tidx); - - /* (end of) block 0 */ - gsi = gsi_for_stmt (info.arr_ref_first); -- tmp_u_var = create_tmp_var (utype, "csui"); -- add_referenced_var (tmp_u_var); -- tmp_u_1 = make_ssa_name (tmp_u_var, NULL); -+ gsi_next (&gsi); - -- cast = fold_convert_loc (loc, utype, info.index_expr); -- cast_assign = gimple_build_assign (tmp_u_1, cast); -- SSA_NAME_DEF_STMT (tmp_u_1) = cast_assign; -- gsi_insert_before (&gsi, cast_assign, GSI_SAME_STMT); -- update_stmt (cast_assign); -- -- ulb = fold_convert_loc (loc, utype, info.range_min); -- minus = fold_build2_loc (loc, MINUS_EXPR, utype, tmp_u_1, ulb); -- minus = force_gimple_operand_gsi (&gsi, minus, false, NULL, true, -- GSI_SAME_STMT); -- tmp_u_2 = make_ssa_name (tmp_u_var, NULL); -- minus_assign = gimple_build_assign (tmp_u_2, minus); -- SSA_NAME_DEF_STMT (tmp_u_2) = minus_assign; -- gsi_insert_before (&gsi, minus_assign, GSI_SAME_STMT); -- update_stmt (minus_assign); + *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; - - bound = fold_convert_loc (loc, utype, info.range_size); -- cond_stmt = gimple_build_cond (LE_EXPR, tmp_u_2, bound, NULL_TREE, NULL_TREE); -+ cond_stmt = gimple_build_cond (LE_EXPR, tidx, bound, NULL_TREE, NULL_TREE); - gsi_insert_before (&gsi, cond_stmt, GSI_SAME_STMT); - update_stmt (cond_stmt); - - /* block 2 */ -- gsi = gsi_for_stmt (info.arr_ref_first); - label2 = gimple_build_label (label_decl2); - gsi_insert_before (&gsi, label2, GSI_SAME_STMT); - last_assign = gen_def_assigns (&gsi); - - /* block 1 */ -- gsi = gsi_for_stmt (info.arr_ref_first); - label1 = gimple_build_label (label_decl1); - gsi_insert_before (&gsi, label1, GSI_SAME_STMT); + /* 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/config/i386/i386.md +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/config/i386/i386.md (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/config/i386/i386.md (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -2430,7 +2430,7 @@ - [(set_attr "type" "*,*,mmx,mmxmov,mmxmov,sselog1,ssemov,ssemov,ssemov,sselog1,ssemov,ssemov,ssemov") - (set (attr "prefix") - (if_then_else (eq_attr "alternative" "5,6,7,8") -- (const_string "vex") -+ (const_string "maybe_vex") - (const_string "orig"))) - (set_attr "mode" "DI,DI,DI,DI,DI,TI,DI,TI,DI,V4SF,V2SF,V4SF,V2SF")]) - -@@ -2468,21 +2468,15 @@ - return "movdq2q\t{%1, %0|%0, %1}"; - - case TYPE_SSEMOV: -- if (TARGET_AVX) +--- 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); + ++ + /* 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); + +- 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) - { -- if (get_attr_mode (insn) == MODE_TI) -- return "vmovdqa\t{%1, %0|%0, %1}"; -- else -- return "vmovq\t{%1, %0|%0, %1}"; +- mpz_set (e->value.integer, shape[n]); +- mpz_clear (shape[n]); - } -- - if (get_attr_mode (insn) == MODE_TI) -- return "movdqa\t{%1, %0|%0, %1}"; -- /* FALLTHRU */ -+ return "%vmovdqa\t{%1, %0|%0, %1}"; -+ /* Handle broken assemblers that require movd instead of movq. */ -+ if (GENERAL_REG_P (operands[0]) || GENERAL_REG_P (operands[1])) -+ return "%vmovd\t{%1, %0|%0, %1}"; -+ return "%vmovq\t{%1, %0|%0, %1}"; - - case TYPE_MMXMOV: -- /* Moves from and into integer register is done using movd -- opcode with REX prefix. */ -+ /* Handle broken assemblers that require movd instead of movq. */ - if (GENERAL_REG_P (operands[0]) || GENERAL_REG_P (operands[1])) - return "movd\t{%1, %0|%0, %1}"; - return "movq\t{%1, %0|%0, %1}"; -@@ -2915,12 +2909,13 @@ - - case 9: case 10: case 14: case 15: - return "movd\t{%1, %0|%0, %1}"; -- case 12: case 13: -- return "%vmovd\t{%1, %0|%0, %1}"; - - case 11: - return "movq\t{%1, %0|%0, %1}"; - -+ case 12: case 13: -+ return "%vmovd\t{%1, %0|%0, %1}"; ++ 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; ++ } + - default: - gcc_unreachable (); + gfc_constructor_append_expr (&result->value.constructor, e, NULL); } -@@ -3067,6 +3062,7 @@ - case 3: - case 4: - return "#"; + ++ if (t) ++ gfc_clear_shape (shape, source->rank); + - case 5: - switch (get_attr_mode (insn)) - { -@@ -3262,7 +3258,8 @@ + return result; + } - case 9: - case 10: -- return "%vmovd\t{%1, %0|%0, %1}"; -+ /* Handle broken assemblers that require movd instead of movq. */ -+ return "%vmovd\t{%1, %0|%0, %1}"; - default: - gcc_unreachable(); -@@ -3361,11 +3358,11 @@ - switch (get_attr_mode (insn)) - { - case MODE_V4SF: -- return "xorps\t%0, %0"; -+ return "%vxorps\t%0, %d0"; - case MODE_V2DF: -- return "xorpd\t%0, %0"; -+ return "%vxorpd\t%0, %d0"; - case MODE_TI: -- return "pxor\t%0, %0"; -+ return "%vpxor\t%0, %d0"; - default: - gcc_unreachable (); - } -@@ -3375,28 +3372,56 @@ - switch (get_attr_mode (insn)) - { - case MODE_V4SF: -- return "movaps\t{%1, %0|%0, %1}"; -+ return "%vmovaps\t{%1, %0|%0, %1}"; - case MODE_V2DF: -- return "movapd\t{%1, %0|%0, %1}"; -+ return "%vmovapd\t{%1, %0|%0, %1}"; - case MODE_TI: -- return "movdqa\t{%1, %0|%0, %1}"; -+ return "%vmovdqa\t{%1, %0|%0, %1}"; - case MODE_DI: -- return "movq\t{%1, %0|%0, %1}"; -+ return "%vmovq\t{%1, %0|%0, %1}"; - case MODE_DF: -- return "movsd\t{%1, %0|%0, %1}"; -+ if (TARGET_AVX) -+ { -+ if (REG_P (operands[0]) && REG_P (operands[1])) -+ return "vmovsd\t{%1, %0, %0|%0, %0, %1}"; -+ else -+ return "vmovsd\t{%1, %0|%0, %1}"; -+ } -+ else -+ return "movsd\t{%1, %0|%0, %1}"; - case MODE_V1DF: -- return "movlpd\t{%1, %0|%0, %1}"; -+ if (TARGET_AVX) -+ { -+ if (REG_P (operands[0])) -+ return "vmovlpd\t{%1, %0, %0|%0, %0, %1}"; -+ else -+ return "vmovlpd\t{%1, %0|%0, %1}"; -+ } -+ else -+ return "movlpd\t{%1, %0|%0, %1}"; - case MODE_V2SF: -- return "movlps\t{%1, %0|%0, %1}"; -+ if (TARGET_AVX) -+ { -+ if (REG_P (operands[0])) -+ return "vmovlps\t{%1, %0, %0|%0, %0, %1}"; -+ else -+ return "vmovlps\t{%1, %0|%0, %1}"; -+ } -+ else -+ return "movlps\t{%1, %0|%0, %1}"; - default: - gcc_unreachable (); +-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 @@ } - default: -- gcc_unreachable(); -+ gcc_unreachable (); + /* 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; } + +@@ -5598,13 +5606,32 @@ + return NULL; + } + +- 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); ++ + return return_value; } - [(set_attr "type" "fmov,fmov,fmov,multi,multi,sselog1,ssemov,ssemov,ssemov") -+ (set (attr "prefix") -+ (if_then_else (eq_attr "alternative" "0,1,2,3,4") -+ (const_string "orig") -+ (const_string "maybe_vex"))) - (set (attr "prefix_data16") - (if_then_else (eq_attr "mode" "V1DF") - (const_string "1") -Index: gcc/config/i386/mmx.md -=================================================================== ---- gcc/config/i386/mmx.md (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/config/i386/mmx.md (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -63,6 +63,7 @@ - DONE; - }) -+;; movd instead of movq is required to handle broken assemblers. - (define_insn "*mov_internal_rex64" - [(set (match_operand:MMXMODEI8 0 "nonimmediate_operand" - "=rm,r,!?y,!?y ,m ,!y,*Y2,x,x ,m,r,Yi") -@@ -81,8 +82,8 @@ - %vpxor\t%0, %d0 - %vmovq\t{%1, %0|%0, %1} - %vmovq\t{%1, %0|%0, %1} -- %vmovq\t{%1, %0|%0, %1} -- %vmovq\t{%1, %0|%0, %1}" -+ %vmovd\t{%1, %0|%0, %1} -+ %vmovd\t{%1, %0|%0, %1}" - [(set_attr "type" "imov,imov,mmx,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,ssemov,ssemov") - (set_attr "unit" "*,*,*,*,*,mmx,mmx,*,*,*,*,*") - (set_attr "prefix_rep" "*,*,*,*,*,1,1,*,1,*,*,*") -@@ -192,6 +193,7 @@ - (const_string "orig"))) - (set_attr "mode" "DI,DI,DI,DI,DI,DI,DI,V4SF,V4SF,V2SF,V2SF,DI,DI")]) - -+;; movd instead of movq is required to handle broken assemblers. - (define_insn "*movv2sf_internal_rex64" - [(set (match_operand:V2SF 0 "nonimmediate_operand" - "=rm,r ,!?y,!?y ,m ,!y,*Y2,x,x,x,m,r,Yi") -Index: gcc/config/i386/sse.md -=================================================================== ---- gcc/config/i386/sse.md (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/config/i386/sse.md (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -7473,9 +7473,8 @@ - "@ - # - # -- %vmov{q}\t{%1, %0|%0, %1}" -+ mov{q}\t{%1, %0|%0, %1}" - [(set_attr "type" "*,*,imov") -- (set_attr "prefix" "*,*,maybe_vex") - (set_attr "mode" "*,*,DI")]) - - (define_insn "*sse2_storeq" -@@ -7513,11 +7512,11 @@ - vmovhps\t{%1, %0|%0, %1} - vpsrldq\t{$8, %1, %0|%0, %1, 8} - vmovq\t{%H1, %0|%0, %H1} -- vmov{q}\t{%H1, %0|%0, %H1}" -+ mov{q}\t{%H1, %0|%0, %H1}" - [(set_attr "type" "ssemov,sseishft1,ssemov,imov") - (set_attr "length_immediate" "*,1,*,*") - (set_attr "memory" "*,none,*,*") -- (set_attr "prefix" "vex") -+ (set_attr "prefix" "vex,vex,vex,orig") - (set_attr "mode" "V2SF,TI,TI,DI")]) - - (define_insn "*vec_extractv2di_1_rex64" -@@ -7795,6 +7794,7 @@ - (const_string "vex"))) - (set_attr "mode" "TI,TI,TI,TI,TI,V2SF")]) - -+;; movd instead of movq is required to handle broken assemblers. - (define_insn "*vec_concatv2di_rex64_sse4_1" - [(set (match_operand:V2DI 0 "register_operand" "=x ,x ,Yi,!x,x,x,x") - (vec_concat:V2DI -@@ -7804,7 +7804,7 @@ - "@ - pinsrq\t{$0x1, %2, %0|%0, %2, 0x1} - movq\t{%1, %0|%0, %1} -- movq\t{%1, %0|%0, %1} -+ movd\t{%1, %0|%0, %1} - movq2dq\t{%1, %0|%0, %1} - punpcklqdq\t{%2, %0|%0, %2} - movlhps\t{%2, %0|%0, %2} -@@ -7815,6 +7815,7 @@ - (set_attr "length_immediate" "1,*,*,*,*,*,*") - (set_attr "mode" "TI,TI,TI,TI,TI,V4SF,V2SF")]) - -+;; movd instead of movq is required to handle broken assemblers. - (define_insn "*vec_concatv2di_rex64_sse" - [(set (match_operand:V2DI 0 "register_operand" "=Y2 ,Yi,!Y2,Y2,x,x") - (vec_concat:V2DI -@@ -7823,7 +7824,7 @@ - "TARGET_64BIT && TARGET_SSE" - "@ - movq\t{%1, %0|%0, %1} -- movq\t{%1, %0|%0, %1} -+ movd\t{%1, %0|%0, %1} - movq2dq\t{%1, %0|%0, %1} - punpcklqdq\t{%2, %0|%0, %2} - movlhps\t{%2, %0|%0, %2} -Index: gcc/config/i386/i386.c -=================================================================== ---- gcc/config/i386/i386.c (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/config/i386/i386.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -14610,11 +14610,15 @@ - if (req_mode == CCZmode) - return 0; - /* FALLTHRU */ -+ case CCZmode: -+ break; -+ - case CCAmode: - case CCCmode: - case CCOmode: - case CCSmode: -- case CCZmode: -+ if (set_mode != req_mode) -+ return 0; - break; - default: -@@ -27711,10 +27715,19 @@ - break; - - case V2DImode: -- use_vec_merge = TARGET_SSE4_1; -+ use_vec_merge = TARGET_SSE4_1 && TARGET_64BIT; - if (use_vec_merge) - break; - -+ tmp = gen_reg_rtx (GET_MODE_INNER (mode)); -+ ix86_expand_vector_extract (false, tmp, target, 1 - elt); -+ if (elt == 0) -+ tmp = gen_rtx_VEC_CONCAT (mode, tmp, val); -+ else -+ tmp = gen_rtx_VEC_CONCAT (mode, val, tmp); -+ emit_insn (gen_rtx_SET (VOIDmode, target, tmp)); -+ return; + 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; + - case V2DFmode: ++ return range_check (result, "SIZE"); ++} ++ ++ ++gfc_expr * + gfc_simplify_sign (gfc_expr *x, gfc_expr *y) + { + gfc_expr *result; +Index: gcc/cfgexpand.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++) { - rtx op0, op1; -Index: gcc/config/rs6000/rs6000.c +Index: gcc/sched-deps.c =================================================================== ---- gcc/config/rs6000/rs6000.c (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/config/rs6000/rs6000.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -5426,10 +5426,11 @@ +--- 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) + { +- rtx list, next; ++ add_dependence_list (insn, *listp, uncond, dep_type); + + /* 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)) +- { +- add_dependence_list (insn, *listp, uncond, dep_type); +- return; +- } ++ return; - if (model == TLS_MODEL_GLOBAL_DYNAMIC) - { -- r3 = gen_rtx_REG (Pmode, 3); - tga = rs6000_tls_get_addr (); -- emit_library_call_value (tga, dest, LCT_CONST, Pmode, 1, r3, Pmode); -+ emit_library_call_value (tga, dest, LCT_CONST, Pmode, -+ 1, const0_rtx, Pmode); - -+ r3 = gen_rtx_REG (Pmode, 3); - if (DEFAULT_ABI == ABI_AIX && TARGET_64BIT) - insn = gen_tls_gd_aix64 (r3, got, addr, tga, const0_rtx); - else if (DEFAULT_ABI == ABI_AIX && !TARGET_64BIT) -@@ -5446,11 +5447,12 @@ - } - else if (model == TLS_MODEL_LOCAL_DYNAMIC) - { -- r3 = gen_rtx_REG (Pmode, 3); - tga = rs6000_tls_get_addr (); - tmp1 = gen_reg_rtx (Pmode); -- emit_library_call_value (tga, tmp1, LCT_CONST, Pmode, 1, r3, Pmode); -+ emit_library_call_value (tga, tmp1, LCT_CONST, Pmode, -+ 1, const0_rtx, Pmode); - -+ r3 = gen_rtx_REG (Pmode, 3); - if (DEFAULT_ABI == ABI_AIX && TARGET_64BIT) - insn = gen_tls_ld_aix64 (r3, got, tga, const0_rtx); - else if (DEFAULT_ABI == ABI_AIX && !TARGET_64BIT) -@@ -6694,7 +6696,7 @@ - - /* Nonzero if we can use an AltiVec register to pass this arg. */ - #define USE_ALTIVEC_FOR_ARG_P(CUM,MODE,TYPE,NAMED) \ -- ((ALTIVEC_VECTOR_MODE (MODE) || VSX_VECTOR_MODE (MODE)) \ -+ (ALTIVEC_OR_VSX_VECTOR_MODE (MODE) \ - && (CUM)->vregno <= ALTIVEC_ARG_MAX_REG \ - && TARGET_ALTIVEC_ABI \ - && (NAMED)) -@@ -6920,7 +6922,7 @@ - existing library interfaces. - - Doubleword align SPE vectors. -- Quadword align Altivec vectors. -+ Quadword align Altivec/VSX vectors. - Quadword align large synthetic vector types. */ - - int -@@ -6937,7 +6939,7 @@ - && int_size_in_bytes (type) >= 8 - && int_size_in_bytes (type) < 16)) - return 64; -- else if ((ALTIVEC_VECTOR_MODE (mode) || VSX_VECTOR_MODE (mode)) -+ else if (ALTIVEC_OR_VSX_VECTOR_MODE (mode) - || (type && TREE_CODE (type) == VECTOR_TYPE - && int_size_in_bytes (type) >= 16)) - return 128; -@@ -7082,8 +7084,7 @@ - cum->nargs_prototype--; - - if (TARGET_ALTIVEC_ABI -- && (ALTIVEC_VECTOR_MODE (mode) -- || VSX_VECTOR_MODE (mode) -+ && (ALTIVEC_OR_VSX_VECTOR_MODE (mode) - || (type && TREE_CODE (type) == VECTOR_TYPE - && int_size_in_bytes (type) == 16))) - { -@@ -7677,8 +7678,7 @@ - else - return gen_rtx_REG (mode, cum->vregno); - else if (TARGET_ALTIVEC_ABI -- && (ALTIVEC_VECTOR_MODE (mode) -- || VSX_VECTOR_MODE (mode) -+ && (ALTIVEC_OR_VSX_VECTOR_MODE (mode) - || (type && TREE_CODE (type) == VECTOR_TYPE - && int_size_in_bytes (type) == 16))) +- 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); + } + + /* 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) { -@@ -18280,7 +18280,7 @@ - - /* Some cases that need register indexed addressing. */ - if ((TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (mode)) -- || (TARGET_VSX && VSX_VECTOR_MODE (mode)) -+ || (TARGET_VSX && ALTIVEC_OR_VSX_VECTOR_MODE (mode)) - || (TARGET_E500_DOUBLE && mode == DFmode) - || (TARGET_SPE_ABI - && SPE_VECTOR_MODE (mode) -@@ -25565,14 +25565,13 @@ - else if (TREE_CODE (valtype) == COMPLEX_TYPE - && targetm.calls.split_complex_arg) - return rs6000_complex_function_value (mode); -+ /* VSX is a superset of Altivec and adds V2DImode/V2DFmode. Since the same -+ return register is used in both cases, and we won't see V2DImode/V2DFmode -+ for pure altivec, combine the two cases. */ - else if (TREE_CODE (valtype) == VECTOR_TYPE - && TARGET_ALTIVEC && TARGET_ALTIVEC_ABI -- && ALTIVEC_VECTOR_MODE (mode)) -+ && ALTIVEC_OR_VSX_VECTOR_MODE (mode)) - regno = ALTIVEC_ARG_RETURN; -- else if (TREE_CODE (valtype) == VECTOR_TYPE -- && TARGET_VSX && TARGET_ALTIVEC_ABI -- && VSX_VECTOR_MODE (mode)) -- regno = ALTIVEC_ARG_RETURN; - else if (TARGET_E500_DOUBLE && TARGET_HARD_FLOAT - && (mode == DFmode || mode == DCmode - || mode == TFmode || mode == TCmode)) -@@ -25611,12 +25610,12 @@ - && TARGET_HARD_FLOAT && TARGET_FPRS - && ((TARGET_SINGLE_FLOAT && mode == SFmode) || TARGET_DOUBLE_FLOAT)) - regno = FP_ARG_RETURN; -- else if (ALTIVEC_VECTOR_MODE (mode) -+ /* VSX is a superset of Altivec and adds V2DImode/V2DFmode. Since the same -+ return register is used in both cases, and we won't see V2DImode/V2DFmode -+ for pure altivec, combine the two cases. */ -+ else if (ALTIVEC_OR_VSX_VECTOR_MODE (mode) - && TARGET_ALTIVEC && TARGET_ALTIVEC_ABI) - regno = ALTIVEC_ARG_RETURN; -- else if (VSX_VECTOR_MODE (mode) -- && TARGET_VSX && TARGET_ALTIVEC_ABI) -- regno = ALTIVEC_ARG_RETURN; - else if (COMPLEX_MODE_P (mode) && targetm.calls.split_complex_arg) - return rs6000_complex_function_value (mode); - else if (TARGET_E500_DOUBLE && TARGET_HARD_FLOAT - -Zmiany atrybutów dla: gcc/config/rs6000/rs6000.c -___________________________________________________________________ -Dodane: svn:mergeinfo - Połączono zmiany /trunk/gcc/config/rs6000/rs6000.c:r162404,173624 - -Index: gcc/config/rs6000/rs6000.h + 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/rs6000.h (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/config/rs6000/rs6000.h (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -1038,10 +1038,9 @@ - - /* When setting up caller-save slots (MODE == VOIDmode) ensure we allocate - enough space to account for vectors in FP regs. */ --#define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE) \ -- (TARGET_VSX \ -- && ((MODE) == VOIDmode || VSX_VECTOR_MODE (MODE) \ -- || ALTIVEC_VECTOR_MODE (MODE)) \ -+#define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE) \ -+ (TARGET_VSX \ -+ && ((MODE) == VOIDmode || ALTIVEC_OR_VSX_VECTOR_MODE (MODE)) \ - && FP_REGNO_P (REGNO) \ - ? V2DFmode \ - : choose_hard_reg_mode ((REGNO), (NREGS), false)) -@@ -1057,25 +1056,16 @@ - ((MODE) == V4SFmode \ - || (MODE) == V2DFmode) \ - --#define VSX_SCALAR_MODE(MODE) \ -- ((MODE) == DFmode) -- --#define VSX_MODE(MODE) \ -- (VSX_VECTOR_MODE (MODE) \ -- || VSX_SCALAR_MODE (MODE)) -- --#define VSX_MOVE_MODE(MODE) \ -- (VSX_VECTOR_MODE (MODE) \ -- || VSX_SCALAR_MODE (MODE) \ -- || ALTIVEC_VECTOR_MODE (MODE) \ -- || (MODE) == TImode) -- - #define ALTIVEC_VECTOR_MODE(MODE) \ - ((MODE) == V16QImode \ - || (MODE) == V8HImode \ - || (MODE) == V4SFmode \ - || (MODE) == V4SImode) - -+#define ALTIVEC_OR_VSX_VECTOR_MODE(MODE) \ -+ (ALTIVEC_VECTOR_MODE (MODE) || VSX_VECTOR_MODE (MODE) \ -+ || (MODE) == V2DImode) -+ - #define SPE_VECTOR_MODE(MODE) \ - ((MODE) == V4HImode \ - || (MODE) == V2SFmode \ -@@ -1118,10 +1108,10 @@ - ? ALTIVEC_VECTOR_MODE (MODE2) \ - : ALTIVEC_VECTOR_MODE (MODE2) \ - ? ALTIVEC_VECTOR_MODE (MODE1) \ -- : VSX_VECTOR_MODE (MODE1) \ -- ? VSX_VECTOR_MODE (MODE2) \ -- : VSX_VECTOR_MODE (MODE2) \ -- ? VSX_VECTOR_MODE (MODE1) \ -+ : ALTIVEC_OR_VSX_VECTOR_MODE (MODE1) \ -+ ? ALTIVEC_OR_VSX_VECTOR_MODE (MODE2) \ -+ : ALTIVEC_OR_VSX_VECTOR_MODE (MODE2) \ -+ ? ALTIVEC_OR_VSX_VECTOR_MODE (MODE1) \ - : 1) - - /* Post-reload, we can't use any new AltiVec registers, as we already - -Zmiany atrybutów dla: gcc/config/rs6000/rs6000.h -___________________________________________________________________ -Dodane: svn:mergeinfo - Połączono zmiany /trunk/gcc/config/rs6000/rs6000.h:r162404,173624 - -Index: gcc/config/arm/arm.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/arm/arm.c (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/config/arm/arm.c (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -18237,7 +18237,7 @@ - rtx tmp1 = gen_reg_rtx (mode); - rtx tmp2 = gen_reg_rtx (mode); - -- emit_insn (intfn (tmp1, op1, tmp2, op2)); -+ emit_insn (intfn (tmp1, op1, op2, tmp2)); - - emit_move_insn (mem, tmp1); - mem = adjust_address (mem, mode, GET_MODE_SIZE (mode)); -Index: gcc/config/arm/neon.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/arm/neon.md (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/config/arm/neon.md (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -680,7 +680,7 @@ - (match_operand:SI 2 "immediate_operand" "i")))] - "TARGET_NEON" +--- 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" { -- int elt = ffs ((int) INTVAL (operands[2]) - 1); -+ int elt = ffs ((int) INTVAL (operands[2])) - 1; - if (BYTES_BIG_ENDIAN) - elt = GET_MODE_NUNITS (mode) - 1 - elt; - operands[2] = GEN_INT (elt); -@@ -3895,13 +3895,14 @@ - - (define_insn "neon_vtrn_internal" - [(set (match_operand:VDQW 0 "s_register_operand" "=w") -- (unspec:VDQW [(match_operand:VDQW 1 "s_register_operand" "0")] -- UNSPEC_VTRN1)) -- (set (match_operand:VDQW 2 "s_register_operand" "=w") -- (unspec:VDQW [(match_operand:VDQW 3 "s_register_operand" "2")] -- UNSPEC_VTRN2))] -+ (unspec:VDQW [(match_operand:VDQW 1 "s_register_operand" "0") -+ (match_operand:VDQW 2 "s_register_operand" "w")] -+ UNSPEC_VTRN1)) -+ (set (match_operand:VDQW 3 "s_register_operand" "=2") -+ (unspec:VDQW [(match_dup 1) (match_dup 2)] -+ UNSPEC_VTRN2))] - "TARGET_NEON" -- "vtrn.\t%0, %2" -+ "vtrn.\t%0, %3" - [(set (attr "neon_type") - (if_then_else (ne (symbol_ref "") (const_int 0)) - (const_string "neon_bp_simple") -@@ -3921,13 +3922,14 @@ - - (define_insn "neon_vzip_internal" - [(set (match_operand:VDQW 0 "s_register_operand" "=w") -- (unspec:VDQW [(match_operand:VDQW 1 "s_register_operand" "0")] -- UNSPEC_VZIP1)) -- (set (match_operand:VDQW 2 "s_register_operand" "=w") -- (unspec:VDQW [(match_operand:VDQW 3 "s_register_operand" "2")] -- UNSPEC_VZIP2))] -+ (unspec:VDQW [(match_operand:VDQW 1 "s_register_operand" "0") -+ (match_operand:VDQW 2 "s_register_operand" "w")] -+ UNSPEC_VZIP1)) -+ (set (match_operand:VDQW 3 "s_register_operand" "=2") -+ (unspec:VDQW [(match_dup 1) (match_dup 2)] -+ UNSPEC_VZIP2))] - "TARGET_NEON" -- "vzip.\t%0, %2" -+ "vzip.\t%0, %3" - [(set (attr "neon_type") - (if_then_else (ne (symbol_ref "") (const_int 0)) - (const_string "neon_bp_simple") -@@ -3947,13 +3949,14 @@ - - (define_insn "neon_vuzp_internal" - [(set (match_operand:VDQW 0 "s_register_operand" "=w") -- (unspec:VDQW [(match_operand:VDQW 1 "s_register_operand" "0")] -+ (unspec:VDQW [(match_operand:VDQW 1 "s_register_operand" "0") -+ (match_operand:VDQW 2 "s_register_operand" "w")] - UNSPEC_VUZP1)) -- (set (match_operand:VDQW 2 "s_register_operand" "=w") -- (unspec:VDQW [(match_operand:VDQW 3 "s_register_operand" "2")] -- UNSPEC_VUZP2))] -+ (set (match_operand:VDQW 3 "s_register_operand" "=2") -+ (unspec:VDQW [(match_dup 1) (match_dup 2)] -+ UNSPEC_VUZP2))] - "TARGET_NEON" -- "vuzp.\t%0, %2" -+ "vuzp.\t%0, %3" - [(set (attr "neon_type") - (if_then_else (ne (symbol_ref "") (const_int 0)) - (const_string "neon_bp_simple") -Index: gcc/config/pa/predicates.md +- 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}\"; + } + [(set_attr "type" "sseishft") +Index: gcc/config/i386/i386.c =================================================================== ---- gcc/config/pa/predicates.md (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/config/pa/predicates.md (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -411,12 +411,16 @@ - - ;; True iff depi can be used to compute (reg | OP). +--- 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)); + } --(define_predicate "ior_operand" -- (match_code "const_int") --{ -- return (GET_CODE (op) == CONST_INT && ior_mask_p (INTVAL (op))); --}) -+(define_predicate "cint_ior_operand" -+ (and (match_code "const_int") -+ (match_test "ior_mask_p (INTVAL (op))"))) - -+;; True iff OP can be used to compute (reg | OP). -+ -+(define_predicate "reg_or_cint_ior_operand" -+ (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. -Index: gcc/config/pa/pa.md +Index: gcc/config/sh/sh.md =================================================================== ---- gcc/config/pa/pa.md (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ gcc/config/pa/pa.md (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -5686,7 +5686,7 @@ - (define_expand "iordi3" - [(set (match_operand:DI 0 "register_operand" "") - (ior:DI (match_operand:DI 1 "register_operand" "") -- (match_operand:DI 2 "ior_operand" "")))] -+ (match_operand:DI 2 "reg_or_cint_ior_operand" "")))] - "" - " - { -@@ -5707,7 +5707,7 @@ - (define_insn "" - [(set (match_operand:DI 0 "register_operand" "=r,r") - (ior:DI (match_operand:DI 1 "register_operand" "0,0") -- (match_operand:DI 2 "ior_operand" "M,i")))] -+ (match_operand:DI 2 "cint_ior_operand" "M,i")))] - "TARGET_64BIT" - "* return output_64bit_ior (operands); " - [(set_attr "type" "binary,shift") -@@ -5726,19 +5726,14 @@ - (define_expand "iorsi3" - [(set (match_operand:SI 0 "register_operand" "") - (ior:SI (match_operand:SI 1 "register_operand" "") -- (match_operand:SI 2 "arith32_operand" "")))] -+ (match_operand:SI 2 "reg_or_cint_ior_operand" "")))] - "" -- " --{ -- if (! (ior_operand (operands[2], SImode) -- || register_operand (operands[2], SImode))) -- operands[2] = force_reg (SImode, operands[2]); --}") -+ "") - - (define_insn "" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (ior:SI (match_operand:SI 1 "register_operand" "0,0") -- (match_operand:SI 2 "ior_operand" "M,i")))] -+ (match_operand:SI 2 "cint_ior_operand" "M,i")))] - "" - "* return output_ior (operands); " - [(set_attr "type" "binary,shift") -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_5_3_release) (wersja 173771) -+++ gcc/config/pa/pa-protos.h (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -79,7 +79,6 @@ - extern int prefetch_cc_operand (rtx, enum machine_mode); - extern int prefetch_nocc_operand (rtx, enum machine_mode); - extern int and_operand (rtx, enum machine_mode); --extern int ior_operand (rtx, enum machine_mode); - extern int arith32_operand (rtx, enum machine_mode); - extern int uint32_operand (rtx, enum machine_mode); - extern int reg_before_reload_operand (rtx, enum machine_mode); -@@ -94,7 +93,6 @@ - extern int fmpyaddoperands (rtx *); - extern int fmpysuboperands (rtx *); - extern int call_operand_address (rtx, enum machine_mode); --extern int ior_operand (rtx, enum machine_mode); - extern void emit_bcond_fp (rtx[]); - extern int emit_move_sequence (rtx *, enum machine_mode, rtx); - extern int emit_hpdiv_const (rtx *, int); -Index: libffi/src/alpha/osf.S +--- 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 =================================================================== ---- libffi/src/alpha/osf.S (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ libffi/src/alpha/osf.S (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -1,5 +1,5 @@ - /* ----------------------------------------------------------------------- -- osf.S - Copyright (c) 1998, 2001, 2007, 2008 Red Hat -+ osf.S - Copyright (c) 1998, 2001, 2007, 2008, 2011 Red Hat - - Alpha/OSF Foreign Function Interface - -@@ -299,33 +299,51 @@ - #endif - - #ifdef __ELF__ -+# define UA_SI .4byte -+# define FDE_ENCODING 0x1b /* pcrel sdata4 */ -+# define FDE_ENCODE(X) .4byte X-. -+# define FDE_ARANGE(X) .4byte X -+#elif defined __osf__ -+# define UA_SI .align 0; .long -+# define FDE_ENCODING 0x50 /* aligned absolute */ -+# define FDE_ENCODE(X) .align 3; .quad X -+# define FDE_ARANGE(X) .align 0; .quad X -+#endif -+ -+#ifdef __ELF__ - .section .eh_frame,EH_FRAME_FLAGS,@progbits -+#elif defined __osf__ -+ .data -+ .align 3 -+ .globl _GLOBAL__F_ffi_call_osf -+_GLOBAL__F_ffi_call_osf: -+#endif - __FRAME_BEGIN__: -- .4byte $LECIE1-$LSCIE1 # Length of Common Information Entry -+ UA_SI $LECIE1-$LSCIE1 # Length of Common Information Entry - $LSCIE1: -- .4byte 0x0 # CIE Identifier Tag -+ UA_SI 0x0 # CIE Identifier Tag - .byte 0x1 # CIE Version - .ascii "zR\0" # CIE Augmentation - .byte 0x1 # uleb128 0x1; CIE Code Alignment Factor - .byte 0x78 # sleb128 -8; CIE Data Alignment Factor - .byte 26 # CIE RA Column - .byte 0x1 # uleb128 0x1; Augmentation size -- .byte 0x1b # FDE Encoding (pcrel sdata4) -+ .byte FDE_ENCODING # FDE Encoding - .byte 0xc # DW_CFA_def_cfa - .byte 30 # uleb128 column 30 - .byte 0 # uleb128 offset 0 - .align 3 - $LECIE1: - $LSFDE1: -- .4byte $LEFDE1-$LASFDE1 # FDE Length -+ UA_SI $LEFDE1-$LASFDE1 # FDE Length - $LASFDE1: -- .4byte $LASFDE1-__FRAME_BEGIN__ # FDE CIE offset -- .4byte $LFB1-. # FDE initial location -- .4byte $LFE1-$LFB1 # FDE address range -+ UA_SI $LASFDE1-__FRAME_BEGIN__ # FDE CIE offset -+ FDE_ENCODE($LFB1) # FDE initial location -+ FDE_ARANGE($LFE1-$LFB1) # FDE address range - .byte 0x0 # uleb128 0x0; Augmentation size - - .byte 0x4 # DW_CFA_advance_loc4 -- .4byte $LCFI1-$LFB1 -+ UA_SI $LCFI1-$LFB1 - .byte 0x9a # DW_CFA_offset, column 26 - .byte 4 # uleb128 4*-8 - .byte 0x8f # DW_CFA_offset, column 15 -@@ -335,32 +353,35 @@ - .byte 32 # uleb128 offset 32 - - .byte 0x4 # DW_CFA_advance_loc4 -- .4byte $LCFI2-$LCFI1 -+ UA_SI $LCFI2-$LCFI1 - .byte 0xda # DW_CFA_restore, column 26 - .align 3 - $LEFDE1: - - $LSFDE3: -- .4byte $LEFDE3-$LASFDE3 # FDE Length -+ UA_SI $LEFDE3-$LASFDE3 # FDE Length - $LASFDE3: -- .4byte $LASFDE3-__FRAME_BEGIN__ # FDE CIE offset -- .4byte $LFB2-. # FDE initial location -- .4byte $LFE2-$LFB2 # FDE address range -+ UA_SI $LASFDE3-__FRAME_BEGIN__ # FDE CIE offset -+ FDE_ENCODE($LFB2) # FDE initial location -+ FDE_ARANGE($LFE2-$LFB2) # FDE address range - .byte 0x0 # uleb128 0x0; Augmentation size - - .byte 0x4 # DW_CFA_advance_loc4 -- .4byte $LCFI5-$LFB2 -+ UA_SI $LCFI5-$LFB2 - .byte 0xe # DW_CFA_def_cfa_offset - .byte 0x80,0x1 # uleb128 128 - - .byte 0x4 # DW_CFA_advance_loc4 -- .4byte $LCFI6-$LCFI5 -+ UA_SI $LCFI6-$LCFI5 - .byte 0x9a # DW_CFA_offset, column 26 - .byte 16 # uleb128 offset 16*-8 - .align 3 - $LEFDE3: -+#if defined __osf__ -+ .align 0 -+ .long 0 # End of Table -+#endif - --#ifdef __linux__ -+#if defined __ELF__ && defined __linux__ - .section .note.GNU-stack,"",@progbits - #endif --#endif -Index: libffi/ChangeLog +--- 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 =================================================================== ---- libffi/ChangeLog (.../tags/gcc_4_5_3_release) (wersja 173771) -+++ libffi/ChangeLog (.../branches/gcc-4_5-branch) (wersja 173771) -@@ -1,3 +1,13 @@ -+2011-05-02 Rainer Orth +--- 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 ++ ++ Backport from mainline: ++ 2013-03-20 Tilo Schwarz ++ ++ 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. ++ ++2013-04-28 Jerry DeLisle + + Backport from mainline: -+ 2011-04-29 Rainer Orth + -+ * src/alpha/osf.S (UA_SI, FDE_ENCODING, FDE_ENCODE, FDE_ARANGE): -+ Define. -+ Use them to handle ELF vs. ECOFF differences. -+ [__osf__] (_GLOBAL__F_ffi_call_osf): Define. ++ 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. + - 2011-04-28 Release Manager ++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. ++ + 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) + { + int dim; +@@ -2053,7 +2053,7 @@ + /* The next character in the stream should be the '('. */ - * GCC 4.5.3 released. + if ((c = next_char (dtp)) == EOF) +- return FAILURE; ++ goto err_ret; + + /* Process the qualifier, by dimension and triplet. */ + +@@ -2067,7 +2067,7 @@ + + /* 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; + +- 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 @@ + + err_ret: + ++ /* 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) ++ { ++ hit_eof (dtp); ++ dtp->u.p.input_complete = 1; ++ return SUCCESS; ++ } + 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; ++ } ++ while (!( c=='=' || c==' ' || c=='\t' || c =='(' || c =='%' )); + + unget_char (dtp, c); + +@@ -2842,7 +2851,7 @@ + { + 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; + + 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; + } + +- 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; + + root_nl = nl; + + component_flag = 1; + if ((c = next_char (dtp)) == EOF) +- return FAILURE; ++ goto nml_err_ret; + goto get_name; + } + +@@ -2898,8 +2908,8 @@ + descriptor_dimension chd[1] = { {1, clow, nl->string_length} }; + array_loop_spec ind[1] = { {1, clow, nl->string_length, 1} }; + +- 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; ++ } ++ + return FAILURE; + } + +Index: libgfortran/io/transfer.c +=================================================================== +--- 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;