+--- gcc/testsuite/gcc.target/i386/pr64409.c (.../tags/gcc_4_8_4_release) (revision 0)
++++ gcc/testsuite/gcc.target/i386/pr64409.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -0,0 +1,6 @@
++/* { dg-do compile { target { ! { ia32 } } } } */
++/* { dg-require-effective-target maybe_x32 } */
++/* { dg-options "-O0 -mx32" } */
++
++int a;
++int* __attribute__ ((ms_abi)) fn1 () { return &a; } /* { dg-error "X32 does not support ms_abi attribute" } */
+Index: gcc/testsuite/gcc.target/i386/sse-14.c
+===================================================================
+--- gcc/testsuite/gcc.target/i386/sse-14.c (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/testsuite/gcc.target/i386/sse-14.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -150,6 +150,8 @@
+
+ /* emmintrin.h */
+ test_2 (_mm_shuffle_pd, __m128d, __m128d, __m128d, 1)
++test_1 (_mm_bsrli_si128, __m128i, __m128i, 1)
++test_1 (_mm_bslli_si128, __m128i, __m128i, 1)
+ test_1 (_mm_srli_si128, __m128i, __m128i, 1)
+ test_1 (_mm_slli_si128, __m128i, __m128i, 1)
+ test_1 (_mm_extract_epi16, int, __m128i, 1)
+Index: gcc/testsuite/gcc.target/i386/pr57003.c
+===================================================================
+--- gcc/testsuite/gcc.target/i386/pr57003.c (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/testsuite/gcc.target/i386/pr57003.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -1,5 +1,5 @@
+ /* PR rtl-optimization/57003 */
+-/* { dg-do run } */
++/* { dg-do run { target { ! x32 } } } */
+ /* { dg-options "-O2 -maccumulate-outgoing-args" } */
+
+ #define N 2001
+Index: gcc/testsuite/gcc.target/i386/sse-22.c
+===================================================================
+--- gcc/testsuite/gcc.target/i386/sse-22.c (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/testsuite/gcc.target/i386/sse-22.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -88,6 +88,8 @@
+ #endif
+ #include <emmintrin.h>
+ test_2 (_mm_shuffle_pd, __m128d, __m128d, __m128d, 1)
++test_1 (_mm_bsrli_si128, __m128i, __m128i, 1)
++test_1 (_mm_bslli_si128, __m128i, __m128i, 1)
+ test_1 (_mm_srli_si128, __m128i, __m128i, 1)
+ test_1 (_mm_slli_si128, __m128i, __m128i, 1)
+ test_1 (_mm_extract_epi16, int, __m128i, 1)
+@@ -219,6 +221,8 @@
+ test_1 ( _mm256_shuffle_epi32, __m256i, __m256i, 1)
+ test_1 ( _mm256_shufflehi_epi16, __m256i, __m256i, 1)
+ test_1 ( _mm256_shufflelo_epi16, __m256i, __m256i, 1)
++test_1 ( _mm256_bslli_epi128, __m256i, __m256i, 8)
++test_1 ( _mm256_bsrli_epi128, __m256i, __m256i, 8)
+ test_1 ( _mm256_slli_si256, __m256i, __m256i, 8)
+ test_1 ( _mm256_srli_si256, __m256i, __m256i, 8)
+ test_2 ( _mm_blend_epi32, __m128i, __m128i, __m128i, 1)
+Index: gcc/testsuite/gcc.target/i386/pr60516.c
+===================================================================
+--- gcc/testsuite/gcc.target/i386/pr60516.c (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/testsuite/gcc.target/i386/pr60516.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -1,5 +1,5 @@
+ /* PR target/60516 */
+-/* { dg-do compile } */
++/* { dg-do compile { target { ! x32 } } } */
+ /* { dg-options "-O2" } */
+
+ struct S { char c[65536]; };
+Index: gcc/testsuite/gcc.target/i386/pr64513.c
+===================================================================
+--- gcc/testsuite/gcc.target/i386/pr64513.c (.../tags/gcc_4_8_4_release) (revision 0)
++++ gcc/testsuite/gcc.target/i386/pr64513.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -0,0 +1,17 @@
++/* PR target/64513 */
++/* { dg-do compile } */
++/* { dg-options "-O2 -mstack-arg-probe" } */
++
++struct A {};
++struct B { struct A y; };
++int foo (struct A);
++
++int
++bar (int x)
++{
++ struct B b;
++ int c;
++ while (x--)
++ c = foo (b.y);
++ return c;
++}
+Index: gcc/testsuite/gfortran.dg/pr64528.f90
+===================================================================
+--- gcc/testsuite/gfortran.dg/pr64528.f90 (.../tags/gcc_4_8_4_release) (revision 0)
++++ gcc/testsuite/gfortran.dg/pr64528.f90 (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -0,0 +1,20 @@
++! PR fortran/64528
++! { dg-do compile }
++! { dg-options "-O -fno-tree-dce -fno-tree-ccp" }
++
++program pr64528
++ interface
++ subroutine foo(x)
++ integer, value :: x
++ end subroutine foo
++ end interface
++ integer :: x
++ x = 10
++ call foo(x)
++ if(x .ne. 10) then
++ endif
++end program pr64528
++subroutine foo(x)
++ integer, value :: x
++ x = 11
++end subroutine foo
+Index: gcc/testsuite/gfortran.dg/typebound_operator_20.f90
+===================================================================
+--- gcc/testsuite/gfortran.dg/typebound_operator_20.f90 (.../tags/gcc_4_8_4_release) (revision 0)
++++ gcc/testsuite/gfortran.dg/typebound_operator_20.f90 (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -0,0 +1,53 @@
++! { dg-do run }
++!
++! PR 63733: [4.8/4.9/5 Regression] [OOP] wrong resolution for OPERATOR generics
++!
++! Original test case from Alberto F. MartÃn Huertas <amartin@cimne.upc.edu>
++! Slightly modified by Salvatore Filippone <sfilippone@uniroma2.it>
++! Further modified by Janus Weil <janus@gcc.gnu.org>
++
++module overwrite
++ type parent
++ contains
++ procedure :: sum => sum_parent
++ generic :: operator(+) => sum
++ end type
++
++ type, extends(parent) :: child
++ contains
++ procedure :: sum => sum_child
++ end type
++
++contains
++
++ integer function sum_parent(op1,op2)
++ implicit none
++ class(parent), intent(in) :: op1, op2
++ sum_parent = 0
++ end function
++
++ integer function sum_child(op1,op2)
++ implicit none
++ class(child) , intent(in) :: op1
++ class(parent), intent(in) :: op2
++ sum_child = 1
++ end function
++
++end module
++
++program drive
++ use overwrite
++ implicit none
++
++ type(parent) :: m1, m2
++ class(parent), pointer :: mres
++ type(child) :: h1, h2
++ class(parent), pointer :: hres
++
++ if (m1 + m2 /= 0) call abort()
++ if (h1 + m2 /= 1) call abort()
++ if (h1%sum(h2) /= 1) call abort()
++
++end
++
++! { dg-final { cleanup-modules "overwrite" } }
+Index: gcc/testsuite/gfortran.dg/typebound_call_26.f90
+===================================================================
+--- gcc/testsuite/gfortran.dg/typebound_call_26.f90 (.../tags/gcc_4_8_4_release) (revision 0)
++++ gcc/testsuite/gfortran.dg/typebound_call_26.f90 (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -0,0 +1,30 @@
++! { dg-do compile }
++!
++! PR 64244: [4.8/4.9/5 Regression] ICE at class.c:236 when using non_overridable
++!
++! Contributed by OndÅ™ej ÄŒertÃk <ondrej.certik@gmail.com>
++
++module m
++ implicit none
++
++ type :: A
++ contains
++ generic :: f => g
++ procedure, non_overridable :: g
++ end type
++
++contains
++
++ subroutine g(this)
++ class(A), intent(in) :: this
++ end subroutine
++
++end module
++
++
++program test_non_overridable
++ use m, only: A
++ implicit none
++ class(A), allocatable :: h
++ call h%f()
++end
+Index: gcc/testsuite/gfortran.dg/dependency_45.f90
+===================================================================
+--- gcc/testsuite/gfortran.dg/dependency_45.f90 (.../tags/gcc_4_8_4_release) (revision 0)
++++ gcc/testsuite/gfortran.dg/dependency_45.f90 (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -0,0 +1,12 @@
++! { dg-do run }
++! { dg-options "-Warray-temporaries" }
++! PR 56867 - substrings were not checked for dependency.
++program main
++ character(len=4) :: a
++ character(len=4) :: c(3)
++ c(1) = 'abcd'
++ c(2) = '1234'
++ c(3) = 'wxyz'
++ c(:)(1:2) = c(2)(2:3) ! { dg-warning "array temporary" }
++ if (c(3) .ne. '23yz') call abort
++end program main
+Index: gcc/testsuite/gcc.dg/pr61058.c
+===================================================================
+--- gcc/testsuite/gcc.dg/pr61058.c (.../tags/gcc_4_8_4_release) (revision 0)
++++ gcc/testsuite/gcc.dg/pr61058.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -0,0 +1,10 @@
++/* PR rtl-optimization/61058 */
++/* { dg-do compile } */
++/* { dg-options "" } */
++/* { dg-additional-options "-fno-asynchronous-unwind-tables -mtune=atom" { target i?86-*-* x86_64-*-* } } */
++
++void
++foo (void)
++{
++ __builtin_unreachable ();
++}
+Index: gcc/testsuite/gcc.dg/pr64766.c
+===================================================================
+--- gcc/testsuite/gcc.dg/pr64766.c (.../tags/gcc_4_8_4_release) (revision 0)
++++ gcc/testsuite/gcc.dg/pr64766.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -0,0 +1,9 @@
++/* PR c/64766 */
++/* { dg-do compile } */
++
++void
++foo ()
++{
++}
++
++void foo () = 0; /* { dg-error "is initialized like a variable|invalid initializer" } */
+Index: gcc/testsuite/gcc.dg/pr64563.c
+===================================================================
+--- gcc/testsuite/gcc.dg/pr64563.c (.../tags/gcc_4_8_4_release) (revision 0)
++++ gcc/testsuite/gcc.dg/pr64563.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -0,0 +1,14 @@
++/* PR tree-optimization/64563 */
++/* { dg-do compile } */
++/* { dg-options "-Os -Wtype-limits" } */
++
++int a, b, c, d, f;
++unsigned int e;
++
++void
++foo (void)
++{
++ d = b = (a != (e | 4294967288UL));
++ if (!d)
++ c = f || b;
++}
+Index: gcc/testsuite/ChangeLog
+===================================================================
+--- gcc/testsuite/ChangeLog (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/testsuite/ChangeLog (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -1,3 +1,103 @@
++2015-02-01 Jakub Jelinek <jakub@redhat.com>
++
++ Backported from mainline
++ 2015-01-27 Jakub Jelinek <jakub@redhat.com>
++
++ PR rtl-optimization/61058
++ * gcc.dg/pr61058.c: New test.
++
++ PR c/64766
++ * gcc.dg/pr64766.c: New test.
++
++ 2015-01-13 Jakub Jelinek <jakub@redhat.com>
++
++ PR fortran/64528
++ * gfortran.dg/pr64528.f90: New test.
++
++ 2015-01-12 Jakub Jelinek <jakub@redhat.com>
++
++ PR tree-optimization/64563
++ * gcc.dg/pr64563.c: New test.
++
++ PR target/64513
++ * gcc.target/i386/pr64513.c: New test.
++
++2015-01-29 Ilya Tocar <ilya.tocar@intel.com>
++
++ * gcc.target/i386/sse-14.c: Test new intrinsic.
++ * gcc.target/i386/sse-22.c: Ditto.
++
++2015-01-27 Mikael Pettersson <mikpelinux@gmail.com>
++
++ Backport from mainline
++
++ 2013-09-20 Bernd Edlinger <bernd.edlinger@hotmail.de>
++
++ PR middle-end/57748
++ * gcc.dg/torture/pr57748-1.c: New test.
++ * gcc.dg/torture/pr57748-2.c: New test.
++
++ 2014-01-08 Bernd Edlinger <bernd.edlinger@hotmail.de>
++
++ PR middle-end/57748
++ * gcc.dg/torture/pr57748-3.c: New test.
++ * gcc.dg/torture/pr57748-4.c: New test.
++
++2015-01-24 Thomas Koenig <tkoenig@gcc.gnu.org>
++
++ PR fortran/56867
++ * gfortran.dg/dependency_45.f90: New test.
++
++2015-01-24 Thomas Koenig <tkoenig@netcologne.de>
++
++ Backport from trunk
++ PR fortran/57023
++ * gfortran.dg/internal_pack_15.f90: New test.
++
++2015-01-20 Marek Polacek <polacek@redhat.com>
++
++ Backport from mainline
++ 2014-06-23 Marek Polacek <polacek@redhat.com>
++
++ PR c/61553
++ * c-c++-common/pr61553.c: New test.
++
++2015-01-12 Janus Weil <janus@gcc.gnu.org>
++
++ Backport from mainline
++ PR fortran/63733
++ * gfortran.dg/typebound_operator_20.f90: New.
++
++2014-12-28 H.J. Lu <hongjiu.lu@intel.com>
++
++ Backport from mainline:
++ 2014-12-28 H.J. Lu <hongjiu.lu@intel.com>
++
++ * gcc.target/i386/pr57003.c: Skip on x32.
++ * gcc.target/i386/pr60516.c: Likewise.
++
++2014-12-27 H.J. Lu <hongjiu.lu@intel.com>
++
++ Backport from mainline:
++ 2014-12-26 H.J. Lu <hongjiu.lu@intel.com>
++
++ PR target/64409
++ * gcc.target/i386/pr64409.c: New test.
++
++2014-12-23 Janus Weil <janus@gcc.gnu.org>
++
++ Backport from mainline
++ PR fortran/64244
++ * gfortran.dg/typebound_call_26.f90: New.
++
++2014-12-19 H.J. Lu <hongjiu.lu@intel.com>
++
++ Backported from mainline
++ 2014-12-14 H.J. Lu <hongjiu.lu@intel.com>
++
++ PR rtl-optimization/64037
++ * g++.dg/pr64037.C: New test.
++
+ 2014-12-19 Release Manager
+
+ * GCC 4.8.4 released.
+Index: gcc/testsuite/g++.dg/pr64037.C
+===================================================================
+--- gcc/testsuite/g++.dg/pr64037.C (.../tags/gcc_4_8_4_release) (revision 0)
++++ gcc/testsuite/g++.dg/pr64037.C (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -0,0 +1,27 @@
++// { dg-do run { target i?86-*-* x86_64-*-* } }
++// { dg-options "-std=c++11 -Os" }
++
++enum class X : unsigned char {
++ V = 2,
++};
++
++static void
++__attribute__((noinline,noclone))
++foo(unsigned &out, unsigned a, X b)
++{
++ out = static_cast<unsigned>(b);
++}
++
++int main()
++{
++ unsigned deadbeef = 0xDEADBEEF;
++ asm volatile ("" : "+d" (deadbeef), "+c" (deadbeef));
++
++ unsigned out;
++ foo(out, 2, X::V);
++
++ if (out != 2)
++ __builtin_abort ();
++
++ return 0;
++}
+Index: gcc/testsuite/g++.dg/cpp0x/ref-qual16.C
+===================================================================
+--- gcc/testsuite/g++.dg/cpp0x/ref-qual16.C (.../tags/gcc_4_8_4_release) (revision 0)
++++ gcc/testsuite/g++.dg/cpp0x/ref-qual16.C (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -0,0 +1,12 @@
++// PR c++/64297
++// { dg-do compile { target c++11 } }
++
++struct A {
++ typedef int X;
++ template <int> X m_fn1() const;
++};
++template <typename> struct is_function {};
++is_function<int() const &> i;
++struct D {
++ template <typename Y, typename = is_function<Y>> D(Y);
++} b(&A::m_fn1<0>);
+Index: gcc/testsuite/g++.dg/template/offsetof3.C
+===================================================================
+--- gcc/testsuite/g++.dg/template/offsetof3.C (.../tags/gcc_4_8_4_release) (revision 0)
++++ gcc/testsuite/g++.dg/template/offsetof3.C (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -0,0 +1,18 @@
++// PR c++/64487
++
++struct foo {
++ int member;
++};
++
++template < int N>
++struct bar {};
++
++template <int N>
++struct qux {
++ static bar<N+__builtin_offsetof(foo,member)> static_member;
++};
++
++template <int N>
++bar<N+__builtin_offsetof(foo,member)> qux<N>::static_member;
++
++int main() { }
+Index: gcc/testsuite/g++.dg/template/non-dependent14.C
+===================================================================
+--- gcc/testsuite/g++.dg/template/non-dependent14.C (.../tags/gcc_4_8_4_release) (revision 0)
++++ gcc/testsuite/g++.dg/template/non-dependent14.C (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -0,0 +1,7 @@
++// PR c++/64251
++
++class DictionaryValue {};
++template <typename T> void CreateValue(T) {
++ DictionaryValue(0);
++ CreateValue(0);
++}
+Index: gcc/testsuite/c-c++-common/pr61553.c
+===================================================================
+--- gcc/testsuite/c-c++-common/pr61553.c (.../tags/gcc_4_8_4_release) (revision 0)
++++ gcc/testsuite/c-c++-common/pr61553.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -0,0 +1,8 @@
++/* PR c/61553 */
++/* { dg-do compile } */
++
++void
++foo (char *s)
++{
++ __atomic_store (s, (void *) 0, __ATOMIC_SEQ_CST); /* { dg-error "size mismatch" } */
++}
+Index: gcc/cp/typeck.c
+===================================================================
+--- gcc/cp/typeck.c (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/cp/typeck.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -8639,6 +8639,12 @@
+ /* This should really have a different TYPE_MAIN_VARIANT, but that gets
+ complex. */
+ tree result = build_qualified_type (type, memfn_quals);
++ if (tree canon = TYPE_CANONICAL (result))
++ if (canon != result)
++ /* check_qualified_type doesn't check the ref-qualifier, so make sure
++ TYPE_CANONICAL is correct. */
++ TYPE_CANONICAL (result)
++ = build_ref_qualified_type (canon, type_memfn_rqual (result));
+ result = build_exception_variant (result, TYPE_RAISES_EXCEPTIONS (type));
+ return build_ref_qualified_type (result, rqual);
+ }
+Index: gcc/cp/ChangeLog
+===================================================================
+--- gcc/cp/ChangeLog (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/cp/ChangeLog (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -1,3 +1,15 @@
++2015-01-13 Jason Merrill <jason@redhat.com>
++
++ PR c++/64487
++ * semantics.c (finish_offsetof): Handle templates here.
++ * parser.c (cp_parser_builtin_offsetof): Not here.
++
++ PR c++/64251
++ * decl2.c (mark_used): Don't mark if in_template_function.
++
++ PR c++/64297
++ * typeck.c (apply_memfn_quals): Correct wrong TYPE_CANONICAL.
++
+ 2014-12-19 Release Manager
+
+ * GCC 4.8.4 released.
+Index: gcc/cp/semantics.c
+===================================================================
+--- gcc/cp/semantics.c (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/cp/semantics.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -3651,6 +3651,14 @@
+ tree
+ finish_offsetof (tree expr)
+ {
++ /* If we're processing a template, we can't finish the semantics yet.
++ Otherwise we can fold the entire expression now. */
++ if (processing_template_decl)
++ {
++ expr = build1 (OFFSETOF_EXPR, size_type_node, expr);
++ return expr;
++ }
++
+ if (TREE_CODE (expr) == PSEUDO_DTOR_EXPR)
+ {
+ error ("cannot apply %<offsetof%> to destructor %<~%T%>",
+Index: gcc/cp/decl2.c
+===================================================================
+--- gcc/cp/decl2.c (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/cp/decl2.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -4606,7 +4606,7 @@
+ --function_depth;
+ }
+
+- if (processing_template_decl)
++ if (processing_template_decl || in_template_function ())
+ return true;
+
+ /* Check this too in case we're within fold_non_dependent_expr. */
+Index: gcc/cp/parser.c
+===================================================================
+--- gcc/cp/parser.c (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/cp/parser.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -8024,12 +8024,7 @@
+ }
+
+ success:
+- /* If we're processing a template, we can't finish the semantics yet.
+- Otherwise we can fold the entire expression now. */
+- if (processing_template_decl)
+- expr = build1 (OFFSETOF_EXPR, size_type_node, expr);
+- else
+- expr = finish_offsetof (expr);
++ expr = finish_offsetof (expr);
+
+ failure:
+ parser->integral_constant_expression_p = save_ice_p;
+Index: gcc/jump.c
+===================================================================
+--- gcc/jump.c (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/jump.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -133,7 +133,30 @@
+ if (BARRIER_P (prev))
+ delete_insn (insn);
+ else if (prev != PREV_INSN (insn))
+- reorder_insns (insn, insn, prev);
++ {
++ basic_block bb = BLOCK_FOR_INSN (prev);
++ rtx end = PREV_INSN (insn);
++ reorder_insns_nobb (insn, insn, prev);
++ if (bb)
++ {
++ /* If the backend called in machine reorg compute_bb_for_insn
++ and didn't free_bb_for_insn again, preserve basic block
++ boundaries. Move the end of basic block to PREV since
++ it is followed by a barrier now, and clear BLOCK_FOR_INSN
++ on the following notes.
++ ??? Maybe the proper solution for the targets that have
++ cfg around after machine reorg is not to run cleanup_barriers
++ pass at all. */
++ BB_END (bb) = prev;
++ do
++ {
++ prev = NEXT_INSN (prev);
++ if (prev != insn && BLOCK_FOR_INSN (prev) == bb)
++ BLOCK_FOR_INSN (prev) = NULL;
++ }
++ while (prev != end);
++ }
++ }
+ }
+ }
+ return 0;
+Index: gcc/expr.c
+===================================================================
+--- gcc/expr.c (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/expr.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -4708,8 +4708,6 @@
+ int unsignedp;
+ int volatilep = 0;
+ tree tem;
+- bool misalignp;
+- rtx mem = NULL_RTX;
+
+ push_temp_slots ();
+ tem = get_inner_reference (to, &bitsize, &bitpos, &offset, &mode1,
+@@ -4728,41 +4726,8 @@
+ && DECL_BIT_FIELD_TYPE (TREE_OPERAND (to, 1)))
+ get_bit_range (&bitregion_start, &bitregion_end, to, &bitpos, &offset);
+
+- /* If we are going to use store_bit_field and extract_bit_field,
+- make sure to_rtx will be safe for multiple use. */
+- mode = TYPE_MODE (TREE_TYPE (tem));
+- if (TREE_CODE (tem) == MEM_REF
+- && mode != BLKmode
+- && ((align = get_object_alignment (tem))
+- < GET_MODE_ALIGNMENT (mode))
+- && ((icode = optab_handler (movmisalign_optab, mode))
+- != CODE_FOR_nothing))
+- {
+- struct expand_operand ops[2];
++ to_rtx = expand_expr (tem, NULL_RTX, VOIDmode, EXPAND_WRITE);
+
+- misalignp = true;
+- to_rtx = gen_reg_rtx (mode);
+- mem = expand_expr (tem, NULL_RTX, VOIDmode, EXPAND_WRITE);
+-
+- /* If the misaligned store doesn't overwrite all bits, perform
+- rmw cycle on MEM. */
+- if (bitsize != GET_MODE_BITSIZE (mode))
+- {
+- create_input_operand (&ops[0], to_rtx, mode);
+- create_fixed_operand (&ops[1], mem);
+- /* The movmisalign<mode> pattern cannot fail, else the assignment
+- would silently be omitted. */
+- expand_insn (icode, 2, ops);
+-
+- mem = copy_rtx (mem);
+- }
+- }
+- else
+- {
+- misalignp = false;
+- to_rtx = expand_expr (tem, NULL_RTX, VOIDmode, EXPAND_WRITE);
+- }
+-
+ /* If the bitfield is volatile, we want to access it in the
+ field's mode, not the computed mode.
+ If a MEM has VOIDmode (external with incomplete type),
+@@ -4900,17 +4865,6 @@
+ get_alias_set (to), nontemporal);
+ }
+
+- if (misalignp)
+- {
+- struct expand_operand ops[2];
+-
+- create_fixed_operand (&ops[0], mem);
+- create_input_operand (&ops[1], to_rtx, mode);
+- /* The movmisalign<mode> pattern cannot fail, else the assignment
+- would silently be omitted. */
+- expand_insn (icode, 2, ops);
+- }
+-
+ if (result)
+ preserve_temp_slots (result);
+ pop_temp_slots ();
+@@ -5262,7 +5216,7 @@
+ temp = expand_expr_real (exp, tmp_target, GET_MODE (target),
+ (call_param_p
+ ? EXPAND_STACK_PARM : EXPAND_NORMAL),
+- &alt_rtl);
++ &alt_rtl, false);
+ }
+
+ /* If TEMP is a VOIDmode constant and the mode of the type of EXP is not
+@@ -7881,11 +7835,21 @@
+ address, and ALT_RTL is non-NULL, then *ALT_RTL is set to the
+ DECL_RTL of the VAR_DECL. *ALT_RTL is also set if EXP is a
+ COMPOUND_EXPR whose second argument is such a VAR_DECL, and so on
+- recursively. */
++ recursively.
+
++ If INNER_REFERENCE_P is true, we are expanding an inner reference.
++ In this case, we don't adjust a returned MEM rtx that wouldn't be
++ sufficiently aligned for its mode; instead, it's up to the caller
++ to deal with it afterwards. This is used to make sure that unaligned
++ base objects for which out-of-bounds accesses are supported, for
++ example record types with trailing arrays, aren't realigned behind
++ the back of the caller.
++ The normal operating mode is to pass FALSE for this parameter. */
++
+ rtx
+ expand_expr_real (tree exp, rtx target, enum machine_mode tmode,
+- enum expand_modifier modifier, rtx *alt_rtl)
++ enum expand_modifier modifier, rtx *alt_rtl,
++ bool inner_reference_p)
+ {
+ rtx ret;
+
+@@ -7897,7 +7861,8 @@
+ return ret ? ret : const0_rtx;
+ }
+
+- ret = expand_expr_real_1 (exp, target, tmode, modifier, alt_rtl);
++ ret = expand_expr_real_1 (exp, target, tmode, modifier, alt_rtl,
++ inner_reference_p);
+ return ret;
+ }
+
+@@ -9190,7 +9155,8 @@
+
+ rtx
+ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
+- enum expand_modifier modifier, rtx *alt_rtl)
++ enum expand_modifier modifier, rtx *alt_rtl,
++ bool inner_reference_p)
+ {
+ rtx op0, op1, temp, decl_rtl;
+ tree type;
+@@ -9336,7 +9302,7 @@
+
+ set_curr_insn_location (gimple_location (g));
+ r = expand_expr_real (gimple_assign_rhs_to_tree (g), target,
+- tmode, modifier, NULL);
++ tmode, modifier, NULL, inner_reference_p);
+ set_curr_insn_location (saved_loc);
+ if (REG_P (r) && !REG_EXPR (r))
+ set_reg_attrs_for_decl_rtl (SSA_NAME_VAR (exp), r);
+@@ -9557,7 +9523,8 @@
+ case SAVE_EXPR:
+ {
+ tree val = treeop0;
+- rtx ret = expand_expr_real_1 (val, target, tmode, modifier, alt_rtl);
++ rtx ret = expand_expr_real_1 (val, target, tmode, modifier, alt_rtl,
++ inner_reference_p);
+
+ if (!SAVE_EXPR_RESOLVED_P (exp))
+ {
+@@ -9706,6 +9673,7 @@
+ MEM_VOLATILE_P (temp) = 1;
+ if (modifier != EXPAND_WRITE
+ && modifier != EXPAND_MEMORY
++ && !inner_reference_p
+ && mode != BLKmode
+ && align < GET_MODE_ALIGNMENT (mode))
+ {
+@@ -9940,18 +9908,19 @@
+ computation, since it will need a temporary and TARGET is known
+ to have to do. This occurs in unchecked conversion in Ada. */
+ orig_op0 = op0
+- = expand_expr (tem,
+- (TREE_CODE (TREE_TYPE (tem)) == UNION_TYPE
+- && COMPLETE_TYPE_P (TREE_TYPE (tem))
+- && (TREE_CODE (TYPE_SIZE (TREE_TYPE (tem)))
+- != INTEGER_CST)
+- && modifier != EXPAND_STACK_PARM
+- ? target : NULL_RTX),
+- VOIDmode,
+- (modifier == EXPAND_INITIALIZER
+- || modifier == EXPAND_CONST_ADDRESS
+- || modifier == EXPAND_STACK_PARM)
+- ? modifier : EXPAND_NORMAL);
++ = expand_expr_real (tem,
++ (TREE_CODE (TREE_TYPE (tem)) == UNION_TYPE
++ && COMPLETE_TYPE_P (TREE_TYPE (tem))
++ && (TREE_CODE (TYPE_SIZE (TREE_TYPE (tem)))
++ != INTEGER_CST)
++ && modifier != EXPAND_STACK_PARM
++ ? target : NULL_RTX),
++ VOIDmode,
++ (modifier == EXPAND_INITIALIZER
++ || modifier == EXPAND_CONST_ADDRESS
++ || modifier == EXPAND_STACK_PARM)
++ ? modifier : EXPAND_NORMAL,
++ NULL, true);
+
+
+ /* If the bitfield is volatile, we want to access it in the
+@@ -10302,17 +10271,18 @@
+ {
+ /* See the normal_inner_ref case for the rationale. */
+ orig_op0
+- = expand_expr (tem,
+- (TREE_CODE (TREE_TYPE (tem)) == UNION_TYPE
+- && (TREE_CODE (TYPE_SIZE (TREE_TYPE (tem)))
+- != INTEGER_CST)
+- && modifier != EXPAND_STACK_PARM
+- ? target : NULL_RTX),
+- VOIDmode,
+- (modifier == EXPAND_INITIALIZER
+- || modifier == EXPAND_CONST_ADDRESS
+- || modifier == EXPAND_STACK_PARM)
+- ? modifier : EXPAND_NORMAL);
++ = expand_expr_real (tem,
++ (TREE_CODE (TREE_TYPE (tem)) == UNION_TYPE
++ && (TREE_CODE (TYPE_SIZE (TREE_TYPE (tem)))
++ != INTEGER_CST)
++ && modifier != EXPAND_STACK_PARM
++ ? target : NULL_RTX),
++ VOIDmode,
++ (modifier == EXPAND_INITIALIZER
++ || modifier == EXPAND_CONST_ADDRESS
++ || modifier == EXPAND_STACK_PARM)
++ ? modifier : EXPAND_NORMAL,
++ NULL, true);
+
+ if (MEM_P (orig_op0))
+ {
+@@ -10339,8 +10309,8 @@
+ }
+
+ if (!op0)
+- op0 = expand_expr (treeop0,
+- NULL_RTX, VOIDmode, modifier);
++ op0 = expand_expr_real (treeop0, NULL_RTX, VOIDmode, modifier,
++ NULL, inner_reference_p);
+
+ /* If the input and output modes are both the same, we are done. */
+ if (mode == GET_MODE (op0))
+@@ -10407,50 +10377,53 @@
+ op0 = copy_rtx (op0);
+ set_mem_align (op0, MAX (MEM_ALIGN (op0), TYPE_ALIGN (type)));
+ }
+- else if (mode != BLKmode
+- && MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (mode)
+- /* If the target does have special handling for unaligned
+- loads of mode then use them. */
+- && ((icode = optab_handler (movmisalign_optab, mode))
+- != CODE_FOR_nothing))
+- {
+- rtx reg, insn;
+-
+- op0 = adjust_address (op0, mode, 0);
+- /* We've already validated the memory, and we're creating a
+- new pseudo destination. The predicates really can't
+- fail. */
+- reg = gen_reg_rtx (mode);
+-
+- /* Nor can the insn generator. */
+- insn = GEN_FCN (icode) (reg, op0);
+- emit_insn (insn);
+- return reg;
+- }
+- else if (STRICT_ALIGNMENT
++ else if (modifier != EXPAND_WRITE
++ && modifier != EXPAND_MEMORY
++ && !inner_reference_p
+ && mode != BLKmode
+ && MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (mode))
+ {
+- tree inner_type = TREE_TYPE (treeop0);
+- HOST_WIDE_INT temp_size
+- = MAX (int_size_in_bytes (inner_type),
+- (HOST_WIDE_INT) GET_MODE_SIZE (mode));
+- rtx new_rtx
+- = assign_stack_temp_for_type (mode, temp_size, type);
+- rtx new_with_op0_mode
+- = adjust_address (new_rtx, GET_MODE (op0), 0);
++ /* If the target does have special handling for unaligned
++ loads of mode then use them. */
++ if ((icode = optab_handler (movmisalign_optab, mode))
++ != CODE_FOR_nothing)
++ {
++ rtx reg, insn;
+
+- gcc_assert (!TREE_ADDRESSABLE (exp));
++ op0 = adjust_address (op0, mode, 0);
++ /* We've already validated the memory, and we're creating a
++ new pseudo destination. The predicates really can't
++ fail. */
++ reg = gen_reg_rtx (mode);
+
+- if (GET_MODE (op0) == BLKmode)
+- emit_block_move (new_with_op0_mode, op0,
+- GEN_INT (GET_MODE_SIZE (mode)),
+- (modifier == EXPAND_STACK_PARM
+- ? BLOCK_OP_CALL_PARM : BLOCK_OP_NORMAL));
+- else
+- emit_move_insn (new_with_op0_mode, op0);
++ /* Nor can the insn generator. */
++ insn = GEN_FCN (icode) (reg, op0);
++ emit_insn (insn);
++ return reg;
++ }
++ else if (STRICT_ALIGNMENT)
++ {
++ tree inner_type = TREE_TYPE (treeop0);
++ HOST_WIDE_INT temp_size
++ = MAX (int_size_in_bytes (inner_type),
++ (HOST_WIDE_INT) GET_MODE_SIZE (mode));
++ rtx new_rtx
++ = assign_stack_temp_for_type (mode, temp_size, type);
++ rtx new_with_op0_mode
++ = adjust_address (new_rtx, GET_MODE (op0), 0);
+
+- op0 = new_rtx;
++ gcc_assert (!TREE_ADDRESSABLE (exp));
++
++ if (GET_MODE (op0) == BLKmode)
++ emit_block_move (new_with_op0_mode, op0,
++ GEN_INT (GET_MODE_SIZE (mode)),
++ (modifier == EXPAND_STACK_PARM
++ ? BLOCK_OP_CALL_PARM : BLOCK_OP_NORMAL));
++ else
++ emit_move_insn (new_with_op0_mode, op0);
++
++ op0 = new_rtx;
++ }
+ }
+
+ op0 = adjust_address (op0, mode, 0);
+@@ -10550,7 +10523,7 @@
+ /* WITH_SIZE_EXPR expands to its first argument. The caller should
+ have pulled out the size to use in whatever context it needed. */
+ return expand_expr_real (treeop0, original_target, tmode,
+- modifier, alt_rtl);
++ modifier, alt_rtl, inner_reference_p);
+
+ default:
+ return expand_expr_real_2 (&ops, target, tmode, modifier);
+Index: gcc/expr.h
+===================================================================
+--- gcc/expr.h (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/expr.h (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -41,7 +41,8 @@
+ is a constant that is not a legitimate address.
+ EXPAND_WRITE means we are only going to write to the resulting rtx.
+ EXPAND_MEMORY means we are interested in a memory result, even if
+- the memory is constant and we could have propagated a constant value. */
++ the memory is constant and we could have propagated a constant value,
++ or the memory is unaligned on a STRICT_ALIGNMENT target. */
+ enum expand_modifier {EXPAND_NORMAL = 0, EXPAND_STACK_PARM, EXPAND_SUM,
+ EXPAND_CONST_ADDRESS, EXPAND_INITIALIZER, EXPAND_WRITE,
+ EXPAND_MEMORY};
+@@ -428,9 +429,9 @@
+
+ /* Work horses for expand_expr. */
+ extern rtx expand_expr_real (tree, rtx, enum machine_mode,
+- enum expand_modifier, rtx *);
++ enum expand_modifier, rtx *, bool);
+ extern rtx expand_expr_real_1 (tree, rtx, enum machine_mode,
+- enum expand_modifier, rtx *);
++ enum expand_modifier, rtx *, bool);
+ extern rtx expand_expr_real_2 (sepops, rtx, enum machine_mode,
+ enum expand_modifier);
+
+@@ -441,13 +442,13 @@
+ expand_expr (tree exp, rtx target, enum machine_mode mode,
+ enum expand_modifier modifier)
+ {
+- return expand_expr_real (exp, target, mode, modifier, NULL);
++ return expand_expr_real (exp, target, mode, modifier, NULL, false);
+ }
+
+ static inline rtx
+ expand_normal (tree exp)
+ {
+- return expand_expr_real (exp, NULL_RTX, VOIDmode, EXPAND_NORMAL, NULL);
++ return expand_expr_real (exp, NULL_RTX, VOIDmode, EXPAND_NORMAL, NULL, false);
+ }
+
+ /* At the start of a function, record that we have no previously-pushed
+Index: gcc/fortran/interface.c
+===================================================================
+--- gcc/fortran/interface.c (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/fortran/interface.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -3557,6 +3557,8 @@
+ gfc_user_op *uop;
+ gfc_intrinsic_op i;
+ const char *gname;
++ gfc_typebound_proc* tbo;
++ gfc_expr* tb_base;
+
+ sym = NULL;
+
+@@ -3573,8 +3575,50 @@
+
+ i = fold_unary_intrinsic (e->value.op.op);
+
++ /* See if we find a matching type-bound operator. */
+ if (i == INTRINSIC_USER)
++ tbo = matching_typebound_op (&tb_base, actual,
++ i, e->value.op.uop->name, &gname);
++ else
++ switch (i)
++ {
++#define CHECK_OS_COMPARISON(comp) \
++ case INTRINSIC_##comp: \
++ case INTRINSIC_##comp##_OS: \
++ tbo = matching_typebound_op (&tb_base, actual, \
++ INTRINSIC_##comp, NULL, &gname); \
++ if (!tbo) \
++ tbo = matching_typebound_op (&tb_base, actual, \
++ INTRINSIC_##comp##_OS, NULL, &gname); \
++ break;
++ CHECK_OS_COMPARISON(EQ)
++ CHECK_OS_COMPARISON(NE)
++ CHECK_OS_COMPARISON(GT)
++ CHECK_OS_COMPARISON(GE)
++ CHECK_OS_COMPARISON(LT)
++ CHECK_OS_COMPARISON(LE)
++#undef CHECK_OS_COMPARISON
++
++ default:
++ tbo = matching_typebound_op (&tb_base, actual, i, NULL, &gname);
++ break;
++ }
++
++ /* If there is a matching typebound-operator, replace the expression with
++ a call to it and succeed. */
++ if (tbo)
+ {
++ gcc_assert (tb_base);
++ build_compcall_for_operator (e, actual, tb_base, tbo, gname);
++
++ if (gfc_resolve_expr (e) == FAILURE)
++ return MATCH_ERROR;
++ else
++ return MATCH_YES;
++ }
++
++ if (i == INTRINSIC_USER)
++ {
+ for (ns = gfc_current_ns; ns; ns = ns->parent)
+ {
+ uop = gfc_find_uop (e->value.op.uop->name, ns);
+@@ -3623,54 +3667,6 @@
+
+ if (sym == NULL)
+ {
+- gfc_typebound_proc* tbo;
+- gfc_expr* tb_base;
+-
+- /* See if we find a matching type-bound operator. */
+- if (i == INTRINSIC_USER)
+- tbo = matching_typebound_op (&tb_base, actual,
+- i, e->value.op.uop->name, &gname);
+- else
+- switch (i)
+- {
+-#define CHECK_OS_COMPARISON(comp) \
+- case INTRINSIC_##comp: \
+- case INTRINSIC_##comp##_OS: \
+- tbo = matching_typebound_op (&tb_base, actual, \
+- INTRINSIC_##comp, NULL, &gname); \
+- if (!tbo) \
+- tbo = matching_typebound_op (&tb_base, actual, \
+- INTRINSIC_##comp##_OS, NULL, &gname); \
+- break;
+- CHECK_OS_COMPARISON(EQ)
+- CHECK_OS_COMPARISON(NE)
+- CHECK_OS_COMPARISON(GT)
+- CHECK_OS_COMPARISON(GE)
+- CHECK_OS_COMPARISON(LT)
+- CHECK_OS_COMPARISON(LE)
+-#undef CHECK_OS_COMPARISON
+-
+- default:
+- tbo = matching_typebound_op (&tb_base, actual, i, NULL, &gname);
+- break;
+- }
+-
+- /* If there is a matching typebound-operator, replace the expression with
+- a call to it and succeed. */
+- if (tbo)
+- {
+- gfc_try result;
+-
+- gcc_assert (tb_base);
+- build_compcall_for_operator (e, actual, tb_base, tbo, gname);
+-
+- result = gfc_resolve_expr (e);
+- if (result == FAILURE)
+- return MATCH_ERROR;
+-
+- return MATCH_YES;
+- }
+-
+ /* Don't use gfc_free_actual_arglist(). */
+ free (actual->next);
+ free (actual);
+Index: gcc/fortran/trans-array.c
+===================================================================
+--- gcc/fortran/trans-array.c (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/fortran/trans-array.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -4299,11 +4299,20 @@
+
+ for (ss = rss; ss != gfc_ss_terminator; ss = ss->next)
+ {
+- if (ss->info->type != GFC_SS_SECTION)
+- continue;
+
+ ss_expr = ss->info->expr;
+
++ if (ss->info->type != GFC_SS_SECTION)
++ {
++ /* Check for cases like c(:)(1:2) = c(2)(2:3) */
++ if (!nDepend && dest_expr->rank > 0
++ && dest_expr->ts.type == BT_CHARACTER
++ && ss_expr->expr_type == EXPR_VARIABLE)
++
++ nDepend = gfc_check_dependency (dest_expr, ss_expr, false);
++ continue;
++ }
++
+ if (dest_expr->symtree->n.sym != ss_expr->symtree->n.sym)
+ {
+ if (gfc_could_be_alias (dest, ss)
+Index: gcc/fortran/ChangeLog
+===================================================================
+--- gcc/fortran/ChangeLog (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/fortran/ChangeLog (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -1,3 +1,42 @@
++2015-02-01 Jakub Jelinek <jakub@redhat.com>
++
++ Backported from mainline
++ 2015-01-13 Jakub Jelinek <jakub@redhat.com>
++
++ PR fortran/64528
++ * trans-decl.c (create_function_arglist): Don't set TREE_READONLY
++ on dummy args with VALUE attribute.
++
++2015-01-24 Thomas Koenig <tkoenig@gcc.gnu.org>
++
++ PR fortran/56867
++ * trans-array.c (gfc_conv_resolve_dependencies): Also check
++ dependencies when there may be substrings of character arrays.
++
++2015-01-24 Thomas Koenig <tkoenig@netcologne.de>
++
++ Backport from trunk
++ PR fortran/57023
++ * dependency.c (callback_dummy_intent_not_int): New function.
++ (dummy_intent_not_in): New function.
++ (gfc_full_array_ref_p): Use dummy_intent_not_in.
++
++2015-01-12 Janus Weil <janus@gcc.gnu.org>
++
++ Backport from mainline
++ PR fortran/63733
++ * interface.c (gfc_extend_expr): Look for type-bound operators before
++ non-typebound ones.
++
++2014-12-23 Janus Weil <janus@gcc.gnu.org>
++
++ Backport from mainline
++ PR fortran/64244
++ * resolve.c (resolve_typebound_call): New argument to pass out the
++ non-overridable attribute of the specific procedure.
++ (resolve_typebound_subroutine): Get overridable flag from
++ resolve_typebound_call.
++
+ 2014-12-19 Release Manager
+
+ * GCC 4.8.4 released.
+Index: gcc/fortran/resolve.c
+===================================================================
+--- gcc/fortran/resolve.c (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/fortran/resolve.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -6048,7 +6048,7 @@
+ /* Resolve a call to a type-bound subroutine. */
+
+ static gfc_try
+-resolve_typebound_call (gfc_code* c, const char **name)
++resolve_typebound_call (gfc_code* c, const char **name, bool *overridable)
+ {
+ gfc_actual_arglist* newactual;
+ gfc_symtree* target;
+@@ -6072,6 +6072,10 @@
+ if (resolve_typebound_generic_call (c->expr1, name) == FAILURE)
+ return FAILURE;
+
++ /* Pass along the NON_OVERRIDABLE attribute of the specific TBP. */
++ if (overridable)
++ *overridable = !c->expr1->value.compcall.tbp->non_overridable;
++
+ /* Transform into an ordinary EXEC_CALL for now. */
+
+ if (resolve_typebound_static (c->expr1, &target, &newactual) == FAILURE)
+@@ -6324,7 +6328,7 @@
+ if (c->ts.u.derived == NULL)
+ c->ts.u.derived = gfc_find_derived_vtab (declared);
+
+- if (resolve_typebound_call (code, &name) == FAILURE)
++ if (resolve_typebound_call (code, &name, NULL) == FAILURE)
+ return FAILURE;
+
+ /* Use the generic name if it is there. */
+@@ -6356,7 +6360,7 @@
+ }
+
+ if (st == NULL)
+- return resolve_typebound_call (code, NULL);
++ return resolve_typebound_call (code, NULL, NULL);
+
+ if (resolve_ref (code->expr1) == FAILURE)
+ return FAILURE;
+@@ -6369,10 +6373,10 @@
+ || (!class_ref && st->n.sym->ts.type != BT_CLASS))
+ {
+ gfc_free_ref_list (new_ref);
+- return resolve_typebound_call (code, NULL);
++ return resolve_typebound_call (code, NULL, NULL);
+ }
+
+- if (resolve_typebound_call (code, &name) == FAILURE)
++ if (resolve_typebound_call (code, &name, &overridable) == FAILURE)
+ {
+ gfc_free_ref_list (new_ref);
+ return FAILURE;
+Index: gcc/fortran/trans-decl.c
+===================================================================
+--- gcc/fortran/trans-decl.c (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/fortran/trans-decl.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -2186,8 +2186,9 @@
+ /* Fill in arg stuff. */
+ DECL_CONTEXT (parm) = fndecl;
+ DECL_ARG_TYPE (parm) = TREE_VALUE (typelist);
+- /* All implementation args are read-only. */
+- TREE_READONLY (parm) = 1;
++ /* All implementation args except for VALUE are read-only. */
++ if (!f->sym->attr.value)
++ TREE_READONLY (parm) = 1;
+ if (POINTER_TYPE_P (type)
+ && (!f->sym->attr.proc_pointer
+ && f->sym->attr.flavor != FL_PROCEDURE))
+Index: gcc/fortran/dependency.c
+===================================================================
+--- gcc/fortran/dependency.c (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/fortran/dependency.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -1604,11 +1604,40 @@
+ return GFC_DEP_EQUAL;
+ }
+
++/* Callback function for checking if an expression depends on a
++ dummy variable which is any other than INTENT(IN). */
+
++static int
++callback_dummy_intent_not_in (gfc_expr **ep,
++ int *walk_subtrees ATTRIBUTE_UNUSED,
++ void *data ATTRIBUTE_UNUSED)
++{
++ gfc_expr *e = *ep;
++
++ if (e->expr_type == EXPR_VARIABLE && e->symtree
++ && e->symtree->n.sym->attr.dummy)
++ return e->symtree->n.sym->attr.intent != INTENT_IN;
++ else
++ return 0;
++}
++
++/* Auxiliary function to check if subexpressions have dummy variables which
++ are not intent(in).
++*/
++
++static bool
++dummy_intent_not_in (gfc_expr **ep)
++{
++ return gfc_expr_walker (ep, callback_dummy_intent_not_in, NULL);
++}
++
+ /* Determine if an array ref, usually an array section specifies the
+ entire array. In addition, if the second, pointer argument is
+ provided, the function will return true if the reference is
+- contiguous; eg. (:, 1) gives true but (1,:) gives false. */
++ contiguous; eg. (:, 1) gives true but (1,:) gives false.
++ If one of the bounds depends on a dummy variable which is
++ not INTENT(IN), also return false, because the user may
++ have changed the variable. */
+
+ bool
+ gfc_full_array_ref_p (gfc_ref *ref, bool *contiguous)
+@@ -1672,7 +1701,8 @@
+ && (!ref->u.ar.as
+ || !ref->u.ar.as->lower[i]
+ || gfc_dep_compare_expr (ref->u.ar.start[i],
+- ref->u.ar.as->lower[i])))
++ ref->u.ar.as->lower[i])
++ || dummy_intent_not_in (&ref->u.ar.start[i])))
+ lbound_OK = false;
+ /* Check the upper bound. */
+ if (ref->u.ar.end[i]
+@@ -1679,7 +1709,8 @@
+ && (!ref->u.ar.as
+ || !ref->u.ar.as->upper[i]
+ || gfc_dep_compare_expr (ref->u.ar.end[i],
+- ref->u.ar.as->upper[i])))
++ ref->u.ar.as->upper[i])
++ || dummy_intent_not_in (&ref->u.ar.end[i])))
+ ubound_OK = false;
+ /* Check the stride. */
+ if (ref->u.ar.stride[i]
+Index: gcc/alias.c
+===================================================================
+--- gcc/alias.c (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/alias.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -380,17 +380,9 @@
+ static inline int
+ mems_in_disjoint_alias_sets_p (const_rtx mem1, const_rtx mem2)
+ {
+-/* Perform a basic sanity check. Namely, that there are no alias sets
+- if we're not using strict aliasing. This helps to catch bugs
+- whereby someone uses PUT_CODE, but doesn't clear MEM_ALIAS_SET, or
+- where a MEM is allocated in some way other than by the use of
+- gen_rtx_MEM, and the MEM_ALIAS_SET is not cleared. If we begin to
+- use alias sets to indicate that spilled registers cannot alias each
+- other, we might need to remove this check. */
+- gcc_assert (flag_strict_aliasing
+- || (!MEM_ALIAS_SET (mem1) && !MEM_ALIAS_SET (mem2)));
+-
+- return ! alias_sets_conflict_p (MEM_ALIAS_SET (mem1), MEM_ALIAS_SET (mem2));
++ return (flag_strict_aliasing
++ && ! alias_sets_conflict_p (MEM_ALIAS_SET (mem1),
++ MEM_ALIAS_SET (mem2)));
+ }
+
+ /* Insert the NODE into the splay tree given by DATA. Used by
+Index: gcc/cfgexpand.c
+===================================================================
+--- gcc/cfgexpand.c (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/cfgexpand.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -2111,7 +2111,7 @@
+ if (lhs)
+ expand_assignment (lhs, exp, false);
+ else
+- expand_expr_real_1 (exp, const0_rtx, VOIDmode, EXPAND_NORMAL, NULL);
++ expand_expr (exp, const0_rtx, VOIDmode, EXPAND_NORMAL);
+
+ mark_transaction_restart_calls (stmt);
+ }
+Index: gcc/combine.c
+===================================================================
+--- gcc/combine.c (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/combine.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -1527,8 +1527,8 @@
+ uns3 = TYPE_UNSIGNED (DECL_ARG_TYPE (arg));
+
+ /* The mode and signedness of the argument as it is actually passed,
+- after any TARGET_PROMOTE_FUNCTION_ARGS-driven ABI promotions. */
+- mode3 = promote_function_mode (DECL_ARG_TYPE (arg), mode2, &uns3,
++ see assign_parm_setup_reg in function.c. */
++ mode3 = promote_function_mode (TREE_TYPE (arg), mode1, &uns3,
+ TREE_TYPE (cfun->decl), 0);
+
+ /* The mode of the register in which the argument is being passed. */
+Index: gcc/config/i386/i386.md
+===================================================================
+--- gcc/config/i386/i386.md (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/config/i386/i386.md (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -1945,7 +1945,8 @@
+ (const_string "ssemov")
+ (eq_attr "alternative" "15,16")
+ (const_string "ssecvt")
+- (match_operand 1 "pic_32bit_operand")
++ (and (match_operand 0 "register_operand")
++ (match_operand 1 "pic_32bit_operand"))
+ (const_string "lea")
+ ]
+ (const_string "imov")))
+@@ -2171,7 +2172,8 @@
+ (const_string "sselog1")
+ (eq_attr "alternative" "7,8,9,10,11")
+ (const_string "ssemov")
+- (match_operand 1 "pic_32bit_operand")
++ (and (match_operand 0 "register_operand")
++ (match_operand 1 "pic_32bit_operand"))
+ (const_string "lea")
+ ]
+ (const_string "imov")))
+Index: gcc/config/i386/avx2intrin.h
+===================================================================
+--- gcc/config/i386/avx2intrin.h (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/config/i386/avx2intrin.h (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -639,11 +639,20 @@
+ #ifdef __OPTIMIZE__
+ extern __inline __m256i
+ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
++_mm256_bslli_epi128 (__m256i __A, const int __N)
++{
++ return (__m256i)__builtin_ia32_pslldqi256 (__A, __N * 8);
++}
++
++extern __inline __m256i
++__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+ _mm256_slli_si256 (__m256i __A, const int __N)
+ {
+ return (__m256i)__builtin_ia32_pslldqi256 (__A, __N * 8);
+ }
+ #else
++#define _mm256_bslli_epi128(A, N) \
++ ((__m256i)__builtin_ia32_pslldqi256 ((__m256i)(A), (int)(N) * 8))
+ #define _mm256_slli_si256(A, N) \
+ ((__m256i)__builtin_ia32_pslldqi256 ((__m256i)(A), (int)(N) * 8))
+ #endif
+@@ -721,11 +730,20 @@
+ #ifdef __OPTIMIZE__
+ extern __inline __m256i
+ __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
++_mm256_bsrli_epi128 (__m256i __A, const int __N)
++{
++ return (__m256i)__builtin_ia32_psrldqi256 (__A, __N * 8);
++}
++
++extern __inline __m256i
++__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+ _mm256_srli_si256 (__m256i __A, const int __N)
+ {
+ return (__m256i)__builtin_ia32_psrldqi256 (__A, __N * 8);
+ }
+ #else
++#define _mm256_bsrli_epi128(A, N) \
++ ((__m256i)__builtin_ia32_psrldqi256 ((__m256i)(A), (int)(N) * 8))
+ #define _mm256_srli_si256(A, N) \
+ ((__m256i)__builtin_ia32_psrldqi256 ((__m256i)(A), (int)(N) * 8))
+ #endif
+Index: gcc/config/i386/sse.md
+===================================================================
+--- gcc/config/i386/sse.md (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/config/i386/sse.md (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -7369,7 +7369,7 @@
+ movss\t{%2, %0|%0, %2}
+ movss\t{%2, %0|%0, %2}
+ vmovss\t{%2, %1, %0|%0, %1, %2}"
+- [(set_attr "isa" "sse2,*,noavx,noavx,avx")
++ [(set_attr "isa" "sse2,sse2,noavx,noavx,avx")
+ (set_attr "type" "ssemov")
+ (set_attr "prefix" "maybe_vex,maybe_vex,orig,orig,vex")
+ (set_attr "mode" "TI,TI,V4SF,SF,SF")])
+Index: gcc/config/i386/emmintrin.h
+===================================================================
+--- gcc/config/i386/emmintrin.h (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/config/i386/emmintrin.h (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -1143,6 +1143,18 @@
+
+ #ifdef __OPTIMIZE__
+ extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
++_mm_bsrli_si128 (__m128i __A, const int __N)
++{
++ return (__m128i)__builtin_ia32_psrldqi128 (__A, __N * 8);
++}
++
++extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
++_mm_bslli_si128 (__m128i __A, const int __N)
++{
++ return (__m128i)__builtin_ia32_pslldqi128 (__A, __N * 8);
++}
++
++extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+ _mm_srli_si128 (__m128i __A, const int __N)
+ {
+ return (__m128i)__builtin_ia32_psrldqi128 (__A, __N * 8);
+@@ -1154,6 +1166,10 @@
+ return (__m128i)__builtin_ia32_pslldqi128 (__A, __N * 8);
+ }
+ #else
++#define _mm_bsrli_si128(A, N) \
++ ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(A), (int)(N) * 8))
++#define _mm_bslli_si128(A, N) \
++ ((__m128i)__builtin_ia32_pslldqi128 ((__m128i)(A), (int)(N) * 8))
+ #define _mm_srli_si128(A, N) \
+ ((__m128i)__builtin_ia32_psrldqi128 ((__m128i)(A), (int)(N) * 8))
+ #define _mm_slli_si128(A, N) \
+Index: gcc/config/i386/i386.c
+===================================================================
+--- gcc/config/i386/i386.c (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/config/i386/i386.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -5539,7 +5539,18 @@
+ if (abi == SYSV_ABI)
+ {
+ if (lookup_attribute ("ms_abi", TYPE_ATTRIBUTES (fntype)))
+- abi = MS_ABI;
++ {
++ if (TARGET_X32)
++ {
++ static bool warned = false;
++ if (!warned)
++ {
++ error ("X32 does not support ms_abi attribute");
++ warned = true;
++ }
++ }
++ abi = MS_ABI;
++ }
+ }
+ else if (lookup_attribute ("sysv_abi", TYPE_ATTRIBUTES (fntype)))
+ abi = SYSV_ABI;
+@@ -10483,6 +10494,10 @@
+ if (sp_is_cfa_reg)
+ m->fs.cfa_offset += UNITS_PER_WORD;
+ RTX_FRAME_RELATED_P (insn) = 1;
++ add_reg_note (insn, REG_FRAME_RELATED_EXPR,
++ gen_rtx_SET (VOIDmode, stack_pointer_rtx,
++ plus_constant (Pmode, stack_pointer_rtx,
++ -UNITS_PER_WORD)));
+ }
+ }
+
+@@ -10496,6 +10511,10 @@
+ if (sp_is_cfa_reg)
+ m->fs.cfa_offset += UNITS_PER_WORD;
+ RTX_FRAME_RELATED_P (insn) = 1;
++ add_reg_note (insn, REG_FRAME_RELATED_EXPR,
++ gen_rtx_SET (VOIDmode, stack_pointer_rtx,
++ plus_constant (Pmode, stack_pointer_rtx,
++ -UNITS_PER_WORD)));
+ }
+ }
+
+Index: gcc/config/rs6000/rs6000-cpus.def
+===================================================================
+--- gcc/config/rs6000/rs6000-cpus.def (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/config/rs6000/rs6000-cpus.def (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -91,6 +91,7 @@
+ | OPTION_MASK_PPC_GFXOPT \
+ | OPTION_MASK_PPC_GPOPT \
+ | OPTION_MASK_QUAD_MEMORY \
++ | OPTION_MASK_QUAD_MEMORY_ATOMIC \
+ | OPTION_MASK_RECIP_PRECISION \
+ | OPTION_MASK_SOFT_FLOAT \
+ | OPTION_MASK_STRICT_ALIGN_OPTIONAL \
+Index: gcc/config/rs6000/rs6000.c
+===================================================================
+--- gcc/config/rs6000/rs6000.c (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/config/rs6000/rs6000.c (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -32628,6 +32628,14 @@
+ if (complement_op2_p)
+ op2 = gen_rtx_NOT (mode, op2);
+
++ /* For canonical RTL, if only one arm is inverted it is the first. */
++ if (!complement_op1_p && complement_op2_p)
++ {
++ rtx temp = op1;
++ op1 = op2;
++ op2 = temp;
++ }
++
+ bool_rtx = ((code == NOT)
+ ? gen_rtx_NOT (mode, op1)
+ : gen_rtx_fmt_ee (code, mode, op1, op2));
+Index: gcc/config/rs6000/rs6000.md
+===================================================================
+--- gcc/config/rs6000/rs6000.md (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/config/rs6000/rs6000.md (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -8622,8 +8622,8 @@
+ [(set (match_operand:BOOL_128 0 "vlogical_operand" "=<BOOL_REGS_OUTPUT>")
+ (match_operator:BOOL_128 3 "boolean_operator"
+ [(not:BOOL_128
+- (match_operand:BOOL_128 2 "vlogical_operand" "<BOOL_REGS_OP1>"))
+- (match_operand:BOOL_128 1 "vlogical_operand" "<BOOL_REGS_OP2>")]))]
++ (match_operand:BOOL_128 2 "vlogical_operand" "<BOOL_REGS_OP2>"))
++ (match_operand:BOOL_128 1 "vlogical_operand" "<BOOL_REGS_OP1>")]))]
+ "TARGET_P8_VECTOR || (GET_CODE (operands[3]) == AND)"
+ {
+ if (TARGET_VSX && vsx_register_operand (operands[0], <MODE>mode))
+@@ -8638,7 +8638,7 @@
+ && reload_completed && int_reg_operand (operands[0], <MODE>mode)"
+ [(const_int 0)]
+ {
+- rs6000_split_logical (operands, GET_CODE (operands[3]), false, true, false,
++ rs6000_split_logical (operands, GET_CODE (operands[3]), false, false, true,
+ NULL_RTX);
+ DONE;
+ }
+@@ -8660,14 +8660,14 @@
+ [(set (match_operand:TI2 0 "int_reg_operand" "=&r,r,r")
+ (match_operator:TI2 3 "boolean_operator"
+ [(not:TI2
+- (match_operand:TI2 1 "int_reg_operand" "r,0,r"))
+- (match_operand:TI2 2 "int_reg_operand" "r,r,0")]))]
++ (match_operand:TI2 2 "int_reg_operand" "r,0,r"))
++ (match_operand:TI2 1 "int_reg_operand" "r,r,0")]))]
+ "!TARGET_P8_VECTOR && (GET_CODE (operands[3]) != AND)"
+ "#"
+ "reload_completed && !TARGET_P8_VECTOR && (GET_CODE (operands[3]) != AND)"
+ [(const_int 0)]
+ {
+- rs6000_split_logical (operands, GET_CODE (operands[3]), false, true, false,
++ rs6000_split_logical (operands, GET_CODE (operands[3]), false, false, true,
+ NULL_RTX);
+ DONE;
+ }
+Index: gcc/config/arm/arm.h
+===================================================================
+--- gcc/config/arm/arm.h (.../tags/gcc_4_8_4_release) (revision 220382)
++++ gcc/config/arm/arm.h (.../branches/gcc-4_8-branch) (revision 220382)
+@@ -63,8 +63,8 @@
+ builtin_define_with_int_value ( \
+ "__ARM_SIZEOF_MINIMAL_ENUM", \
+ flag_short_enums ? 1 : 4); \
+- builtin_define_with_int_value ( \
+- "__ARM_SIZEOF_WCHAR_T", WCHAR_TYPE_SIZE); \
++ builtin_define_type_sizeof ("__ARM_SIZEOF_WCHAR_T", \
++ wchar_type_node); \
+ if (TARGET_ARM_ARCH_PROFILE) \
+ builtin_define_with_int_value ( \
+ "__ARM_ARCH_PROFILE", TARGET_ARM_ARCH_PROFILE); \