diff -u gcc-4.6-4.6.2/debian/rules.parameters gcc-4.6-4.6.2/debian/rules.parameters --- gcc-4.6-4.6.2/debian/rules.parameters +++ gcc-4.6-4.6.2/debian/rules.parameters @@ -2,15 +2,15 @@ GCC_VERSION := 4.6.2 NEXT_GCC_VERSION := 4.6.3 BASE_VERSION := 4.6 -SOURCE_VERSION := 4.6.2-10ubuntu1 -DEB_VERSION := 4.6.2-10ubuntu1 -DEB_EVERSION := 1:4.6.2-10ubuntu1 +SOURCE_VERSION := 4.6.2-12ubuntu1 +DEB_VERSION := 4.6.2-12ubuntu1 +DEB_EVERSION := 1:4.6.2-12ubuntu1 GDC_BASE_VERSION := DEB_GDC_VERSION := DEB_SOVERSION := 4.6 DEB_SOEVERSION := 1:4.6 DEB_LIBGCC_SOVERSION := 1:4.6 -DEB_LIBGCC_VERSION := 1:4.6.2-10ubuntu1 +DEB_LIBGCC_VERSION := 1:4.6.2-12ubuntu1 DEB_STDCXX_SOVERSION := 4.6 DEB_GCJ_SOVERSION := 4.6 PKG_GCJ_EXT := 12 diff -u gcc-4.6-4.6.2/debian/control.m4 gcc-4.6-4.6.2/debian/control.m4 --- gcc-4.6-4.6.2/debian/control.m4 +++ gcc-4.6-4.6.2/debian/control.m4 @@ -167,8 +167,8 @@ Section: ifdef(`TARGET',`devel',`libs') Priority: ifdef(`TARGET',`extra',required) Depends: BASEDEP, ${shlibs:Depends}, ${misc:Depends} -ifdef(`TARGET',`Provides: libgcc1-TARGET-dcv1 -',ifdef(`MULTIARCH', `Multi-Arch: same +ifdef(`TARGET',`Provides: libgcc1-TARGET-dcv1', +ifdef(`MULTIARCH', `Multi-Arch: same Pre-Depends: multiarch-support Breaks: ${multiarch:breaks} ')`Provides: libgcc1-armel [armel], libgcc1-armhf [armhf]') @@ -187,8 +187,8 @@ Section: debug Priority: extra Depends: BASEDEP, libgcc1`'LS (= ${gcc:EpochVersion}), ${misc:Depends} -ifdef(`TARGET',`',ifdef(`MULTIARCH', `Multi-Arch: same -')`Provides: libgcc1-dbg-armel [armel], libgcc1-dbg-armhf [armhf]') +ifdef(`TARGET',`',ifdef(`MULTIARCH', `Multi-Arch: same')) +ifdef(`TARGET',`',`Provides: libgcc1-dbg-armel [armel], libgcc1-dbg-armhf [armhf]') Description: GCC support library (debug symbols)`'ifdef(`TARGET)',` (TARGET)', `') Debug symbols for the GCC support library. ifdef(`TARGET', `dnl @@ -869,7 +869,7 @@ Priority: ifdef(`TARGET',`extra',`PRI(optional)') Depends: BASEDEP, ${shlibs:Depends}, ${misc:Depends} Description: GCC OpenMP (GOMP) support library - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection. Package: libgomp`'GOMP_SO-dbg`'LS @@ -880,7 +880,7 @@ ifdef(`TARGET',`',ifdef(`MULTIARCH', `Multi-Arch: same ')`Provides: libgomp'GOMP_SO`-dbg-armel [armel], libgomp'GOMP_SO`-dbg-armhf [armhf]') Description: GCC OpenMP (GOMP) support library (debug symbols) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection. Package: lib32gomp`'GOMP_SO`'LS @@ -890,7 +890,7 @@ Depends: BASEDEP, ${dep:libcbiarch}, ${shlibs:Depends}, ${misc:Depends} Conflicts: ${confl:lib32} Description: GCC OpenMP (GOMP) support library (32bit) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection. Package: lib32gomp`'GOMP_SO-dbg`'LS @@ -899,7 +899,7 @@ Priority: extra Depends: BASEDEP, lib32gomp`'GOMP_SO`'LS (= ${gcc:Version}), ${misc:Depends} Description: GCC OpenMP (GOMP) support library (32 bit debug symbols) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection. Package: lib64gomp`'GOMP_SO`'LS @@ -908,7 +908,7 @@ Priority: ifdef(`TARGET',`extra',`PRI(optional)') Depends: BASEDEP, ${dep:libcbiarch}, ${shlibs:Depends}, ${misc:Depends} Description: GCC OpenMP (GOMP) support library (64bit) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection. Package: lib64gomp`'GOMP_SO-dbg`'LS @@ -917,7 +917,7 @@ Priority: extra Depends: BASEDEP, lib64gomp`'GOMP_SO`'LS (= ${gcc:Version}), ${misc:Depends} Description: GCC OpenMP (GOMP) support library (64bit debug symbols) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection. Package: libn32gomp`'GOMP_SO`'LS @@ -926,7 +926,7 @@ Priority: ifdef(`TARGET',`extra',`PRI(optional)') Depends: BASEDEP, ${dep:libcbiarch}, ${shlibs:Depends}, ${misc:Depends} Description: GCC OpenMP (GOMP) support library (n32) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection. Package: libn32gomp`'GOMP_SO-dbg`'LS @@ -935,7 +935,7 @@ Priority: extra Depends: BASEDEP, libn32gomp`'GOMP_SO`'LS (= ${gcc:Version}), ${misc:Depends} Description: GCC OpenMP (GOMP) support library (n32 debug symbols) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers ifenabled(`libhfgomp',` Package: libhfgomp`'GOMP_SO`'LS @@ -945,7 +945,7 @@ Depends: BASEDEP, ${dep:libcbiarch}, ${shlibs:Depends}, ${misc:Depends} Conflicts: libgomp'GOMP_SO`-armhf [biarchhf_archs] Description: GCC OpenMP (GOMP) support library (hard float ABI) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection. Package: libhfgomp`'GOMP_SO-dbg`'LS @@ -955,7 +955,7 @@ Depends: BASEDEP, libhfgomp`'GOMP_SO`'LS (= ${gcc:Version}), ${misc:Depends} Conflicts: libgomp'GOMP_SO`-dbg-armhf [biarchhf_archs] Description: GCC OpenMP (GOMP) support library (hard float ABI debug symbols) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers ')`'dnl libhfgomp ifenabled(`libsfgomp',` @@ -966,7 +966,7 @@ Depends: BASEDEP, ${dep:libcbiarch}, ${shlibs:Depends}, ${misc:Depends} Conflicts: libgomp'GOMP_SO`-armel [biarchsf_archs] Description: GCC OpenMP (GOMP) support library (soft float ABI) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection. Package: libsfgomp`'GOMP_SO-dbg`'LS @@ -976,7 +976,7 @@ Depends: BASEDEP, libsfgomp`'GOMP_SO`'LS (= ${gcc:Version}), ${misc:Depends} Conflicts: libgomp'GOMP_SO`-dbg-armel [biarchsf_archs] Description: GCC OpenMP (GOMP) support library (soft float ABI debug symbols) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers ')`'dnl libsfgomp ifenabled(`libneongomp',` @@ -986,7 +986,7 @@ Priority: extra Depends: BASEDEP, libc6-neon`'LS, ${shlibs:Depends}, ${misc:Depends} Description: GCC OpenMP (GOMP) support library [neon optimized] - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection. . This set of libraries is optimized to use a NEON coprocessor, and will @@ -1319,9 +1319,9 @@ Provides: fortran95-compiler Suggests: ${gfortran:multilib}, gfortran`'PV-doc, libgfortran`'FORTRAN_SO-dbg`'LS Replaces: libgfortran`'FORTRAN_SO-dev -Description: GNU Fortran 95 compiler +Description: GNU Fortran compiler This is the GNU Fortran compiler, which compiles - Fortran 95 on platforms supported by the gcc compiler. It uses the + Fortran on platforms supported by the gcc compiler. It uses the gcc backend to generate optimized code. ifenabled(`multilib',` @@ -1330,8 +1330,8 @@ Section: devel Priority: ifdef(`TARGET',`extra',`PRI(optional)') Depends: BASEDEP, gfortran`'PV`'TS (= ${gcc:Version}), gcc`'PV-multilib`'TS (= ${gcc:Version}), ${dep:libgfortranbiarch}, ${shlibs:Depends}, ${misc:Depends} -Description: GNU Fortran 95 compiler (multilib files)`'ifdef(`TARGET)',` (cross compiler for TARGET architecture)', `') - This is the GNU Fortran compiler, which compiles Fortran 95 on platforms +Description: GNU Fortran compiler (multilib files)`'ifdef(`TARGET)',` (cross compiler for TARGET architecture)', `') + This is the GNU Fortran compiler, which compiles Fortran on platforms supported by the gcc compiler. . On architectures with multilib support, the package contains files @@ -1345,7 +1345,7 @@ Priority: PRI(optional) Depends: gcc`'PV-base (>= ${gcc:SoftVersion}), dpkg (>= 1.15.4) | install-info, ${misc:Depends} Description: Documentation for the GNU Fortran compiler (gfortran) - Documentation for the GNU Fortran 95 compiler in info `format'. + Documentation for the GNU Fortran compiler in info `format'. ')`'dnl gfdldoc ')`'dnl fdev diff -u gcc-4.6-4.6.2/debian/rules.patch gcc-4.6-4.6.2/debian/rules.patch --- gcc-4.6-4.6.2/debian/rules.patch +++ gcc-4.6-4.6.2/debian/rules.patch @@ -88,7 +88,6 @@ $(if $(with_linaro_branch),,pr49030) \ $(if $(with_linaro_branch),,pr50193) \ pr50114 \ - pr48660 \ # $(if $(filter yes, $(DEB_CROSS)),,gcc-print-file-name) \ # libstdc++-nothumb-check \ @@ -179,7 +178,6 @@ ifneq (,$(findstring $(DEB_TARGET_ARCH),arm armel armhf)) debian_patches += libjava-armel-unwind - debian_patches += $(if $(with_linaro_branch),,gcc-volatile-bitfields) endif ifeq ($(DEB_TARGET_ARCH),m68k) diff -u gcc-4.6-4.6.2/debian/control gcc-4.6-4.6.2/debian/control --- gcc-4.6-4.6.2/debian/control +++ gcc-4.6-4.6.2/debian/control @@ -458,7 +458,7 @@ Priority: optional Depends: gcc-4.6-base (= ${gcc:Version}), ${shlibs:Depends}, ${misc:Depends} Description: GCC OpenMP (GOMP) support library - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection. Package: libgomp1-dbg @@ -469,7 +469,7 @@ Multi-Arch: same Provides: libgomp1-dbg-armel [armel], libgomp1-dbg-armhf [armhf] Description: GCC OpenMP (GOMP) support library (debug symbols) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection. Package: lib32gomp1 @@ -479,7 +479,7 @@ Depends: gcc-4.6-base (= ${gcc:Version}), ${dep:libcbiarch}, ${shlibs:Depends}, ${misc:Depends} Conflicts: ${confl:lib32} Description: GCC OpenMP (GOMP) support library (32bit) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection. Package: lib32gomp1-dbg @@ -488,7 +488,7 @@ Priority: extra Depends: gcc-4.6-base (= ${gcc:Version}), lib32gomp1 (= ${gcc:Version}), ${misc:Depends} Description: GCC OpenMP (GOMP) support library (32 bit debug symbols) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection. Package: lib64gomp1 @@ -497,7 +497,7 @@ Priority: optional Depends: gcc-4.6-base (= ${gcc:Version}), ${dep:libcbiarch}, ${shlibs:Depends}, ${misc:Depends} Description: GCC OpenMP (GOMP) support library (64bit) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection. Package: lib64gomp1-dbg @@ -506,7 +506,7 @@ Priority: extra Depends: gcc-4.6-base (= ${gcc:Version}), lib64gomp1 (= ${gcc:Version}), ${misc:Depends} Description: GCC OpenMP (GOMP) support library (64bit debug symbols) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection. Package: libn32gomp1 @@ -515,7 +515,7 @@ Priority: optional Depends: gcc-4.6-base (= ${gcc:Version}), ${dep:libcbiarch}, ${shlibs:Depends}, ${misc:Depends} Description: GCC OpenMP (GOMP) support library (n32) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection. Package: libn32gomp1-dbg @@ -524,7 +524,7 @@ Priority: extra Depends: gcc-4.6-base (= ${gcc:Version}), libn32gomp1 (= ${gcc:Version}), ${misc:Depends} Description: GCC OpenMP (GOMP) support library (n32 debug symbols) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers Package: libhfgomp1 Section: libs @@ -533,7 +533,7 @@ Depends: gcc-4.6-base (= ${gcc:Version}), ${dep:libcbiarch}, ${shlibs:Depends}, ${misc:Depends} Conflicts: libgomp1-armhf [armel] Description: GCC OpenMP (GOMP) support library (hard float ABI) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection. Package: libhfgomp1-dbg @@ -543,7 +543,7 @@ Depends: gcc-4.6-base (= ${gcc:Version}), libhfgomp1 (= ${gcc:Version}), ${misc:Depends} Conflicts: libgomp1-dbg-armhf [armel] Description: GCC OpenMP (GOMP) support library (hard float ABI debug symbols) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers Package: libsfgomp1 Section: libs @@ -552,7 +552,7 @@ Depends: gcc-4.6-base (= ${gcc:Version}), ${dep:libcbiarch}, ${shlibs:Depends}, ${misc:Depends} Conflicts: libgomp1-armel [armhf] Description: GCC OpenMP (GOMP) support library (soft float ABI) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers in the GNU Compiler Collection. Package: libsfgomp1-dbg @@ -562,7 +562,7 @@ Depends: gcc-4.6-base (= ${gcc:Version}), libsfgomp1 (= ${gcc:Version}), ${misc:Depends} Conflicts: libgomp1-dbg-armel [armhf] Description: GCC OpenMP (GOMP) support library (soft float ABI debug symbols) - GOMP is an implementation of OpenMP for the C, C++, and Fortran 95 compilers + GOMP is an implementation of OpenMP for the C, C++, and Fortran compilers Package: libquadmath0 Section: libs @@ -841,9 +841,9 @@ Provides: fortran95-compiler Suggests: ${gfortran:multilib}, gfortran-4.6-doc, libgfortran3-dbg Replaces: libgfortran3-dev -Description: GNU Fortran 95 compiler +Description: GNU Fortran compiler This is the GNU Fortran compiler, which compiles - Fortran 95 on platforms supported by the gcc compiler. It uses the + Fortran on platforms supported by the gcc compiler. It uses the gcc backend to generate optimized code. Package: gfortran-4.6-multilib @@ -851,8 +851,8 @@ Section: devel Priority: optional Depends: gcc-4.6-base (= ${gcc:Version}), gfortran-4.6 (= ${gcc:Version}), gcc-4.6-multilib (= ${gcc:Version}), ${dep:libgfortranbiarch}, ${shlibs:Depends}, ${misc:Depends} -Description: GNU Fortran 95 compiler (multilib files) - This is the GNU Fortran compiler, which compiles Fortran 95 on platforms +Description: GNU Fortran compiler (multilib files) + This is the GNU Fortran compiler, which compiles Fortran on platforms supported by the gcc compiler. . On architectures with multilib support, the package contains files @@ -864,7 +864,7 @@ Priority: optional Depends: gcc-4.6-base (>= ${gcc:SoftVersion}), dpkg (>= 1.15.4) | install-info, ${misc:Depends} Description: Documentation for the GNU Fortran compiler (gfortran) - Documentation for the GNU Fortran 95 compiler in info format. + Documentation for the GNU Fortran compiler in info format. Package: libgfortran3 Section: libs diff -u gcc-4.6-4.6.2/debian/changelog gcc-4.6-4.6.2/debian/changelog --- gcc-4.6-4.6.2/debian/changelog +++ gcc-4.6-4.6.2/debian/changelog @@ -1,3 +1,36 @@ +gcc-4.6 (4.6.2-12ubuntu1) precise; urgency=low + + * Merge with Debian. + + -- Matthias Klose Fri, 20 Jan 2012 12:10:59 +0100 + +gcc-4.6 (4.6.2-12) unstable; urgency=low + + * Update to SVN 20120120 (r183333) from the gcc-4_6-branch. + - Fix PR middle-end/48660, PR tree-optimization/51315, + PR target/51756 (avr), PR rtl-optimization/38644, PR ada/41929, + PR target/48743 (x86), PR tree-optimization/49642, + PR rtl-optimization/51821, PR tree-optimization/51759, + PR rtl-optimization/51821, PR target/51623, PR c++/51854, PR c++/51868, + PR c++/51344, PR fortran/51800, PR fortran/51904. + + [ Matthias Klose ] + * Update the Linaro support to the 4.6-2012.01-1 release. + + [ Marcin Juszkiewicz ] + * Fix control file generation for ARM multiarch cross builds. + + -- Matthias Klose Fri, 20 Jan 2012 12:05:27 +0100 + +gcc-4.6 (4.6.2-11) unstable; urgency=low + + * Update to SVN 20120104 (r182901) from the gcc-4_6-branch. + - Fix PR tree-optimization/51624. + * gcc-volatile-bitfields.diff: Remove, integrated upstream. + * Replace Fortran 95 with Fortran in package descriptions. + + -- Matthias Klose Thu, 05 Jan 2012 06:04:20 +0100 + gcc-4.6 (4.6.2-10ubuntu1) precise; urgency=low * Merge with Debian. diff -u gcc-4.6-4.6.2/debian/patches/gcc-linaro.diff gcc-4.6-4.6.2/debian/patches/gcc-linaro.diff --- gcc-4.6-4.6.2/debian/patches/gcc-linaro.diff +++ gcc-4.6-4.6.2/debian/patches/gcc-linaro.diff @@ -1,8 +1,18 @@ -# DP: Changes for the Linaro 4.6-2011.12 release. +# DP: Changes for the Linaro 4.6-2012.01 release. --- a/src/ChangeLog +++ b/src/ChangeLog -@@ -1,3 +1,13 @@ +@@ -1,3 +1,23 @@ ++2012-01-02 Richard Guenther ++ ++ PR bootstrap/51686 ++ * Makefile.def (install-strip-gcc): Depend on install-strip-lto-plugin. ++ * Makefile.in: Regenerate. ++ ++2011-12-18 Eric Botcazou ++ ++ * configure: Regenerate. ++ +2011-11-20 Andreas Tobler + + * libtool.m4: Additional FreeBSD 10 fixes. @@ -18,7 +28,72 @@ * GCC 4.6.2 released. --- a/src/ChangeLog.linaro +++ b/src/ChangeLog.linaro -@@ -0,0 +1,3067 @@ +@@ -0,0 +1,3132 @@ ++2012-01-11 Andrew Stubbs ++ ++ GCC Linaro 4.6-2012.01 released. ++ ++ gcc/ ++ * LINARO-VERSION: Update. ++ ++2012-01-06 Andrew Stubbs ++ ++ Backport from mainline: ++ ++ 2012-01-06 Andrew Stubbs ++ ++ gcc/testsuite/ ++ * gcc.target/arm/headmerge-2.c: Adjust scan pattern. ++ ++2012-01-05 Andrew Stubbs ++ ++ Merge from FSF GCC 4.6.2 (svn branches/gcc-4_6-branch 182894). ++ ++2012-01-05 Michael Hope ++ ++ Backport from mainline r182271: ++ ++ 2011-12-13 Revital Eres ++ ++ gcc/ ++ * modulo-sched.c (mark_loop_unsched): Free bbs. ++ ++2011-12-30 Richard Sandiford ++ ++ gcc/ ++ Backport from mainline: ++ ++ 2011-10-12 Richard Sandiford ++ ++ * expr.h (copy_blkmode_to_reg): Declare. ++ * expr.c (copy_blkmode_to_reg): New function. ++ (expand_assignment): Don't expand register RESULT_DECLs before ++ the lhs. Use copy_blkmode_to_reg to copy BLKmode values into a ++ RESULT_DECL register. ++ (expand_expr_real_1): Handle BLKmode decls when looking for promotion. ++ * stmt.c (expand_return): Move BLKmode-to-register code into ++ copy_blkmode_to_reg. ++ ++2011-12-20 Ira Rosen ++ ++ Backport from mainline: ++ ++ 2011-11-29 Ira Rosen ++ ++ PR tree-optimization/51301 ++ gcc/ ++ * tree-vect-patterns.c (vect_recog_over_widening_pattern): Check that ++ the last statement doesn't convert to a bigger type than the original ++ type of the computation. ++ ++ gcc/testsuite/ ++ * gcc.dg/vect/pr51301.c: New test. ++ ++2011-12-06 Andrew Stubbs ++ ++ gcc/ ++ * LINARO-VERSION: Bump version. ++ +2011-12-06 Andrew Stubbs + + GCC Linaro 4.6-2011.12 released. @@ -3086,6 +3161,26 @@ + * LINARO-VERSION: New file. + +Imported GCC from FSF trunk SVN revision 170067. +--- a/src/Makefile.def ++++ b/src/Makefile.def +@@ -353,6 +353,7 @@ + dependencies = { module=install-gcc ; on=install-fixincludes; }; + dependencies = { module=install-gcc ; on=install-lto-plugin; }; + dependencies = { module=install-strip-gcc ; on=install-strip-fixincludes; }; ++dependencies = { module=install-strip-gcc ; on=install-strip-lto-plugin; }; + + dependencies = { module=configure-libcpp; on=configure-libiberty; hard=true; }; + dependencies = { module=configure-libcpp; on=configure-intl; }; +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -60017,6 +60017,7 @@ + install-gcc: maybe-install-fixincludes + install-gcc: maybe-install-lto-plugin + install-strip-gcc: maybe-install-strip-fixincludes ++install-strip-gcc: maybe-install-strip-lto-plugin + configure-libcpp: configure-libiberty + + configure-stage1-libcpp: configure-stage1-libiberty --- a/src/boehm-gc/ChangeLog +++ b/src/boehm-gc/ChangeLog @@ -1,3 +1,7 @@ @@ -3152,8 +3247,51 @@ shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) +--- a/src/config/ChangeLog ++++ b/src/config/ChangeLog +@@ -1,3 +1,7 @@ ++2011-12-18 Eric Botcazou ++ ++ * acx.m4 (Test for GNAT): Update comment and add quotes in final test. ++ + 2011-10-26 Release Manager + + * GCC 4.6.2 released. +--- a/src/config/acx.m4 ++++ b/src/config/acx.m4 +@@ -356,9 +356,9 @@ + ac_c_preproc_warn_flag=yes])# AC_PROG_CPP_WERROR + + # Test for GNAT. +-# We require the gnatbind program, and a compiler driver that +-# understands Ada. We use the user's CC setting, already found, +-# and possibly add $1 to the command-line parameters. ++# We require the gnatbind & gnatmake programs, as well as a compiler driver ++# that understands Ada. We use the user's CC setting, already found, and ++# possibly add $1 to the command-line parameters. + # + # Sets the shell variable have_gnat to yes or no as appropriate, and + # substitutes GNATBIND and GNATMAKE. +@@ -387,7 +387,7 @@ + fi + rm -f conftest.*]) + +-if test x$GNATBIND != xno && test x$GNATMAKE != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then ++if test "x$GNATBIND" != xno && test "x$GNATMAKE" != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then + have_gnat=yes + else + have_gnat=no --- a/src/configure +++ b/src/configure +@@ -5117,7 +5117,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_cc_gcc_supports_ada" >&5 + $as_echo "$acx_cv_cc_gcc_supports_ada" >&6; } + +-if test x$GNATBIND != xno && test x$GNATMAKE != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then ++if test "x$GNATBIND" != xno && test "x$GNATMAKE" != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then + have_gnat=yes + else + have_gnat=no @@ -6944,10 +6944,6 @@ extra_arflags_for_target=" -X32_64" extra_nmflags_for_target=" -B -X32_64" @@ -3180,7 +3318,324 @@ ;; --- a/src/gcc/ChangeLog +++ b/src/gcc/ChangeLog -@@ -1,3 +1,161 @@ +@@ -1,3 +1,483 @@ ++2012-01-04 Eric Botcazou ++ ++ PR tree-optimization/51624 ++ * tree-sra.c (build_ref_for_model): When replicating a chain of ++ COMPONENT_REFs, stop as soon as the offset would become negative. ++ ++2012-01-04 Richard Guenther ++ ++ PR tree-optimization/49651 ++ * tree-ssa-structalias.c (type_can_have_subvars): New function. ++ (var_can_have_subvars): Use it. ++ (get_constraint_for_1): Only consider subfields if there ++ can be any. ++ ++2012-01-03 Sandra Loosemore ++ ++ Backport from mainline: ++ 2012-01-02 Sandra Loosemore ++ ++ * doc/invoke.texi (-flto and related options): Copy-edit. ++ ++2012-01-03 Richard Guenther ++ ++ Backport from mainline ++ 2011-11-10 Richard Guenther ++ ++ PR tree-optimization/51042 ++ * tree-ssa-pre.c (phi_translate_1): Avoid recursing on ++ self-referential expressions. Refactor code to avoid duplication. ++ ++2012-01-03 Richard Guenther ++ ++ PR tree-optimization/51070 ++ * tree-loop-distribution.c (generate_builtin): Do not replace ++ the loop with a builtin if the partition contains statements which ++ results are used outside of the loop. ++ (stmt_has_scalar_dependences_outside_loop): Properly handle calls. ++ ++2011-12-30 Michael Meissner ++ ++ Backport from the mainline ++ 2011-12-30 Michael Meissner ++ ++ * config/rs6000/rs6000.c (rs6000_inner_target_options): Fix thinko ++ in setting options via target #pragma or attribute. ++ ++2011-12-28 Michael Meissner ++ ++ Backport from mainline ++ 2011-12-28 Michael Meissner ++ ++ PR target/51623 ++ * config/rs6000/rs6000.c (rs6000_assemble_integer): Don't call ++ unlikely_text_section_p. Instead check for being in a code ++ section. ++ ++2011-12-23 Richard Guenther ++ ++ PR rtl-optimization/50396 ++ * simplify-rtx.c (simplify_binary_operation_1): Properly ++ guard code that only works for integers. ++ ++2011-12-22 Doug Kwan ++ ++ Backport from mainline ++ 2011-03-23 Julian Brown ++ ++ * expr.c (expand_expr_real_1): Only use BLKmode for volatile ++ accesses which are not naturally aligned. ++ ++ 2011-11-20 Joey Ye ++ ++ * expr.c (expand_expr_real_1): Correctly handle strict volatile ++ bitfield loads smaller than mode size. ++ ++2011-12-21 Richard Earnshaw ++ ++ PR target/51643 ++ * arm.c (arm_function_ok_for_sibcall): Use DECL_WEAK in previous ++ change. ++ ++2011-12-21 Richard Earnshaw ++ ++ PR target/51643 ++ * arm.c (arm_function_ok_for_sibcall): Don't try to tailcall a ++ weak function on bare-metal EABI targets. ++ ++2011-12-21 Uros Bizjak ++ ++ Backport from mainline ++ 2011-12-21 Richard Guenther ++ ++ PR lto/41159 ++ * tree-outof-ssa.c (insert_value_copy_on_edge): Use the ++ mode of the pseudo as destination mode. Only assert that ++ is equal to the promoted mode of the decl if it is a REG. ++ ++2011-12-21 Uros Bizjak ++ ++ * config/alpha/linux-unwind.h: Update copyright years. ++ (MD_FROB_UPDATE_CONTEXT): New define. ++ (alpha_frob_update_context): New function. ++ ++2011-12-19 Martin Jambor ++ ++ PR tree-optimization/51583 ++ * tree-sra.c (load_assign_lhs_subreplacements): Call ++ force_gimple_operand_gsi when necessary also in case of no ++ corresponding replacement on the RHS. ++ ++2011-12-16 Eric Botcazou ++ ++ * config/sparc/sparc.md (UNSPEC_FRAME_BLOCKAGE): New constant. ++ (frame_blockage): New expander. ++ (frame_blockage): New instruction. ++ * config/sparc/sparc.c (sparc_expand_prologue): When the sequence of ++ instructions establishing the frame isn't atomic, emit frame blockage. ++ ++2011-12-15 H.J. Lu ++ ++ Backport from mainline. ++ 2011-10-28 Chung-Lin Tang ++ ++ PR rtl-optimization/49720 ++ * simplify-rtx.c (simplify_relational_operation_1): Detect ++ infinite recursion condition in "(eq/ne (plus x cst1) cst2) ++ simplifies to (eq/ne x (cst2 - cst1))" case. ++ ++2011-12-15 Andreas Tobler ++ ++ Backport from mainline. ++ 2011-12-15 Andreas Tobler ++ ++ * config/i386/freebsd.h (TARGET_ASM_FILE_END): Define. ++ ++2011-12-13 Eric Botcazou ++ ++ * lto-streamer-out.c (write_symbol): Use proper 64-bit host type. ++ * lto-cgraph.c (input_cgraph_opt_section): Use 'int' for offsets. ++ * lto-streamer-in.c (lto_read_body): Likewise. ++ (lto_input_toplevel_asms): Likewise. ++ * lto-section-in.c (lto_create_simple_input_block): Likewise. ++ * lto-opts.c (lto_read_file_options): Likewise. ++ * ipa-prop.c (ipa_prop_read_section): Likewise. ++ ++ * df.h (DF_NOTE): Fix typo in comment. ++ ++2011-12-13 Andreas Krebbel ++ ++ * regmove.c (fixup_match_2): Only access call_used_regs with hard ++ regs. ++ ++2011-12-12 Jakub Jelinek ++ ++ PR middle-end/51510 ++ * calls.c (internal_arg_pointer_based_exp_scan): Don't use ++ VEC_safe_grow_cleared if idx is smaller than VEC_length. ++ ++ Backported from mainline ++ 2011-12-11 Jakub Jelinek ++ ++ PR tree-optimization/51485 ++ * tree-vect-data-refs.c (vect_analyze_data_refs): Give up on ++ DRs in call stmts. ++ ++2011-12-12 Eric Botcazou ++ ++ PR tree-optimization/50569 ++ * tree-sra.c (build_ref_for_model): Replicate a chain of COMPONENT_REFs ++ in the expression of MODEL instead of just the last one. ++ ++2011-12-09 Michael Meissner ++ ++ Backport from mainline ++ 2011-12-09 Michael Meissner ++ ++ PR rtl-optimization/51469 ++ * varasm.c (default_binds_local_p_1): If the symbol is a gnu ++ indirect function, mark the symbol as non-local. ++ ++2011-12-09 Jakub Jelinek ++ ++ Backport from mainline ++ 2011-12-08 Jakub Jelinek ++ ++ PR tree-optimization/51466 ++ * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Also copy ++ TREE_SIDE_EFFECTS. ++ ++ 2011-11-28 Jakub Jelinek ++ ++ PR tree-optimization/50078 ++ * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Copy over ++ TREE_THIS_VOLATILE also from the old to new lhs resp. rhs. ++ ++2011-12-09 Kazu Hirata ++ ++ Backport from mainline: ++ ++ 2011-12-05 Kazu Hirata ++ ++ PR target/51408 ++ * config/arm/arm.md (*minmax_arithsi): Always require the else ++ clause in the MINUS case. ++ ++2011-12-08 Teresa Johnson ++ ++ Backport from mainline: ++ ++ 2011-08-05 Uros Bizjak ++ ++ * config/i386/i386.md (*movdi_internal_rex64): Use "!o" constraint ++ instead of "!m" for operand 0, alternative 4. ++ (*movdf_internal_rex64): Ditto for operand 0, alernative 6. ++ ++2011-12-08 Jakub Jelinek ++ ++ Backport from mainline ++ 2011-12-05 Jakub Jelinek ++ ++ PR debug/51410 ++ * c-decl.c (pop_scope): Don't add DECL_EXTERNAL decls ++ for debug info if scope is file_scope. ++ ++ PR c/51339 ++ * c-decl.c (c_finish_incomplete_decl, finish_decl): Call ++ relayout_decl instead of layout_decl. ++ ++ 2011-12-05 Jakub Jelinek ++ Eric Botcazou ++ ++ PR middle-end/51323 ++ PR middle-end/50074 ++ * calls.c (internal_arg_pointer_exp_state): New variable. ++ (internal_arg_pointer_based_exp_1, ++ internal_arg_pointer_exp_scan): New functions. ++ (internal_arg_pointer_based_exp): New function. ++ (mem_overlaps_already_clobbered_arg_p): Use it. ++ (expand_call): Free internal_arg_pointer_exp_state.cache vector ++ and clear internal_arg_pointer_exp_state.scan_start. ++ ++ 2011-11-30 Jakub Jelinek ++ ++ PR rtl-optimization/48721 ++ * sched-deps.c (sched_analyze_insn): For SIBLING_CALL_P set ++ reg_pending_barrier to TRUE_BARRIER. ++ ++ 2011-11-26 Joern Rennecke ++ ++ PR middle-end/50074 ++ * calls.c (mem_overlaps_already_clobbered_arg_p): ++ Return false if no outgoing arguments have been stored so far. ++ ++2011-12-08 Eric Botcazou ++ ++ PR tree-optimization/51315 ++ * tree-sra.c (tree_non_mode_aligned_mem_p): Rename to... ++ (tree_non_aligned_mem_p): ...this. Add ALIGN parameter. Look into ++ MEM_REFs and use get_object_or_type_alignment for them. ++ (build_accesses_from_assign): Adjust for above change. ++ (access_precludes_ipa_sra_p): Likewise. ++ ++2011-12-06 Martin Jambor ++ ++ Backport from mainline: ++ ++ 2011-12-02 Martin Jambor ++ ++ PR tree-optimization/50622 ++ * tree-sra.c (load_assign_lhs_subreplacements): Force gimple operand ++ if both lacc and racc are grp_partial_lhs. ++ ++2011-12-06 Iain Sandoe ++ ++ * config/rs6000/rs6000.c (darwin_rs6000_override_options): Initialize ++ rs6000_current_abi. ++ ++2011-12-06 Alan Modra ++ ++ PR target/50906 ++ * config/rs6000/rs6000.c (rs6000_emit_prologue ): ++ Do not mark r11 setup as frame-related. Pass correct offset to ++ rs6000_emit_savres_rtx. Correct out-of-line rs6000_frame_related ++ arguments. Correct sp_offset. Remove "offset" fudge from ++ in-line rs6000_frame_related call. Rename misleading variable. ++ Fix comments and whitespace. Tidy some expressions. ++ (rs6000_emit_epilogue ): Always set frame_reg_rtx ++ to r11 in out-of-line case. Correct sp_offset. Pass correct ++ offset to rs6000_emit_savres_rtx. Rename misleading variable. ++ Fix comments and whitespace. Tidy some expressions. ++ (rs6000_emit_epilogue ): Add sp_offset ++ adjustment when !saving_GPRs_inline. Correct register mode ++ used in address calcs. ++ (rs6000_emit_epilogue ): Similarly when ++ !restoring_GPRs_inline. ++ ++2011-12-04 Jérémie Detrey ++ ++ PR target/51393 ++ * config/i386/avxintrin.h (_mm256_insert_epi64): Declare second ++ parameter as long long. ++ ++2011-12-02 Georg-Johann Lay ++ ++ PR target/51002 ++ PR target/51345 ++ * config/avr/libgcc.S (__prologue_saves__, __epilogue_restores__): ++ Enclose parts using __SP_H__ in !defined (__AVR_HAVE_8BIT_SP__). ++ Add FIXME comments. ++ * config/avr/avr.md (movhi_sp_r_irq_off, movhi_sp_r_irq_on): Set ++ insn condition to !AVR_HAVE_8BIT_SP. ++ * config/avr/avr.c (output_movhi): "clr%B0" instead of "in ++ %B0,__SP_H__" if AVR_HAVE_8BIT_SP. ++ (avr_file_start): Only print "__SP_H__ = 0x3e" if !AVR_HAVE_8BIT_SP. ++ * config/avr/avr-devices.c (avr_mcu_types): ATtiny4313 and ++ AT86RF401 have a 16-bit SP (their manual is bogus). ++ +2011-11-25 Richard Sandiford + + Backport from mainline: @@ -3339,10 +3794,15 @@ + * config/i386/sse.md (*avx_unpcklpd256): Remove extra insn + constraints. Change alternative 1 to "x,m,1". + ++2011-10-26 Jakub Jelinek ++ ++ * BASE-VER: Set to 4.6.3. ++ * DEV-PHASE: Set to prerelease. ++ 2011-10-26 Release Manager * GCC 4.6.2 released. -@@ -144,8 +307,8 @@ +@@ -144,8 +624,8 @@ 2011-10-07 Bernd Schmidt @@ -3353,15 +3813,24 @@ 2011-10-06 Jakub Jelinek +@@ -252,7 +732,7 @@ + * config/rs6000/rs6000.md (probe_stack): Use explicit operand. + * config/rs6000/rs6000.c (output_probe_stack_range): Likewise. + +-2011-09-14 Diego Novillo ++2011-09-14 Diego Novillo + + * tree-vect-stmts.c (vect_transform_stmt): Remove unused + local variable ORIG_SCALAR_STMT. --- a/src/gcc/DATESTAMP +++ b/src/gcc/DATESTAMP @@ -1 +1 @@ -20111026 -+20111201 ++20120105 --- a/src/gcc/LINARO-VERSION +++ b/src/gcc/LINARO-VERSION @@ -0,0 +1 @@ -+4.6-2011.12 ++4.6-2012.01 --- a/src/gcc/Makefile.in +++ b/src/gcc/Makefile.in @@ -888,6 +888,8 @@ @@ -3411,7 +3880,20 @@ $(TREE_FLOW_H) value-prof.h $(FLAGS_H) $(DEMANGLE_H) \ --- a/src/gcc/ada/ChangeLog +++ b/src/gcc/ada/ChangeLog -@@ -1,3 +1,33 @@ +@@ -1,3 +1,46 @@ ++2012-01-02 Eric Botcazou ++ ++ * gnatvsn.ads (Current_Year): Bump to 2011. ++ ++2011-12-08 Eric Botcazou ++ ++ PR tree-optimization/51315 ++ Backport from mainline ++ 2011-09-25 Eric Botcazou ++ ++ * gcc-interface/decl.c (gnat_to_gnu_entity) : Do not promote ++ the alignment if this doesn't prevent BLKmode access to the object. ++ +2011-11-13 Iain Sandoe + + Backport from mainline r181474 @@ -3552,6 +4034,64 @@ $(MAKE) -C $(RTSDIR) \ CC="`echo \"$(GCC_FOR_TARGET)\" \ | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \ +--- a/src/gcc/ada/gcc-interface/decl.c ++++ b/src/gcc/ada/gcc-interface/decl.c +@@ -808,16 +808,30 @@ + && No (Address_Clause (gnat_entity)))) + && TREE_CODE (TYPE_SIZE (gnu_type)) == INTEGER_CST) + { +- /* No point in jumping through all the hoops needed in order ++ unsigned int size_cap, align_cap; ++ ++ /* No point in promoting the alignment if this doesn't prevent ++ BLKmode access to the object, in particular block copy, as ++ this will for example disable the NRV optimization for it. ++ No point in jumping through all the hoops needed in order + to support BIGGEST_ALIGNMENT if we don't really have to. + So we cap to the smallest alignment that corresponds to + a known efficient memory access pattern of the target. */ +- unsigned int align_cap = Is_Atomic (gnat_entity) +- ? BIGGEST_ALIGNMENT +- : get_mode_alignment (ptr_mode); ++ if (Is_Atomic (gnat_entity)) ++ { ++ size_cap = UINT_MAX; ++ align_cap = BIGGEST_ALIGNMENT; ++ } ++ else ++ { ++ size_cap = MAX_FIXED_MODE_SIZE; ++ align_cap = get_mode_alignment (ptr_mode); ++ } + + if (!host_integerp (TYPE_SIZE (gnu_type), 1) +- || compare_tree_int (TYPE_SIZE (gnu_type), align_cap) >= 0) ++ || compare_tree_int (TYPE_SIZE (gnu_type), size_cap) > 0) ++ align = 0; ++ else if (compare_tree_int (TYPE_SIZE (gnu_type), align_cap) > 0) + align = align_cap; + else + align = ceil_alignment (tree_low_cst (TYPE_SIZE (gnu_type), 1)); +--- a/src/gcc/ada/gnatvsn.ads ++++ b/src/gcc/ada/gnatvsn.ads +@@ -6,7 +6,7 @@ + -- -- + -- S p e c -- + -- -- +--- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- ++-- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- + -- -- + -- GNAT is free software; you can redistribute it and/or modify it under -- + -- terms of the GNU General Public License as published by the Free Soft- -- +@@ -92,7 +92,7 @@ + Verbose_Library_Version : constant String := "GNAT Lib v" & Library_Version; + -- Version string stored in e.g. ALI files + +- Current_Year : constant String := "2010"; ++ Current_Year : constant String := "2011"; + -- Used in printing copyright messages + + end Gnatvsn; --- a/src/gcc/ada/init.c +++ b/src/gcc/ada/init.c @@ -2216,12 +2216,33 @@ @@ -3665,6 +4205,35 @@ else if (CONSTANT_CLASS_P (exp)) { align = TYPE_ALIGN (TREE_TYPE (exp)); +--- a/src/gcc/c-decl.c ++++ b/src/gcc/c-decl.c +@@ -721,7 +721,7 @@ + + complete_array_type (&TREE_TYPE (decl), NULL_TREE, true); + +- layout_decl (decl, 0); ++ relayout_decl (decl); + } + } + } +@@ -1200,7 +1200,7 @@ + DECL_CHAIN (p) = BLOCK_VARS (block); + BLOCK_VARS (block) = p; + } +- else if (VAR_OR_FUNCTION_DECL_P (p)) ++ else if (VAR_OR_FUNCTION_DECL_P (p) && scope != file_scope) + { + /* For block local externs add a special + DECL_EXTERNAL decl for debug info generation. */ +@@ -4261,7 +4261,7 @@ + if (DECL_INITIAL (decl)) + TREE_TYPE (DECL_INITIAL (decl)) = type; + +- layout_decl (decl, 0); ++ relayout_decl (decl); + } + + if (TREE_CODE (decl) == VAR_DECL) --- a/src/gcc/c-family/ChangeLog +++ b/src/gcc/c-family/ChangeLog @@ -1,3 +1,15 @@ @@ -3854,7 +4423,177 @@ args[i].value = force_reg (args[i].mode, args[i].value); /* If we are to promote the function arg to a wider mode, -@@ -3449,7 +3449,8 @@ +@@ -1548,6 +1548,131 @@ + return funexp; + } + ++/* Internal state for internal_arg_pointer_based_exp and its helpers. */ ++static struct ++{ ++ /* Last insn that has been scanned by internal_arg_pointer_based_exp_scan, ++ or NULL_RTX if none has been scanned yet. */ ++ rtx scan_start; ++ /* Vector indexed by REGNO - FIRST_PSEUDO_REGISTER, recording if a pseudo is ++ based on crtl->args.internal_arg_pointer. The element is NULL_RTX if the ++ pseudo isn't based on it, a CONST_INT offset if the pseudo is based on it ++ with fixed offset, or PC if this is with variable or unknown offset. */ ++ VEC(rtx, heap) *cache; ++} internal_arg_pointer_exp_state; ++ ++static rtx internal_arg_pointer_based_exp (rtx, bool); ++ ++/* Helper function for internal_arg_pointer_based_exp. Scan insns in ++ the tail call sequence, starting with first insn that hasn't been ++ scanned yet, and note for each pseudo on the LHS whether it is based ++ on crtl->args.internal_arg_pointer or not, and what offset from that ++ that pointer it has. */ ++ ++static void ++internal_arg_pointer_based_exp_scan (void) ++{ ++ rtx insn, scan_start = internal_arg_pointer_exp_state.scan_start; ++ ++ if (scan_start == NULL_RTX) ++ insn = get_insns (); ++ else ++ insn = NEXT_INSN (scan_start); ++ ++ while (insn) ++ { ++ rtx set = single_set (insn); ++ if (set && REG_P (SET_DEST (set)) && !HARD_REGISTER_P (SET_DEST (set))) ++ { ++ rtx val = NULL_RTX; ++ unsigned int idx = REGNO (SET_DEST (set)) - FIRST_PSEUDO_REGISTER; ++ /* Punt on pseudos set multiple times. */ ++ if (idx < VEC_length (rtx, internal_arg_pointer_exp_state.cache) ++ && (VEC_index (rtx, internal_arg_pointer_exp_state.cache, idx) ++ != NULL_RTX)) ++ val = pc_rtx; ++ else ++ val = internal_arg_pointer_based_exp (SET_SRC (set), false); ++ if (val != NULL_RTX) ++ { ++ if (idx ++ >= VEC_length (rtx, internal_arg_pointer_exp_state.cache)) ++ VEC_safe_grow_cleared (rtx, heap, ++ internal_arg_pointer_exp_state.cache, ++ idx + 1); ++ VEC_replace (rtx, internal_arg_pointer_exp_state.cache, ++ idx, val); ++ } ++ } ++ if (NEXT_INSN (insn) == NULL_RTX) ++ scan_start = insn; ++ insn = NEXT_INSN (insn); ++ } ++ ++ internal_arg_pointer_exp_state.scan_start = scan_start; ++} ++ ++/* Helper function for internal_arg_pointer_based_exp, called through ++ for_each_rtx. Return 1 if *LOC is a register based on ++ crtl->args.internal_arg_pointer. Return -1 if *LOC is not based on it ++ and the subexpressions need not be examined. Otherwise return 0. */ ++ ++static int ++internal_arg_pointer_based_exp_1 (rtx *loc, void *data ATTRIBUTE_UNUSED) ++{ ++ if (REG_P (*loc) && internal_arg_pointer_based_exp (*loc, false) != NULL_RTX) ++ return 1; ++ if (MEM_P (*loc)) ++ return -1; ++ return 0; ++} ++ ++/* Compute whether RTL is based on crtl->args.internal_arg_pointer. Return ++ NULL_RTX if RTL isn't based on it, a CONST_INT offset if RTL is based on ++ it with fixed offset, or PC if this is with variable or unknown offset. ++ TOPLEVEL is true if the function is invoked at the topmost level. */ ++ ++static rtx ++internal_arg_pointer_based_exp (rtx rtl, bool toplevel) ++{ ++ if (CONSTANT_P (rtl)) ++ return NULL_RTX; ++ ++ if (rtl == crtl->args.internal_arg_pointer) ++ return const0_rtx; ++ ++ if (REG_P (rtl) && HARD_REGISTER_P (rtl)) ++ return NULL_RTX; ++ ++ if (GET_CODE (rtl) == PLUS && CONST_INT_P (XEXP (rtl, 1))) ++ { ++ rtx val = internal_arg_pointer_based_exp (XEXP (rtl, 0), toplevel); ++ if (val == NULL_RTX || val == pc_rtx) ++ return val; ++ return plus_constant (val, INTVAL (XEXP (rtl, 1))); ++ } ++ ++ /* When called at the topmost level, scan pseudo assignments in between the ++ last scanned instruction in the tail call sequence and the latest insn ++ in that sequence. */ ++ if (toplevel) ++ internal_arg_pointer_based_exp_scan (); ++ ++ if (REG_P (rtl)) ++ { ++ unsigned int idx = REGNO (rtl) - FIRST_PSEUDO_REGISTER; ++ if (idx < VEC_length (rtx, internal_arg_pointer_exp_state.cache)) ++ return VEC_index (rtx, internal_arg_pointer_exp_state.cache, idx); ++ ++ return NULL_RTX; ++ } ++ ++ if (for_each_rtx (&rtl, internal_arg_pointer_based_exp_1, NULL)) ++ return pc_rtx; ++ ++ return NULL_RTX; ++} ++ + /* Return true if and only if SIZE storage units (usually bytes) + starting from address ADDR overlap with already clobbered argument + area. This function is used to determine if we should give up a +@@ -1557,20 +1682,17 @@ + mem_overlaps_already_clobbered_arg_p (rtx addr, unsigned HOST_WIDE_INT size) + { + HOST_WIDE_INT i; ++ rtx val; + +- if (addr == crtl->args.internal_arg_pointer) +- i = 0; +- else if (GET_CODE (addr) == PLUS +- && XEXP (addr, 0) == crtl->args.internal_arg_pointer +- && CONST_INT_P (XEXP (addr, 1))) +- i = INTVAL (XEXP (addr, 1)); +- /* Return true for arg pointer based indexed addressing. */ +- else if (GET_CODE (addr) == PLUS +- && (XEXP (addr, 0) == crtl->args.internal_arg_pointer +- || XEXP (addr, 1) == crtl->args.internal_arg_pointer)) ++ if (sbitmap_empty_p (stored_args_map)) ++ return false; ++ val = internal_arg_pointer_based_exp (addr, true); ++ if (val == NULL_RTX) ++ return false; ++ else if (val == pc_rtx) + return true; + else +- return false; ++ i = INTVAL (val); + + #ifdef ARGS_GROW_DOWNWARD + i = -i - size; +@@ -3175,6 +3297,8 @@ + } + + sbitmap_free (stored_args_map); ++ internal_arg_pointer_exp_state.scan_start = NULL_RTX; ++ VEC_free (rtx, heap, internal_arg_pointer_exp_state.cache); + } + else + { +@@ -3449,7 +3573,8 @@ /* Make sure it is a reasonable operand for a move or push insn. */ if (!REG_P (addr) && !MEM_P (addr) @@ -3864,7 +4603,7 @@ addr = force_operand (addr, NULL_RTX); argvec[count].value = addr; -@@ -3490,7 +3491,7 @@ +@@ -3490,7 +3615,7 @@ /* Make sure it is a reasonable operand for a move or push insn. */ if (!REG_P (val) && !MEM_P (val) @@ -4225,6 +4964,81 @@ else compare_mode = SELECT_CC_MODE (new_code, op0, op1); +--- a/src/gcc/config/alpha/linux-unwind.h ++++ b/src/gcc/config/alpha/linux-unwind.h +@@ -1,5 +1,5 @@ + /* DWARF2 EH unwinding support for Alpha Linux. +- Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc. ++ Copyright (C) 2004, 2005, 2009, 2011 Free Software Foundation, Inc. + + This file is part of GCC. + +@@ -36,16 +36,17 @@ + { + unsigned int *pc = context->ra; + struct sigcontext *sc; +- long new_cfa, i; ++ long new_cfa; ++ int i; + + if (pc[0] != 0x47fe0410 /* mov $30,$16 */ +- || pc[2] != 0x00000083 /* callsys */) ++ || pc[2] != 0x00000083) /* callsys */ + return _URC_END_OF_STACK; + if (context->cfa == 0) + return _URC_END_OF_STACK; + if (pc[1] == 0x201f0067) /* lda $0,NR_sigreturn */ + sc = context->cfa; +- else if (pc[1] == 0x201f015f) /* lda $0,NR_rt_sigreturn */ ++ else if (pc[1] == 0x201f015f) /* lda $0,NR_rt_sigreturn */ + { + struct rt_sigframe { + struct siginfo info; +@@ -55,6 +56,7 @@ + } + else + return _URC_END_OF_STACK; ++ + new_cfa = sc->sc_regs[30]; + fs->regs.cfa_how = CFA_REG_OFFSET; + fs->regs.cfa_reg = 30; +@@ -63,13 +65,13 @@ + { + fs->regs.reg[i].how = REG_SAVED_OFFSET; + fs->regs.reg[i].loc.offset +- = (long)&sc->sc_regs[i] - new_cfa; ++ = (long) &sc->sc_regs[i] - new_cfa; + } + for (i = 0; i < 31; ++i) + { + fs->regs.reg[i+32].how = REG_SAVED_OFFSET; + fs->regs.reg[i+32].loc.offset +- = (long)&sc->sc_fpregs[i] - new_cfa; ++ = (long) &sc->sc_fpregs[i] - new_cfa; + } + fs->regs.reg[64].how = REG_SAVED_OFFSET; + fs->regs.reg[64].loc.offset = (long)&sc->sc_pc - new_cfa; +@@ -78,3 +80,20 @@ + + return _URC_NO_REASON; + } ++ ++#define MD_FROB_UPDATE_CONTEXT alpha_frob_update_context ++ ++/* Fix up for signal handlers that don't have S flag set. */ ++ ++static void ++alpha_frob_update_context (struct _Unwind_Context *context, ++ _Unwind_FrameState *fs ATTRIBUTE_UNUSED) ++{ ++ unsigned int *pc = context->ra; ++ ++ if (pc[0] == 0x47fe0410 /* mov $30,$16 */ ++ && pc[2] == 0x00000083 /* callsys */ ++ && (pc[1] == 0x201f0067 /* lda $0,NR_sigreturn */ ++ || pc[1] == 0x201f015f)) /* lda $0,NR_rt_sigreturn */ ++ _Unwind_SetSignalFrame (context, 1); ++} --- a/src/gcc/config/arm/arm-cores.def +++ b/src/gcc/config/arm/arm-cores.def @@ -70,10 +70,10 @@ @@ -5252,7 +6066,22 @@ if (final_invert) { -@@ -5916,7 +6128,7 @@ +@@ -5077,6 +5289,14 @@ + if (IS_STACKALIGN (func_type)) + return false; + ++ /* The AAPCS says that, on bare-metal, calls to unresolved weak ++ references should become a NOP. Don't convert such calls into ++ sibling calls. */ ++ if (TARGET_AAPCS_BASED ++ && arm_abi == ARM_ABI_AAPCS ++ && DECL_WEAK (decl)) ++ return false; ++ + /* Everything else is ok. */ + return true; + } +@@ -5916,7 +6136,7 @@ addresses based on the frame pointer or arg pointer until the reload pass starts. This is so that eliminating such addresses into stack based ones won't produce impossible code. */ @@ -5261,7 +6090,7 @@ thumb1_legitimate_address_p (enum machine_mode mode, rtx x, int strict_p) { /* ??? Not clear if this is right. Experiment. */ -@@ -6406,23 +6618,134 @@ +@@ -6406,23 +6626,134 @@ HOST_WIDE_INT val = INTVAL (XEXP (*p, 1)); HOST_WIDE_INT low, high; @@ -5413,7 +6242,7 @@ else return false; -@@ -6535,9 +6858,47 @@ +@@ -6535,9 +6866,47 @@ return for_each_rtx (&x, arm_tls_operand_p_1, NULL); } @@ -5462,7 +6291,7 @@ arm_cannot_force_const_mem (rtx x) { rtx base, offset; -@@ -7233,6 +7594,9 @@ +@@ -7233,6 +7602,9 @@ *total = COSTS_N_INSNS (4); return true; @@ -5472,7 +6301,7 @@ default: *total = COSTS_N_INSNS (4); return false; -@@ -7580,6 +7944,9 @@ +@@ -7580,6 +7952,9 @@ *total = COSTS_N_INSNS (1) + 1; return true; @@ -5482,7 +6311,7 @@ default: if (mode != VOIDmode) *total = COSTS_N_INSNS (ARM_NUM_REGS (mode)); -@@ -8160,6 +8527,21 @@ +@@ -8160,6 +8535,21 @@ return cost; } @@ -5504,7 +6333,7 @@ static int fp_consts_inited = 0; /* Only zero is valid for VFP. Other values are also valid for FPA. */ -@@ -8617,24 +8999,106 @@ +@@ -8617,28 +9007,110 @@ return 1; } @@ -5548,8 +6377,6 @@ - if (quad) - sprintf (templ, "%s.i%d\t%%q0, %%2", mnem, width); -- else -- sprintf (templ, "%s.i%d\t%%P0, %%2", mnem, width); + if (i != 0 && elpart != last_elt) + return 0; + @@ -5597,12 +6424,12 @@ + + if (quad) + sprintf (templ, "%s.i%d\t%%q0, %%2", mnem, width); -+ else -+ sprintf (templ, "%s.i%d\t%%P0, %%2", mnem, width); -+ -+ return templ; -+} -+ + else + sprintf (templ, "%s.i%d\t%%P0, %%2", mnem, width); + + return templ; + } + +/* Return a string suitable for output of Neon immediate shift operation + (VSHR or VSHL) MNEM. */ + @@ -5621,10 +6448,14 @@ + sprintf (templ, "%s.%c%d\t%%q0, %%q1, %%2", mnem, sign, width); + else + sprintf (templ, "%s.%c%d\t%%P0, %%P1, %%2", mnem, sign, width); - - return templ; - } -@@ -9111,6 +9575,11 @@ ++ ++ return templ; ++} ++ + /* Output a sequence of pairwise operations to implement a reduction. + NOTE: We do "too much work" here, because pairwise operations work on two + registers-worth of operands in one go. Unfortunately we can't exploit those +@@ -9111,6 +9583,11 @@ if (GET_CODE (ind) == REG) return arm_address_register_rtx_p (ind, 0); @@ -5636,7 +6467,7 @@ return FALSE; } -@@ -9139,11 +9608,14 @@ +@@ -9139,11 +9616,14 @@ return GENERAL_REGS; } @@ -5654,7 +6485,7 @@ if (arm_coproc_mem_operand (x, wb) || s_register_operand (x, mode)) return NO_REGS; -@@ -9812,6 +10284,9 @@ +@@ -9812,6 +10292,9 @@ rtx base_reg_rtx = NULL; int i, stm_case; @@ -5664,7 +6495,7 @@ /* Can only handle up to MAX_LDM_STM_OPS insns at present, though could be easily extended if required. */ gcc_assert (nops >= 2 && nops <= MAX_LDM_STM_OPS); -@@ -9869,7 +10344,9 @@ +@@ -9869,7 +10352,9 @@ /* If it isn't an integer register, then we can't do this. */ if (unsorted_regs[i] < 0 || (TARGET_THUMB1 && unsorted_regs[i] > LAST_LO_REGNUM) @@ -5675,7 +6506,7 @@ || (TARGET_THUMB2 && unsorted_regs[i] == SP_REGNUM) || unsorted_regs[i] > 14) return 0; -@@ -10331,6 +10808,335 @@ +@@ -10331,6 +10816,335 @@ return true; } @@ -6011,7 +6842,7 @@ int arm_gen_movmemqi (rtx *operands) { -@@ -10343,8 +11149,13 @@ +@@ -10343,8 +11157,13 @@ if (GET_CODE (operands[2]) != CONST_INT || GET_CODE (operands[3]) != CONST_INT @@ -6027,7 +6858,7 @@ return 0; dstbase = operands[0]; -@@ -11433,6 +12244,19 @@ +@@ -11433,6 +12252,19 @@ return 0; } @@ -6047,7 +6878,7 @@ /* Move a minipool fix MP from its current location to before MAX_MP. If MAX_MP is NULL, then MP doesn't need moving, but the addressing constraints may need updating. */ -@@ -11979,8 +12803,12 @@ +@@ -11979,8 +12811,12 @@ within range. */ gcc_assert (GET_CODE (from) != BARRIER); @@ -6062,7 +6893,7 @@ /* If there is a jump table, add its length. */ tmp = is_jump_table (from); -@@ -12400,6 +13228,11 @@ +@@ -12400,6 +13236,11 @@ insn = table; } } @@ -6074,7 +6905,7 @@ } fix = minipool_fix_head; -@@ -16591,7 +17424,7 @@ +@@ -16591,7 +17432,7 @@ { rtx addr; bool postinc = FALSE; @@ -6083,7 +6914,7 @@ gcc_assert (GET_CODE (x) == MEM); addr = XEXP (x, 0); -@@ -16606,12 +17439,12 @@ +@@ -16606,12 +17447,12 @@ instruction (for some alignments) as an aid to the memory subsystem of the target. */ align = MEM_ALIGN (x) >> 3; @@ -6099,7 +6930,7 @@ align_bits = 128; else if ((align % 8) == 0) align_bits = 64; -@@ -16663,6 +17496,11 @@ +@@ -16663,6 +17504,11 @@ } return; @@ -6111,7 +6942,7 @@ /* Register specifier for vld1.16/vst1.16. Translate the S register number into a D register number and element index. */ case 'z': -@@ -17022,10 +17860,10 @@ +@@ -17022,10 +17868,10 @@ decremented/zeroed by arm_asm_output_opcode as the insns are output. */ /* Returns the index of the ARM condition code string in @@ -6126,7 +6957,7 @@ { enum machine_mode mode = GET_MODE (XEXP (comparison, 0)); enum arm_cond_code code; -@@ -17049,11 +17887,11 @@ +@@ -17049,11 +17895,11 @@ case CC_DLTUmode: code = ARM_CC; dominance: @@ -6141,7 +6972,7 @@ case CC_NOOVmode: switch (comp_code) -@@ -17062,7 +17900,7 @@ +@@ -17062,7 +17908,7 @@ case EQ: return ARM_EQ; case GE: return ARM_PL; case LT: return ARM_MI; @@ -6150,7 +6981,7 @@ } case CC_Zmode: -@@ -17070,7 +17908,7 @@ +@@ -17070,7 +17916,7 @@ { case NE: return ARM_NE; case EQ: return ARM_EQ; @@ -6159,7 +6990,7 @@ } case CC_Nmode: -@@ -17078,7 +17916,7 @@ +@@ -17078,7 +17924,7 @@ { case NE: return ARM_MI; case EQ: return ARM_PL; @@ -6168,7 +6999,7 @@ } case CCFPEmode: -@@ -17103,7 +17941,7 @@ +@@ -17103,7 +17949,7 @@ /* UNEQ and LTGT do not have a representation. */ case UNEQ: /* Fall through. */ case LTGT: /* Fall through. */ @@ -6177,7 +7008,7 @@ } case CC_SWPmode: -@@ -17119,7 +17957,7 @@ +@@ -17119,7 +17965,7 @@ case GTU: return ARM_CC; case LEU: return ARM_CS; case LTU: return ARM_HI; @@ -6186,7 +7017,7 @@ } case CC_Cmode: -@@ -17127,7 +17965,7 @@ +@@ -17127,7 +17973,7 @@ { case LTU: return ARM_CS; case GEU: return ARM_CC; @@ -6195,7 +7026,7 @@ } case CC_CZmode: -@@ -17139,7 +17977,7 @@ +@@ -17139,7 +17985,7 @@ case GTU: return ARM_HI; case LEU: return ARM_LS; case LTU: return ARM_CC; @@ -6204,7 +7035,7 @@ } case CC_NCVmode: -@@ -17149,7 +17987,7 @@ +@@ -17149,7 +17995,7 @@ case LT: return ARM_LT; case GEU: return ARM_CS; case LTU: return ARM_CC; @@ -6213,7 +7044,7 @@ } case CCmode: -@@ -17165,13 +18003,22 @@ +@@ -17165,13 +18011,22 @@ case GTU: return ARM_HI; case LEU: return ARM_LS; case LTU: return ARM_CC; @@ -6237,7 +7068,7 @@ /* Tell arm_asm_output_opcode to output IT blocks for conditionally executed instructions. */ void -@@ -17783,926 +18630,618 @@ +@@ -17783,926 +18638,618 @@ return value; } @@ -7751,7 +8582,7 @@ /* Next create constant-qualified versions of the above types. */ const_intQI_node = build_qualified_type (neon_intQI_type_node, -@@ -18843,252 +19382,740 @@ +@@ -18843,252 +19390,740 @@ } } @@ -7762,9 +8593,9 @@ { neon_builtin_datum *d = &neon_builtin_data[i]; - unsigned int j, codeidx = 0; - -- d->base_fcode = fcode; - +- d->base_fcode = fcode; + - for (j = 0; j < T_MAX; j++) - { - const char* const modenames[] = { @@ -8708,7 +9539,7 @@ } static void -@@ -19115,6 +20142,17 @@ +@@ -19115,6 +20150,17 @@ arm_init_fp16_builtins (); } @@ -8726,7 +9557,7 @@ /* Implement TARGET_INVALID_PARAMETER_TYPE. */ static const char * -@@ -19266,55 +20304,68 @@ +@@ -19266,55 +20312,68 @@ return target; } @@ -8833,7 +9664,7 @@ tree exp, ...) { va_list ap; -@@ -19323,7 +20374,9 @@ +@@ -19323,7 +20382,9 @@ rtx op[NEON_MAX_BUILTIN_ARGS]; enum machine_mode tmode = insn_data[icode].operand[0].mode; enum machine_mode mode[NEON_MAX_BUILTIN_ARGS]; @@ -8843,7 +9674,7 @@ if (have_retval && (!target -@@ -19341,26 +20394,46 @@ +@@ -19341,26 +20402,46 @@ break; else { @@ -8893,7 +9724,7 @@ case NEON_ARG_STOP: gcc_unreachable (); } -@@ -19438,15 +20511,17 @@ +@@ -19438,15 +20519,17 @@ static rtx arm_expand_neon_builtin (int fcode, tree exp, rtx target) { @@ -8914,7 +9745,7 @@ NEON_ARG_COPY_TO_REG, NEON_ARG_CONSTANT, NEON_ARG_STOP); case NEON_BINOP: -@@ -19456,90 +20531,90 @@ +@@ -19456,90 +20539,90 @@ case NEON_SCALARMULH: case NEON_SHIFTINSERT: case NEON_LOGICBINOP: @@ -9025,7 +9856,7 @@ NEON_ARG_STOP); } -@@ -19571,39 +20646,34 @@ +@@ -19571,39 +20654,34 @@ emit_move_insn (mem, tmp2); } @@ -9085,7 +9916,7 @@ } /* Expand an expression EXP that calls a built-in function, -@@ -21455,6 +22525,8 @@ +@@ -21455,6 +22533,8 @@ const char *fpu_name; if (arm_selected_arch) asm_fprintf (asm_out_file, "\t.arch %s\n", arm_selected_arch->name); @@ -9094,7 +9925,7 @@ else asm_fprintf (asm_out_file, "\t.cpu %s\n", arm_selected_cpu->name); -@@ -21518,6 +22590,10 @@ +@@ -21518,6 +22598,10 @@ val = 6; asm_fprintf (asm_out_file, "\t.eabi_attribute 30, %d\n", val); @@ -9105,7 +9936,7 @@ /* Tag_ABI_FP_16bit_format. */ if (arm_fp16_format) asm_fprintf (asm_out_file, "\t.eabi_attribute 38, %d\n", -@@ -22261,7 +23337,21 @@ +@@ -22261,7 +23345,21 @@ return false; } @@ -9128,7 +9959,7 @@ registers when autovectorizing for Neon, at least until multiple vector widths are supported properly by the middle-end. */ -@@ -22272,15 +23362,15 @@ +@@ -22272,15 +23370,15 @@ switch (mode) { case SFmode: @@ -9149,7 +9980,7 @@ return V2DImode; break; -@@ -22305,14 +23395,16 @@ +@@ -22305,14 +23403,16 @@ /* Implement TARGET_CLASS_LIKELY_SPILLED_P. @@ -9171,7 +10002,7 @@ || rclass == CC_REG) return true; -@@ -22964,8 +24056,13 @@ +@@ -22964,8 +24064,13 @@ { switch (arm_tune) { @@ -9185,7 +10016,7 @@ case cortexa5: case cortexa8: case cortexa9: -@@ -23218,12 +24315,26 @@ +@@ -23218,12 +24323,26 @@ rtx target, rtx memory) { @@ -9216,7 +10047,7 @@ } /* Emit a strex{b,h,d, } instruction appropriate for the specified -@@ -23236,14 +24347,41 @@ +@@ -23236,14 +24355,41 @@ rtx value, rtx memory) { @@ -9263,7 +10094,7 @@ } /* Helper to emit a two operand instruction. */ -@@ -23285,7 +24423,7 @@ +@@ -23285,7 +24431,7 @@ required_value: @@ -9272,7 +10103,7 @@ the modify to continue, if NULL no comparsion is performed. */ static void arm_output_sync_loop (emit_f emit, -@@ -23299,7 +24437,13 @@ +@@ -23299,7 +24445,13 @@ enum attr_sync_op sync_op, int early_barrier_required) { @@ -9287,7 +10118,7 @@ gcc_assert (t1 != t2); -@@ -23310,82 +24454,142 @@ +@@ -23310,82 +24462,142 @@ arm_output_ldrex (emit, mode, old_value, memory); @@ -9451,7 +10282,7 @@ break; default: -@@ -23393,8 +24597,11 @@ +@@ -23393,8 +24605,11 @@ } } @@ -9464,7 +10295,7 @@ } static rtx -@@ -23488,7 +24695,7 @@ +@@ -23488,7 +24703,7 @@ target = gen_reg_rtx (mode); memory = arm_legitimize_sync_memory (memory); @@ -9473,7 +10304,7 @@ { rtx load_temp = gen_reg_rtx (SImode); -@@ -23507,6 +24714,12 @@ +@@ -23507,6 +24722,12 @@ } } @@ -9486,7 +10317,7 @@ static bool arm_vector_alignment_reachable (const_tree type, bool is_packed) { -@@ -23660,4 +24873,53 @@ +@@ -23660,4 +24881,53 @@ return NO_REGS; } @@ -10204,6 +11035,15 @@ target = copy_rtx (operands[0]); /* Avoid using a subreg as a subtarget, and avoid writing a paradoxical subreg as the final target. */ +@@ -3272,7 +3395,7 @@ + bool need_else; + + if (which_alternative != 0 || operands[3] != const0_rtx +- || (code != PLUS && code != MINUS && code != IOR && code != XOR)) ++ || (code != PLUS && code != IOR && code != XOR)) + need_else = true; + else + need_else = false; @@ -3618,12 +3741,10 @@ ;; to reduce register pressure later on. @@ -14649,6 +15489,129 @@ +driver-arm.o: $(srcdir)/config/arm/driver-arm.c \ + $(CONFIG_H) $(SYSTEM_H) + $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< +--- a/src/gcc/config/avr/avr-devices.c ++++ b/src/gcc/config/avr/avr-devices.c +@@ -70,7 +70,7 @@ + { "attiny2313a", ARCH_AVR25, "__AVR_ATtiny2313A__", 1, 0x0060, "tn2313a" }, + { "attiny24", ARCH_AVR25, "__AVR_ATtiny24__", 1, 0x0060, "tn24" }, + { "attiny24a", ARCH_AVR25, "__AVR_ATtiny24A__", 1, 0x0060, "tn24a" }, +- { "attiny4313", ARCH_AVR25, "__AVR_ATtiny4313__", 1, 0x0060, "tn4313" }, ++ { "attiny4313", ARCH_AVR25, "__AVR_ATtiny4313__", 0, 0x0060, "tn4313" }, + { "attiny44", ARCH_AVR25, "__AVR_ATtiny44__", 0, 0x0060, "tn44" }, + { "attiny44a", ARCH_AVR25, "__AVR_ATtiny44A__", 0, 0x0060, "tn44a" }, + { "attiny84", ARCH_AVR25, "__AVR_ATtiny84__", 0, 0x0060, "tn84" }, +@@ -88,7 +88,7 @@ + { "attiny87", ARCH_AVR25, "__AVR_ATtiny87__", 0, 0x0100, "tn87" }, + { "attiny48", ARCH_AVR25, "__AVR_ATtiny48__", 0, 0x0100, "tn48" }, + { "attiny88", ARCH_AVR25, "__AVR_ATtiny88__", 0, 0x0100, "tn88" }, +- { "at86rf401", ARCH_AVR25, "__AVR_AT86RF401__", 1, 0x0060, "86401" }, ++ { "at86rf401", ARCH_AVR25, "__AVR_AT86RF401__", 0, 0x0060, "86401" }, + /* Classic, > 8K, <= 64K. */ + { "avr3", ARCH_AVR3, NULL, 0, 0x0060, "43355" }, + { "at43usb355", ARCH_AVR3, "__AVR_AT43USB355__", 0, 0x0060, "43355" }, +--- a/src/gcc/config/avr/avr.c ++++ b/src/gcc/config/avr/avr.c +@@ -1879,9 +1879,12 @@ + } + else if (test_hard_reg_class (STACK_REG, src)) + { +- *l = 2; +- return (AS2 (in,%A0,__SP_L__) CR_TAB +- AS2 (in,%B0,__SP_H__)); ++ *l = 2; ++ return AVR_HAVE_8BIT_SP ++ ? (AS2 (in,%A0,__SP_L__) CR_TAB ++ AS1 (clr,%B0)) ++ : (AS2 (in,%A0,__SP_L__) CR_TAB ++ AS2 (in,%B0,__SP_H__)); + } + + if (AVR_HAVE_MOVW) +@@ -5173,10 +5176,10 @@ + + default_file_start (); + +-/* fprintf (asm_out_file, "\t.arch %s\n", avr_mcu_name);*/ +- fputs ("__SREG__ = 0x3f\n" +- "__SP_H__ = 0x3e\n" +- "__SP_L__ = 0x3d\n", asm_out_file); ++ fputs ("__SREG__ = 0x3f\n", asm_out_file); ++ if (!AVR_HAVE_8BIT_SP) ++ fputs ("__SP_H__ = 0x3e\n", asm_out_file); ++ fputs ("__SP_L__ = 0x3d\n", asm_out_file); + + fputs ("__tmp_reg__ = 0\n" + "__zero_reg__ = 1\n", asm_out_file); +--- a/src/gcc/config/avr/avr.md ++++ b/src/gcc/config/avr/avr.md +@@ -299,7 +299,7 @@ + [(set (match_operand:HI 0 "stack_register_operand" "=q") + (unspec_volatile:HI [(match_operand:HI 1 "register_operand" "r")] + UNSPECV_WRITE_SP_IRQ_OFF))] +- "" ++ "!AVR_HAVE_8BIT_SP" + "out __SP_H__, %B1 + out __SP_L__, %A1" + [(set_attr "length" "2") +@@ -309,7 +309,7 @@ + [(set (match_operand:HI 0 "stack_register_operand" "=q") + (unspec_volatile:HI [(match_operand:HI 1 "register_operand" "r")] + UNSPECV_WRITE_SP_IRQ_ON))] +- "" ++ "!AVR_HAVE_8BIT_SP" + "cli + out __SP_H__, %B1 + sei +--- a/src/gcc/config/avr/libgcc.S ++++ b/src/gcc/config/avr/libgcc.S +@@ -582,6 +582,15 @@ + push r17 + push r28 + push r29 ++#if defined (__AVR_HAVE_8BIT_SP__) ++;; FIXME: __AVR_HAVE_8BIT_SP__ is set on device level, not on core level ++;; so this lines are dead code. To make it work, devices without ++;; SP_H must get their own multilib(s), see PR51345. ++ in r28,__SP_L__ ++ sub r28,r26 ++ clr r29 ++ out __SP_L__,r28 ++#else + in r28,__SP_L__ + in r29,__SP_H__ + sub r28,r26 +@@ -591,6 +600,7 @@ + out __SP_H__,r29 + out __SREG__,__tmp_reg__ + out __SP_L__,r28 ++#endif + #if defined (__AVR_HAVE_EIJMP_EICALL__) + eijmp + #else +@@ -625,6 +635,15 @@ + ldd r16,Y+4 + ldd r17,Y+3 + ldd r26,Y+2 ++#if defined (__AVR_HAVE_8BIT_SP__) ++;; FIXME: __AVR_HAVE_8BIT_SP__ is set on device level, not on core level ++;; so this lines are dead code. To make it work, devices without ++;; SP_H must get their own multilib(s). ++ ldd r29,Y+1 ++ add r28,r30 ++ out __SP_L__,r28 ++ mov r28, r26 ++#else + ldd r27,Y+1 + add r28,r30 + adc r29,__zero_reg__ +@@ -635,6 +654,7 @@ + out __SP_L__,r28 + mov_l r28, r26 + mov_h r29, r27 ++#endif + ret + .endfunc + #endif /* defined (L_epilogue) */ --- a/src/gcc/config/darwin.c +++ b/src/gcc/config/darwin.c @@ -1753,19 +1753,51 @@ @@ -14890,6 +15853,26 @@ #else # define TRY_EMPTY_VM_SPACE 0 #endif +--- a/src/gcc/config/i386/avxintrin.h ++++ b/src/gcc/config/i386/avxintrin.h +@@ -759,7 +759,7 @@ + + #ifdef __x86_64__ + extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) +-_mm256_insert_epi64 (__m256i __X, int __D, int const __N) ++_mm256_insert_epi64 (__m256i __X, long long __D, int const __N) + { + __m128i __Y = _mm256_extractf128_si256 (__X, __N >> 1); + __Y = _mm_insert_epi64 (__Y, __D, __N % 2); +--- a/src/gcc/config/i386/freebsd.h ++++ b/src/gcc/config/i386/freebsd.h +@@ -147,3 +147,6 @@ + #if FBSD_MAJOR >= 6 + #define SUBTARGET32_DEFAULT_CPU "i486" + #endif ++ ++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack ++ --- a/src/gcc/config/i386/i386.c +++ b/src/gcc/config/i386/i386.c @@ -16329,7 +16329,6 @@ @@ -14924,6 +15907,24 @@ } --- a/src/gcc/config/i386/i386.md +++ b/src/gcc/config/i386/i386.md +@@ -1960,7 +1960,7 @@ + + (define_insn "*movdi_internal_rex64" + [(set (match_operand:DI 0 "nonimmediate_operand" +- "=r,r ,r,m ,!m,*y,*y,?r ,m ,?*Ym,?*y,*x,*x,?r ,m,?*Yi,*x,?*x,?*Ym") ++ "=r,r ,r,m ,!o,*y,*y,?r ,m ,?*Ym,?*y,*x,*x,?r ,m,?*Yi,*x,?*x,?*Ym") + (match_operand:DI 1 "general_operand" + "Z ,rem,i,re,n ,C ,*y,*Ym,*y,r ,m ,C ,*x,*Yi,*x,r ,m ,*Ym,*x"))] + "TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))" +@@ -2905,7 +2905,7 @@ + + (define_insn "*movdf_internal_rex64" + [(set (match_operand:DF 0 "nonimmediate_operand" +- "=f,m,f,r ,m,!r,!m,Y2*x,Y2*x,Y2*x,m ,Yi,r ") ++ "=f,m,f,r ,m,!r,!o,Y2*x,Y2*x,Y2*x,m ,Yi,r ") + (match_operand:DF 1 "general_operand" + "fm,f,G,rm,r,F ,F ,C ,Y2*x,m ,Y2*x,r ,Yi"))] + "TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1])) @@ -5103,7 +5103,7 @@ && reload_completed && (SSE_REG_P (operands[0]) @@ -15151,7 +16152,15 @@ && (!TARGET_64BIT \ --- a/src/gcc/config/rs6000/rs6000.c +++ b/src/gcc/config/rs6000/rs6000.c -@@ -5134,7 +5134,9 @@ +@@ -2612,6 +2612,7 @@ + off. */ + rs6000_altivec_abi = 1; + TARGET_ALTIVEC_VRSAVE = 1; ++ rs6000_current_abi = ABI_DARWIN; + + if (DEFAULT_ABI == ABI_DARWIN + && TARGET_64BIT) +@@ -5134,7 +5135,9 @@ for (i = 0; i < n_elts; ++i) { x = XVECEXP (vals, 0, i); @@ -15162,7 +16171,7 @@ ++n_var; } if (n_var == 0) -@@ -5286,7 +5288,9 @@ +@@ -5286,7 +5289,9 @@ for (i = 0; i < n_elts; ++i) { x = XVECEXP (vals, 0, i); @@ -15173,7 +16182,7 @@ ++n_var, one_var = i; else if (x != CONST0_RTX (inner_mode)) all_const_zero = false; -@@ -6824,6 +6828,7 @@ +@@ -6824,6 +6829,7 @@ #if TARGET_MACHO && DEFAULT_ABI == ABI_DARWIN && (flag_pic || MACHO_DYNAMIC_NO_PIC_P) @@ -15181,7 +16190,16 @@ #else && DEFAULT_ABI == ABI_V4 && !flag_pic -@@ -20227,7 +20232,7 @@ +@@ -16613,7 +16619,7 @@ + if (TARGET_RELOCATABLE + && in_section != toc_section + && in_section != text_section +- && !unlikely_text_section_p (in_section) ++ && (in_section && (in_section->common.flags & SECTION_CODE)) == 0 + && !recurse + && GET_CODE (x) != CONST_INT + && GET_CODE (x) != CONST_DOUBLE +@@ -20227,7 +20233,7 @@ { /* This blockage is needed so that sched doesn't decide to move the sp change before the register restores. */ @@ -15190,6 +16208,288 @@ || (TARGET_SPE_ABI && info->spe_64bit_regs_used != 0 && info->first_gp_reg_save != 32)) +@@ -20644,56 +20650,52 @@ + { + int i; + rtx spe_save_area_ptr; +- ++ int save_ptr_to_sp; ++ int ool_adjust = 0; ++ + /* Determine whether we can address all of the registers that need +- to be saved with an offset from the stack pointer that fits in ++ to be saved with an offset from frame_reg_rtx that fits in + the small const field for SPE memory instructions. */ +- int spe_regs_addressable_via_sp +- = (SPE_CONST_OFFSET_OK(info->spe_gp_save_offset + sp_offset +- + (32 - info->first_gp_reg_save - 1) * reg_size) ++ int spe_regs_addressable ++ = (SPE_CONST_OFFSET_OK (info->spe_gp_save_offset + sp_offset ++ + reg_size * (32 - info->first_gp_reg_save - 1)) + && saving_GPRs_inline); + int spe_offset; +- +- if (spe_regs_addressable_via_sp) ++ ++ if (spe_regs_addressable) + { + spe_save_area_ptr = frame_reg_rtx; ++ save_ptr_to_sp = info->total_size - sp_offset; + spe_offset = info->spe_gp_save_offset + sp_offset; + } + else + { + /* Make r11 point to the start of the SPE save area. We need + to be careful here if r11 is holding the static chain. If +- it is, then temporarily save it in r0. We would use r0 as +- our base register here, but using r0 as a base register in +- loads and stores means something different from what we +- would like. */ +- int ool_adjust = (saving_GPRs_inline +- ? 0 +- : (info->first_gp_reg_save +- - (FIRST_SAVRES_REGISTER+1))*8); +- HOST_WIDE_INT offset = (info->spe_gp_save_offset +- + sp_offset - ool_adjust); ++ it is, then temporarily save it in r0. */ ++ int offset; ++ ++ if (!saving_GPRs_inline) ++ ool_adjust = 8 * (info->first_gp_reg_save ++ - (FIRST_SAVRES_REGISTER + 1)); ++ offset = info->spe_gp_save_offset + sp_offset - ool_adjust; ++ spe_save_area_ptr = gen_rtx_REG (Pmode, 11); ++ save_ptr_to_sp = info->total_size - sp_offset + offset; ++ spe_offset = 0; + + if (using_static_chain_p) + { + rtx r0 = gen_rtx_REG (Pmode, 0); + gcc_assert (info->first_gp_reg_save > 11); +- +- emit_move_insn (r0, gen_rtx_REG (Pmode, 11)); ++ ++ emit_move_insn (r0, spe_save_area_ptr); + } +- +- spe_save_area_ptr = gen_rtx_REG (Pmode, 11); +- insn = emit_insn (gen_addsi3 (spe_save_area_ptr, +- frame_reg_rtx, +- GEN_INT (offset))); +- /* We need to make sure the move to r11 gets noted for +- properly outputting unwind information. */ +- if (!saving_GPRs_inline) +- rs6000_frame_related (insn, frame_reg_rtx, offset, +- NULL_RTX, NULL_RTX); +- spe_offset = 0; ++ emit_insn (gen_addsi3 (spe_save_area_ptr, ++ frame_reg_rtx, GEN_INT (offset))); ++ if (REGNO (frame_reg_rtx) == 11) ++ sp_offset = -info->spe_gp_save_offset + ool_adjust; + } +- ++ + if (saving_GPRs_inline) + { + for (i = 0; i < 32 - info->first_gp_reg_save; i++) +@@ -20705,36 +20707,34 @@ + /* We're doing all this to ensure that the offset fits into + the immediate offset of 'evstdd'. */ + gcc_assert (SPE_CONST_OFFSET_OK (reg_size * i + spe_offset)); +- ++ + offset = GEN_INT (reg_size * i + spe_offset); + addr = gen_rtx_PLUS (Pmode, spe_save_area_ptr, offset); + mem = gen_rtx_MEM (V2SImode, addr); +- ++ + insn = emit_move_insn (mem, reg); +- +- rs6000_frame_related (insn, spe_save_area_ptr, +- info->spe_gp_save_offset +- + sp_offset + reg_size * i, +- offset, const0_rtx); ++ ++ rs6000_frame_related (insn, ++ spe_save_area_ptr, save_ptr_to_sp, ++ NULL_RTX, NULL_RTX); + } + } + else + { + rtx par; + +- par = rs6000_make_savres_rtx (info, gen_rtx_REG (Pmode, 11), +- 0, reg_mode, ++ par = rs6000_make_savres_rtx (info, spe_save_area_ptr, ++ ool_adjust, reg_mode, + /*savep=*/true, /*gpr=*/true, + /*lr=*/false); + insn = emit_insn (par); +- rs6000_frame_related (insn, frame_ptr_rtx, info->total_size, ++ rs6000_frame_related (insn, spe_save_area_ptr, save_ptr_to_sp, + NULL_RTX, NULL_RTX); + } +- +- ++ + /* Move the static chain pointer back. */ +- if (using_static_chain_p && !spe_regs_addressable_via_sp) +- emit_move_insn (gen_rtx_REG (Pmode, 11), gen_rtx_REG (Pmode, 0)); ++ if (using_static_chain_p && !spe_regs_addressable) ++ emit_move_insn (spe_save_area_ptr, gen_rtx_REG (Pmode, 0)); + } + else if (!WORLD_SAVE_P (info) && !saving_GPRs_inline) + { +@@ -20743,10 +20743,12 @@ + /* Need to adjust r11 (r12) if we saved any FPRs. */ + if (info->first_fp_reg_save != 64) + { +- rtx dest_reg = gen_rtx_REG (reg_mode, DEFAULT_ABI == ABI_AIX +- ? 12 : 11); +- rtx offset = GEN_INT (sp_offset +- + (-8 * (64-info->first_fp_reg_save))); ++ rtx dest_reg = gen_rtx_REG (Pmode, DEFAULT_ABI == ABI_AIX ? 12 : 11); ++ int save_off = 8 * (64 - info->first_fp_reg_save); ++ rtx offset = GEN_INT (sp_offset - save_off); ++ ++ if (REGNO (dest_reg) == REGNO (frame_reg_rtx)) ++ sp_offset = save_off; + emit_insn (gen_add3_insn (dest_reg, frame_reg_rtx, offset)); + } + +@@ -21622,40 +21624,39 @@ + && info->first_gp_reg_save != 32) + { + /* Determine whether we can address all of the registers that need +- to be saved with an offset from the stack pointer that fits in +- the small const field for SPE memory instructions. */ +- int spe_regs_addressable_via_sp +- = (SPE_CONST_OFFSET_OK(info->spe_gp_save_offset + sp_offset +- + (32 - info->first_gp_reg_save - 1) * reg_size) ++ to be saved with an offset from frame_reg_rtx that fits in ++ the small const field for SPE memory instructions. */ ++ int spe_regs_addressable ++ = (SPE_CONST_OFFSET_OK (info->spe_gp_save_offset + sp_offset ++ + reg_size * (32 - info->first_gp_reg_save - 1)) + && restoring_GPRs_inline); + int spe_offset; ++ int ool_adjust = 0; + +- if (spe_regs_addressable_via_sp) ++ if (spe_regs_addressable) + spe_offset = info->spe_gp_save_offset + sp_offset; + else +- { ++ { + rtx old_frame_reg_rtx = frame_reg_rtx; +- /* Make r11 point to the start of the SPE save area. We worried about +- not clobbering it when we were saving registers in the prologue. +- There's no need to worry here because the static chain is passed +- anew to every function. */ +- int ool_adjust = (restoring_GPRs_inline +- ? 0 +- : (info->first_gp_reg_save +- - (FIRST_SAVRES_REGISTER+1))*8); +- +- if (frame_reg_rtx == sp_reg_rtx) +- frame_reg_rtx = gen_rtx_REG (Pmode, 11); +- emit_insn (gen_addsi3 (frame_reg_rtx, old_frame_reg_rtx, ++ /* Make r11 point to the start of the SPE save area. We worried about ++ not clobbering it when we were saving registers in the prologue. ++ There's no need to worry here because the static chain is passed ++ anew to every function. */ ++ ++ if (!restoring_GPRs_inline) ++ ool_adjust = 8 * (info->first_gp_reg_save ++ - (FIRST_SAVRES_REGISTER + 1)); ++ frame_reg_rtx = gen_rtx_REG (Pmode, 11); ++ emit_insn (gen_addsi3 (frame_reg_rtx, old_frame_reg_rtx, + GEN_INT (info->spe_gp_save_offset + + sp_offset + - ool_adjust))); + /* Keep the invariant that frame_reg_rtx + sp_offset points + at the top of the stack frame. */ +- sp_offset = -info->spe_gp_save_offset; ++ sp_offset = -info->spe_gp_save_offset + ool_adjust; + +- spe_offset = 0; +- } ++ spe_offset = 0; ++ } + + if (restoring_GPRs_inline) + { +@@ -21695,8 +21696,8 @@ + { + rtx par; + +- par = rs6000_make_savres_rtx (info, gen_rtx_REG (Pmode, 11), +- 0, reg_mode, ++ par = rs6000_make_savres_rtx (info, frame_reg_rtx, ++ ool_adjust, reg_mode, + /*savep=*/false, /*gpr=*/true, + /*lr=*/true); + emit_jump_insn (par); +@@ -21717,12 +21718,12 @@ + sp_offset, can_use_exit); + else + { +- emit_insn (gen_add3_insn (gen_rtx_REG (Pmode, DEFAULT_ABI == ABI_AIX +- ? 12 : 11), +- frame_reg_rtx, ++ rtx src_reg = gen_rtx_REG (Pmode, DEFAULT_ABI == ABI_AIX ? 12 : 11); ++ ++ emit_insn (gen_add3_insn (src_reg, frame_reg_rtx, + GEN_INT (sp_offset - info->fp_size))); +- if (REGNO (frame_reg_rtx) == 11) +- sp_offset += info->fp_size; ++ if (REGNO (frame_reg_rtx) == REGNO (src_reg)) ++ sp_offset = info->fp_size; + } + + par = rs6000_make_savres_rtx (info, frame_reg_rtx, +@@ -27763,7 +27764,7 @@ + if (strcmp (r, rs6000_opt_vars[i].name) == 0) + { + size_t j = rs6000_opt_vars[i].global_offset; +- ((int *) &global_options)[j] = !invert; ++ *((int *) ((char *)&global_options + j)) = !invert; + error_p = false; + break; + } +--- a/src/gcc/config/sparc/sparc.c ++++ b/src/gcc/config/sparc/sparc.c +@@ -4569,8 +4569,9 @@ + else if (actual_fsize <= 8192) + { + insn = emit_insn (gen_stack_pointer_inc (GEN_INT (-4096))); +- /* %sp is still the CFA register. */ + RTX_FRAME_RELATED_P (insn) = 1; ++ ++ /* %sp is still the CFA register. */ + insn + = emit_insn (gen_stack_pointer_inc (GEN_INT (4096-actual_fsize))); + } +@@ -4592,8 +4593,18 @@ + else if (actual_fsize <= 8192) + { + insn = emit_insn (gen_save_register_window (GEN_INT (-4096))); ++ + /* %sp is not the CFA register anymore. */ + emit_insn (gen_stack_pointer_inc (GEN_INT (4096-actual_fsize))); ++ ++ /* Make sure no %fp-based store is issued until after the frame is ++ established. The offset between the frame pointer and the stack ++ pointer is calculated relative to the value of the stack pointer ++ at the end of the function prologue, and moving instructions that ++ access the stack via the frame pointer between the instructions ++ that decrement the stack pointer could result in accessing the ++ register window save area, which is volatile. */ ++ emit_insn (gen_frame_blockage ()); + } + else + { --- a/src/gcc/config/sparc/sparc.h +++ b/src/gcc/config/sparc/sparc.h @@ -408,6 +408,7 @@ @@ -15202,7 +16502,15 @@ %{mcpu=ultrasparc:%{!mv8plus:-Av9a}} \ --- a/src/gcc/config/sparc/sparc.md +++ b/src/gcc/config/sparc/sparc.md -@@ -1813,8 +1813,8 @@ +@@ -28,6 +28,7 @@ + [(UNSPEC_MOVE_PIC 0) + (UNSPEC_UPDATE_RETURN 1) + (UNSPEC_LOAD_PCREL_SYM 2) ++ (UNSPEC_FRAME_BLOCKAGE 3) + (UNSPEC_MOVE_PIC_LABEL 5) + (UNSPEC_SETH44 6) + (UNSPEC_SETM44 7) +@@ -1813,8 +1814,8 @@ }) (define_insn "*movsf_insn" @@ -15213,7 +16521,7 @@ "TARGET_FPU && (register_operand (operands[0], mode) || register_or_zero_operand (operands[1], mode))" -@@ -1861,8 +1861,8 @@ +@@ -1861,8 +1862,8 @@ ;; when -mno-fpu. (define_insn "*movsf_insn_no_fpu" @@ -15224,7 +16532,7 @@ "! TARGET_FPU && (register_operand (operands[0], SFmode) || register_or_zero_operand (operands[1], SFmode))" -@@ -1948,8 +1948,8 @@ +@@ -1948,8 +1949,8 @@ ;; Be careful, fmovd does not exist when !v9. (define_insn "*movdf_insn_sp32" @@ -15235,7 +16543,7 @@ "TARGET_FPU && ! TARGET_V9 && (register_operand (operands[0], DFmode) -@@ -1969,8 +1969,8 @@ +@@ -1969,8 +1970,8 @@ (set_attr "length" "*,*,*,*,2,2,2,2,2,2")]) (define_insn "*movdf_insn_sp32_no_fpu" @@ -15246,7 +16554,7 @@ "! TARGET_FPU && ! TARGET_V9 && (register_operand (operands[0], DFmode) -@@ -1986,8 +1986,8 @@ +@@ -1986,8 +1987,8 @@ ;; We have available v9 double floats but not 64-bit integer registers. (define_insn "*movdf_insn_sp32_v9" @@ -15257,7 +16565,7 @@ "TARGET_FPU && TARGET_V9 && ! TARGET_ARCH64 -@@ -2009,8 +2009,8 @@ +@@ -2009,8 +2010,8 @@ (set_attr "fptype" "double,double,*,*,*,*,*,*,*,*")]) (define_insn "*movdf_insn_sp32_v9_no_fpu" @@ -15268,7 +16576,7 @@ "! TARGET_FPU && TARGET_V9 && ! TARGET_ARCH64 -@@ -2027,8 +2027,8 @@ +@@ -2027,8 +2028,8 @@ ;; We have available both v9 double floats and 64-bit integer registers. (define_insn "*movdf_insn_sp64" @@ -15279,7 +16587,7 @@ "TARGET_FPU && TARGET_ARCH64 && (register_operand (operands[0], mode) -@@ -2047,8 +2047,8 @@ +@@ -2047,8 +2048,8 @@ (set_attr "fptype" "double,double,*,*,*,*,*,*")]) (define_insn "*movdf_insn_sp64_no_fpu" @@ -15290,7 +16598,7 @@ "! TARGET_FPU && TARGET_ARCH64 && (register_operand (operands[0], DFmode) -@@ -2288,8 +2288,8 @@ +@@ -2288,8 +2289,8 @@ }) (define_insn "*movtf_insn_sp32" @@ -15301,7 +16609,7 @@ "TARGET_FPU && ! TARGET_ARCH64 && (register_operand (operands[0], TFmode) -@@ -2302,8 +2302,8 @@ +@@ -2302,8 +2303,8 @@ ;; when -mno-fpu. (define_insn "*movtf_insn_sp32_no_fpu" @@ -15312,7 +16620,7 @@ "! TARGET_FPU && ! TARGET_ARCH64 && (register_operand (operands[0], TFmode) -@@ -2312,8 +2312,8 @@ +@@ -2312,8 +2313,8 @@ [(set_attr "length" "4")]) (define_insn "*movtf_insn_sp64" @@ -15323,7 +16631,7 @@ "TARGET_FPU && TARGET_ARCH64 && ! TARGET_HARD_QUAD -@@ -2323,8 +2323,8 @@ +@@ -2323,8 +2324,8 @@ [(set_attr "length" "2")]) (define_insn "*movtf_insn_sp64_hq" @@ -15334,7 +16642,7 @@ "TARGET_FPU && TARGET_ARCH64 && TARGET_HARD_QUAD -@@ -2341,8 +2341,8 @@ +@@ -2341,8 +2342,8 @@ (set_attr "length" "2,*,*,*,2,2")]) (define_insn "*movtf_insn_sp64_no_fpu" @@ -15345,6 +16653,32 @@ "! TARGET_FPU && TARGET_ARCH64 && (register_operand (operands[0], TFmode) +@@ -6337,6 +6338,25 @@ + "" + "" + [(set_attr "length" "0")]) ++ ++;; Do not schedule instructions accessing memory before this point. ++ ++(define_expand "frame_blockage" ++ [(set (match_dup 0) ++ (unspec:BLK [(match_dup 1)] UNSPEC_FRAME_BLOCKAGE))] ++ "" ++{ ++ operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode)); ++ MEM_VOLATILE_P (operands[0]) = 1; ++ operands[1] = stack_pointer_rtx; ++}) ++ ++(define_insn "*frame_blockage" ++ [(set (match_operand:BLK 0 "" "") ++ (unspec:BLK [(match_operand:P 1 "" "")] UNSPEC_FRAME_BLOCKAGE))] ++ "" ++ "" ++ [(set_attr "length" "0")]) + + (define_expand "probe_stack" + [(set (match_operand 0 "memory_operand" "") (const_int 0))] --- a/src/gcc/config.host +++ b/src/gcc/config.host @@ -100,6 +100,14 @@ @@ -15506,7 +16840,38 @@ gcc_AC_PROG_INSTALL --- a/src/gcc/cp/ChangeLog +++ b/src/gcc/cp/ChangeLog -@@ -1,3 +1,32 @@ +@@ -1,3 +1,63 @@ ++2011-12-20 Dodji Seketeli ++ ++ PR debug/49951 ++ * decl.c (cxx_maybe_build_cleanup): Don't set location of the call ++ to the destructor. ++ ++2011-12-16 Jason Merrill ++ ++ PR c++/51416 ++ * init.c (build_value_init_noctor): Check for incomplete type. ++ ++2011-12-16 Jason Merrill ++ ++ PR c++/51331 ++ * class.c (convert_to_base_statically): Just call ++ build_simple_base_path. ++ (build_simple_base_path): Check field offset. ++ ++2011-12-14 Jason Merrill ++ ++ PR c++/51248 ++ * decl.c (copy_type_enum): Also update variants. ++ (finish_enum): Allow variants of complete enums. ++ ++2011-12-13 Jason Merrill ++ ++ PR c++/51406 ++ PR c++/51161 ++ * typeck.c (build_static_cast_1): Fix cast of lvalue to ++ base rvalue reference. ++ +2011-11-22 Paolo Carlini + + PR c++/51265 @@ -15549,6 +16914,125 @@ return cp_build_unary_op (code, arg1, candidates != 0, complain); case ARRAY_REF: +--- a/src/gcc/cp/class.c ++++ b/src/gcc/cp/class.c +@@ -464,7 +464,14 @@ + /* Is this the base field created by build_base_field? */ + if (TREE_CODE (field) == FIELD_DECL + && DECL_FIELD_IS_BASE (field) +- && TREE_TYPE (field) == type) ++ && TREE_TYPE (field) == type ++ /* If we're looking for a field in the most-derived class, ++ also check the field offset; we can have two base fields ++ of the same type if one is an indirect virtual base and one ++ is a direct non-virtual base. */ ++ && (BINFO_INHERITANCE_CHAIN (d_binfo) ++ || tree_int_cst_equal (byte_position (field), ++ BINFO_OFFSET (binfo)))) + { + /* We don't use build_class_member_access_expr here, as that + has unnecessary checks, and more importantly results in +@@ -541,6 +548,10 @@ + { + tree pointer_type; + ++ /* If this is a non-empty base, use a COMPONENT_REF. */ ++ if (!is_empty_class (BINFO_TYPE (base))) ++ return build_simple_base_path (expr, base); ++ + pointer_type = build_pointer_type (expr_type); + + /* We use fold_build2 and fold_convert below to simplify the trees +--- a/src/gcc/cp/decl.c ++++ b/src/gcc/cp/decl.c +@@ -11540,15 +11540,19 @@ + static void + copy_type_enum (tree dst, tree src) + { +- TYPE_MIN_VALUE (dst) = TYPE_MIN_VALUE (src); +- TYPE_MAX_VALUE (dst) = TYPE_MAX_VALUE (src); +- TYPE_SIZE (dst) = TYPE_SIZE (src); +- TYPE_SIZE_UNIT (dst) = TYPE_SIZE_UNIT (src); +- SET_TYPE_MODE (dst, TYPE_MODE (src)); +- TYPE_PRECISION (dst) = TYPE_PRECISION (src); +- TYPE_ALIGN (dst) = TYPE_ALIGN (src); +- TYPE_USER_ALIGN (dst) = TYPE_USER_ALIGN (src); +- TYPE_UNSIGNED (dst) = TYPE_UNSIGNED (src); ++ tree t; ++ for (t = dst; t; t = TYPE_NEXT_VARIANT (t)) ++ { ++ TYPE_MIN_VALUE (t) = TYPE_MIN_VALUE (src); ++ TYPE_MAX_VALUE (t) = TYPE_MAX_VALUE (src); ++ TYPE_SIZE (t) = TYPE_SIZE (src); ++ TYPE_SIZE_UNIT (t) = TYPE_SIZE_UNIT (src); ++ SET_TYPE_MODE (dst, TYPE_MODE (src)); ++ TYPE_PRECISION (t) = TYPE_PRECISION (src); ++ TYPE_ALIGN (t) = TYPE_ALIGN (src); ++ TYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (src); ++ TYPE_UNSIGNED (t) = TYPE_UNSIGNED (src); ++ } + } + + /* Begin compiling the definition of an enumeration type. +@@ -11903,9 +11907,12 @@ + return; + } + +- /* Here there should not be any variants of this type. */ ++ /* If this is a forward declaration, there should not be any variants, ++ though we can get a variant in the middle of an enum-specifier with ++ wacky code like 'enum E { e = sizeof(const E*) };' */ + gcc_assert (enumtype == TYPE_MAIN_VARIANT (enumtype) +- && !TYPE_NEXT_VARIANT (enumtype)); ++ && (TYPE_VALUES (enumtype) ++ || !TYPE_NEXT_VARIANT (enumtype))); + } + + /* Build and install a CONST_DECL for an enumeration constant of the +@@ -13356,8 +13363,17 @@ + cleanup = call; + } + ++ /* build_delete sets the location of the destructor call to the ++ current location, even though the destructor is going to be ++ called later, at the end of the current scope. This can lead to ++ a "jumpy" behaviour for users of debuggers when they step around ++ the end of the block. So let's unset the location of the ++ destructor call instead. */ ++ if (cleanup != NULL && EXPR_P (cleanup)) ++ SET_EXPR_LOCATION (cleanup, UNKNOWN_LOCATION); + return cleanup; + } ++ + + /* When a stmt has been parsed, this function is called. */ + +--- a/src/gcc/cp/init.c ++++ b/src/gcc/cp/init.c +@@ -141,7 +141,9 @@ + zero-initialization does not simply mean filling the storage with + zero bytes. FIELD_SIZE, if non-NULL, is the bit size of the field, + subfields with bit positions at or above that bit size shouldn't +- be added. */ ++ be added. Note that this only works when the result is assigned ++ to a base COMPONENT_REF; if we only have a pointer to the base subobject, ++ expand_assignment will end up clearing the full size of TYPE. */ + + static tree + build_zero_init_1 (tree type, tree nelts, bool static_storage_p, +@@ -368,6 +370,12 @@ + tree + build_value_init_noctor (tree type, tsubst_flags_t complain) + { ++ if (!COMPLETE_TYPE_P (type)) ++ { ++ if (complain & tf_error) ++ error ("value-initialization of incomplete type %qT", type); ++ return error_mark_node; ++ } + if (CLASS_TYPE_P (type)) + { + gcc_assert (!TYPE_NEEDS_CONSTRUCTING (type)); --- a/src/gcc/cp/pt.c +++ b/src/gcc/cp/pt.c @@ -11439,6 +11439,9 @@ @@ -15618,6 +17102,27 @@ } /* Handle complex lvalues (when permitted) +@@ -5772,8 +5770,18 @@ + && reference_related_p (TREE_TYPE (type), intype) + && (c_cast_p || at_least_as_qualified_p (TREE_TYPE (type), intype))) + { +- expr = build_typed_address (expr, type); +- return convert_from_reference (expr); ++ /* Handle the lvalue case here by casting to lvalue reference and ++ then changing it to an rvalue reference. Casting an xvalue to ++ rvalue reference will be handled by the main code path. */ ++ tree lref = cp_build_reference_type (TREE_TYPE (type), false); ++ result = (perform_direct_initialization_if_possible ++ (lref, expr, c_cast_p, complain)); ++ result = cp_fold_convert (type, result); ++ /* Make sure we don't fold back down to a named rvalue reference, ++ because that would be an lvalue. */ ++ if (DECL_P (result)) ++ result = build1 (NON_LVALUE_EXPR, type, result); ++ return convert_from_reference (result); + } + + /* Resolve overloaded address here rather than once in --- a/src/gcc/cp/typeck2.c +++ b/src/gcc/cp/typeck2.c @@ -479,18 +479,20 @@ @@ -15874,6 +17379,17 @@ && !df_ignore_stack_reg (mws->start_regno)) { bool really_add_notes = debug_insn != 0; +--- a/src/gcc/df.h ++++ b/src/gcc/df.h +@@ -53,7 +53,7 @@ + #define DF_RD 3 /* Reaching Defs. */ + #define DF_CHAIN 4 /* Def-Use and/or Use-Def Chains. */ + #define DF_WORD_LR 5 /* Subreg tracking lr. */ +-#define DF_NOTE 6 /* REG_DEF and REG_UNUSED notes. */ ++#define DF_NOTE 6 /* REG_DEAD and REG_UNUSED notes. */ + #define DF_MD 7 /* Multiple Definitions. */ + + #define DF_LAST_PROBLEM_PLUS1 (DF_MD + 1) --- a/src/gcc/doc/tm.texi.in +++ b/src/gcc/doc/tm.texi.in @@ -2521,7 +2521,7 @@ @@ -16294,7 +17810,7 @@ x = validize_mem (force_const_mem (mode, x)); /* See if the machine can do this with a load multiple insn. */ -@@ -2308,7 +2308,7 @@ +@@ -2308,7 +2413,7 @@ offset -= size; cst = (*constfun) (constfundata, offset, mode); @@ -16303,7 +17819,7 @@ return 0; if (!reverse) -@@ -3363,7 +3363,7 @@ +@@ -3363,7 +3468,7 @@ y_cst = y; @@ -16312,7 +17828,7 @@ { y = force_const_mem (mode, y); -@@ -3419,7 +3419,7 @@ +@@ -3419,7 +3524,7 @@ REAL_VALUE_FROM_CONST_DOUBLE (r, y); @@ -16321,7 +17837,7 @@ oldcost = rtx_cost (y, SET, speed); else oldcost = rtx_cost (force_const_mem (dstmode, y), SET, speed); -@@ -3442,7 +3442,7 @@ +@@ -3442,7 +3547,7 @@ trunc_y = CONST_DOUBLE_FROM_REAL_VALUE (r, srcmode); @@ -16330,7 +17846,7 @@ { /* Skip if the target needs extra instructions to perform the extension. */ -@@ -3855,7 +3855,7 @@ +@@ -3855,7 +3960,7 @@ by setting SKIP to 0. */ skip = (reg_parm_stack_space == 0) ? 0 : not_stack; @@ -16339,7 +17855,7 @@ x = validize_mem (force_const_mem (mode, x)); /* If X is a hard register in a non-integer mode, copy it into a pseudo; -@@ -4866,16 +4866,136 @@ +@@ -4866,16 +4976,136 @@ return NULL_RTX; } @@ -16480,7 +17996,7 @@ /* Whether CTOR is a valid constant initializer, in accordance with what initializer_constant_valid_p does. If inferred from the constructor -@@ -4884,7 +5004,9 @@ +@@ -4884,7 +5114,9 @@ bool const_p = const_from_elts_p ? true : TREE_STATIC (ctor); nz_elts = 0; @@ -16491,7 +18007,7 @@ FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (ctor), idx, purpose, value) { -@@ -4899,6 +5021,8 @@ +@@ -4899,6 +5131,8 @@ mult = (tree_low_cst (hi_index, 1) - tree_low_cst (lo_index, 1) + 1); } @@ -16500,7 +18016,7 @@ switch (TREE_CODE (value)) { -@@ -4906,11 +5030,11 @@ +@@ -4906,11 +5140,11 @@ { HOST_WIDE_INT nz = 0, ic = 0; @@ -16515,7 +18031,7 @@ if (const_from_elts_p && const_p) const_p = const_elt_p; -@@ -4922,12 +5046,12 @@ +@@ -4922,12 +5156,12 @@ case FIXED_CST: if (!initializer_zerop (value)) nz_elts += mult; @@ -16530,7 +18046,7 @@ break; case COMPLEX_CST: -@@ -4935,7 +5059,7 @@ +@@ -4935,7 +5169,7 @@ nz_elts += mult; if (!initializer_zerop (TREE_IMAGPART (value))) nz_elts += mult; @@ -16539,7 +18055,7 @@ break; case VECTOR_CST: -@@ -4945,65 +5069,31 @@ +@@ -4945,65 +5179,31 @@ { if (!initializer_zerop (TREE_VALUE (v))) nz_elts += mult; @@ -16613,7 +18129,7 @@ return const_p; } -@@ -5013,111 +5103,50 @@ +@@ -5013,111 +5213,50 @@ and place it in *P_NZ_ELTS; * how many scalar fields in total are in CTOR, and place it in *P_ELT_COUNT. @@ -16752,7 +18268,7 @@ } /* Return 1 if EXP contains mostly (3/4) zeros. */ -@@ -5126,18 +5155,12 @@ +@@ -5126,18 +5265,12 @@ mostly_zeros_p (const_tree exp) { if (TREE_CODE (exp) == CONSTRUCTOR) @@ -16760,22 +18276,22 @@ { - HOST_WIDE_INT nz_elts, count, elts; - bool must_clear; -- ++ HOST_WIDE_INT nz_elts, init_elts; ++ bool complete_p; + - categorize_ctor_elements (exp, &nz_elts, &count, &must_clear); - if (must_clear) - return 1; - - elts = count_type_elements (TREE_TYPE (exp), false); -+ HOST_WIDE_INT nz_elts, init_elts; -+ bool complete_p; - +- - return nz_elts < elts / 4; + categorize_ctor_elements (exp, &nz_elts, &init_elts, &complete_p); + return !complete_p || nz_elts < init_elts / 4; } return initializer_zerop (exp); -@@ -5149,12 +5172,11 @@ +@@ -5149,12 +5282,11 @@ all_zeros_p (const_tree exp) { if (TREE_CODE (exp) == CONSTRUCTOR) @@ -16791,7 +18307,7 @@ return nz_elts == 0; } -@@ -7666,18 +7688,16 @@ +@@ -7666,18 +7798,16 @@ { enum machine_mode innermode = TYPE_MODE (TREE_TYPE (treeop0)); this_optab = usmul_widen_optab; @@ -16819,7 +18335,7 @@ } } /* Check for a multiplication with matching signedness. */ -@@ -7692,10 +7712,10 @@ +@@ -7692,10 +7822,10 @@ optab other_optab = zextend_p ? smul_widen_optab : umul_widen_optab; this_optab = zextend_p ? umul_widen_optab : smul_widen_optab; @@ -16833,7 +18349,7 @@ { expand_operands (treeop0, treeop1, NULL_RTX, &op0, &op1, EXPAND_NORMAL); -@@ -7703,7 +7723,8 @@ +@@ -7703,7 +7833,8 @@ unsignedp, this_optab); return REDUCE_BIT_FIELD (temp); } @@ -16843,7 +18359,7 @@ && innermode == word_mode) { rtx htem, hipart; -@@ -8269,6 +8290,19 @@ +@@ -8269,6 +8400,19 @@ return target; } @@ -16863,7 +18379,7 @@ case VEC_PACK_TRUNC_EXPR: case VEC_PACK_SAT_EXPR: case VEC_PACK_FIX_TRUNC_EXPR: -@@ -8545,10 +8579,13 @@ +@@ -8545,10 +8694,13 @@ if (code == SSA_NAME && (g = SSA_NAME_DEF_STMT (ssa_name)) && gimple_code (g) == GIMPLE_CALL) @@ -16881,7 +18397,7 @@ else pmode = promote_decl_mode (exp, &unsignedp); gcc_assert (GET_MODE (decl_rtl) == pmode); -@@ -9108,7 +9145,7 @@ +@@ -9108,7 +9260,7 @@ constant and we don't need a memory reference. */ if (CONSTANT_P (op0) && mode2 != BLKmode @@ -16890,6 +18406,36 @@ && !must_force_mem) op0 = force_reg (mode2, op0); +@@ -9189,8 +9341,16 @@ + && modifier != EXPAND_CONST_ADDRESS + && modifier != EXPAND_INITIALIZER) + /* If the field is volatile, we always want an aligned +- access. */ +- || (volatilep && flag_strict_volatile_bitfields > 0) ++ access. Do this in following two situations: ++ 1. the access is not already naturally ++ aligned, otherwise "normal" (non-bitfield) volatile fields ++ become non-addressable. ++ 2. the bitsize is narrower than the access size. Need ++ to extract bitfields from the access. */ ++ || (volatilep && flag_strict_volatile_bitfields > 0 ++ && (bitpos % GET_MODE_ALIGNMENT (mode) != 0 ++ || (mode1 != BLKmode ++ && bitsize < GET_MODE_SIZE (mode1) * BITS_PER_UNIT))) + /* If the field isn't aligned enough to fetch as a memref, + fetch it as a bit field. */ + || (mode1 != BLKmode +--- a/src/gcc/expr.h ++++ b/src/gcc/expr.h +@@ -324,6 +324,8 @@ + /* Copy BLKmode object from a set of registers. */ + extern rtx copy_blkmode_from_reg (rtx, rtx, tree); + ++extern rtx copy_blkmode_to_reg (enum machine_mode, tree); ++ + /* Mark REG as holding a parameter for the next CALL_INSN. */ + extern void use_reg (rtx *, rtx); + --- a/src/gcc/fold-const.c +++ b/src/gcc/fold-const.c @@ -9232,15 +9232,10 @@ @@ -16944,7 +18490,73 @@ case, we'd have to replace it by its greatest power-of-2 --- a/src/gcc/fortran/ChangeLog +++ b/src/gcc/fortran/ChangeLog -@@ -1,3 +1,18 @@ +@@ -1,3 +1,84 @@ ++2012-01-01 Thomas König ++ ++ Backport from trunk ++ PR fortran/51502 ++ * expr.c (gfc_check_vardef_context): When determining ++ implicit pure status, also check for variable definition ++ context. Walk up namespaces until a procedure is ++ found to reset the implict pure attribute. ++ * resolve.c (gfc_implicit_pure): Walk up namespaces ++ until a procedure is found. ++ ++2011-12-22 Toon Moene ++ ++ PR fortran/51310 ++ * resolve.c (build_default_init_expr): Allow non-allocatable, ++ non-compile-time-constant-shape arrays to have a default ++ initializer. ++ * invoke.texi: Delete the restriction on automatic arrays not ++ being initialized by -finit-=. ++ ++2011-12-15 Tobias Burnus ++ ++ PR fortran/51550 ++ PR fortran/47545 ++ PR fortran/49050 ++ PR fortran/51075 ++ * resolve.c (resolve_fl_derived0): Print not-implemented error ++ for deferred-length character components. ++ ++2011-12-11 Tobias Burnus ++ ++ PR fortran/50923 ++ * trans-decl.c (generate_local_decl): Set TREE_NO_WARNING only ++ if the front end has printed a warning. ++ (gfc_generate_function_code): Fix unset-result warning. ++ ++2011-12-11 Thomas Koenig ++ ++ PR fortran/51338 ++ Backport from trunk ++ * dependency.c (are_identical_variables): Handle case where ++ end fields of substring references are NULL. ++ ++2011-12-08 Toon Moene ++ ++ PR fortran/51310 ++ * invoke.texi: Itemize the cases for which ++ -finit-= doesn't work. ++ ++2011-12-08 Tobias Burnus ++ ++ PR fortran/51448 ++ * fortran/trans-array.c (get_std_lbound): Fix handling of ++ conversion functions. ++ ++2011-12-06 Tobias Burnus ++ ++ PR fortran/51435 ++ * expr.c (gfc_has_default_initializer): Fix handling of ++ DT with initialized pointer components. ++ ++2011-12-03 Tobias Burnus ++ ++ PR fortran/50684 ++ * check.c (variable_check): Fix intent(in) check. ++ +2011-11-25 Tobias Burnus + + PR fortran/50408 @@ -16963,6 +18575,114 @@ 2011-10-26 Release Manager * GCC 4.6.2 released. +--- a/src/gcc/fortran/check.c ++++ b/src/gcc/fortran/check.c +@@ -485,10 +485,31 @@ + && (gfc_current_intrinsic_arg[n]->intent == INTENT_OUT + || gfc_current_intrinsic_arg[n]->intent == INTENT_INOUT)) + { +- gfc_error ("'%s' argument of '%s' intrinsic at %L cannot be INTENT(IN)", +- gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic, +- &e->where); +- return FAILURE; ++ gfc_ref *ref; ++ bool pointer = e->symtree->n.sym->ts.type == BT_CLASS ++ && CLASS_DATA (e->symtree->n.sym) ++ ? CLASS_DATA (e->symtree->n.sym)->attr.class_pointer ++ : e->symtree->n.sym->attr.pointer; ++ ++ for (ref = e->ref; ref; ref = ref->next) ++ { ++ if (pointer && ref->type == REF_COMPONENT) ++ break; ++ if (ref->type == REF_COMPONENT ++ && ((ref->u.c.component->ts.type == BT_CLASS ++ && CLASS_DATA (ref->u.c.component)->attr.class_pointer) ++ || (ref->u.c.component->ts.type != BT_CLASS ++ && ref->u.c.component->attr.pointer))) ++ break; ++ } ++ ++ if (!ref) ++ { ++ gfc_error ("'%s' argument of '%s' intrinsic at %L cannot be " ++ "INTENT(IN)", gfc_current_intrinsic_arg[n]->name, ++ gfc_current_intrinsic, &e->where); ++ return FAILURE; ++ } + } + + if (e->expr_type == EXPR_VARIABLE +--- a/src/gcc/fortran/dependency.c ++++ b/src/gcc/fortran/dependency.c +@@ -163,9 +163,19 @@ + break; + + case REF_SUBSTRING: +- if (gfc_dep_compare_expr (r1->u.ss.start, r2->u.ss.start) != 0 +- || gfc_dep_compare_expr (r1->u.ss.end, r2->u.ss.end) != 0) ++ if (gfc_dep_compare_expr (r1->u.ss.start, r2->u.ss.start) != 0) + return false; ++ ++ /* If both are NULL, the end length compares equal, because we ++ are looking at the same variable. This can only happen for ++ assumed- or deferred-length character arguments. */ ++ ++ if (r1->u.ss.end == NULL && r2->u.ss.end == NULL) ++ break; ++ ++ if (gfc_dep_compare_expr (r1->u.ss.end, r2->u.ss.end) != 0) ++ return false; ++ + break; + + default: +--- a/src/gcc/fortran/expr.c ++++ b/src/gcc/fortran/expr.c +@@ -3679,6 +3679,8 @@ + if (!c->attr.pointer + && gfc_has_default_initializer (c->ts.u.derived)) + return true; ++ if (c->attr.pointer && c->initializer) ++ return true; + } + else + { +@@ -3689,6 +3691,7 @@ + return false; + } + ++ + /* Get an expression for a default initializer. */ + + gfc_expr * +@@ -4520,9 +4523,24 @@ + return FAILURE; + } + +- if (!pointer && gfc_implicit_pure (NULL) && gfc_impure_variable (sym)) +- gfc_current_ns->proc_name->attr.implicit_pure = 0; ++ if (!pointer && context && gfc_implicit_pure (NULL) ++ && gfc_impure_variable (sym)) ++ { ++ gfc_namespace *ns; ++ gfc_symbol *sym; + ++ for (ns = gfc_current_ns; ns; ns = ns->parent) ++ { ++ sym = ns->proc_name; ++ if (sym == NULL) ++ break; ++ if (sym->attr.flavor == FL_PROCEDURE) ++ { ++ sym->attr.implicit_pure = 0; ++ break; ++ } ++ } ++ } + /* Check variable definition context for associate-names. */ + if (!pointer && sym->assoc) + { --- a/src/gcc/fortran/resolve.c +++ b/src/gcc/fortran/resolve.c @@ -3132,10 +3132,10 @@ @@ -16989,6 +18709,106 @@ } +@@ -9687,7 +9690,7 @@ + int i; + + /* These symbols should never have a default initialization. */ +- if ((sym->attr.dimension && !gfc_is_compile_time_shape (sym->as)) ++ if (sym->attr.allocatable + || sym->attr.external + || sym->attr.dummy + || sym->attr.pointer +@@ -11394,6 +11397,14 @@ + + for (c = sym->components; c != NULL; c = c->next) + { ++ /* See PRs 51550, 47545, 48654, 49050, 51075 - and 45170. */ ++ if (c->ts.type == BT_CHARACTER && c->ts.deferred) ++ { ++ gfc_error ("Deferred-length character component '%s' at %L is not " ++ "yet supported", c->name, &c->loc); ++ return FAILURE; ++ } ++ + /* F2008, C442. */ + if (c->attr.codimension /* FIXME: c->as check due to PR 43412. */ + && (!c->attr.allocatable || (c->as && c->as->type != AS_DEFERRED))) +@@ -12925,24 +12936,25 @@ + int + gfc_implicit_pure (gfc_symbol *sym) + { +- symbol_attribute attr; ++ gfc_namespace *ns; + + if (sym == NULL) + { +- /* Check if the current namespace is implicit_pure. */ +- sym = gfc_current_ns->proc_name; +- if (sym == NULL) +- return 0; +- attr = sym->attr; +- if (attr.flavor == FL_PROCEDURE +- && attr.implicit_pure && !attr.pure) +- return 1; +- return 0; ++ /* Check if the current procedure is implicit_pure. Walk up ++ the procedure list until we find a procedure. */ ++ for (ns = gfc_current_ns; ns; ns = ns->parent) ++ { ++ sym = ns->proc_name; ++ if (sym == NULL) ++ return 0; ++ ++ if (sym->attr.flavor == FL_PROCEDURE) ++ break; ++ } + } +- +- attr = sym->attr; +- +- return attr.flavor == FL_PROCEDURE && attr.implicit_pure && !attr.pure; ++ ++ return sym->attr.flavor == FL_PROCEDURE && sym->attr.implicit_pure ++ && !sym->attr.pure; + } + + +--- a/src/gcc/fortran/trans-array.c ++++ b/src/gcc/fortran/trans-array.c +@@ -6772,7 +6772,16 @@ + gfc_array_index_type, cond, + lbound, gfc_index_one_node); + } +- else if (expr->expr_type == EXPR_VARIABLE) ++ ++ if (expr->expr_type == EXPR_FUNCTION) ++ { ++ /* A conversion function, so use the argument. */ ++ gcc_assert (expr->value.function.isym ++ && expr->value.function.isym->conversion); ++ expr = expr->value.function.actual->expr; ++ } ++ ++ if (expr->expr_type == EXPR_VARIABLE) + { + tmp = TREE_TYPE (expr->symtree->n.sym->backend_decl); + for (ref = expr->ref; ref; ref = ref->next) +@@ -6785,15 +6794,6 @@ + } + return GFC_TYPE_ARRAY_LBOUND(tmp, dim); + } +- else if (expr->expr_type == EXPR_FUNCTION) +- { +- /* A conversion function, so use the argument. */ +- expr = expr->value.function.actual->expr; +- if (expr->expr_type != EXPR_VARIABLE) +- return gfc_index_one_node; +- desc = TREE_TYPE (expr->symtree->n.sym->backend_decl); +- return get_std_lbound (expr, desc, dim, assumed_size); +- } + + return gfc_index_one_node; + } --- a/src/gcc/fortran/trans-decl.c +++ b/src/gcc/fortran/trans-decl.c @@ -677,7 +677,7 @@ @@ -17012,6 +18832,51 @@ sym->backend_decl = s->backend_decl; return sym->backend_decl; } +@@ -4179,10 +4184,16 @@ + "declared INTENT(OUT) but was not set and " + "does not have a default initializer", + sym->name, &sym->declared_at); ++ if (sym->backend_decl != NULL_TREE) ++ TREE_NO_WARNING(sym->backend_decl) = 1; + } + else if (gfc_option.warn_unused_dummy_argument) +- gfc_warning ("Unused dummy argument '%s' at %L", sym->name, ++ { ++ gfc_warning ("Unused dummy argument '%s' at %L", sym->name, + &sym->declared_at); ++ if (sym->backend_decl != NULL_TREE) ++ TREE_NO_WARNING(sym->backend_decl) = 1; ++ } + } + + /* Warn for unused variables, but not if they're inside a common +@@ -4227,11 +4238,6 @@ + mark the symbol now, as well as in traverse_ns, to prevent + getting stuck in a circular dependency. */ + sym->mark = 1; +- +- /* We do not want the middle-end to warn about unused parameters +- as this was already done above. */ +- if (sym->attr.dummy && sym->backend_decl != NULL_TREE) +- TREE_NO_WARNING(sym->backend_decl) = 1; + } + else if (sym->attr.flavor == FL_PARAMETER) + { +@@ -4846,11 +4852,11 @@ + if (result == NULL_TREE) + { + /* TODO: move to the appropriate place in resolve.c. */ +- if (warn_return_type && !sym->attr.referenced && sym == sym->result) ++ if (warn_return_type && sym == sym->result) + gfc_warning ("Return value of function '%s' at %L not set", + sym->name, &sym->declared_at); +- +- TREE_NO_WARNING(sym->backend_decl) = 1; ++ if (warn_return_type) ++ TREE_NO_WARNING(sym->backend_decl) = 1; + } + else + gfc_add_expr_to_block (&body, gfc_generate_return ()); --- a/src/gcc/fortran/trans-types.c +++ b/src/gcc/fortran/trans-types.c @@ -2092,6 +2092,9 @@ @@ -17064,7 +18929,7 @@ #define YY_RESTORE_YY_MORE_OFFSET char *yytext; -#line 1 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 1 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 1 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" /* -*- indented-text -*- */ /* Process source files and output type information. Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 @@ -17073,7 +18938,7 @@ . */ #define YY_NO_INPUT 1 -#line 25 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 25 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 25 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" #include "bconfig.h" #include "system.h" @@ -17113,7 +18978,7 @@ register int yy_act; -#line 59 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 59 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 59 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" /* Do this on entry to yylex(): */ *yylval = 0; @@ -17131,7 +18996,7 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 70 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 70 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 70 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { BEGIN(in_struct); return TYPEDEF; @@ -17140,7 +19005,7 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 74 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 74 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 74 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { BEGIN(in_struct); return STRUCT; @@ -17149,7 +19014,7 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 78 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 78 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 78 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { BEGIN(in_struct); return UNION; @@ -17158,7 +19023,7 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 82 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 82 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 82 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { BEGIN(in_struct); return EXTERN; @@ -17167,7 +19032,7 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 86 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 86 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 86 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { BEGIN(in_struct); return STATIC; @@ -17176,7 +19041,7 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 91 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 91 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 91 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { BEGIN(in_struct); return DEFVEC_OP; @@ -17185,7 +19050,7 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 95 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 95 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 95 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { BEGIN(in_struct); return DEFVEC_I; @@ -17194,7 +19059,7 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 99 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 99 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 99 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { BEGIN(in_struct); return DEFVEC_ALLOC; @@ -17203,21 +19068,21 @@ case 9: YY_RULE_SETUP -#line 107 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 107 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 107 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { BEGIN(in_struct_comment); } YY_BREAK case 10: /* rule 10 can match eol */ YY_RULE_SETUP -#line 109 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 109 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 109 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { update_lineno (yytext, yyleng); } YY_BREAK case 11: /* rule 11 can match eol */ YY_RULE_SETUP -#line 110 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 110 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 110 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { lexer_line.line++; } YY_BREAK case 12: @@ -17226,7 +19091,7 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 112 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 112 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 112 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" /* don't care */ YY_BREAK case 13: @@ -17235,7 +19100,7 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 113 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 113 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 113 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { return GTY_TOKEN; } YY_BREAK case 14: @@ -17244,7 +19109,7 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 114 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 114 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 114 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { return VEC_TOKEN; } YY_BREAK case 15: @@ -17253,7 +19118,7 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 115 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 115 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 115 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { return UNION; } YY_BREAK case 16: @@ -17262,7 +19127,7 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 116 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 116 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 116 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { return STRUCT; } YY_BREAK case 17: @@ -17271,7 +19136,7 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 117 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 117 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 117 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { return ENUM; } YY_BREAK case 18: @@ -17280,7 +19145,7 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 118 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 118 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 118 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { return PTR_ALIAS; } YY_BREAK case 19: @@ -17289,13 +19154,13 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 119 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 119 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 119 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { return NESTED_PTR; } YY_BREAK case 20: YY_RULE_SETUP -#line 120 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 120 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 120 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { return NUM; } YY_BREAK case 21: @@ -17304,7 +19169,7 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 121 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 121 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 121 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { *yylval = XDUPVAR (const char, yytext, yyleng, yyleng+1); return PARAM_IS; @@ -17313,12 +19178,12 @@ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ -#line 127 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 127 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 127 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" case 23: /* rule 23 can match eol */ YY_RULE_SETUP -#line 127 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 127 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 127 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { size_t len; @@ -17327,7 +19192,7 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 139 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 139 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 139 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { *yylval = XDUPVAR (const char, yytext, yyleng, yyleng+1); return ID; @@ -17336,7 +19201,7 @@ /* rule 25 can match eol */ YY_RULE_SETUP -#line 144 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 144 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 144 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { *yylval = XDUPVAR (const char, yytext+1, yyleng-2, yyleng-1); return STRING; @@ -17345,7 +19210,7 @@ /* rule 26 can match eol */ YY_RULE_SETUP -#line 149 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 149 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 149 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { *yylval = XDUPVAR (const char, yytext+1, yyleng-2, yyleng-1); return ARRAY; @@ -17354,7 +19219,7 @@ /* rule 27 can match eol */ YY_RULE_SETUP -#line 153 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 153 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 153 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { *yylval = XDUPVAR (const char, yytext+1, yyleng-2, yyleng); return CHAR; @@ -17363,13 +19228,13 @@ case 28: YY_RULE_SETUP -#line 158 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 158 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 158 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { return ELLIPSIS; } YY_BREAK case 29: YY_RULE_SETUP -#line 159 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 159 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 159 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { return yytext[0]; } YY_BREAK /* ignore pp-directives */ @@ -17377,13 +19242,13 @@ /* rule 30 can match eol */ YY_RULE_SETUP -#line 162 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 162 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 162 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" {lexer_line.line++;} YY_BREAK case 31: YY_RULE_SETUP -#line 164 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 164 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 164 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { error_at_line (&lexer_line, "unexpected character `%s'", yytext); } @@ -17392,35 +19257,35 @@ case 32: YY_RULE_SETUP -#line 169 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 169 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 169 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { BEGIN(in_comment); } YY_BREAK case 33: /* rule 33 can match eol */ YY_RULE_SETUP -#line 170 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 170 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 170 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { lexer_line.line++; } YY_BREAK case 34: -#line 172 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 172 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 172 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" case 35: /* rule 35 can match eol */ -#line 173 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 173 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 173 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" case 36: /* rule 36 can match eol */ YY_RULE_SETUP -#line 173 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 173 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 173 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" /* do nothing */ YY_BREAK case 37: /* rule 37 can match eol */ YY_RULE_SETUP -#line 174 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 174 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 174 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { update_lineno (yytext, yyleng); } YY_BREAK case 38: @@ -17429,7 +19294,7 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 175 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 175 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 175 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" /* do nothing */ YY_BREAK @@ -17437,16 +19302,16 @@ /* rule 39 can match eol */ YY_RULE_SETUP -#line 178 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 178 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 178 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { lexer_line.line++; } YY_BREAK case 40: -#line 180 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 180 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 180 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" case 41: YY_RULE_SETUP -#line 180 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 180 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 180 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" /* do nothing */ YY_BREAK case 42: @@ -17455,29 +19320,29 @@ YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 181 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 181 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 181 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" /* do nothing */ YY_BREAK case 43: YY_RULE_SETUP -#line 183 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 183 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 183 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { BEGIN(INITIAL); } YY_BREAK case 44: YY_RULE_SETUP -#line 184 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 184 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 184 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { BEGIN(in_struct); } YY_BREAK case 45: -#line 187 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 187 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 187 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" case 46: YY_RULE_SETUP -#line 187 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 187 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 187 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" { error_at_line (&lexer_line, "unterminated comment or string; unexpected EOF"); @@ -17486,13 +19351,13 @@ /* rule 47 can match eol */ YY_RULE_SETUP -#line 192 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 192 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 192 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" /* do nothing */ YY_BREAK case 48: YY_RULE_SETUP -#line 194 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 194 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 194 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1650 "gengtype-lex.c" @@ -17516,7 +19381,7 @@ #define YYTABLES_NAME "yytables" -#line 194 "/d/gcc-4.6.2/gcc-4.6.2/gcc/gengtype-lex.l" -+#line 194 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2011.12/gcc/gengtype-lex.l" ++#line 194 "/home/ams/tmp/linaro/gcc-4.6/gcc-linaro-4.6-2012.01/gcc/gengtype-lex.l" @@ -18398,6 +20263,19 @@ if (TREE_CODE (target) == SSA_NAME) ipa_analyze_indirect_call_uses (node, info, parms_info, call, target); else if (TREE_CODE (target) == OBJ_TYPE_REF) +@@ -2868,9 +2870,9 @@ + { + const struct lto_function_header *header = + (const struct lto_function_header *) data; +- const int32_t cfg_offset = sizeof (struct lto_function_header); +- const int32_t main_offset = cfg_offset + header->cfg_size; +- const int32_t string_offset = main_offset + header->main_size; ++ const int cfg_offset = sizeof (struct lto_function_header); ++ const int main_offset = cfg_offset + header->cfg_size; ++ const int string_offset = main_offset + header->main_size; + struct data_in *data_in; + struct lto_input_block ib_main; + unsigned int i; --- a/src/gcc/loop-doloop.c +++ b/src/gcc/loop-doloop.c @@ -78,6 +78,8 @@ @@ -18522,7 +20400,199 @@ */ condition = gen_rtx_fmt_ee (NE, VOIDmode, inc_src, const1_rtx); ---- a/src/gcc/modulo-sched.c +--- a/src/gcc/lto/ChangeLog ++++ b/src/gcc/lto/ChangeLog +@@ -1,3 +1,10 @@ ++2011-12-13 Eric Botcazou ++ ++ * lto.h (lto_parse_hex): Delete. ++ * lto.c (lto_read_decls): Use 'int' for offsets. ++ (lto_parse_hex): Make static and return proper 64-bit host type. ++ (lto_resolution_read): Use proper 64-bit host type. ++ + 2011-10-26 Release Manager + + * GCC 4.6.2 released. +--- a/src/gcc/lto/lto.c ++++ b/src/gcc/lto/lto.c +@@ -198,7 +198,7 @@ + uint32_t ix; + tree decl; + uint32_t i, j; +- ++ + ix = *data++; + decl = lto_streamer_cache_get (data_in->reader_cache, (int) ix); + if (TREE_CODE (decl) != FUNCTION_DECL) +@@ -241,9 +241,9 @@ + VEC(ld_plugin_symbol_resolution_t,heap) *resolutions) + { + const struct lto_decl_header *header = (const struct lto_decl_header *) data; +- const int32_t decl_offset = sizeof (struct lto_decl_header); +- const int32_t main_offset = decl_offset + header->decl_state_size; +- const int32_t string_offset = main_offset + header->main_size; ++ const int decl_offset = sizeof (struct lto_decl_header); ++ const int main_offset = decl_offset + header->decl_state_size; ++ const int string_offset = main_offset + header->main_size; + struct lto_input_block ib_main; + struct data_in *data_in; + unsigned int i; +@@ -291,17 +291,20 @@ + + if (data_ptr != data_end) + internal_error ("bytecode stream: garbage at the end of symbols section"); +- ++ + /* Set the current decl state to be the global state. */ + decl_data->current_decl_state = decl_data->global_decl_state; + + lto_data_in_delete (data_in); + } + +-/* strtoll is not portable. */ +-int64_t +-lto_parse_hex (const char *p) { +- uint64_t ret = 0; ++/* Custom version of strtoll, which is not portable. */ ++ ++static HOST_WIDEST_INT ++lto_parse_hex (const char *p) ++{ ++ HOST_WIDEST_INT ret = 0; ++ + for (; *p != '\0'; ++p) + { + char c = *p; +@@ -317,6 +320,7 @@ + internal_error ("could not parse hex number"); + ret |= part; + } ++ + return ret; + } + +@@ -352,7 +356,7 @@ + { + int t; + char offset_p[17]; +- int64_t offset; ++ HOST_WIDEST_INT offset; + t = fscanf (resolution, "@0x%16s", offset_p); + if (t != 1) + internal_error ("could not parse file offset"); +--- a/src/gcc/lto/lto.h ++++ b/src/gcc/lto/lto.h +@@ -60,6 +60,4 @@ + size_t len; + }; + +-int64_t lto_parse_hex (const char *p); +- + #endif /* LTO_H */ +--- a/src/gcc/lto-cgraph.c ++++ b/src/gcc/lto-cgraph.c +@@ -1792,9 +1792,9 @@ + { + const struct lto_function_header *header = + (const struct lto_function_header *) data; +- const int32_t cfg_offset = sizeof (struct lto_function_header); +- const int32_t main_offset = cfg_offset + header->cfg_size; +- const int32_t string_offset = main_offset + header->main_size; ++ const int cfg_offset = sizeof (struct lto_function_header); ++ const int main_offset = cfg_offset + header->cfg_size; ++ const int string_offset = main_offset + header->main_size; + struct data_in *data_in; + struct lto_input_block ib_main; + unsigned int i; +--- a/src/gcc/lto-opts.c ++++ b/src/gcc/lto-opts.c +@@ -358,7 +358,7 @@ + size_t len, l, skip; + const char *data, *p; + const struct lto_simple_header *header; +- int32_t opts_offset; ++ int opts_offset; + struct lto_input_block ib; + + data = lto_get_section_data (file_data, LTO_section_opts, NULL, &len); +@@ -379,10 +379,10 @@ + + lto_check_version (header->lto_header.major_version, + header->lto_header.minor_version); +- ++ + LTO_INIT_INPUT_BLOCK (ib, p + opts_offset, 0, header->main_size); + input_options (&ib); +- ++ + skip = header->main_size + opts_offset; + l -= skip; + p += skip; +--- a/src/gcc/lto-section-in.c ++++ b/src/gcc/lto-section-in.c +@@ -296,7 +296,7 @@ + = (const struct lto_simple_header *) data; + + struct lto_input_block* ib_main; +- int32_t main_offset = sizeof (struct lto_simple_header); ++ int main_offset = sizeof (struct lto_simple_header); + + if (!data) + return NULL; +--- a/src/gcc/lto-streamer-in.c ++++ b/src/gcc/lto-streamer-in.c +@@ -1366,9 +1366,9 @@ + { + const struct lto_function_header *header; + struct data_in *data_in; +- int32_t cfg_offset; +- int32_t main_offset; +- int32_t string_offset; ++ int cfg_offset; ++ int main_offset; ++ int string_offset; + struct lto_input_block ib_cfg; + struct lto_input_block ib_main; + +--- a/src/gcc/lto-streamer-out.c ++++ b/src/gcc/lto-streamer-out.c +@@ -2408,7 +2408,7 @@ + enum gcc_plugin_symbol_kind kind; + enum gcc_plugin_symbol_visibility visibility; + int slot_num; +- uint64_t size; ++ unsigned HOST_WIDEST_INT size; + const char *comdat; + unsigned char c; + +@@ -2466,7 +2466,7 @@ + when symbol has attribute (visibility("hidden")) specified. + targetm.binds_local_p check DECL_VISIBILITY_SPECIFIED and gets this + right. */ +- ++ + if (DECL_EXTERNAL (t) + && !targetm.binds_local_p (t)) + visibility = GCCPV_DEFAULT; +@@ -2488,14 +2488,9 @@ + } + + if (kind == GCCPK_COMMON +- && DECL_SIZE (t) +- && TREE_CODE (DECL_SIZE (t)) == INTEGER_CST) +- { +- size = (HOST_BITS_PER_WIDE_INT >= 64) +- ? (uint64_t) int_size_in_bytes (TREE_TYPE (t)) +- : (((uint64_t) TREE_INT_CST_HIGH (DECL_SIZE_UNIT (t))) << 32) +- | TREE_INT_CST_LOW (DECL_SIZE_UNIT (t)); +- } ++ && DECL_SIZE_UNIT (t) ++ && TREE_CODE (DECL_SIZE_UNIT (t)) == INTEGER_CST) ++ size = TREE_INT_CST_LOW (DECL_SIZE_UNIT (t)); + else + size = 0; + +--- a/src/gcc/modulo-sched.c +++ b/src/gcc/modulo-sched.c @@ -116,14 +116,18 @@ @@ -19635,7 +21705,7 @@ end_sequence (); -@@ -738,15 +1182,30 @@ +@@ -738,15 +1182,32 @@ start_sequence (); for (i = 0; i < last_stage; i++) @@ -19662,12 +21732,14 @@ + + for (i = 0; i < loop->num_nodes; i++) + bbs[i]->flags |= BB_DISABLE_SCHEDULE; ++ ++ free (bbs); +} + /* Return true if all the BBs of the loop are empty except the loop header. */ static bool -@@ -1009,10 +1468,10 @@ +@@ -1009,10 +1470,10 @@ continue; } @@ -19682,7 +21754,7 @@ ??? Should handle insns defining subregs. */ for (insn = head; insn != NEXT_INSN (tail); insn = NEXT_INSN (insn)) { -@@ -1021,8 +1480,8 @@ +@@ -1021,8 +1482,8 @@ if (CALL_P (insn) || BARRIER_P (insn) || (NONDEBUG_INSN_P (insn) && !JUMP_P (insn) @@ -19693,7 +21765,7 @@ || (INSN_P (insn) && (set = single_set (insn)) && GET_CODE (SET_DEST (set)) == SUBREG)) break; -@@ -1036,8 +1495,6 @@ +@@ -1036,8 +1497,6 @@ fprintf (dump_file, "SMS loop-with-call\n"); else if (BARRIER_P (insn)) fprintf (dump_file, "SMS loop-with-barrier\n"); @@ -19702,7 +21774,7 @@ else if ((NONDEBUG_INSN_P (insn) && !JUMP_P (insn) && !single_set (insn) && GET_CODE (PATTERN (insn)) != USE)) fprintf (dump_file, "SMS loop-with-not-single-set\n"); -@@ -1049,7 +1506,11 @@ +@@ -1049,7 +1508,11 @@ continue; } @@ -19715,7 +21787,7 @@ { if (dump_file) fprintf (dump_file, "SMS create_ddg failed\n"); -@@ -1072,9 +1533,9 @@ +@@ -1072,9 +1535,9 @@ { rtx head, tail; rtx count_reg, count_init; @@ -19727,7 +21799,7 @@ if (! (g = g_arr[loop->num])) continue; -@@ -1151,63 +1612,103 @@ +@@ -1151,63 +1614,103 @@ fprintf (dump_file, "SMS iis %d %d %d (rec_mii, mii, maxii)\n", rec_mii, mii, maxii); @@ -19878,7 +21950,7 @@ /* case the BCT count is not known , Do loop-versioning */ if (count_reg && ! count_init) { -@@ -1230,23 +1731,23 @@ +@@ -1230,23 +1733,23 @@ permute_partial_schedule (ps, g->closing_branch->first_note); /* Mark this loop as software pipelined so the later @@ -19909,7 +21981,7 @@ free (node_order); free_ddg (g); } -@@ -1347,19 +1848,21 @@ +@@ -1347,19 +1850,21 @@ scheduling window is empty and zero otherwise. */ static int @@ -19935,7 +22007,7 @@ /* 1. compute sched window for u (start, end, step). */ sbitmap_zero (psp); -@@ -1367,214 +1870,119 @@ +@@ -1367,214 +1872,119 @@ psp_not_empty = sbitmap_a_and_b_cg (psp, u_node_preds, sched_nodes); pss_not_empty = sbitmap_a_and_b_cg (pss, u_node_succs, sched_nodes); @@ -20250,7 +22322,7 @@ *start_p = start; *step_p = step; -@@ -1587,10 +1995,10 @@ +@@ -1587,10 +1997,10 @@ if (dump_file) fprintf (dump_file, "\nEmpty window: start=%d, end=%d, step=%d\n", start, end, step); @@ -20263,7 +22335,7 @@ } /* Calculate MUST_PRECEDE/MUST_FOLLOW bitmaps of U_NODE; which is the -@@ -1646,7 +2054,7 @@ +@@ -1646,7 +2056,7 @@ SCHED_TIME (e->src) - (e->distance * ii) == first_cycle_in_window */ for (e = u_node->in; e != 0; e = e->next_in) if (TEST_BIT (sched_nodes, e->src->cuid) @@ -20272,7 +22344,7 @@ first_cycle_in_window)) { if (dump_file) -@@ -1671,7 +2079,7 @@ +@@ -1671,7 +2081,7 @@ SCHED_TIME (e->dest) + (e->distance * ii) == last_cycle_in_window */ for (e = u_node->out; e != 0; e = e->next_out) if (TEST_BIT (sched_nodes, e->dest->cuid) @@ -20281,7 +22353,7 @@ last_cycle_in_window)) { if (dump_file) -@@ -1695,7 +2103,7 @@ +@@ -1695,7 +2105,7 @@ last row of the scheduling window) */ static bool @@ -20290,7 +22362,7 @@ int u, int cycle, sbitmap sched_nodes, int *num_splits, sbitmap must_precede, sbitmap must_follow) -@@ -1704,11 +2112,10 @@ +@@ -1704,11 +2114,10 @@ bool success = 0; verify_partial_schedule (ps, sched_nodes); @@ -20304,7 +22376,7 @@ SET_BIT (sched_nodes, u); success = 1; *num_splits = 0; -@@ -1760,23 +2167,17 @@ +@@ -1760,23 +2169,17 @@ continue; } @@ -20331,7 +22403,7 @@ (g->nodes[u].insn)), start, end, step); gcc_assert ((step > 0 && start < end) -@@ -1788,26 +2189,13 @@ +@@ -1788,26 +2191,13 @@ for (c = start; c != end; c += step) { @@ -20363,7 +22435,7 @@ sched_nodes, &num_splits, tmp_precede, tmp_follow); -@@ -1883,6 +2271,7 @@ +@@ -1883,6 +2273,7 @@ int ii = ps->ii; int new_ii = ii + 1; int row; @@ -20371,7 +22443,7 @@ verify_partial_schedule (ps, sched_nodes); -@@ -1893,18 +2282,20 @@ +@@ -1893,18 +2284,20 @@ if (dump_file) fprintf (dump_file, "split_row=%d\n", split_row); @@ -20395,7 +22467,7 @@ int new_time = SCHED_TIME (u) + (SCHED_TIME (u) / ii); SCHED_TIME (u) = new_time; -@@ -1920,11 +2311,12 @@ +@@ -1920,11 +2313,12 @@ for (row = split_row; row < ii; row++) { rows_new[row + 1] = ps->rows[row]; @@ -20409,7 +22481,7 @@ int new_time = SCHED_TIME (u) + (SCHED_TIME (u) / ii) + 1; SCHED_TIME (u) = new_time; -@@ -1941,6 +2333,8 @@ +@@ -1941,6 +2335,8 @@ + (SMODULO (ps->max_cycle, ii) >= split_row ? 1 : 0); free (ps->rows); ps->rows = rows_new; @@ -20418,7 +22490,7 @@ ps->ii = new_ii; gcc_assert (ps->min_cycle >= 0); -@@ -1962,24 +2356,24 @@ +@@ -1962,24 +2358,24 @@ { ddg_edge_ptr e; int lower = INT_MIN, upper = INT_MAX; @@ -20452,7 +22524,7 @@ { crit_cycle = SCHED_TIME (crit_pred) + 1; return SMODULO (crit_cycle, ii); -@@ -1987,17 +2381,18 @@ +@@ -1987,17 +2383,18 @@ for (e = u_node->out; e != 0; e = e->next_out) { @@ -20478,7 +22550,7 @@ { crit_cycle = SCHED_TIME (crit_succ); return SMODULO (crit_cycle, ii); -@@ -2016,16 +2411,23 @@ +@@ -2016,16 +2413,23 @@ ps_insn_ptr crr_insn; for (row = 0; row < ps->ii; row++) @@ -20512,7 +22584,7 @@ } -@@ -2431,6 +2833,8 @@ +@@ -2431,6 +2835,8 @@ { partial_schedule_ptr ps = XNEW (struct partial_schedule); ps->rows = (ps_insn_ptr *) xcalloc (ii, sizeof (ps_insn_ptr)); @@ -20521,7 +22593,7 @@ ps->ii = ii; ps->history = history; ps->min_cycle = INT_MAX; -@@ -2465,10 +2869,19 @@ +@@ -2465,10 +2871,19 @@ static void free_partial_schedule (partial_schedule_ptr ps) { @@ -20541,7 +22613,7 @@ free (ps); } -@@ -2486,6 +2899,8 @@ +@@ -2486,6 +2901,8 @@ ps->rows = (ps_insn_ptr *) xrealloc (ps->rows, new_ii * sizeof (ps_insn_ptr)); memset (ps->rows, 0, new_ii * sizeof (ps_insn_ptr)); @@ -20550,7 +22622,7 @@ ps->ii = new_ii; ps->min_cycle = INT_MAX; ps->max_cycle = INT_MIN; -@@ -2505,8 +2920,13 @@ +@@ -2505,8 +2922,13 @@ fprintf (dump, "\n[ROW %d ]: ", i); while (ps_i) { @@ -20566,7 +22638,7 @@ ps_i = ps_i->next_in_row; } } -@@ -2514,36 +2934,31 @@ +@@ -2514,36 +2936,31 @@ /* Creates an object of PS_INSN and initializes it to the given parameters. */ static ps_insn_ptr @@ -20610,7 +22682,7 @@ ps->rows[row] = ps_i->next_in_row; if (ps->rows[row]) ps->rows[row]->prev_in_row = NULL; -@@ -2554,8 +2969,10 @@ +@@ -2554,8 +2971,10 @@ if (ps_i->next_in_row) ps_i->next_in_row->prev_in_row = ps_i->prev_in_row; } @@ -20622,7 +22694,7 @@ } /* Unlike what literature describes for modulo scheduling (which focuses -@@ -2571,6 +2988,7 @@ +@@ -2571,6 +2990,7 @@ ps_insn_ptr next_ps_i; ps_insn_ptr first_must_follow = NULL; ps_insn_ptr last_must_precede = NULL; @@ -20630,7 +22702,7 @@ int row; if (! ps_i) -@@ -2585,10 +3003,11 @@ +@@ -2585,10 +3005,11 @@ next_ps_i; next_ps_i = next_ps_i->next_in_row) { @@ -20644,7 +22716,7 @@ { /* If we have already met a node that must follow, then there is no possible column. */ -@@ -2597,8 +3016,37 @@ +@@ -2597,8 +3018,37 @@ else last_must_precede = next_ps_i; } @@ -20682,7 +22754,7 @@ /* Now insert the node after INSERT_AFTER_PSI. */ if (! last_must_precede) -@@ -2631,7 +3079,6 @@ +@@ -2631,7 +3081,6 @@ { ps_insn_ptr prev, next; int row; @@ -20690,7 +22762,7 @@ if (!ps || !ps_i) return false; -@@ -2641,11 +3088,9 @@ +@@ -2641,11 +3090,9 @@ if (! ps_i->next_in_row) return false; @@ -20703,7 +22775,7 @@ return false; /* Advance PS_I over its next_in_row in the doubly linked list. */ -@@ -2676,21 +3121,16 @@ +@@ -2676,21 +3123,16 @@ before/after (respectively) the node pointed to by PS_I when scheduled in the same cycle. */ static ps_insn_ptr @@ -20728,7 +22800,7 @@ /* Finds and inserts PS_I according to MUST_FOLLOW and MUST_PRECEDE. */ -@@ -2700,6 +3140,7 @@ +@@ -2700,6 +3142,7 @@ return NULL; } @@ -20736,7 +22808,7 @@ return ps_i; } -@@ -2741,7 +3182,7 @@ +@@ -2741,7 +3184,7 @@ crr_insn; crr_insn = crr_insn->next_in_row) { @@ -20745,7 +22817,7 @@ if (!NONDEBUG_INSN_P (insn)) continue; -@@ -2778,7 +3219,7 @@ +@@ -2778,7 +3221,7 @@ cuid N must be come before/after (respectively) the node pointed to by PS_I when scheduled in the same cycle. */ ps_insn_ptr @@ -20754,7 +22826,7 @@ int c, sbitmap must_precede, sbitmap must_follow) { -@@ -2820,6 +3261,22 @@ +@@ -2820,6 +3263,22 @@ return ps_i; } @@ -20777,7 +22849,7 @@ /* Rotate the rows of PS such that insns scheduled at time START_CYCLE will appear in row 0. Updates max/min_cycles. */ void -@@ -2837,11 +3294,16 @@ +@@ -2837,11 +3296,16 @@ for (i = 0; i < backward_rotates; i++) { ps_insn_ptr first_row = ps->rows[0]; @@ -22862,6 +24934,17 @@ } return NULL_RTX; } +--- a/src/gcc/regmove.c ++++ b/src/gcc/regmove.c +@@ -860,7 +860,7 @@ + if (REG_N_CALLS_CROSSED (REGNO (src)) == 0) + break; + +- if (call_used_regs [REGNO (dst)] ++ if ((HARD_REGISTER_P (dst) && call_used_regs [REGNO (dst)]) + || find_reg_fusage (p, CLOBBER, dst)) + break; + } --- a/src/gcc/reload.c +++ b/src/gcc/reload.c @@ -1017,6 +1017,7 @@ @@ -23104,6 +25187,21 @@ #ifdef HAVE_cc0 /* If the last insn in the delay slot sets CC0 for some insn, various code assumes that it is in a delay slot. We could +--- a/src/gcc/sched-deps.c ++++ b/src/gcc/sched-deps.c +@@ -2687,7 +2687,11 @@ + else + sched_analyze_2 (deps, XEXP (link, 0), insn); + } +- if (find_reg_note (insn, REG_SETJMP, NULL)) ++ /* Don't schedule anything after a tail call, tail call needs ++ to use at least all call-saved registers. */ ++ if (SIBLING_CALL_P (insn)) ++ reg_pending_barrier = TRUE_BARRIER; ++ else if (find_reg_note (insn, REG_SETJMP, NULL)) + reg_pending_barrier = MOVE_BARRIER; + } + --- a/src/gcc/simplify-rtx.c +++ b/src/gcc/simplify-rtx.c @@ -1000,6 +1000,48 @@ @@ -23251,7 +25349,40 @@ /* (xor (comparison foo bar) (const_int 1)) can become the reversed comparison if STORE_FLAG_VALUE is 1. */ if (STORE_FLAG_VALUE == 1 -@@ -5443,6 +5567,7 @@ +@@ -2777,7 +2901,7 @@ + } + } + } +- else ++ else if (SCALAR_INT_MODE_P (mode)) + { + /* 0/x is 0 (or x&0 if x has side-effects). */ + if (trueop0 == CONST0_RTX (mode) +@@ -4177,10 +4301,20 @@ + { + rtx x = XEXP (op0, 0); + rtx c = XEXP (op0, 1); ++ enum rtx_code invcode = op0code == PLUS ? MINUS : PLUS; ++ rtx tem = simplify_gen_binary (invcode, cmp_mode, op1, c); + +- c = simplify_gen_binary (op0code == PLUS ? MINUS : PLUS, +- cmp_mode, op1, c); +- return simplify_gen_relational (code, mode, cmp_mode, x, c); ++ /* Detect an infinite recursive condition, where we oscillate at this ++ simplification case between: ++ A + B == C <---> C - B == A, ++ where A, B, and C are all constants with non-simplifiable expressions, ++ usually SYMBOL_REFs. */ ++ if (GET_CODE (tem) == invcode ++ && CONSTANT_P (x) ++ && rtx_equal_p (c, XEXP (tem, 1))) ++ return NULL_RTX; ++ ++ return simplify_gen_relational (code, mode, cmp_mode, x, tem); + } + + /* (ne:SI (zero_extract:SI FOO (const_int 1) BAR) (const_int 0))) is +@@ -5443,6 +5577,7 @@ /* Optimize SUBREG truncations of zero and sign extended values. */ if ((GET_CODE (op) == ZERO_EXTEND || GET_CODE (op) == SIGN_EXTEND) @@ -23259,7 +25390,7 @@ && GET_MODE_BITSIZE (outermode) < GET_MODE_BITSIZE (innermode)) { unsigned int bitpos = subreg_lsb_1 (outermode, innermode, byte); -@@ -5481,6 +5606,7 @@ +@@ -5481,6 +5616,7 @@ if ((GET_CODE (op) == LSHIFTRT || GET_CODE (op) == ASHIFTRT) && SCALAR_INT_MODE_P (outermode) @@ -23267,7 +25398,7 @@ /* Ensure that OUTERMODE is at least twice as wide as the INNERMODE to avoid the possibility that an outer LSHIFTRT shifts by more than the sign extension's sign_bit_copies and introduces zeros -@@ -5500,6 +5626,7 @@ +@@ -5500,6 +5636,7 @@ if ((GET_CODE (op) == LSHIFTRT || GET_CODE (op) == ASHIFTRT) && SCALAR_INT_MODE_P (outermode) @@ -23275,7 +25406,7 @@ && GET_MODE_BITSIZE (outermode) < GET_MODE_BITSIZE (innermode) && CONST_INT_P (XEXP (op, 1)) && GET_CODE (XEXP (op, 0)) == ZERO_EXTEND -@@ -5514,6 +5641,7 @@ +@@ -5514,6 +5651,7 @@ the outer subreg is effectively a truncation to the original mode. */ if (GET_CODE (op) == ASHIFT && SCALAR_INT_MODE_P (outermode) @@ -23283,7 +25414,7 @@ && GET_MODE_BITSIZE (outermode) < GET_MODE_BITSIZE (innermode) && CONST_INT_P (XEXP (op, 1)) && (GET_CODE (XEXP (op, 0)) == ZERO_EXTEND -@@ -5527,7 +5655,7 @@ +@@ -5527,7 +5665,7 @@ /* Recognize a word extraction from a multi-word subreg. */ if ((GET_CODE (op) == LSHIFTRT || GET_CODE (op) == ASHIFTRT) @@ -23292,7 +25423,7 @@ && GET_MODE_BITSIZE (outermode) >= BITS_PER_WORD && GET_MODE_BITSIZE (innermode) >= (2 * GET_MODE_BITSIZE (outermode)) && CONST_INT_P (XEXP (op, 1)) -@@ -5549,6 +5677,7 @@ +@@ -5549,6 +5687,7 @@ if ((GET_CODE (op) == LSHIFTRT || GET_CODE (op) == ASHIFTRT) @@ -23300,6 +25431,135 @@ && MEM_P (XEXP (op, 0)) && CONST_INT_P (XEXP (op, 1)) && GET_MODE_SIZE (outermode) < GET_MODE_SIZE (GET_MODE (op)) +--- a/src/gcc/stmt.c ++++ b/src/gcc/stmt.c +@@ -1684,119 +1684,21 @@ + expand_value_return (result_rtl); + + /* If the result is an aggregate that is being returned in one (or more) +- registers, load the registers here. The compiler currently can't handle +- copying a BLKmode value into registers. We could put this code in a +- more general area (for use by everyone instead of just function +- call/return), but until this feature is generally usable it is kept here +- (and in expand_call). */ ++ registers, load the registers here. */ + + else if (retval_rhs != 0 + && TYPE_MODE (TREE_TYPE (retval_rhs)) == BLKmode + && REG_P (result_rtl)) + { +- int i; +- unsigned HOST_WIDE_INT bitpos, xbitpos; +- unsigned HOST_WIDE_INT padding_correction = 0; +- unsigned HOST_WIDE_INT bytes +- = int_size_in_bytes (TREE_TYPE (retval_rhs)); +- int n_regs = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; +- unsigned int bitsize +- = MIN (TYPE_ALIGN (TREE_TYPE (retval_rhs)), BITS_PER_WORD); +- rtx *result_pseudos = XALLOCAVEC (rtx, n_regs); +- rtx result_reg, src = NULL_RTX, dst = NULL_RTX; +- rtx result_val = expand_normal (retval_rhs); +- enum machine_mode tmpmode, result_reg_mode; +- +- if (bytes == 0) +- { +- expand_null_return (); +- return; +- } +- +- /* If the structure doesn't take up a whole number of words, see +- whether the register value should be padded on the left or on +- the right. Set PADDING_CORRECTION to the number of padding +- bits needed on the left side. +- +- In most ABIs, the structure will be returned at the least end of +- the register, which translates to right padding on little-endian +- targets and left padding on big-endian targets. The opposite +- holds if the structure is returned at the most significant +- end of the register. */ +- if (bytes % UNITS_PER_WORD != 0 +- && (targetm.calls.return_in_msb (TREE_TYPE (retval_rhs)) +- ? !BYTES_BIG_ENDIAN +- : BYTES_BIG_ENDIAN)) +- padding_correction = (BITS_PER_WORD - ((bytes % UNITS_PER_WORD) +- * BITS_PER_UNIT)); +- +- /* Copy the structure BITSIZE bits at a time. */ +- for (bitpos = 0, xbitpos = padding_correction; +- bitpos < bytes * BITS_PER_UNIT; +- bitpos += bitsize, xbitpos += bitsize) +- { +- /* We need a new destination pseudo each time xbitpos is +- on a word boundary and when xbitpos == padding_correction +- (the first time through). */ +- if (xbitpos % BITS_PER_WORD == 0 +- || xbitpos == padding_correction) +- { +- /* Generate an appropriate register. */ +- dst = gen_reg_rtx (word_mode); +- result_pseudos[xbitpos / BITS_PER_WORD] = dst; +- +- /* Clear the destination before we move anything into it. */ +- emit_move_insn (dst, CONST0_RTX (GET_MODE (dst))); +- } +- +- /* We need a new source operand each time bitpos is on a word +- boundary. */ +- if (bitpos % BITS_PER_WORD == 0) +- src = operand_subword_force (result_val, +- bitpos / BITS_PER_WORD, +- BLKmode); +- +- /* Use bitpos for the source extraction (left justified) and +- xbitpos for the destination store (right justified). */ +- store_bit_field (dst, bitsize, xbitpos % BITS_PER_WORD, word_mode, +- extract_bit_field (src, bitsize, +- bitpos % BITS_PER_WORD, 1, false, +- NULL_RTX, word_mode, word_mode)); +- } +- +- tmpmode = GET_MODE (result_rtl); +- if (tmpmode == BLKmode) ++ val = copy_blkmode_to_reg (GET_MODE (result_rtl), retval_rhs); ++ if (val) + { +- /* Find the smallest integer mode large enough to hold the +- entire structure and use that mode instead of BLKmode +- on the USE insn for the return register. */ +- for (tmpmode = GET_CLASS_NARROWEST_MODE (MODE_INT); +- tmpmode != VOIDmode; +- tmpmode = GET_MODE_WIDER_MODE (tmpmode)) +- /* Have we found a large enough mode? */ +- if (GET_MODE_SIZE (tmpmode) >= bytes) +- break; +- +- /* A suitable mode should have been found. */ +- gcc_assert (tmpmode != VOIDmode); +- +- PUT_MODE (result_rtl, tmpmode); ++ /* Use the mode of the result value on the return register. */ ++ PUT_MODE (result_rtl, GET_MODE (val)); ++ expand_value_return (val); + } +- +- if (GET_MODE_SIZE (tmpmode) < GET_MODE_SIZE (word_mode)) +- result_reg_mode = word_mode; + else +- result_reg_mode = tmpmode; +- result_reg = gen_reg_rtx (result_reg_mode); +- +- for (i = 0; i < n_regs; i++) +- emit_move_insn (operand_subword (result_reg, i, 0, result_reg_mode), +- result_pseudos[i]); +- +- if (tmpmode != result_reg_mode) +- result_reg = gen_lowpart (tmpmode, result_reg); +- +- expand_value_return (result_reg); ++ expand_null_return (); + } + else if (retval_rhs != 0 + && !VOID_TYPE_P (TREE_TYPE (retval_rhs)) --- a/src/gcc/stor-layout.c +++ b/src/gcc/stor-layout.c @@ -546,6 +546,34 @@ @@ -23436,7 +25696,225 @@ +extern bool default_legitimate_constant_p (enum machine_mode, rtx); --- a/src/gcc/testsuite/ChangeLog +++ b/src/gcc/testsuite/ChangeLog -@@ -1,3 +1,69 @@ +@@ -1,3 +1,287 @@ ++2012-01-04 Richard Guenther ++ ++ PR tree-optimization/49651 ++ * gcc.dg/tree-ssa/pta-ptrarith-1.c: Adjust. ++ * gcc.dg/tree-ssa/pta-ptrarith-2.c: Likewise. ++ ++2012-01-03 Richard Guenther ++ ++ Backport from mainline ++ 2011-11-10 Richard Guenther ++ ++ PR tree-optimization/51042 ++ * gcc.dg/torture/pr51042.c: New testcase. ++ ++2012-01-03 Richard Guenther ++ ++ PR tree-optimization/51070 ++ * gcc.dg/torture/pr51070.c: New testcase. ++ * gcc.dg/torture/pr51070-2.c: Likewise. ++ ++2011-12-20 Dodji Seketeli ++ ++ PR debug/49951 ++ * g++.dg/gcov/gcov-2.C: Adjust. ++ ++2012-01-01 Thomas König ++ ++ Backport from trunk ++ PR fortran/51502 ++ * lib/gcc-dg.exp (scan-module-absence): New function. ++ * gfortran.dg/implicit_pure_2.f90: New test. ++ ++2011-12-28 Michael Meissner ++ ++ Backport from mainline ++ 2011-12-28 Michael Meissner ++ ++ PR target/51623 ++ * gcc.target/powerpc/pr51623.c: New file. ++ ++2011-12-28 Uros Bizjak ++ ++ * gcc.dg/torture/pr50396.c: Use dg-add-options ieee. ++ ++2011-12-23 Richard Guenther ++ ++ PR rtl-optimization/50396 ++ * gcc.dg/torture/pr50396.c: New testcase. ++ ++2011-12-22 Doug Kwan ++ ++ Backport from mainline ++ 2011-11-20 Joey Ye ++ ++ * gcc.dg/volatile-bitfields-1.c: New. ++ ++2011-12-21 Richard Earnshaw ++ ++ PR target/51643 ++ * gcc.target/arm/sibcall-2.c: New test. ++ ++2011-12-19 Martin Jambor ++ ++ PR tree-optimization/51583 ++ * gcc.dg/tree-ssa/pr51583.c: New test. ++ ++2011-12-16 Jason Merrill ++ ++ PR c++/51416 ++ * g++.dg/cpp0x/auto31.C: New. ++ ++2011-12-16 Jason Merrill ++ ++ PR c++/51331 ++ * g++.dg/init/value10.C: New. ++ ++2011-12-15 H.J. Lu ++ ++ Backport from mainline. ++ 2011-10-28 Chung-Lin Tang ++ ++ PR rtl-optimization/49720 ++ * g++.dg/torture/pr49720.C: New test. ++ ++2011-12-14 Jason Merrill ++ ++ PR c++/51248 ++ * g++.dg/other/enum2.C: New. ++ ++2011-12-13 Jason Merrill ++ ++ PR c++/51406 ++ PR c++/51161 ++ * g++.dg/cpp0x/rv-cast3.C: New. ++ * g++.dg/cpp0x/rv-cast4.C: New. ++ ++2011-12-12 Jakub Jelinek ++ ++ PR testsuite/51511 ++ * gcc.dg/pr45819.c: Add -w to dg-options. ++ ++ Backported from mainline ++ 2011-12-11 Jakub Jelinek ++ ++ PR tree-optimization/51485 ++ * g++.dg/vect/pr51485.cc: New test. ++ ++2011-12-12 Eric Botcazou ++ ++ * gcc.c-torture/execute/20111212-1.c: New test. ++ ++2011-12-11 Tobias Burnus ++ ++ PR fortran/50923 ++ * gfortran.dg/warn_function_without_result_2.f90: New. ++ ++2011-12-11 Thomas Koenig ++ ++ PR fortran/51338 ++ Backport from trunk ++ * gfortran.dg/assumed_charlen_substring_1.f90: New test. ++ ++2011-12-09 Jakub Jelinek ++ ++ Backport from mainline ++ 2011-12-08 Jakub Jelinek ++ ++ PR tree-optimization/51466 ++ * gcc.c-torture/execute/pr51466.c: New test. ++ ++ 2011-11-28 Jakub Jelinek ++ ++ PR tree-optimization/50078 ++ * gcc.dg/pr50078.c: New test. ++ ++2011-12-09 Kazu Hirata ++ ++ Backport from mainline: ++ ++ 2011-12-05 Kazu Hirata ++ ++ PR target/51408 ++ * gcc.dg/pr51408.c: New. ++ ++2011-12-08 Tobias Burnus ++ ++ PR fortran/51448 ++ * gfortran.dg/realloc_on_assign_8.f90: New. ++ ++2011-12-08 Teresa Johnson ++ ++ * gcc.target/i386/movdi-rex64.c: Remove unnecessary ++ unused label. ++ ++2011-12-08 Teresa Johnson ++ ++ * gcc.target/i386/movdi-rex64.c: Remove unnecessary ++ -Wwrite-strings option. ++ ++2011-12-08 Teresa Johnson ++ ++ * gcc.target/i386/movdi-rex64.c: New. ++ ++2011-12-08 Jakub Jelinek ++ ++ Backport from mainline ++ 2011-12-05 Jakub Jelinek ++ ++ PR debug/51410 ++ * gcc.dg/debug/dwarf2/pr51410.c: New test. ++ ++ PR c/51339 ++ * gcc.dg/gomp/pr51339.c: New test. ++ ++ 2011-12-05 Jakub Jelinek ++ Eric Botcazou ++ ++ PR middle-end/51323 ++ PR middle-end/50074 ++ * gcc.c-torture/execute/pr51323.c: New test. ++ ++ 2011-11-30 Jakub Jelinek ++ ++ PR rtl-optimization/48721 ++ * gcc.target/i386/pr48721.c: New test. ++ ++2011-12-08 Eric Botcazou ++ ++ * gcc.c-torture/execute/20111208-1.c: New test. ++ ++ Backport from mainline ++ 2011-09-25 Eric Botcazou ++ ++ * gnat.dg/frame_overflow.ads: New. ++ * gnat.dg/frame_overflow.adb: Adjust. ++ * gnat.dg/specs/addr1.ads: Likewise. ++ ++2011-12-06 Tobias Burnus ++ ++ PR fortran/51435 ++ * gfortran.dg/default_initialization_5.f90: New. ++ ++2011-12-06 Martin Jambor ++ ++ PR tree-optimization/50622 ++ * g++.dg/tree-ssa/pr50622.C: New test. ++ ++2011-12-04 Uros Bizjak ++ Jérémie Detrey ++ ++ PR target/51393 ++ * gcc.target/i386/pr51393.c: New test. ++ ++2011-12-03 Tobias Burnus ++ ++ PR fortran/50684 ++ * gfortran.dg/move_alloc_8.f90: New. ++ +2011-11-25 Tobias Burnus + + PR fortran/50408 @@ -23506,6 +25984,34 @@ 2011-10-26 Release Manager * GCC 4.6.2 released. +@@ -9,9 +293,9 @@ + + 2011-10-20 Uros Bizjak + +- * gcc.dg/ipa/ipa-sra-2.c: Add dg-require-effective-target +- non_strict_align. +- * gcc.dg/ipa/ipa-sra-6.c: Ditto. ++ * gcc.dg/ipa/ipa-sra-2.c: Add dg-require-effective-target ++ non_strict_align. ++ * gcc.dg/ipa/ipa-sra-6.c: Ditto. + + 2011-10-19 Jason Merrill + +--- a/src/gcc/testsuite/g++.dg/cpp0x/auto31.C ++++ b/src/gcc/testsuite/g++.dg/cpp0x/auto31.C +@@ -0,0 +1,12 @@ ++// PR c++/51416 ++// { dg-options "-std=c++0x" } ++ ++template void foo(T, U... u) ++{ ++ auto foo(u...); // { dg-error "auto" } ++} ++ ++void bar() ++{ ++ foo(0); ++} --- a/src/gcc/testsuite/g++.dg/cpp0x/decltype35.C +++ b/src/gcc/testsuite/g++.dg/cpp0x/decltype35.C @@ -0,0 +1,15 @@ @@ -23583,6 +26089,101 @@ +} + +template void Boo(int); +--- a/src/gcc/testsuite/g++.dg/cpp0x/rv-cast3.C ++++ b/src/gcc/testsuite/g++.dg/cpp0x/rv-cast3.C +@@ -0,0 +1,18 @@ ++// PR c++/51406 ++// { dg-do run } ++// { dg-options "-std=c++0x" } ++ ++extern "C" int printf(const char *,...); ++extern "C" void abort(); ++ ++struct A { int a; A() : a(1) {} }; ++struct B { int b; B() : b(2) {} }; ++struct X : A, B {}; ++ ++int main() { ++ X x; ++ int a=static_cast(x).a; ++ int b=static_cast(x).b; ++ // printf ("%d %d\n", a, b); ++ if (a!=1 || b!=2) abort(); ++} +--- a/src/gcc/testsuite/g++.dg/cpp0x/rv-cast4.C ++++ b/src/gcc/testsuite/g++.dg/cpp0x/rv-cast4.C +@@ -0,0 +1,13 @@ ++// PR c++/51161 ++// { dg-options "-std=c++0x" } ++ ++struct A{}; ++struct B : A{}; ++struct C : A{}; ++struct D : B, C{}; ++ ++int main() ++{ ++ D d; ++ static_cast(d); // { dg-error "ambiguous" } ++} +--- a/src/gcc/testsuite/g++.dg/cpp0x/variadic103.C ++++ b/src/gcc/testsuite/g++.dg/cpp0x/variadic103.C +@@ -5,7 +5,7 @@ + + template + void test() { +- T t(create()...); // { dg-error "unknown bound" } ++ T t(create()...); // { dg-error "incomplete" } + (void) t; + } + +--- a/src/gcc/testsuite/g++.dg/gcov/gcov-2.C ++++ b/src/gcc/testsuite/g++.dg/gcov/gcov-2.C +@@ -20,7 +20,7 @@ + + void foo() + { +- C c; /* count(2) */ ++ C c; /* count(1) */ + c.seti (1); /* count(1) */ + } + +--- a/src/gcc/testsuite/g++.dg/init/value10.C ++++ b/src/gcc/testsuite/g++.dg/init/value10.C +@@ -0,0 +1,27 @@ ++// PR c++/51331 ++// { dg-do run } ++ ++struct A { ++ A(): x(10) {} ++ virtual ~A() {} ++ ++ int x; ++}; ++ ++struct B: public virtual A { ++}; ++ ++struct C: public virtual A { ++}; ++ ++struct D: public B, virtual public C { ++ D(): B(), C() {} // note an explicit call to C() which is auto-generated ++}; ++ ++int main() { ++ D* d = new D(); ++ ++ // Crashes here with the following message: ++ // *** glibc detected *** ./test: free(): invalid next size (fast) ++ delete d; ++} +--- a/src/gcc/testsuite/g++.dg/other/enum2.C ++++ b/src/gcc/testsuite/g++.dg/other/enum2.C +@@ -0,0 +1,3 @@ ++// PR c++/51248 ++ ++enum E { e = sizeof(const E*) }; --- a/src/gcc/testsuite/g++.dg/other/offsetof7.C +++ b/src/gcc/testsuite/g++.dg/other/offsetof7.C @@ -0,0 +1,17 @@ @@ -23603,6 +26204,92 @@ +}; + +int fails = __builtin_offsetof (C, b.offset); +--- a/src/gcc/testsuite/g++.dg/pr48660.C ++++ b/src/gcc/testsuite/g++.dg/pr48660.C +@@ -0,0 +1,22 @@ ++template struct val { char a[N]; }; ++ ++class Base ++{ ++public: ++ virtual val<1> get1() const = 0; ++ virtual val<2> get2() const = 0; ++ virtual val<3> get3() const = 0; ++ virtual val<4> get4() const = 0; ++}; ++ ++class Derived : public virtual Base ++{ ++public: ++ virtual val<1> get1() const { return foo->get1(); } ++ virtual val<2> get2() const { return foo->get2(); } ++ virtual val<3> get3() const { return foo->get3(); } ++ virtual val<4> get4() const { return foo->get4(); } ++ Base *foo; ++}; ++ ++Base* make() { return new Derived; } +--- a/src/gcc/testsuite/g++.dg/torture/pr49720.C ++++ b/src/gcc/testsuite/g++.dg/torture/pr49720.C +@@ -0,0 +1,8 @@ ++/* { dg-do compile } */ ++ ++extern char t_start[], t_end[], t_size[]; ++bool foo (void) ++{ ++ long size = reinterpret_cast(t_size); ++ return (size == t_end - t_start); ++} +--- a/src/gcc/testsuite/g++.dg/tree-ssa/pr50622.C ++++ b/src/gcc/testsuite/g++.dg/tree-ssa/pr50622.C +@@ -0,0 +1,30 @@ ++// { dg-do compile } ++// { dg-options "-O2" } ++ ++typedef __complex__ double Value; ++struct LorentzVector ++{ ++ LorentzVector & operator+=(const LorentzVector & a) { ++ theX += a.theX; ++ theY += a.theY; ++ theZ += a.theZ; ++ theT += a.theT; ++ return *this; ++ } ++ ++ Value theX; ++ Value theY; ++ Value theZ; ++ Value theT; ++}; ++ ++inline LorentzVector ++operator+(LorentzVector a, const LorentzVector & b) { ++ return a += b; ++} ++ ++Value ex, et; ++LorentzVector sum() { ++ LorentzVector v1; v1.theX =ex; v1.theY =ex+et; v1.theZ =ex-et; v1.theT =et; ++ return v1+v1; ++} +--- a/src/gcc/testsuite/g++.dg/vect/pr51485.cc ++++ b/src/gcc/testsuite/g++.dg/vect/pr51485.cc +@@ -0,0 +1,14 @@ ++/* { dg-do compile } */ ++ ++struct A { A (); unsigned int a; }; ++double bar (A a) throw () __attribute__((pure)); ++ ++void ++foo (unsigned int x, double *y, A *z) ++{ ++ unsigned int i; ++ for (i = 0; i < x; i++) ++ y[i] = bar (z[i]); ++} ++ ++/* { dg-final { cleanup-tree-dump "vect" } } */ --- a/src/gcc/testsuite/gcc.c-torture/compile/20110401-1.c +++ b/src/gcc/testsuite/gcc.c-torture/compile/20110401-1.c @@ -0,0 +1,22 @@ @@ -23675,6 +26362,224 @@ + y = (struct S *) &y->t[z]; + } +} +--- a/src/gcc/testsuite/gcc.c-torture/execute/20111208-1.c ++++ b/src/gcc/testsuite/gcc.c-torture/execute/20111208-1.c +@@ -0,0 +1,94 @@ ++/* PR tree-optimization/51315 */ ++/* Reported by Jurij Smakov */ ++ ++typedef unsigned int size_t; ++ ++extern void *memcpy (void *__restrict __dest, ++ __const void *__restrict __src, size_t __n) ++ __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); ++ ++extern size_t strlen (__const char *__s) ++ __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); ++ ++typedef short int int16_t; ++typedef int int32_t; ++ ++extern void abort (void); ++ ++int a; ++ ++static void __attribute__ ((noinline,noclone)) ++do_something (int item) ++{ ++ a = item; ++} ++ ++int ++pack_unpack (char *s, char *p) ++{ ++ char *send, *pend; ++ char type; ++ int integer_size; ++ ++ send = s + strlen (s); ++ pend = p + strlen (p); ++ ++ while (p < pend) ++ { ++ type = *p++; ++ ++ switch (type) ++ { ++ case 's': ++ integer_size = 2; ++ goto unpack_integer; ++ ++ case 'l': ++ integer_size = 4; ++ goto unpack_integer; ++ ++ unpack_integer: ++ switch (integer_size) ++ { ++ case 2: ++ { ++ union ++ { ++ int16_t i; ++ char a[sizeof (int16_t)]; ++ } ++ v; ++ memcpy (v.a, s, sizeof (int16_t)); ++ s += sizeof (int16_t); ++ do_something (v.i); ++ } ++ break; ++ ++ case 4: ++ { ++ union ++ { ++ int32_t i; ++ char a[sizeof (int32_t)]; ++ } ++ v; ++ memcpy (v.a, s, sizeof (int32_t)); ++ s += sizeof (int32_t); ++ do_something (v.i); ++ } ++ break; ++ } ++ break; ++ } ++ } ++ return (int) *s; ++} ++ ++int ++main (void) ++{ ++ int n = pack_unpack ("\200\001\377\376\035\300", "sl"); ++ if (n != 0) ++ abort (); ++ return 0; ++} +--- a/src/gcc/testsuite/gcc.c-torture/execute/20111212-1.c ++++ b/src/gcc/testsuite/gcc.c-torture/execute/20111212-1.c +@@ -0,0 +1,34 @@ ++/* PR tree-optimization/50569 */ ++/* Reported by Paul Koning */ ++/* Reduced testcase by Mikael Pettersson */ ++ ++struct event { ++ struct { ++ unsigned int sec; ++ } sent __attribute__((packed)); ++}; ++ ++void __attribute__((noinline,noclone)) frob_entry(char *buf) ++{ ++ struct event event; ++ ++ __builtin_memcpy(&event, buf, sizeof(event)); ++ if (event.sent.sec < 64) { ++ event.sent.sec = -1U; ++ __builtin_memcpy(buf, &event, sizeof(event)); ++ } ++} ++ ++int main(void) ++{ ++ union { ++ char buf[1 + sizeof(struct event)]; ++ int align; ++ } u; ++ ++ __builtin_memset(&u, 0, sizeof u); ++ ++ frob_entry(&u.buf[1]); ++ ++ return 0; ++} +--- a/src/gcc/testsuite/gcc.c-torture/execute/pr51323.c ++++ b/src/gcc/testsuite/gcc.c-torture/execute/pr51323.c +@@ -0,0 +1,35 @@ ++/* PR middle-end/51323 */ ++ ++extern void abort (void); ++struct S { int a, b, c; }; ++int v; ++ ++__attribute__((noinline, noclone)) void ++foo (int x, int y, int z) ++{ ++ if (x != v || y != 0 || z != 9) ++ abort (); ++} ++ ++static inline int ++baz (const struct S *p) ++{ ++ return p->b; ++} ++ ++__attribute__((noinline, noclone)) void ++bar (int x, struct S y) ++{ ++ foo (baz (&y), 0, x); ++} ++ ++int ++main () ++{ ++ struct S s; ++ v = 3; s.a = v - 1; s.b = v; s.c = v + 1; ++ bar (9, s); ++ v = 17; s.a = v - 1; s.b = v; s.c = v + 1; ++ bar (9, s); ++ return 0; ++} +--- a/src/gcc/testsuite/gcc.c-torture/execute/pr51466.c ++++ b/src/gcc/testsuite/gcc.c-torture/execute/pr51466.c +@@ -0,0 +1,43 @@ ++/* PR tree-optimization/51466 */ ++ ++extern void abort (void); ++ ++__attribute__((noinline, noclone)) int ++foo (int i) ++{ ++ volatile int v[4]; ++ int *p; ++ v[i] = 6; ++ p = (int *) &v[i]; ++ return *p; ++} ++ ++__attribute__((noinline, noclone)) int ++bar (int i) ++{ ++ volatile int v[4]; ++ int *p; ++ v[i] = 6; ++ p = (int *) &v[i]; ++ *p = 8; ++ return v[i]; ++} ++ ++__attribute__((noinline, noclone)) int ++baz (int i) ++{ ++ volatile int v[4]; ++ int *p; ++ v[i] = 6; ++ p = (int *) &v[0]; ++ *p = 8; ++ return v[i]; ++} ++ ++int ++main () ++{ ++ if (foo (3) != 6 || bar (2) != 8 || baz (0) != 8 || baz (1) != 6) ++ abort (); ++ return 0; ++} --- a/src/gcc/testsuite/gcc.dg/cpp/assert4.c +++ b/src/gcc/testsuite/gcc.dg/cpp/assert4.c @@ -1,4 +1,4 @@ @@ -23692,6 +26597,22 @@ # if !#system(linux) || !#system(unix) || !#system(posix) # error # endif +--- a/src/gcc/testsuite/gcc.dg/debug/dwarf2/pr51410.c ++++ b/src/gcc/testsuite/gcc.dg/debug/dwarf2/pr51410.c +@@ -0,0 +1,13 @@ ++/* PR debug/51410 */ ++/* { dg-do compile } */ ++/* { dg-options "-O0 -gdwarf-2 -dA -fno-merge-debug-strings" } */ ++ ++int x; ++ ++int ++foo (void) ++{ ++ return x; ++} ++ ++/* { dg-final { scan-assembler-times "\\(DIE\[^\\r\\n\]*DW_TAG_variable\\)" 1 } } */ --- a/src/gcc/testsuite/gcc.dg/delay-slot-2.c +++ b/src/gcc/testsuite/gcc.dg/delay-slot-2.c @@ -0,0 +1,116 @@ @@ -24186,6 +27107,50 @@ + return 0; +} + +--- a/src/gcc/testsuite/gcc.dg/gomp/pr51339.c ++++ b/src/gcc/testsuite/gcc.dg/gomp/pr51339.c +@@ -0,0 +1,15 @@ ++/* PR c/51339 */ ++/* { dg-do compile } */ ++/* { dg-options "-fopenmp" } */ ++ ++char g[] = "g"; ++ ++void ++foo (void) ++{ ++#pragma omp parallel sections firstprivate (g) lastprivate (g) ++ { ++ #pragma omp section ++ g[0] = 'h'; ++ } ++} +--- a/src/gcc/testsuite/gcc.dg/pr45819.c ++++ b/src/gcc/testsuite/gcc.dg/pr45819.c +@@ -1,5 +1,5 @@ + /* { dg-do compile } */ +-/* { dg-options "-O2 -fdump-tree-optimized" } */ ++/* { dg-options "-O2 -fdump-tree-optimized -w" } */ + + struct ehci_regs { + char x; +--- a/src/gcc/testsuite/gcc.dg/pr50078.c ++++ b/src/gcc/testsuite/gcc.dg/pr50078.c +@@ -0,0 +1,14 @@ ++/* PR tree-optimization/50078 */ ++/* { dg-do compile } */ ++/* { dg-options "-O2" } */ ++ ++unsigned nonvolvar[2]; ++ ++void ++test (int arg) ++{ ++ unsigned v = *(volatile unsigned *) (&nonvolvar[arg]); ++ *(volatile unsigned *) (&nonvolvar[arg]) = v; ++} ++ ++/* { dg-final { scan-assembler-times "movl\[^\n\r\]*nonvolvar" 2 { target { { i?86-*-* x86_64-*-* } && nonpic } } } } */ --- a/src/gcc/testsuite/gcc.dg/pr50193-1.c +++ b/src/gcc/testsuite/gcc.dg/pr50193-1.c @@ -0,0 +1,10 @@ @@ -24228,6 +27193,31 @@ + +/* { dg-final { scan-tree-dump-times "WIDEN_MULT_PLUS_EXPR" 0 "widening_mul" } } */ +/* { dg-final { cleanup-tree-dump "widening_mul" } } */ +--- a/src/gcc/testsuite/gcc.dg/pr51408.c ++++ b/src/gcc/testsuite/gcc.dg/pr51408.c +@@ -0,0 +1,22 @@ ++/* This testcase used to fail because of a bug in ++ arm.md:*minmax_arithsi. */ ++ ++/* { dg-do run } */ ++/* { dg-options "-O1" } */ ++ ++extern void abort (void); ++ ++int __attribute__((noinline)) ++foo (int a, int b) ++{ ++ int max = (b > 0) ? b : 0; ++ return max - a; ++} ++ ++int ++main (void) ++{ ++ if (foo (3, -1) != -3) ++ abort (); ++ return 0; ++} --- a/src/gcc/testsuite/gcc.dg/sms-10.c +++ b/src/gcc/testsuite/gcc.dg/sms-10.c @@ -0,0 +1,118 @@ @@ -24452,6 +27442,186 @@ +} + +/* { dg-final { scan-assembler "abort" } } */ +--- a/src/gcc/testsuite/gcc.dg/torture/pr50396.c ++++ b/src/gcc/testsuite/gcc.dg/torture/pr50396.c +@@ -0,0 +1,22 @@ ++/* { dg-do run } */ ++/* { dg-add-options ieee } */ ++ ++extern void abort (void); ++typedef float vf128 __attribute__((vector_size(16))); ++typedef float vf64 __attribute__((vector_size(8))); ++int main() ++{ ++#if !__FINITE_MATH_ONLY__ ++#if __FLT_HAS_QUIET_NAN__ ++ vf128 v = (vf128){ 0.f, 0.f, 0.f, 0.f }; ++ vf64 u = (vf64){ 0.f, 0.f }; ++ v = v / (vf128){ 0.f, 0.f, 0.f, 0.f }; ++ if (v[0] == v[0]) ++ abort (); ++ u = u / (vf64){ 0.f, 0.f }; ++ if (u[0] == u[0]) ++ abort (); ++#endif ++#endif ++ return 0; ++} +--- a/src/gcc/testsuite/gcc.dg/torture/pr51042.c ++++ b/src/gcc/testsuite/gcc.dg/torture/pr51042.c +@@ -0,0 +1,22 @@ ++/* { dg-do compile } */ ++ ++int a, b; ++ ++void ++foo (int x) ++{ ++ int e[2]; ++ int d; ++ while (x) ++ { ++ for (d = 0; d <= 1; d = 1) ++ if (e[a]) ++ break; ++ for (b = 0; b <= 0; b = 1) ++ { ++ e[a] = a; ++ if (a) ++ break; ++ } ++ } ++} +--- a/src/gcc/testsuite/gcc.dg/torture/pr51070-2.c ++++ b/src/gcc/testsuite/gcc.dg/torture/pr51070-2.c +@@ -0,0 +1,35 @@ ++/* { dg-do compile } */ ++/* { dg-options "-fno-inline" } */ ++ ++int ++func_4 (int si1, int si2) ++{ ++ return si1; ++} ++ ++int ++func_14 (int left, int right) ++{ ++ return 1; ++} ++ ++int ++func_37 (int left, int right) ++{ ++ return left; ++} ++ ++int g_92[1024]; ++int g_95[1024]; ++int g_224; ++int g_352[1024]; ++int ++func_9 () ++{ ++ for (; g_224; g_224 += 1) ++ { ++ g_95[0] = func_4 (func_37 (g_92[g_224], 0), 0); ++ g_92[g_224] = 0, g_352[g_224] = func_14 (0, 0); ++ } ++ return 0; ++} +--- a/src/gcc/testsuite/gcc.dg/torture/pr51070.c ++++ b/src/gcc/testsuite/gcc.dg/torture/pr51070.c +@@ -0,0 +1,34 @@ ++/* { dg-do compile } */ ++ ++int ++func_4 (int si1, int si2) ++{ ++ return si1; ++} ++ ++int ++func_14 (int left, int right) ++{ ++ return 1; ++} ++ ++int ++func_37 (int left, int right) ++{ ++ return left; ++} ++ ++int g_92[1024]; ++int g_95[1024]; ++int g_224; ++int g_352[1024]; ++int ++func_9 () ++{ ++ for (; g_224; g_224 += 1) ++ { ++ g_95[0] = func_4 (func_37 (g_92[g_224], 0), 0); ++ g_92[g_224] = 0, g_352[g_224] = func_14 (0, 0); ++ } ++ return 0; ++} +--- a/src/gcc/testsuite/gcc.dg/tree-ssa/pr51583.c ++++ b/src/gcc/testsuite/gcc.dg/tree-ssa/pr51583.c +@@ -0,0 +1,34 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O1" } */ ++ ++typedef __complex__ double Value; ++ ++union U ++{ ++ Value v; ++ char c[sizeof(Value)]; ++}; ++ ++struct S ++{ ++ union U u; ++ int i,j; ++}; ++ ++Value gv; ++int gi, gj; ++ ++Value foo (void) ++{ ++ struct S s,t; ++ ++ t.i = gi; ++ t.j = gj; ++ t.u.v = gv; ++ t.u.c[0] = 0; ++ ++ s = t; ++ __imag__ s.u.v += s.i; ++ ++ return s.u.v; ++} +--- a/src/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c ++++ b/src/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c +@@ -1,5 +1,5 @@ + /* { dg-do compile } */ +-/* { dg-options "-O2 -fno-tree-ccp -fdump-tree-ealias" } */ ++/* { dg-options "-O2 -fno-tree-forwprop -fno-tree-ccp -fdump-tree-ealias" } */ + + extern void abort (void); + struct X { +--- a/src/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c ++++ b/src/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c +@@ -1,5 +1,5 @@ + /* { dg-do compile } */ +-/* { dg-options "-O2 -fno-tree-ccp -fdump-tree-ealias" } */ ++/* { dg-options "-O2 -fno-tree-forwprop -fno-tree-ccp -fdump-tree-ealias" } */ + + extern void abort (void); + struct X { --- a/src/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c +++ b/src/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c @@ -26,7 +26,7 @@ @@ -25527,6 +28697,24 @@ + +/* { dg-final { cleanup-tree-dump "vect" } } */ + +--- a/src/gcc/testsuite/gcc.dg/vect/pr51301.c ++++ b/src/gcc/testsuite/gcc.dg/vect/pr51301.c +@@ -0,0 +1,15 @@ ++/* { dg-do compile } */ ++ ++typedef signed char int8_t; ++typedef signed long long int64_t; ++int64_t ++f0a (int8_t * __restrict__ arg1) ++{ ++ int idx; ++ int64_t result = 0; ++ for (idx = 0; idx < 416; idx += 1) ++ result += arg1[idx] << (arg1[idx] == arg1[idx]); ++ return result; ++} ++ ++/* { dg-final { cleanup-tree-dump "vect" } } */ --- a/src/gcc/testsuite/gcc.dg/vect/slp-11.c +++ b/src/gcc/testsuite/gcc.dg/vect/slp-11.c @@ -1,113 +0,0 @@ @@ -28577,6 +31765,32 @@ # Clean up. set dg-do-what-default ${save-dg-do-what-default} +--- a/src/gcc/testsuite/gcc.dg/volatile-bitfields-1.c ++++ b/src/gcc/testsuite/gcc.dg/volatile-bitfields-1.c +@@ -0,0 +1,23 @@ ++/* { dg-options "-fstrict-volatile-bitfields" } */ ++/* { dg-do run } */ ++ ++extern int puts(const char *); ++extern void abort(void) __attribute__((noreturn)); ++ ++typedef struct { ++ volatile unsigned short a:8, b:8; ++} BitStruct; ++ ++BitStruct bits = {1, 2}; ++ ++void check(int i, int j) ++{ ++ if (i != 1 || j != 2) puts("FAIL"), abort(); ++} ++ ++int main () ++{ ++ check(bits.a, bits.b); ++ ++ return 0; ++} --- a/src/gcc/testsuite/gcc.target/arm/cmp-1.c +++ b/src/gcc/testsuite/gcc.target/arm/cmp-1.c @@ -0,0 +1,37 @@ @@ -32438,6 +35652,21 @@ +} + +/* { dg-final { scan-assembler "mvn.*\[al]sl #6" } } */ +--- a/src/gcc/testsuite/gcc.target/arm/sibcall-2.c ++++ b/src/gcc/testsuite/gcc.target/arm/sibcall-2.c +@@ -0,0 +1,12 @@ ++/* { dg-require-effective-target arm_eabi } */ ++/* { dg-do compile } */ ++/* { dg-options "-O2 -mabi=aapcs" } */ ++ ++ ++extern void __attribute__((weak)) wfunc(void); ++void main(void) ++{ ++ wfunc(); /* Must not tail-call. */ ++} ++ ++/* { dg-final { scan-assembler-not "b\[\\t \]+wfunc" } } */ --- a/src/gcc/testsuite/gcc.target/arm/smlaltb-1.c +++ b/src/gcc/testsuite/gcc.target/arm/smlaltb-1.c @@ -0,0 +1,13 @@ @@ -33025,25 +36254,244 @@ +/* { dg-final { scan-assembler "orr" } } */ +/* { dg-final { scan-assembler-not "mvn" } } */ +/* { dg-final { scan-assembler-not "uxth" } } */ ---- a/src/gcc/testsuite/gcc.target/sparc/ultrasp12.c -+++ b/src/gcc/testsuite/gcc.target/sparc/ultrasp12.c -@@ -0,0 +1,64 @@ -+/* PR rtl-optimization/48830 */ -+/* Testcase by Hans-Peter Nilsson */ +--- a/src/gcc/testsuite/gcc.target/i386/movdi-rex64.c ++++ b/src/gcc/testsuite/gcc.target/i386/movdi-rex64.c +@@ -0,0 +1,11 @@ ++/* { dg-do compile { target *-*-linux* } } */ ++/* { dg-options "-fPIE" } */ ++ ++char *strcpy (char *dest, const char *src); + ++static __thread char buffer[25]; ++const char * error_message (void) ++{ ++ strcpy (buffer, "Unknown code "); ++ return 0; ++} +--- a/src/gcc/testsuite/gcc.target/i386/pr48721.c ++++ b/src/gcc/testsuite/gcc.target/i386/pr48721.c +@@ -0,0 +1,51 @@ ++/* PR rtl-optimization/48721 */ +/* { dg-do compile } */ -+/* { dg-require-effective-target lp64 } */ -+/* { dg-options "-O2 -mcpu=ultrasparc -mvis" } */ ++/* { dg-options "-O -foptimize-sibling-calls -fsched2-use-superblocks -fschedule-insns2 -mtune=core2" } */ + -+typedef unsigned char uint8_t; -+typedef unsigned int uint32_t; -+typedef unsigned long int uint64_t; -+typedef unsigned long int uintmax_t; -+typedef unsigned char rc_vec_t __attribute__((__vector_size__(8))); -+typedef short rc_svec_type_ __attribute__((__vector_size__(8))); -+typedef unsigned char rc_vec4_type_ __attribute__((__vector_size__(4))); ++extern unsigned char a[]; ++extern int b[], d[], e[], f[], g[], *h[], m[], *n[], o[]; ++extern char c[]; + -+void ++struct S ++{ ++ unsigned char s1; ++ int s2, s3, s4, s5, s6, s7, s8; ++}; ++ ++__attribute__((noinline, noclone)) int ++foo (int x) ++{ ++ return 0; ++} ++ ++int ++bar (int x, struct S *y) ++{ ++ int z; ++ switch (x) ++ { ++ case 1: ++ case 2: ++ { ++ int t2, t4, t5, t6, t7, t8; ++ z = o[y->s8 * 6]; ++ t8 = *n[m[x] * 5]; ++ t4 = *h[y->s7]; ++ t7 = z; ++ z = g[f[x] + y->s6]; ++ t6 = e[y->s5]; ++ t5 = d[c[x] + y->s3 * 17]; ++ if (z) ++ t2 = b[z]; ++ if (a[z] != y->s1) ++ return foo (x); ++ y->s8 = t8; ++ y->s4 = t4; ++ y->s7 = t7; ++ y->s6 = t6; ++ y->s5 = t5; ++ y->s2 = t2; ++ } ++ } ++ return 0; ++} +--- a/src/gcc/testsuite/gcc.target/i386/pr51393.c ++++ b/src/gcc/testsuite/gcc.target/i386/pr51393.c +@@ -0,0 +1,22 @@ ++/* { dg-do run } */ ++/* { dg-require-effective-target avx } */ ++/* { dg-require-effective-target lp64 } */ ++/* { dg-options "-O -mavx" } */ ++ ++#include "avx-check.h" ++#include ++ ++static void ++__attribute__((noinline)) ++avx_test (void) ++{ ++ long long in = 0x800000000ll; ++ long long out; ++ ++ __m256i zero = _mm256_setzero_si256(); ++ __m256i tmp = _mm256_insert_epi64 (zero, in, 0); ++ out = _mm256_extract_epi64(tmp, 0); ++ ++ if (in != out) ++ abort (); ++} +--- a/src/gcc/testsuite/gcc.target/powerpc/pr51623.c ++++ b/src/gcc/testsuite/gcc.target/powerpc/pr51623.c +@@ -0,0 +1,123 @@ ++/* PR target/51623 */ ++/* { dg-do compile { target { { powerpc*-*-linux* && ilp32 } || { powerpc-*-eabi* } } } } */ ++/* { dg-options "-mrelocatable -ffreestanding" } */ ++ ++/* This generated an error, since the compiler was calling ++ unlikely_text_section_p in a context where it wasn't valid. */ ++ ++typedef long long loff_t; ++typedef unsigned size_t; ++ ++ ++struct mtd_info { ++ unsigned writesize; ++ unsigned oobsize; ++ const char *name; ++}; ++ ++extern int strcmp(const char *,const char *); ++extern char * strchr(const char *,int); ++ ++struct cmd_tbl_s { ++ char *name; ++}; ++ ++ ++int printf(const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2))); ++void* malloc(size_t); ++void free(void*); ++ ++ ++extern int nand_curr_device; ++extern struct mtd_info nand_info[]; ++ ++static int nand_dump(struct mtd_info *nand, unsigned long off, int only_oob) ++{ ++ int i; ++ unsigned char *datbuf, *oobbuf, *p; ++ ++ datbuf = malloc(nand->writesize + nand->oobsize); ++ oobbuf = malloc(nand->oobsize); ++ off &= ~(nand->writesize - 1); ++ ++ printf("Page %08lx dump:\n", off); ++ i = nand->writesize >> 4; ++ p = datbuf; ++ ++ while (i--) { ++ if (!only_oob) ++ printf("\t%02x %02x %02x %02x %02x %02x %02x %02x" ++ " %02x %02x %02x %02x %02x %02x %02x %02x\n", ++ p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], ++ p[8], p[9], p[10], p[11], p[12], p[13], p[14], ++ p[15]); ++ p += 16; ++ } ++ ++ i = nand->oobsize >> 3; ++ free(datbuf); ++ free(oobbuf); ++ ++ return 0; ++} ++ ++int do_nand(struct cmd_tbl_s * cmdtp, int flag, int argc, char *argv[]) ++{ ++ int dev; ++ unsigned long off; ++ char *cmd, *s; ++ struct mtd_info *nand; ++ ++ if (argc < 2) ++ goto usage; ++ ++ cmd = argv[1]; ++ ++ if (strcmp(cmd, "info") == 0) { ++ putc('\n'); ++ return 0; ++ } ++ ++ if (strcmp(cmd, "device") == 0) { ++ if (argc < 3) { ++ putc('\n'); ++ } ++ dev = (int)simple_strtoul(argv[2], ((void *)0), 10); ++ nand_curr_device = dev; ++ return 0; ++ } ++ ++ if (strcmp(cmd, "bad") != 0 && strcmp(cmd, "erase") != 0 ) ++ goto usage; ++ ++ if (nand_curr_device < 0 ) { ++ return 1; ++ } ++ nand = &nand_info[nand_curr_device]; ++ ++ if (strcmp(cmd, "erase") == 0 || strcmp(cmd, "scrub") == 0) { ++ int clean = argc > 2 && !strcmp("clean", argv[2]); ++ int scrub = !strcmp(cmd, "scrub"); ++ return 0; ++ } ++ ++ if (strncmp(cmd, "dump", 4) == 0) { ++ if (argc < 3) ++ goto usage; ++ ++ s = strchr(cmd, '.'); ++ off = (int)simple_strtoul(argv[2], ((void *)0), 16); ++ ++ if (s != ((void *)0) && strcmp(s, ".oob") == 0) ++ nand_dump(nand, off, 1); ++ else ++ nand_dump(nand, off, 0); ++ ++ return 0; ++ } ++usage: ++ cmd_usage(cmdtp); ++ return 1; ++} ++ ++void *ptr = do_nand; +--- a/src/gcc/testsuite/gcc.target/sparc/ultrasp12.c ++++ b/src/gcc/testsuite/gcc.target/sparc/ultrasp12.c +@@ -0,0 +1,64 @@ ++/* PR rtl-optimization/48830 */ ++/* Testcase by Hans-Peter Nilsson */ ++ ++/* { dg-do compile } */ ++/* { dg-require-effective-target lp64 } */ ++/* { dg-options "-O2 -mcpu=ultrasparc -mvis" } */ ++ ++typedef unsigned char uint8_t; ++typedef unsigned int uint32_t; ++typedef unsigned long int uint64_t; ++typedef unsigned long int uintmax_t; ++typedef unsigned char rc_vec_t __attribute__((__vector_size__(8))); ++typedef short rc_svec_type_ __attribute__((__vector_size__(8))); ++typedef unsigned char rc_vec4_type_ __attribute__((__vector_size__(4))); ++ ++void +rc_stat_xsum_acc(const uint8_t *__restrict src1, int src1_dim, + const uint8_t *__restrict src2, int src2_dim, + int len, int height, uintmax_t sum[5]) @@ -33092,6 +36540,75 @@ + sum[4] = s12; + ; +} +--- a/src/gcc/testsuite/gfortran.dg/default_initialization_5.f90 ++++ b/src/gcc/testsuite/gfortran.dg/default_initialization_5.f90 +@@ -0,0 +1,66 @@ ++! { dg-do run } ++! { dg-options "-fdump-tree-original" } ++! ++! PR fortran/51435 ++! ++! Contributed by darmar.xxl@gmail.com ++! ++module arr_m ++ type arr_t ++ real(8), dimension(:), allocatable :: rsk ++ end type ++ type arr_t2 ++ integer :: a = 77 ++ end type ++end module arr_m ++!********************* ++module list_m ++ use arr_m ++ implicit none ++ ++ type(arr_t2), target :: tgt ++ ++ type my_list ++ type(arr_t), pointer :: head => null() ++ end type my_list ++ type my_list2 ++ type(arr_t2), pointer :: head => tgt ++ end type my_list2 ++end module list_m ++!*********************** ++module worker_mod ++ use list_m ++ implicit none ++ ++ type data_all_t ++ type(my_list) :: my_data ++ end type data_all_t ++ type data_all_t2 ++ type(my_list2) :: my_data ++ end type data_all_t2 ++contains ++ subroutine do_job() ++ type(data_all_t) :: dum ++ type(data_all_t2) :: dum2 ++ ++ if (associated(dum%my_data%head)) then ++ call abort() ++ else ++ print *, 'OK: do_job my_data%head is NOT associated' ++ end if ++ ++ if (dum2%my_data%head%a /= 77) & ++ call abort() ++ end subroutine ++end module ++!*************** ++program hello ++ use worker_mod ++ implicit none ++ call do_job() ++end program ++ ++! { dg-final { scan-tree-dump-times "my_data.head = 0B" 1 "original" } } ++! { dg-final { scan-tree-dump-times "my_data.head = &tgt" 1 "original" } } ++! { dg-final { cleanup-tree-dump "original" } } ++! { dg-final { cleanup-modules "arr_m list_m worker_mod" } } --- a/src/gcc/testsuite/gfortran.dg/implicit_pure_1.f90 +++ b/src/gcc/testsuite/gfortran.dg/implicit_pure_1.f90 @@ -0,0 +1,53 @@ @@ -33148,6 +36665,135 @@ + +! { dg-final { scan-module "b" "IMPLICIT_PURE" } } +! { dg-final { cleanup-modules "b" } } +--- a/src/gcc/testsuite/gfortran.dg/implicit_pure_2.f90 ++++ b/src/gcc/testsuite/gfortran.dg/implicit_pure_2.f90 +@@ -0,0 +1,17 @@ ++! { dg-do compile } ++! PR 51502 - this was wrongly detected to be implicit pure. ++module m ++ integer :: i ++contains ++ subroutine foo(x) ++ integer, intent(inout) :: x ++ outer: block ++ block ++ i = 5 ++ end block ++ end block outer ++ end subroutine foo ++end module m ++ ++! { dg-final { scan-module-absence "m" "IMPLICIT_PURE" } } ++! { dg-final { cleanup-modules "m" } } +--- a/src/gcc/testsuite/gfortran.dg/move_alloc_8.f90 ++++ b/src/gcc/testsuite/gfortran.dg/move_alloc_8.f90 +@@ -0,0 +1,106 @@ ++! { dg-do compile } ++! ++! PR fortran/50684 ++! ++! Module "bug" contributed by Martin Steghöfer. ++! ++ ++MODULE BUG ++ TYPE MY_TYPE ++ INTEGER, ALLOCATABLE :: VALUE ++ END TYPE ++CONTAINS ++ SUBROUTINE POINTER_INTENT_IN_BUG_WORKING(POINTER_INTENT_IN_VARIABLE) ++ TYPE(MY_TYPE), POINTER, INTENT(IN) :: POINTER_INTENT_IN_VARIABLE ++ TYPE(MY_TYPE), POINTER :: POINTER_VARIABLE_LOCAL ++ INTEGER, ALLOCATABLE :: LOCAL_VALUE ++ ++ POINTER_VARIABLE_LOCAL=>POINTER_INTENT_IN_VARIABLE ++ CALL MOVE_ALLOC(POINTER_VARIABLE_LOCAL%VALUE, LOCAL_VALUE) ++ ++ RETURN ++ END SUBROUTINE POINTER_INTENT_IN_BUG_WORKING ++ ++ SUBROUTINE POINTER_INTENT_IN_BUG_FAILING(POINTER_INTENT_IN_VARIABLE) ++ TYPE(MY_TYPE), POINTER, INTENT(IN) :: POINTER_INTENT_IN_VARIABLE ++ INTEGER, ALLOCATABLE :: LOCAL_VALUE ++ ++ CALL MOVE_ALLOC(POINTER_INTENT_IN_VARIABLE%VALUE, LOCAL_VALUE) ++ ++ RETURN ++ END SUBROUTINE POINTER_INTENT_IN_BUG_FAILING ++end module bug ++ ++subroutine test1() ++ TYPE MY_TYPE ++ INTEGER, ALLOCATABLE :: VALUE ++ END TYPE ++CONTAINS ++ SUBROUTINE sub (dt) ++ type(MY_TYPE), intent(in) :: dt ++ INTEGER, ALLOCATABLE :: lv ++ call move_alloc(dt%VALUE, lv) ! { dg-error "cannot be INTENT.IN." } ++ END SUBROUTINE ++end subroutine test1 ++ ++subroutine test2 (x, px) ++ implicit none ++ type t ++ integer, allocatable :: a ++ end type t ++ ++ type t2 ++ type(t), pointer :: ptr ++ integer, allocatable :: a ++ end type t2 ++ ++ type(t2), intent(in) :: x ++ type(t2), pointer, intent(in) :: px ++ ++ integer, allocatable :: a ++ type(t2), pointer :: ta ++ ++ call move_alloc (px, ta) ! { dg-error "cannot be INTENT.IN." } ++ call move_alloc (x%a, a) ! { dg-error "cannot be INTENT.IN." } ++ call move_alloc (x%ptr%a, a) ! OK (3) ++ call move_alloc (px%a, a) ! OK (4) ++ call move_alloc (px%ptr%a, a) ! OK (5) ++end subroutine test2 ++ ++subroutine test3 (x, px) ++ implicit none ++ type t ++ integer, allocatable :: a ++ end type t ++ ++ type t2 ++ class(t), pointer :: ptr ++ integer, allocatable :: a ++ end type t2 ++ ++ type(t2), intent(in) :: x ++ class(t2), pointer, intent(in) :: px ++ ++ integer, allocatable :: a ++ class(t2), pointer :: ta ++ ++ call move_alloc (px, ta) ! { dg-error "cannot be INTENT.IN." } ++ call move_alloc (x%a, a) ! { dg-error "cannot be INTENT.IN." } ++ call move_alloc (x%ptr%a, a) ! OK (6) ++ call move_alloc (px%a, a) ! OK (7) ++ call move_alloc (px%ptr%a, a) ! OK (8) ++end subroutine test3 ++ ++subroutine test4() ++ TYPE MY_TYPE ++ INTEGER, ALLOCATABLE :: VALUE ++ END TYPE ++CONTAINS ++ SUBROUTINE sub (dt) ++ CLASS(MY_TYPE), intent(in) :: dt ++ INTEGER, ALLOCATABLE :: lv ++ call move_alloc(dt%VALUE, lv) ! { dg-error "cannot be INTENT.IN." } ++ END SUBROUTINE ++end subroutine test4 ++ ++! { dg-final { cleanup-modules "bug" } } --- a/src/gcc/testsuite/gfortran.dg/pr50875.f90 +++ b/src/gcc/testsuite/gfortran.dg/pr50875.f90 @@ -0,0 +1,39 @@ @@ -33190,6 +36836,26 @@ +end module test + +! { dg-final { cleanup-modules "test" } } +--- a/src/gcc/testsuite/gfortran.dg/realloc_on_assign_8.f90 ++++ b/src/gcc/testsuite/gfortran.dg/realloc_on_assign_8.f90 +@@ -0,0 +1,17 @@ ++! { dg-do compile } ++! ++! PR fortran/51448 ++! ++! Contribued by François Willot ++! ++ PROGRAM MAIN ++ IMPLICIT NONE ++ TYPE mytype ++ REAL b(2) ++ END TYPE mytype ++ TYPE(mytype) a ++ DOUBLE PRECISION, ALLOCATABLE :: x(:) ++ ALLOCATE(x(2)) ++ a%b=0.0E0 ++ x=a%b ++ END --- a/src/gcc/testsuite/gfortran.dg/vect/pr19049.f90 +++ b/src/gcc/testsuite/gfortran.dg/vect/pr19049.f90 @@ -19,6 +19,7 @@ @@ -33201,6 +36867,28 @@ +! { dg-final { scan-tree-dump-times "complicated access pattern" 2 "vect" { target vect_multiple_sizes } } } ! { dg-final { cleanup-tree-dump "vect" } } +--- a/src/gcc/testsuite/gfortran.dg/warn_function_without_result_2.f90 ++++ b/src/gcc/testsuite/gfortran.dg/warn_function_without_result_2.f90 +@@ -0,0 +1,19 @@ ++! { dg-do compile } ++! { dg-options "-Wall" } ++! ++! PR fortran/50923 ++! ++module m ++contains ++ integer pure function f() ! { dg-warning "Return value of function 'f' at .1. not set" } ++ end function f ++ integer pure function g() result(h) ! { dg-warning "Return value 'h' of function 'g' declared at .1. not set" } ++ end function g ++ integer pure function i() ++ i = 7 ++ end function i ++ integer pure function j() result(k) ++ k = 8 ++ end function j ++end module m ++! { dg-final { cleanup-modules "mod" } } --- a/src/gcc/testsuite/gfortran.dg/whole_file_35.f90 +++ b/src/gcc/testsuite/gfortran.dg/whole_file_35.f90 @@ -0,0 +1,28 @@ @@ -33232,6 +36920,109 @@ + end program p + +! { dg-final { cleanup-modules "m" } } +--- a/src/gcc/testsuite/gnat.dg/frame_overflow.adb ++++ b/src/gcc/testsuite/gnat.dg/frame_overflow.adb +@@ -1,27 +1,20 @@ + -- { dg-do compile } + +-with System; ++package body Frame_Overflow is + +-procedure frame_overflow is +- +- type Bitpos_Range_T is range 1..2**(System.Word_Size-1)-1; +- type Bitmap_Array_T is array (Bitpos_Range_T) of Boolean; +- +- type Bitmap_T is record +- Bits : Bitmap_Array_T := (others => False); +- end record; +- +- function ++ function -- { dg-error "too large" } + Set_In (Bitmap : Bitmap_T; Bitpos : Bitpos_Range_T) return Bitmap_T + is +- Result: Bitmap_T := Bitmap; -- { dg-error "Storage_Error" } ++ Result: Bitmap_T := Bitmap; + begin + Result.Bits (Bitpos) := True; + return Result; + end; + +- function Negate (Bitmap : Bitmap_T) return Bitmap_T is +- Result: Bitmap_T; -- { dg-error "Storage_Error" } ++ function -- { dg-error "too large" } ++ Negate (Bitmap : Bitmap_T) return Bitmap_T ++ is ++ Result: Bitmap_T; + begin + for E in Bitpos_Range_T loop + Result.Bits (E) := not Bitmap.Bits (E); +@@ -29,6 +22,4 @@ + return Result; + end; + +-begin +- null; +-end; ++end Frame_Overflow; +--- a/src/gcc/testsuite/gnat.dg/frame_overflow.ads ++++ b/src/gcc/testsuite/gnat.dg/frame_overflow.ads +@@ -0,0 +1,17 @@ ++with System; ++ ++package Frame_Overflow is ++ ++ type Bitpos_Range_T is range 1..2**(System.Word_Size-1)-1; ++ type Bitmap_Array_T is array (Bitpos_Range_T) of Boolean; ++ ++ type Bitmap_T is record ++ Bits : Bitmap_Array_T := (others => False); ++ end record; ++ ++ function ++ Set_In (Bitmap : Bitmap_T; Bitpos : Bitpos_Range_T) return Bitmap_T; ++ ++ function Negate (Bitmap : Bitmap_T) return Bitmap_T; ++ ++end Frame_Overflow; +--- a/src/gcc/testsuite/gnat.dg/specs/addr1.ads ++++ b/src/gcc/testsuite/gnat.dg/specs/addr1.ads +@@ -15,7 +15,7 @@ + end record; + for Rec2'Size use 64; + +- A: Arr (1 .. 12); ++ A: Arr (1 .. 4); + + Obj1: Rec1; + for Obj1'Address use A'Address; -- { dg-bogus "alignment" } +--- a/src/gcc/testsuite/lib/gcc-dg.exp ++++ b/src/gcc/testsuite/lib/gcc-dg.exp +@@ -565,6 +565,24 @@ + } + } + ++# Scan Fortran modules for absence of a given regexp. ++# ++# Argument 0 is the module name ++# Argument 1 is the regexp to match ++proc scan-module-absence { args } { ++ set modfilename [string tolower [lindex $args 0]].mod ++ set fd [open $modfilename r] ++ set text [read $fd] ++ close $fd ++ ++ upvar 2 name testcase ++ if [regexp -- [lindex $args 1] $text] { ++ fail "$testcase scan-module [lindex $args 1]" ++ } else { ++ pass "$testcase scan-module [lindex $args 1]" ++ } ++} ++ + # Verify that the compiler output file exists, invoked via dg-final. + proc output-exists { args } { + # Process an optional target or xfail list. --- a/src/gcc/testsuite/lib/target-supports.exp +++ b/src/gcc/testsuite/lib/target-supports.exp @@ -1894,6 +1894,18 @@ @@ -34045,7 +37836,59 @@ if (funtype) --- a/src/gcc/tree-loop-distribution.c +++ b/src/gcc/tree-loop-distribution.c -@@ -267,7 +267,7 @@ +@@ -63,6 +63,51 @@ + predecessor a node that writes to memory. */ + static bitmap upstream_mem_writes; + ++/* Returns true when DEF is an SSA_NAME defined in LOOP and used after ++ the LOOP. */ ++ ++static bool ++ssa_name_has_uses_outside_loop_p (tree def, loop_p loop) ++{ ++ imm_use_iterator imm_iter; ++ use_operand_p use_p; ++ ++ FOR_EACH_IMM_USE_FAST (use_p, imm_iter, def) ++ if (loop != loop_containing_stmt (USE_STMT (use_p))) ++ return true; ++ ++ return false; ++} ++ ++/* Returns true when STMT defines a scalar variable used after the ++ loop. */ ++ ++static bool ++stmt_has_scalar_dependences_outside_loop (gimple stmt) ++{ ++ tree name; ++ ++ switch (gimple_code (stmt)) ++ { ++ case GIMPLE_CALL: ++ case GIMPLE_ASSIGN: ++ name = gimple_get_lhs (stmt); ++ break; ++ ++ case GIMPLE_PHI: ++ name = gimple_phi_result (stmt); ++ break; ++ ++ default: ++ return false; ++ } ++ ++ return (name ++ && TREE_CODE (name) == SSA_NAME ++ && ssa_name_has_uses_outside_loop_p (name, ++ loop_containing_stmt (stmt))); ++} ++ + /* Update the PHI nodes of NEW_LOOP. NEW_LOOP is a duplicate of + ORIG_LOOP. */ + +@@ -267,7 +312,7 @@ DR_STMT (dr) = stmt; DR_REF (dr) = op0; @@ -34054,6 +37897,78 @@ gcc_assert (res && stride_of_unit_type_p (DR_STEP (dr), TREE_TYPE (op0))); nb_bytes = build_size_arg_loc (loc, nb_iter, op0, &stmt_list); +@@ -332,10 +377,18 @@ + { + gimple stmt = gsi_stmt (bsi); + +- if (gimple_code (stmt) != GIMPLE_LABEL +- && !is_gimple_debug (stmt) +- && bitmap_bit_p (partition, x++) +- && is_gimple_assign (stmt) ++ if (gimple_code (stmt) == GIMPLE_LABEL ++ || is_gimple_debug (stmt)) ++ continue; ++ ++ if (!bitmap_bit_p (partition, x++)) ++ continue; ++ ++ /* If the stmt has uses outside of the loop fail. */ ++ if (stmt_has_scalar_dependences_outside_loop (stmt)) ++ goto end; ++ ++ if (is_gimple_assign (stmt) + && !is_gimple_reg (gimple_assign_lhs (stmt))) + { + /* Don't generate the builtins when there are more than +@@ -826,48 +879,6 @@ + } + } + +-/* Returns true when DEF is an SSA_NAME defined in LOOP and used after +- the LOOP. */ +- +-static bool +-ssa_name_has_uses_outside_loop_p (tree def, loop_p loop) +-{ +- imm_use_iterator imm_iter; +- use_operand_p use_p; +- +- FOR_EACH_IMM_USE_FAST (use_p, imm_iter, def) +- if (loop != loop_containing_stmt (USE_STMT (use_p))) +- return true; +- +- return false; +-} +- +-/* Returns true when STMT defines a scalar variable used after the +- loop. */ +- +-static bool +-stmt_has_scalar_dependences_outside_loop (gimple stmt) +-{ +- tree name; +- +- switch (gimple_code (stmt)) +- { +- case GIMPLE_ASSIGN: +- name = gimple_assign_lhs (stmt); +- break; +- +- case GIMPLE_PHI: +- name = gimple_phi_result (stmt); +- break; +- +- default: +- return false; +- } +- +- return TREE_CODE (name) == SSA_NAME +- && ssa_name_has_uses_outside_loop_p (name, loop_containing_stmt (stmt)); +-} +- + /* Returns true when STMT will be code generated in a partition of RDG + different than PART and that will not be code generated as a + builtin. */ --- a/src/gcc/tree-object-size.c +++ b/src/gcc/tree-object-size.c @@ -175,7 +175,7 @@ @@ -34065,6 +37980,21 @@ { sz = compute_builtin_object_size (TREE_OPERAND (pt_var, 0), object_size_type & ~1); +--- a/src/gcc/tree-outof-ssa.c ++++ b/src/gcc/tree-outof-ssa.c +@@ -237,9 +237,10 @@ + + var = SSA_NAME_VAR (partition_to_var (SA.map, dest)); + src_mode = TYPE_MODE (TREE_TYPE (src)); +- dest_mode = promote_decl_mode (var, &unsignedp); ++ dest_mode = GET_MODE (SA.partition_to_pseudo[dest]); + gcc_assert (src_mode == TYPE_MODE (TREE_TYPE (var))); +- gcc_assert (dest_mode == GET_MODE (SA.partition_to_pseudo[dest])); ++ gcc_assert (!REG_P (SA.partition_to_pseudo[dest]) ++ || dest_mode == promote_decl_mode (var, &unsignedp)); + + if (src_mode != dest_mode) + { --- a/src/gcc/tree-predcom.c +++ b/src/gcc/tree-predcom.c @@ -1114,7 +1114,7 @@ @@ -34129,6 +38059,186 @@ case POINTER_PLUS_EXPR: return "+"; +--- a/src/gcc/tree-sra.c ++++ b/src/gcc/tree-sra.c +@@ -1020,26 +1020,28 @@ + return false; + } + +-/* Return true iff type of EXP is not sufficiently aligned. */ ++/* Return true if EXP is a memory reference less aligned than ALIGN. This is ++ invoked only on strict-alignment targets. */ + + static bool +-tree_non_mode_aligned_mem_p (tree exp) ++tree_non_aligned_mem_p (tree exp, unsigned int align) + { +- enum machine_mode mode = TYPE_MODE (TREE_TYPE (exp)); +- unsigned int align; ++ unsigned int exp_align; + + if (TREE_CODE (exp) == VIEW_CONVERT_EXPR) + exp = TREE_OPERAND (exp, 0); + +- if (TREE_CODE (exp) == SSA_NAME +- || TREE_CODE (exp) == MEM_REF +- || mode == BLKmode +- || is_gimple_min_invariant (exp) +- || !STRICT_ALIGNMENT) ++ if (TREE_CODE (exp) == SSA_NAME || is_gimple_min_invariant (exp)) + return false; + +- align = get_object_alignment (exp, BIGGEST_ALIGNMENT); +- if (GET_MODE_ALIGNMENT (mode) > align) ++ /* get_object_alignment will fall back to BITS_PER_UNIT if it cannot ++ compute an explicit alignment. Pretend that dereferenced pointers ++ are always aligned on strict-alignment targets. */ ++ exp_align = get_object_alignment (exp, BIGGEST_ALIGNMENT); ++ if (TREE_CODE (exp) == MEM_REF || TREE_CODE (exp) == TARGET_MEM_REF) ++ exp_align = MAX (TYPE_ALIGN (TREE_TYPE (exp)), exp_align); ++ ++ if (exp_align < align) + return true; + + return false; +@@ -1071,7 +1073,11 @@ + if (lacc) + { + lacc->grp_assignment_write = 1; +- lacc->grp_unscalarizable_region |= tree_non_mode_aligned_mem_p (rhs); ++ if (STRICT_ALIGNMENT ++ && tree_non_aligned_mem_p (rhs, ++ get_object_alignment (lhs, ++ BIGGEST_ALIGNMENT))) ++ lacc->grp_unscalarizable_region = 1; + } + + if (racc) +@@ -1080,7 +1086,11 @@ + if (should_scalarize_away_bitmap && !gimple_has_volatile_ops (stmt) + && !is_gimple_reg_type (racc->type)) + bitmap_set_bit (should_scalarize_away_bitmap, DECL_UID (racc->base)); +- racc->grp_unscalarizable_region |= tree_non_mode_aligned_mem_p (lhs); ++ if (STRICT_ALIGNMENT ++ && tree_non_aligned_mem_p (lhs, ++ get_object_alignment (rhs, ++ BIGGEST_ALIGNMENT))) ++ racc->grp_unscalarizable_region = 1; + } + + if (lacc && racc +@@ -1435,29 +1445,67 @@ + return fold_build2_loc (loc, MEM_REF, exp_type, base, off); + } + ++DEF_VEC_ALLOC_P_STACK (tree); ++#define VEC_tree_stack_alloc(alloc) VEC_stack_alloc (tree, alloc) ++ + /* Construct a memory reference to a part of an aggregate BASE at the given +- OFFSET and of the same type as MODEL. In case this is a reference to a +- component, the function will replicate the last COMPONENT_REF of model's +- expr to access it. GSI and INSERT_AFTER have the same meaning as in +- build_ref_for_offset. */ ++ OFFSET and of the type of MODEL. In case this is a chain of references ++ to component, the function will replicate the chain of COMPONENT_REFs of ++ the expression of MODEL to access it. GSI and INSERT_AFTER have the same ++ meaning as in build_ref_for_offset. */ + + static tree + build_ref_for_model (location_t loc, tree base, HOST_WIDE_INT offset, + struct access *model, gimple_stmt_iterator *gsi, + bool insert_after) + { ++ tree type = model->type, t; ++ VEC(tree,stack) *cr_stack = NULL; ++ + if (TREE_CODE (model->expr) == COMPONENT_REF) + { +- tree t, exp_type, fld = TREE_OPERAND (model->expr, 1); +- offset -= int_bit_position (fld); +- exp_type = TREE_TYPE (TREE_OPERAND (model->expr, 0)); +- t = build_ref_for_offset (loc, base, offset, exp_type, gsi, insert_after); +- return fold_build3_loc (loc, COMPONENT_REF, TREE_TYPE (fld), t, fld, +- NULL_TREE); ++ tree expr = model->expr; ++ ++ /* Create a stack of the COMPONENT_REFs so later we can walk them in ++ order from inner to outer. */ ++ cr_stack = VEC_alloc (tree, stack, 6); ++ ++ do { ++ tree field = TREE_OPERAND (expr, 1); ++ HOST_WIDE_INT bit_pos = int_bit_position (field); ++ ++ /* We can be called with a model different from the one associated ++ with BASE so we need to avoid going up the chain too far. */ ++ if (offset - bit_pos < 0) ++ break; ++ ++ offset -= bit_pos; ++ VEC_safe_push (tree, stack, cr_stack, expr); ++ ++ expr = TREE_OPERAND (expr, 0); ++ type = TREE_TYPE (expr); ++ } while (TREE_CODE (expr) == COMPONENT_REF); + } +- else +- return build_ref_for_offset (loc, base, offset, model->type, +- gsi, insert_after); ++ ++ t = build_ref_for_offset (loc, base, offset, type, gsi, insert_after); ++ ++ if (TREE_CODE (model->expr) == COMPONENT_REF) ++ { ++ unsigned i; ++ tree expr; ++ ++ /* Now replicate the chain of COMPONENT_REFs from inner to outer. */ ++ FOR_EACH_VEC_ELT_REVERSE (tree, cr_stack, i, expr) ++ { ++ tree field = TREE_OPERAND (expr, 1); ++ t = fold_build3_loc (loc, COMPONENT_REF, TREE_TYPE (field), t, field, ++ NULL_TREE); ++ } ++ ++ VEC_free (tree, stack, cr_stack); ++ } ++ ++ return t; + } + + /* Construct a memory reference consisting of component_refs and array_refs to +@@ -2594,6 +2642,10 @@ + rhs = get_access_replacement (racc); + if (!useless_type_conversion_p (lacc->type, racc->type)) + rhs = fold_build1_loc (loc, VIEW_CONVERT_EXPR, lacc->type, rhs); ++ ++ if (racc->grp_partial_lhs && lacc->grp_partial_lhs) ++ rhs = force_gimple_operand_gsi (old_gsi, rhs, true, NULL_TREE, ++ true, GSI_SAME_STMT); + } + else + { +@@ -2609,6 +2661,9 @@ + else + rhs = build_ref_for_model (loc, top_racc->base, offset, lacc, + new_gsi, true); ++ if (lacc->grp_partial_lhs) ++ rhs = force_gimple_operand_gsi (new_gsi, rhs, true, NULL_TREE, ++ false, GSI_NEW_STMT); + } + + stmt = gimple_build_assign (get_access_replacement (lacc), rhs); +@@ -3604,7 +3659,8 @@ + || gimple_code (access->stmt) == GIMPLE_ASM)) + return true; + +- if (tree_non_mode_aligned_mem_p (access->expr)) ++ if (STRICT_ALIGNMENT ++ && tree_non_aligned_mem_p (access->expr, TYPE_ALIGN (access->type))) + return true; + + return false; --- a/src/gcc/tree-ssa-ccp.c +++ b/src/gcc/tree-ssa-ccp.c @@ -522,10 +522,6 @@ @@ -34230,6 +38340,56 @@ fprintf (stream, " ("); for (i = 0; i < nargs; i++) { +--- a/src/gcc/tree-ssa-forwprop.c ++++ b/src/gcc/tree-ssa-forwprop.c +@@ -872,7 +872,7 @@ + TREE_TYPE (gimple_assign_rhs1 (use_stmt)))) + { + tree *def_rhs_basep = &TREE_OPERAND (def_rhs, 0); +- tree new_offset, new_base, saved; ++ tree new_offset, new_base, saved, new_lhs; + while (handled_component_p (*def_rhs_basep)) + def_rhs_basep = &TREE_OPERAND (*def_rhs_basep, 0); + saved = *def_rhs_basep; +@@ -891,9 +891,12 @@ + *def_rhs_basep = build2 (MEM_REF, TREE_TYPE (*def_rhs_basep), + new_base, new_offset); + TREE_THIS_VOLATILE (*def_rhs_basep) = TREE_THIS_VOLATILE (lhs); ++ TREE_SIDE_EFFECTS (*def_rhs_basep) = TREE_SIDE_EFFECTS (lhs); + TREE_THIS_NOTRAP (*def_rhs_basep) = TREE_THIS_NOTRAP (lhs); +- gimple_assign_set_lhs (use_stmt, +- unshare_expr (TREE_OPERAND (def_rhs, 0))); ++ new_lhs = unshare_expr (TREE_OPERAND (def_rhs, 0)); ++ gimple_assign_set_lhs (use_stmt, new_lhs); ++ TREE_THIS_VOLATILE (new_lhs) = TREE_THIS_VOLATILE (lhs); ++ TREE_SIDE_EFFECTS (new_lhs) = TREE_SIDE_EFFECTS (lhs); + *def_rhs_basep = saved; + tidy_after_forward_propagate_addr (use_stmt); + /* Continue propagating into the RHS if this was not the +@@ -953,7 +956,7 @@ + TREE_TYPE (TREE_OPERAND (def_rhs, 0)))) + { + tree *def_rhs_basep = &TREE_OPERAND (def_rhs, 0); +- tree new_offset, new_base, saved; ++ tree new_offset, new_base, saved, new_rhs; + while (handled_component_p (*def_rhs_basep)) + def_rhs_basep = &TREE_OPERAND (*def_rhs_basep, 0); + saved = *def_rhs_basep; +@@ -972,9 +975,12 @@ + *def_rhs_basep = build2 (MEM_REF, TREE_TYPE (*def_rhs_basep), + new_base, new_offset); + TREE_THIS_VOLATILE (*def_rhs_basep) = TREE_THIS_VOLATILE (rhs); ++ TREE_SIDE_EFFECTS (*def_rhs_basep) = TREE_SIDE_EFFECTS (rhs); + TREE_THIS_NOTRAP (*def_rhs_basep) = TREE_THIS_NOTRAP (rhs); +- gimple_assign_set_rhs1 (use_stmt, +- unshare_expr (TREE_OPERAND (def_rhs, 0))); ++ new_rhs = unshare_expr (TREE_OPERAND (def_rhs, 0)); ++ gimple_assign_set_rhs1 (use_stmt, new_rhs); ++ TREE_THIS_VOLATILE (new_rhs) = TREE_THIS_VOLATILE (rhs); ++ TREE_SIDE_EFFECTS (new_rhs) = TREE_SIDE_EFFECTS (rhs); + *def_rhs_basep = saved; + fold_stmt_inplace (use_stmt); + tidy_after_forward_propagate_addr (use_stmt); --- a/src/gcc/tree-ssa-math-opts.c +++ b/src/gcc/tree-ssa-math-opts.c @@ -1266,39 +1266,67 @@ @@ -34952,7 +39112,164 @@ static bool --- a/src/gcc/tree-ssa-pre.c +++ b/src/gcc/tree-ssa-pre.c -@@ -2657,11 +2657,13 @@ +@@ -1545,7 +1545,7 @@ + tree newvuse = vuse; + VEC (vn_reference_op_s, heap) *newoperands = NULL; + bool changed = false, same_valid = true; +- unsigned int i, j; ++ unsigned int i, j, n; + vn_reference_op_t operand; + vn_reference_t newref; + +@@ -1554,100 +1554,83 @@ + { + pre_expr opresult; + pre_expr leader; +- tree oldop0 = operand->op0; +- tree oldop1 = operand->op1; +- tree oldop2 = operand->op2; +- tree op0 = oldop0; +- tree op1 = oldop1; +- tree op2 = oldop2; ++ tree op[3]; + tree type = operand->type; + vn_reference_op_s newop = *operand; +- +- if (op0 && TREE_CODE (op0) == SSA_NAME) ++ op[0] = operand->op0; ++ op[1] = operand->op1; ++ op[2] = operand->op2; ++ for (n = 0; n < 3; ++n) + { +- unsigned int op_val_id = VN_INFO (op0)->value_id; +- leader = find_leader_in_sets (op_val_id, set1, set2); +- opresult = phi_translate (leader, set1, set2, pred, phiblock); +- if (opresult && opresult != leader) ++ unsigned int op_val_id; ++ if (!op[n]) ++ continue; ++ if (TREE_CODE (op[n]) != SSA_NAME) + { +- tree name = get_representative_for (opresult); +- if (!name) ++ /* We can't possibly insert these. */ ++ if (n != 0 ++ && !is_gimple_min_invariant (op[n])) + break; +- op0 = name; ++ continue; + } +- else if (!opresult) +- break; +- } +- changed |= op0 != oldop0; +- +- if (op1 && TREE_CODE (op1) == SSA_NAME) +- { +- unsigned int op_val_id = VN_INFO (op1)->value_id; ++ op_val_id = VN_INFO (op[n])->value_id; + leader = find_leader_in_sets (op_val_id, set1, set2); +- opresult = phi_translate (leader, set1, set2, pred, phiblock); +- if (opresult && opresult != leader) ++ if (!leader) ++ break; ++ /* Make sure we do not recursively translate ourselves ++ like for translating a[n_1] with the leader for ++ n_1 being a[n_1]. */ ++ if (get_expression_id (leader) != get_expression_id (expr)) + { +- tree name = get_representative_for (opresult); +- if (!name) ++ opresult = phi_translate (leader, set1, set2, ++ pred, phiblock); ++ if (!opresult) + break; +- op1 = name; ++ if (opresult != leader) ++ { ++ tree name = get_representative_for (opresult); ++ if (!name) ++ break; ++ changed |= name != op[n]; ++ op[n] = name; ++ } + } +- else if (!opresult) +- break; + } +- /* We can't possibly insert these. */ +- else if (op1 && !is_gimple_min_invariant (op1)) +- break; +- changed |= op1 != oldop1; +- if (op2 && TREE_CODE (op2) == SSA_NAME) ++ if (n != 3) + { +- unsigned int op_val_id = VN_INFO (op2)->value_id; +- leader = find_leader_in_sets (op_val_id, set1, set2); +- opresult = phi_translate (leader, set1, set2, pred, phiblock); +- if (opresult && opresult != leader) +- { +- tree name = get_representative_for (opresult); +- if (!name) +- break; +- op2 = name; +- } +- else if (!opresult) +- break; ++ if (newoperands) ++ VEC_free (vn_reference_op_s, heap, newoperands); ++ return NULL; + } +- /* We can't possibly insert these. */ +- else if (op2 && !is_gimple_min_invariant (op2)) +- break; +- changed |= op2 != oldop2; +- + if (!newoperands) + newoperands = VEC_copy (vn_reference_op_s, heap, operands); + /* We may have changed from an SSA_NAME to a constant */ +- if (newop.opcode == SSA_NAME && TREE_CODE (op0) != SSA_NAME) +- newop.opcode = TREE_CODE (op0); ++ if (newop.opcode == SSA_NAME && TREE_CODE (op[0]) != SSA_NAME) ++ newop.opcode = TREE_CODE (op[0]); + newop.type = type; +- newop.op0 = op0; +- newop.op1 = op1; +- newop.op2 = op2; ++ newop.op0 = op[0]; ++ newop.op1 = op[1]; ++ newop.op2 = op[2]; + /* If it transforms a non-constant ARRAY_REF into a constant + one, adjust the constant offset. */ + if (newop.opcode == ARRAY_REF + && newop.off == -1 +- && TREE_CODE (op0) == INTEGER_CST +- && TREE_CODE (op1) == INTEGER_CST +- && TREE_CODE (op2) == INTEGER_CST) ++ && TREE_CODE (op[0]) == INTEGER_CST ++ && TREE_CODE (op[1]) == INTEGER_CST ++ && TREE_CODE (op[2]) == INTEGER_CST) + { +- double_int off = tree_to_double_int (op0); ++ double_int off = tree_to_double_int (op[0]); + off = double_int_add (off, + double_int_neg +- (tree_to_double_int (op1))); +- off = double_int_mul (off, tree_to_double_int (op2)); ++ (tree_to_double_int (op[1]))); ++ off = double_int_mul (off, tree_to_double_int (op[2])); + if (double_int_fits_in_shwi_p (off)) + newop.off = off.low; + } + VEC_replace (vn_reference_op_s, newoperands, j, &newop); + /* If it transforms from an SSA_NAME to an address, fold with + a preceding indirect reference. */ +- if (j > 0 && op0 && TREE_CODE (op0) == ADDR_EXPR ++ if (j > 0 && op[0] && TREE_CODE (op[0]) == ADDR_EXPR + && VEC_index (vn_reference_op_s, + newoperands, j - 1)->opcode == MEM_REF) + vn_reference_fold_indirect (&newoperands, &j); +@@ -2657,11 +2640,13 @@ } /* Return true if we can value number the call in STMT. This is true @@ -34967,7 +39284,7 @@ if (gimple_call_flags (stmt) & (ECF_PURE | ECF_CONST)) return true; return false; -@@ -4190,6 +4192,7 @@ +@@ -4190,6 +4175,7 @@ gimple_stmt_iterator gsi; gimple stmt; unsigned i; @@ -34975,7 +39292,7 @@ FOR_EACH_BB (b) { -@@ -4381,9 +4384,10 @@ +@@ -4381,9 +4367,10 @@ /* Visit indirect calls and turn them into direct calls if possible. */ if (is_gimple_call (stmt) @@ -35002,7 +39319,25 @@ changed = defs_to_varying (stmt); --- a/src/gcc/tree-ssa-structalias.c +++ b/src/gcc/tree-ssa-structalias.c -@@ -4328,6 +4328,7 @@ +@@ -308,6 +308,7 @@ + static varinfo_t first_or_preceding_vi_for_offset (varinfo_t, + unsigned HOST_WIDE_INT); + static varinfo_t lookup_vi_for_tree (tree); ++static inline bool type_can_have_subvars (const_tree); + + /* Pool of variable info structures. */ + static alloc_pool variable_info_pool; +@@ -3353,7 +3354,8 @@ + return; + + cs = *VEC_last (ce_s, *results); +- if (cs.type == DEREF) ++ if (cs.type == DEREF ++ && type_can_have_subvars (TREE_TYPE (t))) + { + /* For dereferences this means we have to defer it + to solving time. */ +@@ -4328,6 +4330,7 @@ /* Fallthru to general call handling. */; } if (!in_ipa_mode @@ -35010,6 +39345,35 @@ || (fndecl && (!(fi = lookup_vi_for_tree (fndecl)) || !fi->is_fn_info))) +@@ -4981,6 +4984,15 @@ + VEC_qsort (fieldoff_s, fieldstack, fieldoff_compare); + } + ++/* Return true if T is a type that can have subvars. */ ++ ++static inline bool ++type_can_have_subvars (const_tree t) ++{ ++ /* Aggregates without overlapping fields can have subvars. */ ++ return TREE_CODE (t) == RECORD_TYPE; ++} ++ + /* Return true if V is a tree that we can have subvars for. + Normally, this is any aggregate type. Also complex + types which are not gimple registers can have subvars. */ +@@ -4996,11 +5008,7 @@ + if (!DECL_P (v)) + return false; + +- /* Aggregates without overlapping fields can have subvars. */ +- if (TREE_CODE (TREE_TYPE (v)) == RECORD_TYPE) +- return true; +- +- return false; ++ return type_can_have_subvars (TREE_TYPE (v)); + } + + /* Return true if T is a type that does contain pointers. */ --- a/src/gcc/tree-vect-data-refs.c +++ b/src/gcc/tree-vect-data-refs.c @@ -43,6 +43,45 @@ @@ -35171,7 +39535,24 @@ if (stride == 0) stride = count; -@@ -2983,31 +2975,33 @@ +@@ -2631,6 +2623,16 @@ + return false; + } + ++ if (is_gimple_call (stmt)) ++ { ++ if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS)) ++ { ++ fprintf (vect_dump, "not vectorized: dr in a call "); ++ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM); ++ } ++ return false; ++ } ++ + /* Update DR field in stmt_vec_info struct. */ + + /* If the dataref is in an inner-loop of the loop that is considered for +@@ -2983,31 +2985,33 @@ /* Function vect_create_data_ref_ptr. @@ -35217,7 +39598,7 @@ if OFFSET is not supplied: initial_address = &a[init]; -@@ -3027,7 +3021,7 @@ +@@ -3027,7 +3031,7 @@ 4. Return the pointer. */ tree @@ -35226,7 +39607,7 @@ tree offset, tree *initial_address, gimple *ptr_incr, bool only_init, bool *inv_p) { -@@ -3037,17 +3031,16 @@ +@@ -3037,17 +3041,16 @@ struct loop *loop = NULL; bool nested_in_vect_loop = false; struct loop *containing_loop = NULL; @@ -35248,7 +39629,7 @@ gimple_stmt_iterator incr_gsi; bool insert_after; bool negative; -@@ -3058,6 +3051,9 @@ +@@ -3058,6 +3061,9 @@ gimple_stmt_iterator gsi = gsi_for_stmt (stmt); tree base; @@ -35258,7 +39639,7 @@ if (loop_vinfo) { loop = LOOP_VINFO_LOOP (loop_vinfo); -@@ -3092,8 +3088,9 @@ +@@ -3092,8 +3098,9 @@ if (vect_print_dump_info (REPORT_DETAILS)) { tree data_ref_base = base_name; @@ -35270,7 +39651,7 @@ if (TREE_CODE (data_ref_base) == VAR_DECL || TREE_CODE (data_ref_base) == ARRAY_REF) fprintf (vect_dump, " vectorizing an array ref: "); -@@ -3104,27 +3101,28 @@ +@@ -3104,27 +3111,28 @@ print_generic_expr (vect_dump, base_name, TDF_SLIM); } @@ -35312,7 +39693,7 @@ get_name (base_name)); } -@@ -3135,14 +3133,14 @@ +@@ -3135,14 +3143,14 @@ do { tree lhs = gimple_assign_lhs (orig_stmt); @@ -35333,7 +39714,7 @@ get_name (base_name)); break; } -@@ -3152,7 +3150,7 @@ +@@ -3152,7 +3160,7 @@ while (orig_stmt); } @@ -35342,7 +39723,7 @@ /* Note: If the dataref is in an inner-loop nested in LOOP, and we are vectorizing LOOP (i.e., outer-loop vectorization), we need to create two -@@ -3185,8 +3183,8 @@ +@@ -3185,8 +3193,8 @@ vp2 = vp1 + step if () goto LOOP */ @@ -35353,7 +39734,7 @@ /* Create: (&(base[init_val+offset]) in the loop preheader. */ -@@ -3205,17 +3203,17 @@ +@@ -3205,17 +3213,17 @@ *initial_address = new_temp; @@ -35378,7 +39759,7 @@ if (pe) { new_bb = gsi_insert_on_edge_immediate (pe, vec_stmt); -@@ -3225,19 +3223,19 @@ +@@ -3225,19 +3233,19 @@ gsi_insert_before (&gsi, vec_stmt, GSI_SAME_STMT); } else @@ -35403,7 +39784,7 @@ /* One exception to the above is when the scalar step of the load in LOOP is zero. In this case the step here is also zero. */ if (*inv_p) -@@ -3247,9 +3245,9 @@ +@@ -3247,9 +3255,9 @@ standard_iv_increment_position (loop, &incr_gsi, &insert_after); @@ -35416,7 +39797,7 @@ &indx_before_incr, &indx_after_incr); incr = gsi_stmt (incr_gsi); set_vinfo_for_stmt (incr, new_stmt_vec_info (incr, loop_vinfo, NULL)); -@@ -3263,14 +3261,14 @@ +@@ -3263,14 +3271,14 @@ if (ptr_incr) *ptr_incr = incr; @@ -35434,7 +39815,7 @@ nested in LOOP, if exists. */ gcc_assert (nested_in_vect_loop); -@@ -3278,7 +3276,7 @@ +@@ -3278,7 +3286,7 @@ { standard_iv_increment_position (containing_loop, &incr_gsi, &insert_after); @@ -35443,7 +39824,7 @@ containing_loop, &incr_gsi, insert_after, &indx_before_incr, &indx_after_incr); incr = gsi_stmt (incr_gsi); -@@ -3415,13 +3413,22 @@ +@@ -3415,13 +3423,22 @@ and FALSE otherwise. */ bool @@ -35467,7 +39848,7 @@ /* Check that the operation is supported. */ interleave_high_optab = optab_for_tree_code (VEC_INTERLEAVE_HIGH_EXPR, vectype, optab_default); -@@ -3446,6 +3453,18 @@ +@@ -3446,6 +3463,18 @@ } @@ -35486,7 +39867,7 @@ /* Function vect_permute_store_chain. Given a chain of interleaved stores in DR_CHAIN of LENGTH that must be -@@ -3507,7 +3526,7 @@ +@@ -3507,7 +3536,7 @@ I3: 4 12 20 28 5 13 21 30 I4: 6 14 22 30 7 15 23 31. */ @@ -35495,7 +39876,7 @@ vect_permute_store_chain (VEC(tree,heap) *dr_chain, unsigned int length, gimple stmt, -@@ -3521,9 +3540,7 @@ +@@ -3521,9 +3550,7 @@ unsigned int j; enum tree_code high_code, low_code; @@ -35506,7 +39887,7 @@ *result_chain = VEC_copy (tree, heap, dr_chain); -@@ -3576,7 +3593,6 @@ +@@ -3576,7 +3603,6 @@ } dr_chain = VEC_copy (tree, heap, *result_chain); } @@ -35514,7 +39895,7 @@ } /* Function vect_setup_realignment -@@ -3746,8 +3762,9 @@ +@@ -3746,8 +3772,9 @@ gcc_assert (!compute_in_loop); vec_dest = vect_create_destination_var (scalar_dest, vectype); @@ -35526,7 +39907,7 @@ new_stmt = gimple_build_assign_with_ops (BIT_AND_EXPR, NULL_TREE, ptr, build_int_cst (TREE_TYPE (ptr), -@@ -3852,13 +3869,22 @@ +@@ -3852,13 +3879,22 @@ and FALSE otherwise. */ bool @@ -35550,7 +39931,7 @@ perm_even_optab = optab_for_tree_code (VEC_EXTRACT_EVEN_EXPR, vectype, optab_default); if (!perm_even_optab) -@@ -3893,6 +3919,16 @@ +@@ -3893,6 +3929,16 @@ return true; } @@ -35567,7 +39948,7 @@ /* Function vect_permute_load_chain. -@@ -3970,7 +4006,7 @@ +@@ -3970,7 +4016,7 @@ 3rd vec (E2): 2 6 10 14 18 22 26 30 4th vec (E4): 3 7 11 15 19 23 27 31. */ @@ -35576,7 +39957,7 @@ vect_permute_load_chain (VEC(tree,heap) *dr_chain, unsigned int length, gimple stmt, -@@ -3983,9 +4019,7 @@ +@@ -3983,9 +4029,7 @@ int i; unsigned int j; @@ -35587,7 +39968,7 @@ *result_chain = VEC_copy (tree, heap, dr_chain); for (i = 0; i < exact_log2 (length); i++) -@@ -4028,7 +4062,6 @@ +@@ -4028,7 +4072,6 @@ } dr_chain = VEC_copy (tree, heap, *result_chain); } @@ -35595,7 +39976,7 @@ } -@@ -4039,24 +4072,32 @@ +@@ -4039,24 +4082,32 @@ the scalar statements. */ @@ -35637,7 +40018,7 @@ /* Put a permuted data-ref in the VECTORIZED_STMT field. Since we scan the chain starting from it's first node, their order -@@ -4118,9 +4159,6 @@ +@@ -4118,9 +4169,6 @@ break; } } @@ -36627,15 +41008,15 @@ oprnd0 = gimple_assign_rhs1 (stmt); *type_in = half_type; -@@ -641,9 +871,813 @@ +@@ -641,10 +871,818 @@ when doing outer-loop vectorization. */ gcc_assert (!nested_in_vect_loop_p (loop, last_stmt)); + VEC_safe_push (gimple, heap, *stmts, last_stmt); -+ return pattern_stmt; -+} -+ -+ + return pattern_stmt; + } + + +/* Return TRUE if the operation in STMT can be performed on a smaller type. + + Input: @@ -36898,6 +41279,7 @@ + struct loop *loop = NULL; + bb_vec_info bb_vinfo; + stmt_vec_info stmt_vinfo; ++ tree type = NULL; + + stmt_vinfo = vinfo_for_stmt (stmt); + loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo); @@ -36967,6 +41349,7 @@ + print_gimple_stmt (vect_dump, pattern_stmt, 0, TDF_SLIM); + } + ++ type = gimple_expr_type (stmt); + prev_stmt = stmt; + stmt = use_stmt; + @@ -36982,9 +41365,11 @@ + { + use_lhs = gimple_assign_lhs (use_stmt); + use_type = TREE_TYPE (use_lhs); -+ /* Support only type promotion or signedess change. */ ++ /* Support only type promotion or signedess change. Check that USE_TYPE ++ is not bigger than the original type. */ + if (!INTEGRAL_TYPE_P (use_type) -+ || TYPE_PRECISION (new_type) > TYPE_PRECISION (use_type)) ++ || TYPE_PRECISION (new_type) > TYPE_PRECISION (use_type) ++ || TYPE_PRECISION (type) < TYPE_PRECISION (use_type)) + return NULL; + + if (TYPE_UNSIGNED (new_type) != TYPE_UNSIGNED (use_type) @@ -37261,9 +41646,9 @@ + last_stmt = orig_stmt; + + VEC_safe_push (gimple, heap, *stmts, last_stmt); - return pattern_stmt; - } - ++ return pattern_stmt; ++} ++ +/* Function vect_recog_mixed_size_cond_pattern + + Try to find the following pattern: @@ -37438,10 +41823,11 @@ + STMT_VINFO_VECTYPE (def_stmt_info) = pattern_vectype; + } +} - ++ /* Function vect_pattern_recog_1 -@@ -669,29 +1703,33 @@ + Input: +@@ -669,29 +1707,33 @@ static void vect_pattern_recog_1 ( @@ -37483,7 +41869,7 @@ pattern_vectype = type_out ? type_out : type_in; } else -@@ -736,22 +1774,32 @@ +@@ -736,22 +1778,32 @@ } /* Mark the stmts that are involved in the pattern. */ @@ -37529,7 +41915,7 @@ } -@@ -761,8 +1809,8 @@ +@@ -761,8 +1813,8 @@ LOOP_VINFO - a struct_loop_info of a loop in which we want to look for computation idioms. @@ -37540,7 +41926,7 @@ also record some information in the struct_stmt_info of the relevant stmts, as explained below: -@@ -777,79 +1825,113 @@ +@@ -777,79 +1829,113 @@ S5: ... = ..use(a_0).. - - - Say the sequence {S1,S2,S3,S4} was detected as a pattern that can be @@ -41552,6 +45938,28 @@ || gimple_call_fndecl (stmt) != NULL_TREE) return; +--- a/src/gcc/varasm.c ++++ b/src/gcc/varasm.c +@@ -6751,11 +6751,14 @@ + /* A non-decl is an entry in the constant pool. */ + if (!DECL_P (exp)) + local_p = true; +- /* Weakrefs may not bind locally, even though the weakref itself is +- always static and therefore local. +- FIXME: We can resolve this more curefuly by looking at the weakref +- alias. */ +- else if (lookup_attribute ("weakref", DECL_ATTRIBUTES (exp))) ++ /* Weakrefs may not bind locally, even though the weakref itself is always ++ static and therefore local. Similarly, the resolver for ifunc functions ++ might resolve to a non-local function. ++ FIXME: We can resolve the weakref case more curefuly by looking at the ++ weakref alias. */ ++ else if (lookup_attribute ("weakref", DECL_ATTRIBUTES (exp)) ++ || (TREE_CODE (exp) == FUNCTION_DECL ++ && lookup_attribute ("ifunc", DECL_ATTRIBUTES (exp)))) + local_p = false; + /* Static variables are always local. */ + else if (! TREE_PUBLIC (exp)) --- a/src/libada/ChangeLog +++ b/src/libada/ChangeLog @@ -1,3 +1,9 @@ @@ -41648,7 +46056,15 @@ freebsd3.[01]* | freebsdelf3.[01]*) --- a/src/libgcc/ChangeLog +++ b/src/libgcc/ChangeLog -@@ -1,3 +1,8 @@ +@@ -1,3 +1,16 @@ ++2011-12-15 H.J. Lu ++ ++ Backport from mainline ++ 2011-12-14 H.J. Lu ++ ++ * generic-morestack.c (__generic_morestack_set_initial_sp): Check ++ __GLIBC__ instead of __linux__ when using __SIGRTMIN. ++ +2011-11-23 Gerald Pfeifer + + * config.host (*-*-freebsd[12], *-*-freebsd[12].*, @@ -41675,6 +46091,19 @@ *-*-freebsd*) # This is the generic ELF configuration of FreeBSD. Later # machine-specific sections may refine and add to this +--- a/src/libgcc/generic-morestack.c ++++ b/src/libgcc/generic-morestack.c +@@ -459,8 +459,8 @@ + sigemptyset (&__morestack_initial_sp.mask); + + sigfillset (&__morestack_fullmask); +-#ifdef __linux__ +- /* On Linux, the first two real time signals are used by the NPTL ++#ifdef __GLIBC__ ++ /* In glibc, the first two real time signals are used by the NPTL + threading library. By taking them out of the set of signals, we + avoiding copying the signal mask in pthread_sigmask. More + importantly, pthread_sigmask uses less stack space on x86_64. */ --- a/src/libgfortran/ChangeLog +++ b/src/libgfortran/ChangeLog @@ -1,3 +1,7 @@ @@ -43042,7 +47471,83 @@ freebsd3.[01]* | freebsdelf3.[01]*) --- a/src/libstdc++-v3/ChangeLog +++ b/src/libstdc++-v3/ChangeLog -@@ -1,3 +1,55 @@ +@@ -1,3 +1,131 @@ ++2012-01-03 Chase Douglas ++ Jonathan Wakely ++ ++ * include/bits/shared_ptr.h: Default copy ctor and assignment. ++ * include/bits/shared_ptr_base.h: Likewise. ++ * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust dg-error ++ line numbers. ++ * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Likewise. ++ ++2011-12-30 Paolo Carlini ++ ++ PR libstdc++/51711 ++ * include/bits/regex.h (regex_replace): Fix thinko. ++ * testsuite/28_regex/algorithms/regex_replace/char/51711.cc: New. ++ * testsuite/28_regex/algorithms/regex_replace/wchar_t/51711.cc: ++ Likewise. ++ ++2011-12-19 Jonathan Wakely ++ ++ PR libstdc++/51626 ++ * include/bits/stl_uninitialized.h (_Construct_default_a_impl): Define ++ overloaded functions to conditionally use allocator::construct. ++ (_Construct_default_a): Define to dispatch to appropriate ++ _Construct_default_a_impl overload. ++ (__uninitialized_default_a, __uninitialized_default_n_a): Use ++ _Construct_default_a. ++ * testsuite/20_util/allocator/51626.cc: New. ++ ++2011-12-19 Jonathan Wakely ++ ++ * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Adjust ++ dg-error line numbers. ++ * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Likewise. ++ * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Likewise. ++ * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Likewise. ++ ++2011-12-19 Jonathan Wakely ++ ++ * include/c_global/cmath: Update copyright years. ++ * include/ext/type_traits.h: Likewise. ++ ++2011-12-19 Jonathan Wakely ++ ++ Backport from mainline ++ 2011-11-13 Paolo Carlini ++ ++ * include/c_global/cmath (atan2, pow): Simplify constraining on the ++ return type. ++ ++ Backport from mainline ++ 2011-11-12 Jonathan Wakely ++ ++ PR libstdc++/51083 ++ * include/ext/type_traits.h (__promote): Only define __type member ++ for integral and floating point types, to prevent math functions ++ participating in overload resolution for other types. ++ (__promote_2, __promote_3, __promote_4): Use __promote in default ++ template argument values, so deduction only succeeds for integral and ++ floating point types. ++ * testsuite/26_numerics/cmath/51083.cc: New. ++ * testsuite/26_numerics/complex/51083.cc: New. ++ * testsuite/tr1/8_c_compatibility/cmath/51083.cc: New. ++ * testsuite/tr1/8_c_compatibility/complex/51083.cc: New. ++ ++2011-12-19 Jonathan Wakely ++ ++ PR libstdc++/50862 ++ * include/std/condition_variable (condition_variable_any::wait): Fix ++ deadlock and ensure _Lock::lock() is called on exit. ++ * testsuite/30_threads/condition_variable_any/50862.cc: New. ++ ++2011-12-18 Jonathan Wakely ++ ++ PR libstdc++/51540 ++ * include/bits/stl_numeric.h (partial_sum): Adjust doxygen comments. ++ +2011-11-20 Andreas Tobler + + * configure: Regenerate. @@ -43168,6 +47673,49 @@ size_type erase(const key_type&); +--- a/src/libstdc++-v3/include/bits/regex.h ++++ b/src/libstdc++-v3/include/bits/regex.h +@@ -2219,7 +2219,7 @@ + regex_constants::match_flag_type __flags + = regex_constants::match_default) + { +- std::string __result; ++ basic_string<_Ch_type> __result; + regex_replace(std::back_inserter(__result), + __s.begin(), __s.end(), __e, __fmt, __flags); + return __result; +--- a/src/libstdc++-v3/include/bits/shared_ptr.h ++++ b/src/libstdc++-v3/include/bits/shared_ptr.h +@@ -100,6 +100,8 @@ + constexpr shared_ptr() + : __shared_ptr<_Tp>() { } + ++ shared_ptr(const shared_ptr&) = default; // never throws ++ + /** + * @brief Construct a %shared_ptr that owns the pointer @a __p. + * @param __p A pointer that is convertible to element_type*. +@@ -264,6 +266,8 @@ + constexpr shared_ptr(nullptr_t __p) + : __shared_ptr<_Tp>(__p) { } + ++ shared_ptr& operator=(const shared_ptr&) = default; ++ + template + shared_ptr& + operator=(const shared_ptr<_Tp1>& __r) // never throws +--- a/src/libstdc++-v3/include/bits/shared_ptr_base.h ++++ b/src/libstdc++-v3/include/bits/shared_ptr_base.h +@@ -799,7 +799,8 @@ + : _M_ptr(__p), _M_refcount(__r._M_refcount) // never throws + { } + +- // generated copy constructor, assignment, destructor are fine. ++ __shared_ptr(const __shared_ptr&) = default; // never throws ++ __shared_ptr& operator=(const __shared_ptr&) = default; // never throws + + template::value>::type> --- a/src/libstdc++-v3/include/bits/stl_map.h +++ b/src/libstdc++-v3/include/bits/stl_map.h @@ -612,6 +612,11 @@ @@ -43196,6 +47744,42 @@ #else /** * @brief Erases an element from a %multimap. +--- a/src/libstdc++-v3/include/bits/stl_numeric.h ++++ b/src/libstdc++-v3/include/bits/stl_numeric.h +@@ -222,10 +222,10 @@ + /** + * @brief Return list of partial sums + * +- * Accumulates the values in the range [first,last) using operator+(). ++ * Accumulates the values in the range [first,last) using the @c + operator. + * As each successive input value is added into the total, that partial sum +- * is written to @a result. Therefore, the first value in result is the +- * first value of the input, the second value in result is the sum of the ++ * is written to @p result. Therefore, the first value in @p result is the ++ * first value of the input, the second value in @p result is the sum of the + * first and second input values, and so on. + * + * @param first Start of input range. +@@ -261,15 +261,16 @@ + /** + * @brief Return list of partial sums + * +- * Accumulates the values in the range [first,last) using operator+(). ++ * Accumulates the values in the range [first,last) using @p binary_op. + * As each successive input value is added into the total, that partial sum +- * is written to @a result. Therefore, the first value in result is the +- * first value of the input, the second value in result is the sum of the ++ * is written to @a result. Therefore, the first value in @p result is the ++ * first value of the input, the second value in @p result is the sum of the + * first and second input values, and so on. + * + * @param first Start of input range. + * @param last End of input range. + * @param result Output to write sums to. ++ * @param binary_op Function object. + * @return Iterator pointing just beyond the values written to result. + */ + template ++ inline auto ++ _Construct_default_a_impl(_Tp* __ptr, _Allocator& __alloc, void*) ++ -> decltype(__alloc.construct(__ptr)) ++ { return __alloc.construct(__ptr); } ++ ++ template ++ inline void ++ _Construct_default_a_impl(_Tp* __ptr, _Allocator& __alloc, ...) ++ { _Construct(__ptr); } ++ ++ template ++ inline void ++ _Construct_default_a(_Tp* __ptr, _Allocator& __alloc) ++ { _Construct_default_a_impl(__ptr, __alloc, nullptr); } + + // __uninitialized_default_a + // Fills [first, last) with std::distance(first, last) default +@@ -544,7 +559,7 @@ + __try + { + for (; __cur != __last; ++__cur) +- __alloc.construct(std::__addressof(*__cur)); ++ _Construct_default_a(std::__addressof(*__cur), __alloc); + } + __catch(...) + { +@@ -573,7 +588,7 @@ + __try + { + for (; __n > 0; --__n, ++__cur) +- __alloc.construct(std::__addressof(*__cur)); ++ _Construct_default_a(std::__addressof(*__cur), __alloc); + } + __catch(...) + { +--- a/src/libstdc++-v3/include/c_global/cmath ++++ b/src/libstdc++-v3/include/c_global/cmath +@@ -1,7 +1,7 @@ + // -*- C++ -*- C forwarding header. + + // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, +-// 2006, 2007, 2008, 2009, 2010 ++// 2006, 2007, 2008, 2009, 2010, 2011 + // Free Software Foundation, Inc. + // + // This file is part of the GNU ISO C++ Library. This library is free +@@ -156,10 +156,7 @@ + + template + inline +- typename __gnu_cxx::__promote_2< +- typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value +- && __is_arithmetic<_Up>::__value, +- _Tp>::__type, _Up>::__type ++ typename __gnu_cxx::__promote_2<_Tp, _Up>::__type + atan2(_Tp __y, _Up __x) + { + typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; +@@ -374,10 +371,7 @@ + + template + inline +- typename __gnu_cxx::__promote_2< +- typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value +- && __is_arithmetic<_Up>::__value, +- _Tp>::__type, _Up>::__type ++ typename __gnu_cxx::__promote_2<_Tp, _Up>::__type + pow(_Tp __x, _Up __y) + { + typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; --- a/src/libstdc++-v3/include/debug/map.h +++ b/src/libstdc++-v3/include/debug/map.h @@ -273,6 +273,10 @@ @@ -43289,6 +47959,93 @@ erase(const_iterator __first, const_iterator __last) { __glibcxx_check_erase_range(__first, __last); +--- a/src/libstdc++-v3/include/ext/type_traits.h ++++ b/src/libstdc++-v3/include/ext/type_traits.h +@@ -1,6 +1,7 @@ + // -*- C++ -*- + +-// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. ++// Copyright (C) 2005, 2006, 2007, 2009, 2010, 2011 ++// Free Software Foundation, Inc. + // + // This file is part of the GNU ISO C++ Library. This library is free + // software; you can redistribute it and/or modify it under the terms +@@ -161,44 +162,50 @@ + struct __promote + { typedef double __type; }; + ++ // No nested __type member for non-integer non-floating point types, ++ // allows this type to be used for SFINAE to constrain overloads in ++ // and to only the intended types. + template + struct __promote<_Tp, false> +- { typedef _Tp __type; }; ++ { }; ++ ++ template<> ++ struct __promote ++ { typedef long double __type; }; ++ ++ template<> ++ struct __promote ++ { typedef double __type; }; ++ ++ template<> ++ struct __promote ++ { typedef float __type; }; + +- template ++ template::__type, ++ typename _Up2 = typename __promote<_Up>::__type> + struct __promote_2 + { +- private: +- typedef typename __promote<_Tp>::__type __type1; +- typedef typename __promote<_Up>::__type __type2; +- +- public: +- typedef __typeof__(__type1() + __type2()) __type; ++ typedef __typeof__(_Tp2() + _Up2()) __type; + }; + +- template ++ template::__type, ++ typename _Up2 = typename __promote<_Up>::__type, ++ typename _Vp2 = typename __promote<_Vp>::__type> + struct __promote_3 + { +- private: +- typedef typename __promote<_Tp>::__type __type1; +- typedef typename __promote<_Up>::__type __type2; +- typedef typename __promote<_Vp>::__type __type3; +- +- public: +- typedef __typeof__(__type1() + __type2() + __type3()) __type; ++ typedef __typeof__(_Tp2() + _Up2() + _Vp2()) __type; + }; + +- template ++ template::__type, ++ typename _Up2 = typename __promote<_Up>::__type, ++ typename _Vp2 = typename __promote<_Vp>::__type, ++ typename _Wp2 = typename __promote<_Wp>::__type> + struct __promote_4 + { +- private: +- typedef typename __promote<_Tp>::__type __type1; +- typedef typename __promote<_Up>::__type __type2; +- typedef typename __promote<_Vp>::__type __type3; +- typedef typename __promote<_Wp>::__type __type4; +- +- public: +- typedef __typeof__(__type1() + __type2() + __type3() + __type4()) __type; ++ typedef __typeof__(_Tp2() + _Up2() + _Vp2() + _Wp2()) __type; + }; + + _GLIBCXX_END_NAMESPACE_VERSION --- a/src/libstdc++-v3/include/profile/map.h +++ b/src/libstdc++-v3/include/profile/map.h @@ -326,6 +326,10 @@ @@ -43342,6 +48099,38 @@ } #if _GLIBCXX_USE_C99_COMPLEX_TR1 +--- a/src/libstdc++-v3/include/std/condition_variable ++++ b/src/libstdc++-v3/include/std/condition_variable +@@ -198,10 +198,25 @@ + void + wait(_Lock& __lock) + { +- unique_lock __my_lock(_M_mutex); +- __lock.unlock(); +- _M_cond.wait(__my_lock); +- __lock.lock(); ++ // scoped unlock - unlocks in ctor, re-locks in dtor ++ struct _Unlock { ++ explicit _Unlock(_Lock& __lk) : _M_lock(__lk) { __lk.unlock(); } ++ ~_Unlock() noexcept(false) ++ { ++ if (uncaught_exception()) ++ __try { _M_lock.lock(); } __catch(...) { } ++ else ++ _M_lock.lock(); ++ } ++ _Lock& _M_lock; ++ }; ++ ++ unique_lock __my_lock(_M_mutex); ++ _Unlock __unlock(__lock); ++ // _M_mutex must be unlocked before re-locking __lock so move ++ // ownership of _M_mutex lock to an object with shorter lifetime. ++ unique_lock __my_lock2(std::move(__my_lock)); ++ _M_cond.wait(__my_lock2); + } + + --- a/src/libstdc++-v3/include/tr1/complex +++ b/src/libstdc++-v3/include/tr1/complex @@ -185,12 +185,9 @@ @@ -43475,6 +48264,98 @@ } return ctm_failed; +--- a/src/libstdc++-v3/testsuite/20_util/allocator/51626.cc ++++ b/src/libstdc++-v3/testsuite/20_util/allocator/51626.cc +@@ -0,0 +1,66 @@ ++// Copyright (C) 2011 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING3. If not see ++// . ++ ++// { dg-options "-std=gnu++0x" } ++ ++#include ++#include ++#include ++ ++int count = 0; ++ ++template ++ struct allocator98 : std::allocator ++ { ++ template struct rebind { typedef allocator98 other; }; ++ ++ allocator98() { } ++ ++ template allocator98(const allocator98&) { }; ++ ++ void construct(T* p, const T& val) ++ { ++ ++count; ++ std::allocator::construct(p, val); ++ } ++ }; ++ ++template ++ struct allocator11 : std::allocator ++ { ++ template struct rebind { typedef allocator11 other; }; ++ ++ allocator11() { } ++ ++ template allocator11(const allocator11&) { }; ++ ++ template ++ void construct(T* p, Args&&... args) ++ { ++ ++count; ++ std::allocator::construct(p, std::forward(args)...); ++ } ++ }; ++ ++int main() ++{ ++ std::vector< int, allocator98 > v98(1); ++ VERIFY( count == 0 ); ++ ++ std::vector< int, allocator11 > v11(1); ++ VERIFY( count == 1 ); ++} +--- a/src/libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc ++++ b/src/libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc +@@ -35,6 +35,6 @@ + // { dg-error "incomplete" "" { target *-*-* } 766 } + + std::shared_ptr p9(ap()); // { dg-error "here" } +- // { dg-error "incomplete" "" { target *-*-* } 858 } ++ // { dg-error "incomplete" "" { target *-*-* } 859 } + + } +--- a/src/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc ++++ b/src/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc +@@ -42,8 +42,8 @@ + return 0; + } + +-// { dg-warning "note" "" { target *-*-* } 354 } +-// { dg-warning "note" "" { target *-*-* } 1085 } ++// { dg-warning "note" "" { target *-*-* } 358 } ++// { dg-warning "note" "" { target *-*-* } 1086 } + // { dg-warning "note" "" { target *-*-* } 468 } + // { dg-warning "note" "" { target *-*-* } 586 } + // { dg-warning "note" "" { target *-*-* } 1049 } --- a/src/libstdc++-v3/testsuite/23_containers/map/modifiers/erase/51142.cc +++ b/src/libstdc++-v3/testsuite/23_containers/map/modifiers/erase/51142.cc @@ -0,0 +1,38 @@ @@ -43803,6 +48684,71 @@ + if (it != s.end()) + s.erase(it); +} +--- a/src/libstdc++-v3/testsuite/26_numerics/cmath/51083.cc ++++ b/src/libstdc++-v3/testsuite/26_numerics/cmath/51083.cc +@@ -0,0 +1,62 @@ ++// { dg-options "-std=gnu++0x" } ++// ++// Copyright (C) 2011 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++// ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING3. If not see ++// . ++ ++#include ++ ++namespace a ++{ ++ template class Mat { }; ++ ++ template struct Mat2 : Mat { }; ++ ++ template ++ int fdim(Mat) { return 1; } ++ ++ template ++ int floor(Mat, U) { return 1; } ++ template ++ int floor(T, Mat) { return 1; } ++ ++ template ++ int fma(Mat, U, V) { return 1; } ++ template ++ int fma(T, Mat, V) { return 1; } ++ template ++ int fma(T, U, Mat) { return 1; } ++} ++ ++int main() ++{ ++ int __attribute__((unused)) i; ++ ++ using namespace std; ++ ++ a::Mat2 c; ++ i = fdim(c); ++ i = floor(c, 0.); ++ i = floor(0., c); ++ i = floor(c, 1); ++ i = floor(1, c); ++ i = fma(c, 0., 1.); ++ i = fma(0., c, 1.); ++ i = fma(0., 1., c); ++ i = fma(c, 0., 1); ++ i = fma(0., c, 1); ++ i = fma(0., 1, c); ++} --- a/src/libstdc++-v3/testsuite/26_numerics/complex/50880.cc +++ b/src/libstdc++-v3/testsuite/26_numerics/complex/50880.cc @@ -0,0 +1,53 @@ @@ -43859,6 +48805,311 @@ + test01(); + return 0; +} +--- a/src/libstdc++-v3/testsuite/26_numerics/complex/51083.cc ++++ b/src/libstdc++-v3/testsuite/26_numerics/complex/51083.cc +@@ -0,0 +1,54 @@ ++// { dg-options "-std=gnu++0x" } ++// ++// Copyright (C) 2011 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++// ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING3. If not see ++// . ++ ++#include ++ ++namespace a ++{ ++ template class Mat { }; ++ ++ template struct Mat2 : Mat { }; ++ ++ template int arg(Mat) { return 1; } ++ template int conj(Mat) { return 1; } ++ template int imag(Mat) { return 1; } ++ template int norm(Mat) { return 1; } ++ template int proj(Mat) { return 1; } ++ template int real(Mat) { return 1; } ++ ++ template int pow(Mat, U) { return 1; } ++ template int pow(T, Mat) { return 1; } ++} ++ ++int main() ++{ ++ int __attribute__((unused)) i; ++ ++ using namespace std; ++ ++ a::Mat2< std::complex > c; ++ i = arg(c); ++ i = conj(c); ++ i = imag(c); ++ i = norm(c); ++ i = proj(c); ++ i = real(c); ++ i = pow(std::complex(), c); ++ i = pow(c, std::complex()); ++} +--- a/src/libstdc++-v3/testsuite/28_regex/algorithms/regex_replace/char/51711.cc ++++ b/src/libstdc++-v3/testsuite/28_regex/algorithms/regex_replace/char/51711.cc +@@ -0,0 +1,31 @@ ++// { dg-options "-std=gnu++0x" } ++// { dg-do compile } ++ ++// Copyright (C) 2011 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++// ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING3. If not see ++// . ++// ++ ++#include ++#include ++ ++// libstdc++/51711 ++void test01() ++{ ++ std::string toProcess("Bug\r\n"); ++ std::string result __attribute__((unused)) ++ = std::regex_replace(toProcess, std::regex("\\r"), std::string("\\r")); ++} +--- a/src/libstdc++-v3/testsuite/28_regex/algorithms/regex_replace/wchar_t/51711.cc ++++ b/src/libstdc++-v3/testsuite/28_regex/algorithms/regex_replace/wchar_t/51711.cc +@@ -0,0 +1,31 @@ ++// { dg-options "-std=gnu++0x" } ++// { dg-do compile } ++ ++// Copyright (C) 2011 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++// ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING3. If not see ++// . ++// ++ ++#include ++#include ++ ++// libstdc++/51711 ++void test01() ++{ ++ std::wstring toProcess(L"Bug\r\n"); ++ std::wstring result __attribute__((unused)) ++ = std::regex_replace(toProcess, std::wregex(L"\\r"), std::wstring(L"\\r")); ++} +--- a/src/libstdc++-v3/testsuite/30_threads/condition_variable_any/50862.cc ++++ b/src/libstdc++-v3/testsuite/30_threads/condition_variable_any/50862.cc +@@ -0,0 +1,80 @@ ++// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } ++// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } ++// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } ++// { dg-require-cstdint "" } ++// { dg-require-gthreads "" } ++// { dg-require-sched-yield "" } ++ ++// Copyright (C) 2011 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING3. If not see ++// . ++ ++#include ++#include ++#include ++#include ++#include ++ ++struct scoped_thread ++{ ++ ~scoped_thread() { if (t.joinable()) t.join(); } ++ std::thread t; ++}; ++ ++int main() ++{ ++ typedef std::unique_lock Lock; ++ ++ std::mutex m; ++ std::condition_variable_any cond; ++ unsigned int product = 0; ++ const unsigned int count = 10; ++ ++ // writing to stream causes timing changes which makes deadlock easier ++ // to reproduce - do not remove ++ std::ostringstream out; ++ ++ // create consumers ++ std::array threads; ++ for (std::size_t i = 0; i < threads.size(); ++i) ++ threads[i].t ++ = std::thread( [&] ++ { ++ for (unsigned int i = 0; i < count; ++i) ++ { ++ std::this_thread::yield(); ++ Lock lock(m); ++ while(product == 0) ++ cond.wait(lock); ++ out << "got product " ++ << std::this_thread::get_id() ++ << ' ' << product << std::endl; ++ --product; ++ } ++ } ); ++ ++ // single producer ++ for (std::size_t i = 0; i < threads.size() * count; ++i) ++ { ++ std::this_thread::yield(); ++ Lock lock(m); ++ ++product; ++ out << "setting product " << std::this_thread::get_id() ++ << ' ' << product << std::endl; ++ cond.notify_one(); ++ } ++} +--- a/src/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_floating_neg.cc ++++ b/src/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_floating_neg.cc +@@ -35,4 +35,4 @@ + } + + // { dg-error "instantiated from" "" { target *-*-* } 28 } +-// { dg-error "no type" "" { target *-*-* } 69 } ++// { dg-error "no type" "" { target *-*-* } 70 } +--- a/src/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_integer_neg.cc ++++ b/src/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_integer_neg.cc +@@ -36,4 +36,4 @@ + } + + // { dg-error "invalid use of incomplete" "" { target *-*-* } 28 } +-// { dg-error "declaration of" "" { target *-*-* } 63 } ++// { dg-error "declaration of" "" { target *-*-* } 64 } +--- a/src/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_floating_neg.cc ++++ b/src/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_floating_neg.cc +@@ -35,4 +35,4 @@ + } + + // { dg-error "instantiated from" "" { target *-*-* } 28 } +-// { dg-error "no type" "" { target *-*-* } 112 } ++// { dg-error "no type" "" { target *-*-* } 113 } +--- a/src/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_integer_neg.cc ++++ b/src/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_integer_neg.cc +@@ -36,4 +36,4 @@ + } + + // { dg-error "invalid use of incomplete" "" { target *-*-* } 28 } +-// { dg-error "declaration of" "" { target *-*-* } 106 } ++// { dg-error "declaration of" "" { target *-*-* } 107 } +--- a/src/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/51083.cc ++++ b/src/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/51083.cc +@@ -0,0 +1,62 @@ ++// { dg-options "-std=gnu++0x" } ++// ++// Copyright (C) 2011 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++// ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING3. If not see ++// . ++ ++#include ++ ++namespace a ++{ ++ template class Mat { }; ++ ++ template struct Mat2 : Mat { }; ++ ++ template ++ int fdim(Mat) { return 1; } ++ ++ template ++ int floor(Mat, U) { return 1; } ++ template ++ int floor(T, Mat) { return 1; } ++ ++ template ++ int fma(Mat, U, V) { return 1; } ++ template ++ int fma(T, Mat, V) { return 1; } ++ template ++ int fma(T, U, Mat) { return 1; } ++} ++ ++int main() ++{ ++ int __attribute__((unused)) i; ++ ++ using namespace std::tr1; ++ ++ a::Mat2 c; ++ i = fdim(c); ++ i = floor(c, 0.); ++ i = floor(0., c); ++ i = floor(c, 1); ++ i = floor(1, c); ++ i = fma(c, 0., 1.); ++ i = fma(0., c, 1.); ++ i = fma(0., 1., c); ++ i = fma(c, 0., 1); ++ i = fma(0., c, 1); ++ i = fma(0., 1, c); ++} --- a/src/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/50880.cc +++ b/src/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/50880.cc @@ -0,0 +1,51 @@ @@ -43913,6 +49164,63 @@ + test01(); + return 0; +} +--- a/src/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/51083.cc ++++ b/src/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/51083.cc +@@ -0,0 +1,54 @@ ++// { dg-options "-std=gnu++0x" } ++// ++// Copyright (C) 2011 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++// ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++// ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING3. If not see ++// . ++ ++#include ++ ++namespace a ++{ ++ template class Mat { }; ++ ++ template struct Mat2 : Mat { }; ++ ++ template int arg(Mat) { return 1; } ++ template int conj(Mat) { return 1; } ++ template int imag(Mat) { return 1; } ++ template int norm(Mat) { return 1; } ++ template int proj(Mat) { return 1; } ++ template int real(Mat) { return 1; } ++ ++ template int pow(Mat, U) { return 1; } ++ template int pow(T, Mat) { return 1; } ++} ++ ++int main() ++{ ++ int __attribute__((unused)) i; ++ ++ using namespace std::tr1; ++ ++ a::Mat2< std::complex > c; ++ i = arg(c); ++ i = conj(c); ++ i = imag(c); ++ i = norm(c); ++ i = proj(c); ++ i = real(c); ++ i = pow(std::complex(), c); ++ i = pow(c, std::complex()); ++} --- a/src/libtool.m4 +++ b/src/libtool.m4 @@ -2273,7 +2273,7 @@ @@ -43953,7 +49261,20 @@ _LT_TAGVAR(ld_shlibs, $1)=no --- a/src/lto-plugin/ChangeLog +++ b/src/lto-plugin/ChangeLog -@@ -1,3 +1,7 @@ +@@ -1,3 +1,20 @@ ++2012-01-03 Richard Guenther ++ ++ Backport from mainline ++ 2011-08-10 Richard Guenther ++ ++ PR bootstrap/49907 ++ lto-plugin/ ++ * configure.ac: Use ACX_PROG_CC_WARNING_OPTS to detect -Wall presence. ++ * Makefile.am (AM_CFLAGS): Adjust. Do not build with -Werror. ++ * configure: Regenerate. ++ * Makefile.in: Likewise. ++ * aclocal.m4: Likewise. ++ +2011-11-20 Andreas Tobler + + * configure: Regenerate. @@ -43961,9 +49282,111 @@ 2011-10-26 Release Manager * GCC 4.6.2 released. +--- a/src/lto-plugin/Makefile.am ++++ b/src/lto-plugin/Makefile.am +@@ -8,7 +8,7 @@ + libexecsubdir := $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version) + + AM_CPPFLAGS = -I$(top_srcdir)/../include $(DEFS) +-AM_CFLAGS = -Wall -Werror ++AM_CFLAGS = @ac_lto_plugin_warn_cflags@ + AM_LIBTOOLFLAGS = --tag=disable-static + + libexecsub_LTLIBRARIES = liblto_plugin.la +--- a/src/lto-plugin/Makefile.in ++++ b/src/lto-plugin/Makefile.in +@@ -47,6 +47,7 @@ + $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/lthostflags.m4 \ + $(top_srcdir)/../config/override.m4 \ ++ $(top_srcdir)/../config/warnings.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ + $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ + $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac +@@ -167,6 +168,7 @@ + abs_top_srcdir = @abs_top_srcdir@ + ac_ct_CC = @ac_ct_CC@ + ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ++ac_lto_plugin_warn_cflags = @ac_lto_plugin_warn_cflags@ + am__include = @am__include@ + am__leading_dot = @am__leading_dot@ + am__quote = @am__quote@ +@@ -227,7 +229,7 @@ + gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) + libexecsubdir := $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version) + AM_CPPFLAGS = -I$(top_srcdir)/../include $(DEFS) +-AM_CFLAGS = -Wall -Werror ++AM_CFLAGS = @ac_lto_plugin_warn_cflags@ + AM_LIBTOOLFLAGS = --tag=disable-static + libexecsub_LTLIBRARIES = liblto_plugin.la + gcc_build_dir = ../$(host_subdir)/gcc +--- a/src/lto-plugin/aclocal.m4 ++++ b/src/lto-plugin/aclocal.m4 +@@ -973,6 +973,7 @@ + m4_include([../config/lead-dot.m4]) + m4_include([../config/lthostflags.m4]) + m4_include([../config/override.m4]) ++m4_include([../config/warnings.m4]) + m4_include([../libtool.m4]) + m4_include([../ltoptions.m4]) + m4_include([../ltsugar.m4]) --- a/src/lto-plugin/configure +++ b/src/lto-plugin/configure -@@ -8733,7 +8733,7 @@ +@@ -622,6 +622,7 @@ + GREP + SED + LIBTOOL ++ac_lto_plugin_warn_cflags + am__fastdepCC_FALSE + am__fastdepCC_TRUE + CCDEPMODE +@@ -4040,6 +4041,45 @@ + fi + fi + ++ac_lto_plugin_warn_cflags= ++save_CFLAGS="$CFLAGS" ++for option in -Wall; do ++ as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh` ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5 ++$as_echo_n "checking whether $CC supports $option... " >&6; } ++if { as_var=$as_acx_Woption; eval "test \"\${$as_var+set}\" = set"; }; then : ++ $as_echo_n "(cached) " >&6 ++else ++ CFLAGS="$option" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ eval "$as_acx_Woption=yes" ++else ++ eval "$as_acx_Woption=no" ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++eval ac_res=\$$as_acx_Woption ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++$as_echo "$ac_res" >&6; } ++ if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; then : ++ ac_lto_plugin_warn_cflags="$ac_lto_plugin_warn_cflags${ac_lto_plugin_warn_cflags:+ }$option" ++fi ++ done ++CFLAGS="$save_CFLAGS" ++ + case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +@@ -8733,7 +8773,7 @@ ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. @@ -43972,7 +49395,7 @@ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes -@@ -9646,7 +9646,7 @@ +@@ -9646,7 +9686,7 @@ objformat=`/usr/bin/objformat` else case $host_os in @@ -43981,7 +49404,7 @@ *) objformat=elf ;; esac fi -@@ -9664,7 +9664,7 @@ +@@ -9664,7 +9704,7 @@ esac shlibpath_var=LD_LIBRARY_PATH case $host_os in @@ -43990,6 +49413,34 @@ shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) +@@ -10498,7 +10538,7 @@ + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 10501 "configure" ++#line 10541 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +@@ -10604,7 +10644,7 @@ + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +-#line 10607 "configure" ++#line 10647 "configure" + #include "confdefs.h" + + #if HAVE_DLFCN_H +--- a/src/lto-plugin/configure.ac ++++ b/src/lto-plugin/configure.ac +@@ -6,6 +6,7 @@ + AM_MAINTAINER_MODE + AC_PROG_CC + AC_SYS_LARGEFILE ++ACX_PROG_CC_WARNING_OPTS([-Wall], [ac_lto_plugin_warn_cflags]) + AM_PROG_LIBTOOL + ACX_LT_HOST_FLAGS + AC_SUBST(target_noncanonical) --- a/src/maintainer-scripts/ChangeLog +++ b/src/maintainer-scripts/ChangeLog @@ -1,3 +1,8 @@ reverted: --- gcc-4.6-4.6.2/debian/patches/pr48660.diff +++ gcc-4.6-4.6.2.orig/debian/patches/pr48660.diff @@ -1,221 +0,0 @@ -# DP: Proposed backport for PR middle-end/48660. - - -gcc/ - PR middle-end/48660 - * expr.h (copy_blkmode_to_reg): Declare. - * expr.c (copy_blkmode_to_reg): New function. - (expand_assignment): Don't expand register RESULT_DECLs before - the lhs. Use copy_blkmode_to_reg to copy BLKmode values into a - RESULT_DECL register. - (expand_expr_real_1): Handle BLKmode decls when looking for promotion. - -gcc/testsuite/ - PR middle-end/48660 - * g++.dg/pr48660.C: New test. - -Index: gcc/expr.h -=================================================================== ---- a/src/gcc/expr.h 2011-03-15 09:21:15.000000000 +0000 -+++ b/src/gcc/expr.h 2011-12-21 14:16:22.076042238 +0000 -@@ -324,6 +324,8 @@ extern void emit_group_store (rtx, rtx, - /* Copy BLKmode object from a set of registers. */ - extern rtx copy_blkmode_from_reg (rtx, rtx, tree); - -+extern rtx copy_blkmode_to_reg (enum machine_mode, tree); -+ - /* Mark REG as holding a parameter for the next CALL_INSN. */ - extern void use_reg (rtx *, rtx); - -Index: gcc/expr.c -=================================================================== ---- a/src/gcc/expr.c 2011-08-18 16:45:15.000000000 +0100 -+++ b/src/gcc/expr.c 2011-12-21 14:18:27.566635910 +0000 -@@ -2180,6 +2180,111 @@ copy_blkmode_from_reg (rtx tgtblk, rtx s - return tgtblk; - } - -+/* Copy BLKmode value SRC into a register of mode MODE. Return the -+ register if it contains any data, otherwise return null. -+ -+ This is used on targets that return BLKmode values in registers. */ -+ -+rtx -+copy_blkmode_to_reg (enum machine_mode mode, tree src) -+{ -+ int i, n_regs; -+ unsigned HOST_WIDE_INT bitpos, xbitpos, padding_correction = 0, bytes; -+ unsigned int bitsize; -+ rtx *dst_words, dst, x, src_word = NULL_RTX, dst_word = NULL_RTX; -+ enum machine_mode dst_mode; -+ -+ gcc_assert (TYPE_MODE (TREE_TYPE (src)) == BLKmode); -+ -+ x = expand_normal (src); -+ -+ bytes = int_size_in_bytes (TREE_TYPE (src)); -+ if (bytes == 0) -+ return NULL_RTX; -+ -+ /* If the structure doesn't take up a whole number of words, see -+ whether the register value should be padded on the left or on -+ the right. Set PADDING_CORRECTION to the number of padding -+ bits needed on the left side. -+ -+ In most ABIs, the structure will be returned at the least end of -+ the register, which translates to right padding on little-endian -+ targets and left padding on big-endian targets. The opposite -+ holds if the structure is returned at the most significant -+ end of the register. */ -+ if (bytes % UNITS_PER_WORD != 0 -+ && (targetm.calls.return_in_msb (TREE_TYPE (src)) -+ ? !BYTES_BIG_ENDIAN -+ : BYTES_BIG_ENDIAN)) -+ padding_correction = (BITS_PER_WORD - ((bytes % UNITS_PER_WORD) -+ * BITS_PER_UNIT)); -+ -+ n_regs = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; -+ dst_words = XALLOCAVEC (rtx, n_regs); -+ bitsize = MIN (TYPE_ALIGN (TREE_TYPE (src)), BITS_PER_WORD); -+ -+ /* Copy the structure BITSIZE bits at a time. */ -+ for (bitpos = 0, xbitpos = padding_correction; -+ bitpos < bytes * BITS_PER_UNIT; -+ bitpos += bitsize, xbitpos += bitsize) -+ { -+ /* We need a new destination pseudo each time xbitpos is -+ on a word boundary and when xbitpos == padding_correction -+ (the first time through). */ -+ if (xbitpos % BITS_PER_WORD == 0 -+ || xbitpos == padding_correction) -+ { -+ /* Generate an appropriate register. */ -+ dst_word = gen_reg_rtx (word_mode); -+ dst_words[xbitpos / BITS_PER_WORD] = dst_word; -+ -+ /* Clear the destination before we move anything into it. */ -+ emit_move_insn (dst_word, CONST0_RTX (word_mode)); -+ } -+ -+ /* We need a new source operand each time bitpos is on a word -+ boundary. */ -+ if (bitpos % BITS_PER_WORD == 0) -+ src_word = operand_subword_force (x, bitpos / BITS_PER_WORD, BLKmode); -+ -+ /* Use bitpos for the source extraction (left justified) and -+ xbitpos for the destination store (right justified). */ -+ store_bit_field (dst_word, bitsize, xbitpos % BITS_PER_WORD, word_mode, -+ extract_bit_field (src_word, bitsize, -+ bitpos % BITS_PER_WORD, 1, false, -+ NULL_RTX, word_mode, word_mode)); -+ } -+ -+ if (mode == BLKmode) -+ { -+ /* Find the smallest integer mode large enough to hold the -+ entire structure. */ -+ for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); -+ mode != VOIDmode; -+ mode = GET_MODE_WIDER_MODE (mode)) -+ /* Have we found a large enough mode? */ -+ if (GET_MODE_SIZE (mode) >= bytes) -+ break; -+ -+ /* A suitable mode should have been found. */ -+ gcc_assert (mode != VOIDmode); -+ } -+ -+ if (GET_MODE_SIZE (mode) < GET_MODE_SIZE (word_mode)) -+ dst_mode = word_mode; -+ else -+ dst_mode = mode; -+ dst = gen_reg_rtx (dst_mode); -+ -+ for (i = 0; i < n_regs; i++) -+ emit_move_insn (operand_subword (dst, i, 0, dst_mode), dst_words[i]); -+ -+ if (mode != dst_mode) -+ dst = gen_lowpart (mode, dst); -+ -+ return dst; -+} -+ - /* Add a USE expression for REG to the (possibly empty) list pointed - to by CALL_FUSAGE. REG must denote a hard register. */ - -@@ -4382,7 +4487,9 @@ expand_assignment (tree to, tree from, b - if (TREE_CODE (from) == CALL_EXPR && ! aggregate_value_p (from, from) - && COMPLETE_TYPE_P (TREE_TYPE (from)) - && TREE_CODE (TYPE_SIZE (TREE_TYPE (from))) == INTEGER_CST -- && ! (((TREE_CODE (to) == VAR_DECL || TREE_CODE (to) == PARM_DECL) -+ && ! (((TREE_CODE (to) == VAR_DECL -+ || TREE_CODE (to) == PARM_DECL -+ || TREE_CODE (to) == RESULT_DECL) - && REG_P (DECL_RTL (to))) - || TREE_CODE (to) == SSA_NAME)) - { -@@ -4428,12 +4535,15 @@ expand_assignment (tree to, tree from, b - rtx temp; - - push_temp_slots (); -- temp = expand_expr (from, NULL_RTX, GET_MODE (to_rtx), EXPAND_NORMAL); -+ if (REG_P (to_rtx) && TYPE_MODE (TREE_TYPE (from)) == BLKmode) -+ temp = copy_blkmode_to_reg (GET_MODE (to_rtx), from); -+ else -+ temp = expand_expr (from, NULL_RTX, GET_MODE (to_rtx), EXPAND_NORMAL); - - if (GET_CODE (to_rtx) == PARALLEL) - emit_group_load (to_rtx, temp, TREE_TYPE (from), - int_size_in_bytes (TREE_TYPE (from))); -- else -+ else if (temp) - emit_move_insn (to_rtx, temp); - - preserve_temp_slots (to_rtx); -@@ -8533,10 +8643,15 @@ expand_expr_real_1 (tree exp, rtx target - return temp; - } - -- /* If the mode of DECL_RTL does not match that of the decl, it -- must be a promoted value. We return a SUBREG of the wanted mode, -- but mark it so that we know that it was already extended. */ -- if (REG_P (decl_rtl) && GET_MODE (decl_rtl) != DECL_MODE (exp)) -+ /* If the mode of DECL_RTL does not match that of the decl, -+ there are two cases: we are dealing with a BLKmode value -+ that is returned in a register, or we are dealing with -+ a promoted value. In the latter case, return a SUBREG -+ of the wanted mode, but mark it so that we know that it -+ was already extended. */ -+ if (REG_P (decl_rtl) -+ && DECL_MODE (exp) != BLKmode -+ && GET_MODE (decl_rtl) != DECL_MODE (exp)) - { - enum machine_mode pmode; - -Index: gcc/testsuite/g++.dg/pr48660.C -=================================================================== ---- /dev/null 2011-12-19 08:48:58.233814881 +0000 -+++ b/src/gcc/testsuite/g++.dg/pr48660.C 2011-12-21 14:16:22.088042200 +0000 -@@ -0,0 +1,22 @@ -+template struct val { char a[N]; }; -+ -+class Base -+{ -+public: -+ virtual val<1> get1() const = 0; -+ virtual val<2> get2() const = 0; -+ virtual val<3> get3() const = 0; -+ virtual val<4> get4() const = 0; -+}; -+ -+class Derived : public virtual Base -+{ -+public: -+ virtual val<1> get1() const { return foo->get1(); } -+ virtual val<2> get2() const { return foo->get2(); } -+ virtual val<3> get3() const { return foo->get3(); } -+ virtual val<4> get4() const { return foo->get4(); } -+ Base *foo; -+}; -+ -+Base* make() { return new Derived; } diff -u gcc-4.6-4.6.2/debian/patches/gcc-linaro-doc.diff gcc-4.6-4.6.2/debian/patches/gcc-linaro-doc.diff --- gcc-4.6-4.6.2/debian/patches/gcc-linaro-doc.diff +++ gcc-4.6-4.6.2/debian/patches/gcc-linaro-doc.diff @@ -1,8 +1,282 @@ -# DP: Changes for the Linaro 4.6-2011.12 release (documentation). +# DP: Changes for the Linaro 4.6-2012.01 release (documentation). --- a/src/gcc/doc/invoke.texi +++ b/src/gcc/doc/invoke.texi -@@ -8732,6 +8732,10 @@ +@@ -7527,8 +7527,8 @@ + bodies are read from these ELF sections and instantiated as if they + had been part of the same translation unit. + +-To use the link-timer optimizer, @option{-flto} needs to be specified at +-compile time and during the final link. For example, ++To use the link-time optimizer, @option{-flto} needs to be specified at ++compile time and during the final link. For example: + + @smallexample + gcc -c -O2 -flto foo.c +@@ -7536,25 +7536,25 @@ + gcc -o myprog -flto -O2 foo.o bar.o + @end smallexample + +-The first two invocations to GCC will save a bytecode representation ++The first two invocations to GCC save a bytecode representation + of GIMPLE into special ELF sections inside @file{foo.o} and +-@file{bar.o}. The final invocation will read the GIMPLE bytecode from +-@file{foo.o} and @file{bar.o}, merge the two files into a single +-internal image, and compile the result as usual. Since both ++@file{bar.o}. The final invocation reads the GIMPLE bytecode from ++@file{foo.o} and @file{bar.o}, merges the two files into a single ++internal image, and compiles the result as usual. Since both + @file{foo.o} and @file{bar.o} are merged into a single image, this +-causes all the inter-procedural analyses and optimizations in GCC to ++causes all the interprocedural analyses and optimizations in GCC to + work across the two files as if they were a single one. This means, +-for example, that the inliner will be able to inline functions in ++for example, that the inliner is able to inline functions in + @file{bar.o} into functions in @file{foo.o} and vice-versa. + +-Another (simpler) way to enable link-time optimization is, ++Another (simpler) way to enable link-time optimization is: + + @smallexample + gcc -o myprog -flto -O2 foo.c bar.c + @end smallexample + +-The above will generate bytecode for @file{foo.c} and @file{bar.c}, +-merge them together into a single GIMPLE representation and optimize ++The above generates bytecode for @file{foo.c} and @file{bar.c}, ++merges them together into a single GIMPLE representation and optimizes + them as usual to produce @file{myprog}. + + The only important thing to keep in mind is that to enable link-time +@@ -7564,30 +7564,22 @@ + To make whole program optimization effective, it is necessary to make + certain whole program assumptions. The compiler needs to know + what functions and variables can be accessed by libraries and runtime +-outside of the link time optimized unit. When supported by the linker, +-the linker plugin (see @option{-fuse-linker-plugin}) passes to the +-compiler information about used and externally visible symbols. When ++outside of the link-time optimized unit. When supported by the linker, ++the linker plugin (see @option{-fuse-linker-plugin}) passes information ++to the compiler about used and externally visible symbols. When + the linker plugin is not available, @option{-fwhole-program} should be +-used to allow the compiler to make these assumptions, which will lead ++used to allow the compiler to make these assumptions, which leads + to more aggressive optimization decisions. + + Note that when a file is compiled with @option{-flto}, the generated +-object file will be larger than a regular object file because it will +-contain GIMPLE bytecodes and the usual final code. This means that +-object files with LTO information can be linked as a normal object +-file. So, in the previous example, if the final link is done with +- +-@smallexample +-gcc -o myprog foo.o bar.o +-@end smallexample +- +-The only difference will be that no inter-procedural optimizations +-will be applied to produce @file{myprog}. The two object files +-@file{foo.o} and @file{bar.o} will be simply sent to the regular +-linker. ++object file is larger than a regular object file because it ++contains GIMPLE bytecodes and the usual final code. This means that ++object files with LTO information can be linked as normal object ++files; if @option{-flto} is not passed to the linker, no ++interprocedural optimizations are applied. + + Additionally, the optimization flags used to compile individual files +-are not necessarily related to those used at link-time. For instance, ++are not necessarily related to those used at link time. For instance, + + @smallexample + gcc -c -O0 -flto foo.c +@@ -7595,37 +7587,42 @@ + gcc -o myprog -flto -O3 foo.o bar.o + @end smallexample + +-This will produce individual object files with unoptimized assembler +-code, but the resulting binary @file{myprog} will be optimized at +-@option{-O3}. Now, if the final binary is generated without +-@option{-flto}, then @file{myprog} will not be optimized. ++This produces individual object files with unoptimized assembler ++code, but the resulting binary @file{myprog} is optimized at ++@option{-O3}. If, instead, the final binary is generated without ++@option{-flto}, then @file{myprog} is not optimized. + +-When producing the final binary with @option{-flto}, GCC will only +-apply link-time optimizations to those files that contain bytecode. ++When producing the final binary with @option{-flto}, GCC only ++applies link-time optimizations to those files that contain bytecode. + Therefore, you can mix and match object files and libraries with +-GIMPLE bytecodes and final object code. GCC will automatically select ++GIMPLE bytecodes and final object code. GCC automatically selects + which files to optimize in LTO mode and which files to link without + further processing. + +-There are some code generation flags that GCC will preserve when ++There are some code generation flags that GCC preserves when + generating bytecodes, as they need to be used during the final link + stage. Currently, the following options are saved into the GIMPLE + bytecode files: @option{-fPIC}, @option{-fcommon} and all the + @option{-m} target flags. + +-At link time, these options are read-in and reapplied. Note that the +-current implementation makes no attempt at recognizing conflicting +-values for these options. If two or more files have a conflicting +-value (e.g., one file is compiled with @option{-fPIC} and another +-isn't), the compiler will simply use the last value read from the +-bytecode files. It is recommended, then, that all the files +-participating in the same link be compiled with the same options. ++At link time, these options are read in and reapplied. Note that the ++current implementation makes no attempt to recognize conflicting ++values for these options. If different files have conflicting option ++values (e.g., one file is compiled with @option{-fPIC} and another ++isn't), the compiler simply uses the last value read from the ++bytecode files. It is recommended, then, that you compile all the files ++participating in the same link with the same options. ++ ++If LTO encounters objects with C linkage declared with incompatible ++types in separate translation units to be linked together (undefined ++behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be ++issued. The behavior is still undefined at runtime. + + Another feature of LTO is that it is possible to apply interprocedural + optimizations on files written in different languages. This requires +-some support in the language front end. Currently, the C, C++ and ++support in the language front end. Currently, the C, C++ and + Fortran front ends are capable of emitting GIMPLE bytecodes, so +-something like this should work ++something like this should work: + + @smallexample + gcc -c -flto foo.c +@@ -7637,49 +7634,43 @@ + Notice that the final link is done with @command{g++} to get the C++ + runtime libraries and @option{-lgfortran} is added to get the Fortran + runtime libraries. In general, when mixing languages in LTO mode, you +-should use the same link command used when mixing languages in a +-regular (non-LTO) compilation. This means that if your build process +-was mixing languages before, all you need to add is @option{-flto} to ++should use the same link command options as when mixing languages in a ++regular (non-LTO) compilation; all you need to add is @option{-flto} to + all the compile and link commands. + +-If LTO encounters objects with C linkage declared with incompatible +-types in separate translation units to be linked together (undefined +-behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be +-issued. The behavior is still undefined at runtime. +- + If object files containing GIMPLE bytecode are stored in a library archive, say + @file{libfoo.a}, it is possible to extract and use them in an LTO link if you +-are using a linker with linker plugin support. To enable this feature, use +-the flag @option{-fuse-linker-plugin} at link-time: ++are using a linker with plugin support. To enable this feature, use ++the flag @option{-fuse-linker-plugin} at link time: + + @smallexample + gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo + @end smallexample + +-With the linker plugin enabled, the linker will extract the needed +-GIMPLE files from @file{libfoo.a} and pass them on to the running GCC ++With the linker plugin enabled, the linker extracts the needed ++GIMPLE files from @file{libfoo.a} and passes them on to the running GCC + to make them part of the aggregated GIMPLE image to be optimized. + +-If you are not using a linker with linker plugin support and/or do not +-enable linker plugin then the objects inside @file{libfoo.a} +-will be extracted and linked as usual, but they will not participate ++If you are not using a linker with plugin support and/or do not ++enable the linker plugin, then the objects inside @file{libfoo.a} ++are extracted and linked as usual, but they do not participate + in the LTO optimization process. + +-Link time optimizations do not require the presence of the whole program to ++Link-time optimizations do not require the presence of the whole program to + operate. If the program does not require any symbols to be exported, it is +-possible to combine @option{-flto} and with @option{-fwhole-program} to allow ++possible to combine @option{-flto} and @option{-fwhole-program} to allow + the interprocedural optimizers to use more aggressive assumptions which may + lead to improved optimization opportunities. + Use of @option{-fwhole-program} is not needed when linker plugin is + active (see @option{-fuse-linker-plugin}). + +-Regarding portability: the current implementation of LTO makes no +-attempt at generating bytecode that can be ported between different ++The current implementation of LTO makes no ++attempt to generate bytecode that is portable between different + types of hosts. The bytecode files are versioned and there is a + strict version check, so bytecode files generated in one version of + GCC will not work with an older/newer version of GCC. + +-Link time optimization does not play well with generating debugging ++Link-time optimization does not work well with generation of debugging + information. Combining @option{-flto} with + @option{-g} is currently experimental and expected to produce wrong + results. +@@ -7693,15 +7684,15 @@ + You can also specify @option{-flto=jobserver} to use GNU make's + job server mode to determine the number of parallel jobs. This + is useful when the Makefile calling GCC is already executing in parallel. +-The parent Makefile will need a @samp{+} prepended to the command recipe +-for this to work. This will likely only work if @env{MAKE} is ++You must prepend a @samp{+} to the command recipe in the parent Makefile ++for this to work. This option likely only works if @env{MAKE} is + GNU make. + + This option is disabled by default. + + @item -flto-partition=@var{alg} + @opindex flto-partition +-Specify the partitioning algorithm used by the link time optimizer. ++Specify the partitioning algorithm used by the link-time optimizer. + The value is either @code{1to1} to specify a partitioning mirroring + the original source files or @code{balanced} to specify partitioning + into equally sized chunks (whenever possible). Specifying @code{none} +@@ -7718,27 +7709,29 @@ + + @item -flto-report + Prints a report with internal details on the workings of the link-time +-optimizer. The contents of this report vary from version to version, +-it is meant to be useful to GCC developers when processing object ++optimizer. The contents of this report vary from version to version. ++It is meant to be useful to GCC developers when processing object + files in LTO mode (via @option{-flto}). + + Disabled by default. + + @item -fuse-linker-plugin +-Enables the use of linker plugin during link time optimization. This option +-relies on the linker plugin support in linker that is available in gold ++Enables the use of a linker plugin during link-time optimization. This ++option relies on the linker plugin support in linker that is available in gold + or in GNU ld 2.21 or newer. + +-This option enables the extraction of object files with GIMPLE bytecode out of +-library archives. This improves the quality of optimization by exposing more +-code the the link time optimizer. This information specify what symbols +-can be accessed externally (by non-LTO object or during dynamic linking). +-Resulting code quality improvements on binaries (and shared libraries that do +-use hidden visibility) is similar to @code{-fwhole-program}. See +-@option{-flto} for a description on the effect of this flag and how to use it. +- +-Enabled by default when LTO support in GCC is enabled and GCC was compiled +-with a linker supporting plugins (GNU ld 2.21 or newer or gold). ++This option enables the extraction of object files with GIMPLE bytecode out ++of library archives. This improves the quality of optimization by exposing ++more code to the link-time optimizer. This information specifies what ++symbols can be accessed externally (by non-LTO object or during dynamic ++linking). Resulting code quality improvements on binaries (and shared ++libraries that use hidden visibility) are similar to @code{-fwhole-program}. ++See @option{-flto} for a description of the effect of this flag and how to ++use it. ++ ++This option is enabled by default when LTO support in GCC is enabled ++and GCC was configured for use with ++a linker supporting plugins (GNU ld 2.21 or newer or gold). + + @item -fcompare-elim + @opindex fcompare-elim +@@ -8732,6 +8725,10 @@ The maximum number of best instructions in the ready list that are considered for renaming in the selective scheduler. The default value is 2. @@ -13,7 +287,7 @@ @item max-last-value-rtl The maximum size measured as number of RTLs that can be recorded in an expression in combiner for a pseudo register as last known value of that register. The default -@@ -8911,6 +8915,11 @@ +@@ -8911,6 +8908,11 @@ The maximum number of namespaces to consult for suggestions when C++ name lookup fails for an identifier. The default is 1000. @@ -25,7 +299,7 @@ @end table @end table -@@ -10201,11 +10210,22 @@ +@@ -10201,11 +10203,22 @@ @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp}, @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s}, @samp{cortex-a5}, @samp{cortex-a8}, @samp{cortex-a9}, @samp{cortex-a15}, @@ -49,7 +323,7 @@ @item -mtune=@var{name} @opindex mtune This option is very similar to the @option{-mcpu=} option, except that -@@ -10217,6 +10237,18 @@ +@@ -10217,6 +10230,18 @@ For some ARM implementations better performance can be obtained by using this option. @@ -68,7 +342,7 @@ @item -march=@var{name} @opindex march This specifies the name of the target ARM architecture. GCC uses this -@@ -10230,6 +10262,11 @@ +@@ -10230,6 +10255,11 @@ @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}. @@ -253,0 +528,23 @@ +--- a/src/gcc/fortran/invoke.texi ++++ b/src/gcc/fortran/invoke.texi +@@ -1438,10 +1438,16 @@ + the real and imaginary parts of local @code{COMPLEX} variables), + @option{-finit-logical=@var{}}, and + @option{-finit-character=@var{n}} (where @var{n} is an ASCII character +-value) options. These options do not initialize components of derived +-type variables, nor do they initialize variables that appear in an +-@code{EQUIVALENCE} statement. (This limitation may be removed in +-future releases). ++value) options. These options do not initialize ++@itemize @bullet ++@item ++allocatable arrays ++@item ++components of derived type variables ++@item ++variables that appear in an @code{EQUIVALENCE} statement. ++@end itemize ++(These limitations may be removed in future releases). + + Note that the @option{-finit-real=nan} option initializes @code{REAL} + and @code{COMPLEX} variables with a quiet NaN. For a signalling NaN diff -u gcc-4.6-4.6.2/debian/patches/svn-updates-linaro.diff gcc-4.6-4.6.2/debian/patches/svn-updates-linaro.diff --- gcc-4.6-4.6.2/debian/patches/svn-updates-linaro.diff +++ gcc-4.6-4.6.2/debian/patches/svn-updates-linaro.diff @@ -1,5554 +1,1736 @@ -# DP: updates from the 4.6 branch upto 20120104 (r182882). +# DP: updates from the 4.6 branch upto 20120120 (r183333). last_updated() { cat > ${dir}LAST_UPDATED <&5 - $as_echo "$acx_cv_cc_gcc_supports_ada" >&6; } - --if test x$GNATBIND != xno && test x$GNATMAKE != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then -+if test "x$GNATBIND" != xno && test "x$GNATMAKE" != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then - have_gnat=yes - else - have_gnat=no -Index: Makefile.in -=================================================================== ---- a/src/Makefile.in (revision -+++ b/src/Makefile.in (revision -@@ -60017,6 +60017,7 @@ - install-gcc: maybe-install-fixincludes - install-gcc: maybe-install-lto-plugin - install-strip-gcc: maybe-install-strip-fixincludes -+install-strip-gcc: maybe-install-strip-lto-plugin - configure-libcpp: configure-libiberty - - configure-stage1-libcpp: configure-stage1-libiberty -Index: libgcc/generic-morestack.c -=================================================================== ---- a/src/libgcc/generic-morestack.c (revision -+++ b/src/libgcc/generic-morestack.c (revision -@@ -459,8 +459,8 @@ - sigemptyset (&__morestack_initial_sp.mask); - - sigfillset (&__morestack_fullmask); --#ifdef __linux__ -- /* On Linux, the first two real time signals are used by the NPTL -+#ifdef __GLIBC__ -+ /* In glibc, the first two real time signals are used by the NPTL - threading library. By taking them out of the set of signals, we - avoiding copying the signal mask in pthread_sigmask. More - importantly, pthread_sigmask uses less stack space on x86_64. */ -Index: libgcc/ChangeLog -=================================================================== ---- a/src/libgcc/ChangeLog (revision -+++ b/src/libgcc/ChangeLog (revision -@@ -1,3 +1,11 @@ -+2011-12-15 H.J. Lu -+ -+ Backport from mainline -+ 2011-12-14 H.J. Lu -+ -+ * generic-morestack.c (__generic_morestack_set_initial_sp): Check -+ __GLIBC__ instead of __linux__ when using __SIGRTMIN. -+ - 2011-11-23 Gerald Pfeifer - - * config.host (*-*-freebsd[12], *-*-freebsd[12].*, -Index: gcc/tree-loop-distribution.c +--- a/src/gcc/DATESTAMP (revision ++++ b/src/gcc/DATESTAMP (revision +@@ -1 +1 @@ +-20120105 ++20120120 +Index: gcc/ChangeLog =================================================================== ---- a/src/gcc/tree-loop-distribution.c (revision -+++ b/src/gcc/tree-loop-distribution.c (revision -@@ -63,6 +63,51 @@ - predecessor a node that writes to memory. */ - static bitmap upstream_mem_writes; - -+/* Returns true when DEF is an SSA_NAME defined in LOOP and used after -+ the LOOP. */ +--- a/src/gcc/ChangeLog (revision ++++ b/src/gcc/ChangeLog (revision +@@ -1,3 +1,119 @@ ++2012-01-19 Quentin Neill + -+static bool -+ssa_name_has_uses_outside_loop_p (tree def, loop_p loop) -+{ -+ imm_use_iterator imm_iter; -+ use_operand_p use_p; ++ PR target/48743 ++ * config/i386/driver-i386.c (host_detect_local_cpu): Also check ++ family to distinguish PROCESSOR_ATHLON. + -+ FOR_EACH_IMM_USE_FAST (use_p, imm_iter, def) -+ if (loop != loop_containing_stmt (USE_STMT (use_p))) -+ return true; ++2012-01-18 Bill Schmidt + -+ return false; -+} ++ PR tree-optimization/49642 ++ * ipa-split.c (forbidden_dominators): New variable. ++ (check_forbidden_calls): New function. ++ (dominated_by_forbidden): Likewise. ++ (consider_split): Check for forbidden dominators. ++ (execute_split_functions): Initialize and free forbidden ++ dominators info; call check_forbidden_calls. + -+/* Returns true when STMT defines a scalar variable used after the -+ loop. */ ++2012-01-18 David Edelsohn + -+static bool -+stmt_has_scalar_dependences_outside_loop (gimple stmt) -+{ -+ tree name; ++ * config/rs6000/rs6000.md (call_value_indirect_aix32): Fix typo ++ in mode of operand[4]. + -+ switch (gimple_code (stmt)) -+ { -+ case GIMPLE_CALL: -+ case GIMPLE_ASSIGN: -+ name = gimple_get_lhs (stmt); -+ break; ++2012-01-15 Uros Bizjak + -+ case GIMPLE_PHI: -+ name = gimple_phi_result (stmt); -+ break; ++ PR rtl-optimization/51821 ++ * recog.c (peep2_find_free_register): Determine clobbered registers ++ from insn pattern. + -+ default: -+ return false; -+ } ++2012-01-12 Georg-Johann Lay + -+ return (name -+ && TREE_CODE (name) == SSA_NAME -+ && ssa_name_has_uses_outside_loop_p (name, -+ loop_containing_stmt (stmt))); -+} ++ Backport from mainline r183129 ++ PR target/51756 ++ * config/avr/avr.c (avr_encode_section_info): Test for absence of ++ DECL_EXTERNAL when checking for initializers of progmem variables. + - /* Update the PHI nodes of NEW_LOOP. NEW_LOOP is a duplicate of - ORIG_LOOP. */ - -@@ -332,10 +377,18 @@ - { - gimple stmt = gsi_stmt (bsi); - -- if (gimple_code (stmt) != GIMPLE_LABEL -- && !is_gimple_debug (stmt) -- && bitmap_bit_p (partition, x++) -- && is_gimple_assign (stmt) -+ if (gimple_code (stmt) == GIMPLE_LABEL -+ || is_gimple_debug (stmt)) -+ continue; -+ -+ if (!bitmap_bit_p (partition, x++)) -+ continue; -+ -+ /* If the stmt has uses outside of the loop fail. */ -+ if (stmt_has_scalar_dependences_outside_loop (stmt)) -+ goto end; ++22012-01-12 Matthew Gretton-Dann + -+ if (is_gimple_assign (stmt) - && !is_gimple_reg (gimple_assign_lhs (stmt))) - { - /* Don't generate the builtins when there are more than -@@ -826,48 +879,6 @@ - } - } - --/* Returns true when DEF is an SSA_NAME defined in LOOP and used after -- the LOOP. */ -- --static bool --ssa_name_has_uses_outside_loop_p (tree def, loop_p loop) --{ -- imm_use_iterator imm_iter; -- use_operand_p use_p; -- -- FOR_EACH_IMM_USE_FAST (use_p, imm_iter, def) -- if (loop != loop_containing_stmt (USE_STMT (use_p))) -- return true; -- -- return false; --} -- --/* Returns true when STMT defines a scalar variable used after the -- loop. */ -- --static bool --stmt_has_scalar_dependences_outside_loop (gimple stmt) --{ -- tree name; -- -- switch (gimple_code (stmt)) -- { -- case GIMPLE_ASSIGN: -- name = gimple_assign_lhs (stmt); -- break; -- -- case GIMPLE_PHI: -- name = gimple_phi_result (stmt); -- break; -- -- default: -- return false; -- } -- -- return TREE_CODE (name) == SSA_NAME -- && ssa_name_has_uses_outside_loop_p (name, loop_containing_stmt (stmt)); --} -- - /* Returns true when STMT will be code generated in a partition of RDG - different than PART and that will not be code generated as a - builtin. */ -Index: gcc/DATESTAMP -=================================================================== ---- a/src/gcc/DATESTAMP (revision -+++ b/src/gcc/DATESTAMP (revision -@@ -1 +1 @@ --20111201 -+20120104 -Index: gcc/ChangeLog -=================================================================== ---- a/src/gcc/ChangeLog (revision -+++ b/src/gcc/ChangeLog (revision -@@ -1,3 +1,314 @@ -+2012-01-04 Richard Guenther ++ Backport from mainline ++ 2012-01-11 Matthew Gretton-Dann + -+ PR tree-optimization/49651 -+ * tree-ssa-structalias.c (type_can_have_subvars): New function. -+ (var_can_have_subvars): Use it. -+ (get_constraint_for_1): Only consider subfields if there -+ can be any. ++ * config/arm/arm.md (mov_notscc): Use MVN for false condition. + -+2012-01-03 Sandra Loosemore ++2012-01-12 Uros Bizjak + -+ Backport from mainline: -+ 2012-01-02 Sandra Loosemore ++ * config/i386/i386.md (*zero_extendsidi2_rex64): Correct movl template. ++ (x86_shift_adj_1): Remove operand constraint from operand 3. + -+ * doc/invoke.texi (-flto and related options): Copy-edit. ++2012-01-10 Joseph Myers + -+2012-01-03 Richard Guenther ++ Revert: + -+ Backport from mainline -+ 2011-11-10 Richard Guenther ++ 2008-09-18 Andrew Pinski ++ ++ PR rtl-opt/37451 ++ * loop-doloop.c (doloop_modify): New argument zero_extend_p and ++ zero extend count after the correction to it is done. ++ (doloop_optimize): Update call to doloop_modify, don't zero extend ++ count before call. + -+ PR tree-optimization/51042 -+ * tree-ssa-pre.c (phi_translate_1): Avoid recursing on -+ self-referential expressions. Refactor code to avoid duplication. ++ 2008-11-03 Andrew Pinski + -+2012-01-03 Richard Guenther ++ PR rtl-opt/37782 ++ * loop-doloop.c (doloop_modify): Add from_mode argument that says what ++ mode count is in. ++ (doloop_optimize): Update call to doloop_modify. + -+ PR tree-optimization/51070 -+ * tree-loop-distribution.c (generate_builtin): Do not replace -+ the loop with a builtin if the partition contains statements which -+ results are used outside of the loop. -+ (stmt_has_scalar_dependences_outside_loop): Properly handle calls. ++2012-01-09 Richard Sandiford + -+2011-12-30 Michael Meissner ++ * config/mips/mips.md (loadgp_newabi_): Add missing earlyclobber. + -+ Backport from the mainline -+ 2011-12-30 Michael Meissner ++2012-01-09 Eric Botcazou + -+ * config/rs6000/rs6000.c (rs6000_inner_target_options): Fix thinko -+ in setting options via target #pragma or attribute. ++ * config/sparc/sol2-unwind.h (sparc64_is_sighandler): Check that the ++ purported sigacthandler address isn't null before dereferencing it. ++ (sparc_is_sighandler): Likewise. + -+2011-12-28 Michael Meissner ++2012-01-09 Ramana Radhakrishnan + + Backport from mainline -+ 2011-12-28 Michael Meissner ++ 2011-11-04 Jiangning Liu + -+ PR target/51623 -+ * config/rs6000/rs6000.c (rs6000_assemble_integer): Don't call -+ unlikely_text_section_p. Instead check for being in a code -+ section. ++ PR rtl-optimization/38644 ++ * config/arm/arm.c (thumb1_expand_epilogue): Add memory barrier ++ for epilogue having stack adjustment. + -+2011-12-23 Richard Guenther ++2012-01-09 Eric Botcazou + -+ PR rtl-optimization/50396 -+ * simplify-rtx.c (simplify_binary_operation_1): Properly -+ guard code that only works for integers. ++ PR ada/41929 ++ * config/sparc/sol2-unwind.h (sparc64_is_sighandler): Remove SAVPC and ++ add CFA. Revert back to old code for Solaris 8+ multi-threaded. ++ (sparc_is_sighandler): Likewise. ++ (MD_FALLBACK_FRAME_STATE_FOR): Adjust call to IS_SIGHANDLER. + -+2011-12-22 Doug Kwan ++2012-01-06 Eric Botcazou + + Backport from mainline -+ 2011-03-23 Julian Brown ++ 2012-01-06 Arnaud Charlet + -+ * expr.c (expand_expr_real_1): Only use BLKmode for volatile -+ accesses which are not naturally aligned. ++ * c-decl.c (ext_block): Moved up. ++ (collect_all_refs, for_each_global_decl): Take ext_block into account. + -+ 2011-11-20 Joey Ye ++2012-01-06 Richard Sandiford + -+ * expr.c (expand_expr_real_1): Correctly handle strict volatile -+ bitfield loads smaller than mode size. ++ PR middle-end/48660 ++ * expr.h (copy_blkmode_to_reg): Declare. ++ * expr.c (copy_blkmode_to_reg): New function. ++ (expand_assignment): Don't expand register RESULT_DECLs before ++ the lhs. Use copy_blkmode_to_reg to copy BLKmode values into a ++ RESULT_DECL register. ++ (expand_expr_real_1): Handle BLKmode decls when looking for promotion. + -+2011-12-21 Richard Earnshaw ++2012-01-05 Eric Botcazou + -+ PR target/51643 -+ * arm.c (arm_function_ok_for_sibcall): Use DECL_WEAK in previous -+ change. ++ PR tree-optimization/51315 ++ * tree-sra.c (tree_non_aligned_mem_for_access_p): New predicate. ++ (build_accesses_from_assign): Use it instead of tree_non_aligned_mem_p. + -+2011-12-21 Richard Earnshaw + 2012-01-04 Eric Botcazou + + PR tree-optimization/51624 +@@ -9,8 +125,7 @@ + PR tree-optimization/49651 + * tree-ssa-structalias.c (type_can_have_subvars): New function. + (var_can_have_subvars): Use it. +- (get_constraint_for_1): Only consider subfields if there +- can be any. ++ (get_constraint_for_1): Only consider subfields if there can be any. + + 2012-01-03 Sandra Loosemore + +@@ -51,8 +166,7 @@ + + PR target/51623 + * config/rs6000/rs6000.c (rs6000_assemble_integer): Don't call +- unlikely_text_section_p. Instead check for being in a code +- section. ++ unlikely_text_section_p. Instead check for being in a code section. + + 2011-12-23 Richard Guenther + +Index: gcc/testsuite/gcc.target/arm/headmerge-2.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/arm/headmerge-2.c (revision ++++ b/src/gcc/testsuite/gcc.target/arm/headmerge-2.c (revision +@@ -1,6 +1,6 @@ + /* { dg-do compile } */ + /* { dg-options "-O2" } */ +-/* { dg-final { scan-assembler-times "120" 1 } } */ ++/* { dg-final { scan-assembler-times "120\n" 1 } } */ + + extern void foo1 (int); + extern void foo2 (int); +Index: gcc/testsuite/gcc.target/arm/stack-red-zone.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/arm/stack-red-zone.c (revision ++++ b/src/gcc/testsuite/gcc.target/arm/stack-red-zone.c (revision +@@ -0,0 +1,12 @@ ++/* No stack red zone. PR38644. */ ++/* { dg-options "-mthumb -O2" } */ ++/* { dg-final { scan-assembler "ldrb\[^\n\]*\\n\[\t \]*add\[\t \]*sp" } } */ + -+ PR target/51643 -+ * arm.c (arm_function_ok_for_sibcall): Don't try to tailcall a -+ weak function on bare-metal EABI targets. ++extern int doStreamReadBlock (int *, char *, int size, int); + -+2011-12-21 Uros Bizjak ++char readStream (int *s) ++{ ++ char c = 0; ++ doStreamReadBlock (s, &c, 1, *s); ++ return c; ++} +Index: gcc/testsuite/gfortran.dg/intrinsic_size_2.f90 +=================================================================== +--- a/src/gcc/testsuite/gfortran.dg/intrinsic_size_2.f90 (revision ++++ b/src/gcc/testsuite/gfortran.dg/intrinsic_size_2.f90 (revision +@@ -0,0 +1,17 @@ ++! { dg-do compile } ++! ++! PR fortran/51904 ++! ++! Contributed by David Sagan. ++! + -+ Backport from mainline -+ 2011-12-21 Richard Guenther ++call qp_draw_polyline_basic([1.0,2.0]) ++contains ++subroutine qp_draw_polyline_basic (x) ++ implicit none ++ real :: x(:), f ++ integer :: i ++ f = 0 ++ print *, size(f*x) ++end subroutine ++end +Index: gcc/testsuite/gfortran.dg/init_flag_9.f90 +=================================================================== +--- a/src/gcc/testsuite/gfortran.dg/init_flag_9.f90 (revision ++++ b/src/gcc/testsuite/gfortran.dg/init_flag_9.f90 (revision +@@ -0,0 +1,15 @@ ++! { dg-do run } ++! { dg-options "-finit-character=89" } ++! ++! PR fortran/51800 ++! + -+ PR lto/41159 -+ * tree-outof-ssa.c (insert_value_copy_on_edge): Use the -+ mode of the pseudo as destination mode. Only assert that -+ is equal to the promoted mode of the decl if it is a REG. ++subroutine foo(n) ++ character(len=n) :: str ++! print *, str ++ if (str /= repeat ('Y', n)) call abort() ++end subroutine foo ++ ++call foo(3) ++call foo(10) ++end +Index: gcc/testsuite/gfortran.dg/init_flag_8.f90 +=================================================================== +--- a/src/gcc/testsuite/gfortran.dg/init_flag_8.f90 (revision ++++ b/src/gcc/testsuite/gfortran.dg/init_flag_8.f90 (revision +@@ -0,0 +1,18 @@ ++! { dg-do compile } ++! { dg-options "-fno-automatic -finit-local-zero" } ++! ++! PR fortran/51800 ++! ++! Contributed by Mario Baumann ++! ++ SUBROUTINE FOO( N, A ) ++ IMPLICIT NONE ++ INTEGER :: N ++ INTEGER :: A(1:N) ++ INTEGER :: J ++ INTEGER :: DUMMY(1:N) ++ DO J=1,N ++ DUMMY(J) = 0 ++ A(J) = DUMMY(J) ++ END DO ++ END SUBROUTINE FOO +Index: gcc/testsuite/gcc.c-torture/execute/doloop-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.c-torture/execute/doloop-1.c (revision ++++ b/src/gcc/testsuite/gcc.c-torture/execute/doloop-1.c (revision +@@ -0,0 +1,18 @@ ++#include + -+2011-12-21 Uros Bizjak ++extern void exit (int); ++extern void abort (void); + -+ * config/alpha/linux-unwind.h: Update copyright years. -+ (MD_FROB_UPDATE_CONTEXT): New define. -+ (alpha_frob_update_context): New function. ++volatile unsigned int i; + -+2011-12-19 Martin Jambor ++int ++main (void) ++{ ++ unsigned char z = 0; + -+ PR tree-optimization/51583 -+ * tree-sra.c (load_assign_lhs_subreplacements): Call -+ force_gimple_operand_gsi when necessary also in case of no -+ corresponding replacement on the RHS. ++ do ++i; ++ while (--z > 0); ++ if (i != UCHAR_MAX + 1U) ++ abort (); ++ exit (0); ++} +Index: gcc/testsuite/gcc.c-torture/execute/20120111-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.c-torture/execute/20120111-1.c (revision ++++ b/src/gcc/testsuite/gcc.c-torture/execute/20120111-1.c (revision +@@ -0,0 +1,18 @@ ++#include ++#include + -+2011-12-16 Eric Botcazou ++uint32_t f0a (uint64_t arg2) __attribute__((noinline)); + -+ * config/sparc/sparc.md (UNSPEC_FRAME_BLOCKAGE): New constant. -+ (frame_blockage): New expander. -+ (frame_blockage): New instruction. -+ * config/sparc/sparc.c (sparc_expand_prologue): When the sequence of -+ instructions establishing the frame isn't atomic, emit frame blockage. ++uint32_t ++f0a (uint64_t arg) ++{ ++ return ~(arg > -3); ++} + -+2011-12-15 H.J. Lu ++int main() { ++ uint32_t r1; ++ r1 = f0a (12094370573988097329ULL); ++ if (r1 != ~0U) ++ abort (); ++ return 0; ++} +Index: gcc/testsuite/gcc.c-torture/execute/20120105-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.c-torture/execute/20120105-1.c (revision ++++ b/src/gcc/testsuite/gcc.c-torture/execute/20120105-1.c (revision +@@ -0,0 +1,24 @@ ++struct __attribute__((packed)) S ++{ ++ int a, b, c; ++}; + -+ Backport from mainline. -+ 2011-10-28 Chung-Lin Tang ++static int __attribute__ ((noinline,noclone)) ++extract(const char *p) ++{ ++ struct S s; ++ __builtin_memcpy (&s, p, sizeof(struct S)); ++ return s.a; ++} + -+ PR rtl-optimization/49720 -+ * simplify-rtx.c (simplify_relational_operation_1): Detect -+ infinite recursion condition in "(eq/ne (plus x cst1) cst2) -+ simplifies to (eq/ne x (cst2 - cst1))" case. ++volatile int i; + -+2011-12-15 Andreas Tobler ++int main (void) ++{ ++ char p[sizeof(struct S) + 1]; + -+ Backport from mainline. -+ 2011-12-15 Andreas Tobler ++ __builtin_memset (p, 0, sizeof(struct S) + 1); ++ i = extract (p + 1); + -+ * config/i386/freebsd.h (TARGET_ASM_FILE_END): Define. ++ return 0; ++} +Index: gcc/testsuite/gcc.c-torture/execute/doloop-2.c +=================================================================== +--- a/src/gcc/testsuite/gcc.c-torture/execute/doloop-2.c (revision ++++ b/src/gcc/testsuite/gcc.c-torture/execute/doloop-2.c (revision +@@ -0,0 +1,18 @@ ++#include + -+2011-12-13 Eric Botcazou ++extern void exit (int); ++extern void abort (void); + -+ * lto-streamer-out.c (write_symbol): Use proper 64-bit host type. -+ * lto-cgraph.c (input_cgraph_opt_section): Use 'int' for offsets. -+ * lto-streamer-in.c (lto_read_body): Likewise. -+ (lto_input_toplevel_asms): Likewise. -+ * lto-section-in.c (lto_create_simple_input_block): Likewise. -+ * lto-opts.c (lto_read_file_options): Likewise. -+ * ipa-prop.c (ipa_prop_read_section): Likewise. ++volatile unsigned int i; + -+ * df.h (DF_NOTE): Fix typo in comment. ++int ++main (void) ++{ ++ unsigned short z = 0; + -+2011-12-13 Andreas Krebbel ++ do ++i; ++ while (--z > 0); ++ if (i != USHRT_MAX + 1U) ++ abort (); ++ exit (0); ++} +Index: gcc/testsuite/gcc.dg/pr51821.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/pr51821.c (revision ++++ b/src/gcc/testsuite/gcc.dg/pr51821.c (revision +@@ -0,0 +1,25 @@ ++/* { dg-do run } */ ++/* { dg-options "-std=c99 -O2" } */ ++/* { dg-options "-std=c99 -O2 -msse" { target { i?86-*-* x86_64-*-* } } } */ ++/* { dg-require-effective-target sse_runtime { target { i?86-*-* x86_64-*-* } } } */ + -+ * regmove.c (fixup_match_2): Only access call_used_regs with hard -+ regs. ++extern void abort (void); + -+2011-12-12 Jakub Jelinek ++unsigned int __attribute__((noinline)) ++test (int shift_size) ++{ ++ unsigned long long res = ~0; + -+ PR middle-end/51510 -+ * calls.c (internal_arg_pointer_based_exp_scan): Don't use -+ VEC_safe_grow_cleared if idx is smaller than VEC_length. ++ return res << shift_size; ++} + -+ Backported from mainline -+ 2011-12-11 Jakub Jelinek ++int ++main () ++{ ++ int dst = 32; + -+ PR tree-optimization/51485 -+ * tree-vect-data-refs.c (vect_analyze_data_refs): Give up on -+ DRs in call stmts. ++ if (test (dst) != 0) ++ abort (); + -+2011-12-12 Eric Botcazou ++ return 0; ++} +Index: gcc/testsuite/gcc.dg/tree-ssa/pr49642.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/tree-ssa/pr49642.c (revision ++++ b/src/gcc/testsuite/gcc.dg/tree-ssa/pr49642.c (revision +@@ -0,0 +1,49 @@ ++/* Verify that ipa-split is disabled following __builtin_constant_p. */ + -+ PR tree-optimization/50569 -+ * tree-sra.c (build_ref_for_model): Replicate a chain of COMPONENT_REFs -+ in the expression of MODEL instead of just the last one. ++/* { dg-do compile } */ ++/* { dg-options "-O2 -fdump-tree-optimized" } */ + -+2011-12-09 Michael Meissner ++typedef unsigned int u32; ++typedef unsigned long long u64; + -+ Backport from mainline -+ 2011-12-09 Michael Meissner ++static inline __attribute__((always_inline)) __attribute__((const)) ++int __ilog2_u32(u32 n) ++{ ++ int bit; ++ asm ("cntlzw %0,%1" : "=r" (bit) : "r" (n)); ++ return 31 - bit; ++} + -+ PR rtl-optimization/51469 -+ * varasm.c (default_binds_local_p_1): If the symbol is a gnu -+ indirect function, mark the symbol as non-local. + -+2011-12-09 Jakub Jelinek ++static inline __attribute__((always_inline)) __attribute__((const)) ++int __ilog2_u64(u64 n) ++{ ++ int bit; ++ asm ("cntlzd %0,%1" : "=r" (bit) : "r" (n)); ++ return 63 - bit; ++} + -+ Backport from mainline -+ 2011-12-08 Jakub Jelinek + -+ PR tree-optimization/51466 -+ * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Also copy -+ TREE_SIDE_EFFECTS. + -+ 2011-11-28 Jakub Jelinek ++static u64 ehca_map_vaddr(void *caddr); + -+ PR tree-optimization/50078 -+ * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Copy over -+ TREE_THIS_VOLATILE also from the old to new lhs resp. rhs. ++struct ehca_shca { ++ u32 hca_cap_mr_pgsize; ++}; + -+2011-12-09 Kazu Hirata ++static u64 ehca_get_max_hwpage_size(struct ehca_shca *shca) ++{ ++ return 1UL << ( __builtin_constant_p(shca->hca_cap_mr_pgsize) ? ( (shca->hca_cap_mr_pgsize) < 1 ? ____ilog2_NaN() : (shca->hca_cap_mr_pgsize) & (1ULL << 63) ? 63 : (shca->hca_cap_mr_pgsize) & (1ULL << 62) ? 62 : (shca->hca_cap_mr_pgsize) & (1ULL << 61) ? 61 : (shca->hca_cap_mr_pgsize) & (1ULL << 60) ? 60 : (shca->hca_cap_mr_pgsize) & (1ULL << 59) ? 59 : (shca->hca_cap_mr_pgsize) & (1ULL << 58) ? 58 : (shca->hca_cap_mr_pgsize) & (1ULL << 57) ? 57 : (shca->hca_cap_mr_pgsize) & (1ULL << 56) ? 56 : (shca->hca_cap_mr_pgsize) & (1ULL << 55) ? 55 : (shca->hca_cap_mr_pgsize) & (1ULL << 54) ? 54 : (shca->hca_cap_mr_pgsize) & (1ULL << 53) ? 53 : (shca->hca_cap_mr_pgsize) & (1ULL << 52) ? 52 : (shca->hca_cap_mr_pgsize) & (1ULL << 51) ? 51 : (shca->hca_cap_mr_pgsize) & (1ULL << 50) ? 50 : (shca->hca_cap_mr_pgsize) & (1ULL << 49) ? 49 : (shca->hca_cap_mr_pgsize) & (1ULL << 48) ? 48 : (shca->hca_cap_mr_pgsize) & (1ULL << 47) ? 47 : (shca->hca_cap_mr_pgsize) & (1ULL << 46) ? 46 : (shca->hca_cap_mr_pgsize) & (1ULL << 45) ? 45 : (shca->hca_cap_mr_pgsize) & (1ULL << 44) ? 44 : (shca->hca_cap_mr_pgsize) & (1ULL << 43) ? 43 : (shca->hca_cap_mr_pgsize) & (1ULL << 42) ? 42 : (shca->hca_cap_mr_pgsize) & (1ULL << 41) ? 41 : (shca->hca_cap_mr_pgsize) & (1ULL << 40) ? 40 : (shca->hca_cap_mr_pgsize) & (1ULL << 39) ? 39 : (shca->hca_cap_mr_pgsize) & (1ULL << 38) ? 38 : (shca->hca_cap_mr_pgsize) & (1ULL << 37) ? 37 : (shca->hca_cap_mr_pgsize) & (1ULL << 36) ? 36 : (shca->hca_cap_mr_pgsize) & (1ULL << 35) ? 35 : (shca->hca_cap_mr_pgsize) & (1ULL << 34) ? 34 : (shca->hca_cap_mr_pgsize) & (1ULL << 33) ? 33 : (shca->hca_cap_mr_pgsize) & (1ULL << 32) ? 32 : (shca->hca_cap_mr_pgsize) & (1ULL << 31) ? 31 : (shca->hca_cap_mr_pgsize) & (1ULL << 30) ? 30 : (shca->hca_cap_mr_pgsize) & (1ULL << 29) ? 29 : (shca->hca_cap_mr_pgsize) & (1ULL << 28) ? 28 : (shca->hca_cap_mr_pgsize) & (1ULL << 27) ? 27 : (shca->hca_cap_mr_pgsize) & (1ULL << 26) ? 26 : (shca->hca_cap_mr_pgsize) & (1ULL << 25) ? 25 : (shca->hca_cap_mr_pgsize) & (1ULL << 24) ? 24 : (shca->hca_cap_mr_pgsize) & (1ULL << 23) ? 23 : (shca->hca_cap_mr_pgsize) & (1ULL << 22) ? 22 : (shca->hca_cap_mr_pgsize) & (1ULL << 21) ? 21 : (shca->hca_cap_mr_pgsize) & (1ULL << 20) ? 20 : (shca->hca_cap_mr_pgsize) & (1ULL << 19) ? 19 : (shca->hca_cap_mr_pgsize) & (1ULL << 18) ? 18 : (shca->hca_cap_mr_pgsize) & (1ULL << 17) ? 17 : (shca->hca_cap_mr_pgsize) & (1ULL << 16) ? 16 : (shca->hca_cap_mr_pgsize) & (1ULL << 15) ? 15 : (shca->hca_cap_mr_pgsize) & (1ULL << 14) ? 14 : (shca->hca_cap_mr_pgsize) & (1ULL << 13) ? 13 : (shca->hca_cap_mr_pgsize) & (1ULL << 12) ? 12 : (shca->hca_cap_mr_pgsize) & (1ULL << 11) ? 11 : (shca->hca_cap_mr_pgsize) & (1ULL << 10) ? 10 : (shca->hca_cap_mr_pgsize) & (1ULL << 9) ? 9 : (shca->hca_cap_mr_pgsize) & (1ULL << 8) ? 8 : (shca->hca_cap_mr_pgsize) & (1ULL << 7) ? 7 : (shca->hca_cap_mr_pgsize) & (1ULL << 6) ? 6 : (shca->hca_cap_mr_pgsize) & (1ULL << 5) ? 5 : (shca->hca_cap_mr_pgsize) & (1ULL << 4) ? 4 : (shca->hca_cap_mr_pgsize) & (1ULL << 3) ? 3 : (shca->hca_cap_mr_pgsize) & (1ULL << 2) ? 2 : (shca->hca_cap_mr_pgsize) & (1ULL << 1) ? 1 : (shca->hca_cap_mr_pgsize) & (1ULL << 0) ? 0 : ____ilog2_NaN() ) : (sizeof(shca->hca_cap_mr_pgsize) <= 4) ? __ilog2_u32(shca->hca_cap_mr_pgsize) : __ilog2_u64(shca->hca_cap_mr_pgsize) ); ++} + -+ Backport from mainline: ++int x(struct ehca_shca *shca) { ++ return ehca_get_max_hwpage_size(shca); ++} + -+ 2011-12-05 Kazu Hirata ++int y(struct ehca_shca *shca) ++{ ++ return ehca_get_max_hwpage_size(shca); ++} + -+ PR target/51408 -+ * config/arm/arm.md (*minmax_arithsi): Always require the else -+ clause in the MINUS case. ++/* { dg-final { scan-tree-dump-times "____ilog2_NaN" 0 "optimized" } } */ ++/* { dg-final { cleanup-tree-dump "optimized" } } */ +Index: gcc/testsuite/ada/acats/overflow.lst +=================================================================== +--- a/src/gcc/testsuite/ada/acats/overflow.lst (revision ++++ b/src/gcc/testsuite/ada/acats/overflow.lst (revision +@@ -14,3 +14,4 @@ + c460008 + c460011 + c4a012b ++cb20004 +Index: gcc/testsuite/ChangeLog +=================================================================== +--- a/src/gcc/testsuite/ChangeLog (revision ++++ b/src/gcc/testsuite/ChangeLog (revision +@@ -1,3 +1,90 @@ ++2012-01-20 Kai Tietz + -+2011-12-08 Teresa Johnson ++ * g++.dg/torture/pr51344.C: Fix typo. + -+ Backport from mainline: ++2012-01-19 Kai Tietz + -+ 2011-08-05 Uros Bizjak ++ * g++.dg/torture/pr51344.C: New test. + -+ * config/i386/i386.md (*movdi_internal_rex64): Use "!o" constraint -+ instead of "!m" for operand 0, alternative 4. -+ (*movdf_internal_rex64): Ditto for operand 0, alernative 6. ++2012-01-19 Tobias Burnus + -+2011-12-08 Jakub Jelinek ++ PR fortran/51904 ++ * gfortran.dg/intrinsic_size_2.f90: New. + -+ Backport from mainline -+ 2011-12-05 Jakub Jelinek ++2012-01-18 Bill Schmidt + -+ PR debug/51410 -+ * c-decl.c (pop_scope): Don't add DECL_EXTERNAL decls -+ for debug info if scope is file_scope. -+ -+ PR c/51339 -+ * c-decl.c (c_finish_incomplete_decl, finish_decl): Call -+ relayout_decl instead of layout_decl. -+ -+ 2011-12-05 Jakub Jelinek -+ Eric Botcazou -+ -+ PR middle-end/51323 -+ PR middle-end/50074 -+ * calls.c (internal_arg_pointer_exp_state): New variable. -+ (internal_arg_pointer_based_exp_1, -+ internal_arg_pointer_exp_scan): New functions. -+ (internal_arg_pointer_based_exp): New function. -+ (mem_overlaps_already_clobbered_arg_p): Use it. -+ (expand_call): Free internal_arg_pointer_exp_state.cache vector -+ and clear internal_arg_pointer_exp_state.scan_start. -+ -+ 2011-11-30 Jakub Jelinek -+ -+ PR rtl-optimization/48721 -+ * sched-deps.c (sched_analyze_insn): For SIBLING_CALL_P set -+ reg_pending_barrier to TRUE_BARRIER. -+ -+ 2011-11-26 Joern Rennecke -+ -+ PR middle-end/50074 -+ * calls.c (mem_overlaps_already_clobbered_arg_p): -+ Return false if no outgoing arguments have been stored so far. ++ PR tree-optimization/49642 ++ * gcc.dg/tree-ssa/pr49642.c: New test. + -+2011-12-08 Eric Botcazou ++2012-01-16 Jason Merrill + -+ PR tree-optimization/51315 -+ * tree-sra.c (tree_non_mode_aligned_mem_p): Rename to... -+ (tree_non_aligned_mem_p): ...this. Add ALIGN parameter. Look into -+ MEM_REFs and use get_object_or_type_alignment for them. -+ (build_accesses_from_assign): Adjust for above change. -+ (access_precludes_ipa_sra_p): Likewise. ++ PR c++/51854 ++ * g++.dg/abi/mangle60.C: New. + -+2011-12-06 Martin Jambor ++ PR c++/51868 ++ * g++.dg/cpp0x/rv-bitfield.C: New. ++ * g++.dg/cpp0x/rv-bitfield2.C: New. + -+ Backport from mainline: ++2012-01-15 Uros Bizjak + -+ 2011-12-02 Martin Jambor ++ PR rtl-optimization/51821 ++ * gcc.dg/pr51821.c: New test. + -+ PR tree-optimization/50622 -+ * tree-sra.c (load_assign_lhs_subreplacements): Force gimple operand -+ if both lacc and racc are grp_partial_lhs. -+ -+2011-12-06 Iain Sandoe -+ -+ * config/rs6000/rs6000.c (darwin_rs6000_override_options): Initialize -+ rs6000_current_abi. -+ -+2011-12-06 Alan Modra -+ -+ PR target/50906 -+ * config/rs6000/rs6000.c (rs6000_emit_prologue ): -+ Do not mark r11 setup as frame-related. Pass correct offset to -+ rs6000_emit_savres_rtx. Correct out-of-line rs6000_frame_related -+ arguments. Correct sp_offset. Remove "offset" fudge from -+ in-line rs6000_frame_related call. Rename misleading variable. -+ Fix comments and whitespace. Tidy some expressions. -+ (rs6000_emit_epilogue ): Always set frame_reg_rtx -+ to r11 in out-of-line case. Correct sp_offset. Pass correct -+ offset to rs6000_emit_savres_rtx. Rename misleading variable. -+ Fix comments and whitespace. Tidy some expressions. -+ (rs6000_emit_epilogue ): Add sp_offset -+ adjustment when !saving_GPRs_inline. Correct register mode -+ used in address calcs. -+ (rs6000_emit_epilogue ): Similarly when -+ !restoring_GPRs_inline. -+ -+2011-12-04 Jérémie Detrey -+ -+ PR target/51393 -+ * config/i386/avxintrin.h (_mm256_insert_epi64): Declare second -+ parameter as long long. -+ -+2011-12-02 Georg-Johann Lay -+ -+ PR target/51002 -+ PR target/51345 -+ * config/avr/libgcc.S (__prologue_saves__, __epilogue_restores__): -+ Enclose parts using __SP_H__ in !defined (__AVR_HAVE_8BIT_SP__). -+ Add FIXME comments. -+ * config/avr/avr.md (movhi_sp_r_irq_off, movhi_sp_r_irq_on): Set -+ insn condition to !AVR_HAVE_8BIT_SP. -+ * config/avr/avr.c (output_movhi): "clr%B0" instead of "in -+ %B0,__SP_H__" if AVR_HAVE_8BIT_SP. -+ (avr_file_start): Only print "__SP_H__ = 0x3e" if !AVR_HAVE_8BIT_SP. -+ * config/avr/avr-devices.c (avr_mcu_types): ATtiny4313 and -+ AT86RF401 have a 16-bit SP (their manual is bogus). -+ - 2011-11-25 Richard Sandiford - - Backport from mainline: -@@ -415,7 +726,7 @@ - * config/rs6000/rs6000.md (probe_stack): Use explicit operand. - * config/rs6000/rs6000.c (output_probe_stack_range): Likewise. - --2011-09-14 Diego Novillo -+2011-09-14 Diego Novillo - - * tree-vect-stmts.c (vect_transform_stmt): Remove unused - local variable ORIG_SCALAR_STMT. -Index: gcc/testsuite/gcc.target/arm/sibcall-2.c -=================================================================== ---- a/src/gcc/testsuite/gcc.target/arm/sibcall-2.c (revision -+++ b/src/gcc/testsuite/gcc.target/arm/sibcall-2.c (revision -@@ -0,0 +1,12 @@ -+/* { dg-require-effective-target arm_eabi } */ -+/* { dg-do compile } */ -+/* { dg-options "-O2 -mabi=aapcs" } */ ++2012-01-14 Tobias Burnus + ++ Backported from mainline ++ 2012-01-14 Tobias Burnus + -+extern void __attribute__((weak)) wfunc(void); -+void main(void) -+{ -+ wfunc(); /* Must not tail-call. */ -+} ++ PR fortran/51800 ++ * gfortran.dg/init_flag_8.f90: New. ++ * gfortran.dg/init_flag_9.f90: New. + -+/* { dg-final { scan-assembler-not "b\[\\t \]+wfunc" } } */ -Index: gcc/testsuite/gcc.target/powerpc/pr51623.c -=================================================================== ---- a/src/gcc/testsuite/gcc.target/powerpc/pr51623.c (revision -+++ b/src/gcc/testsuite/gcc.target/powerpc/pr51623.c (revision -@@ -0,0 +1,123 @@ -+/* PR target/51623 */ -+/* { dg-do compile { target { { powerpc*-*-linux* && ilp32 } || { powerpc-*-eabi* } } } } */ -+/* { dg-options "-mrelocatable -ffreestanding" } */ -+ -+/* This generated an error, since the compiler was calling -+ unlikely_text_section_p in a context where it wasn't valid. */ -+ -+typedef long long loff_t; -+typedef unsigned size_t; -+ -+ -+struct mtd_info { -+ unsigned writesize; -+ unsigned oobsize; -+ const char *name; -+}; ++2012-01-12 Matthew Gretton-Dann + -+extern int strcmp(const char *,const char *); -+extern char * strchr(const char *,int); ++ Backport from mainline: ++ 2012-01-11 Matthew Gretton-Dann + -+struct cmd_tbl_s { -+ char *name; -+}; ++ * testsuite/gcc.c-torture/execute/20120110-1.c: New testcase. + ++2012-01-10 Joseph Myers + -+int printf(const char *fmt, ...) __attribute__ ((format (__printf__, 1, 2))); -+void* malloc(size_t); -+void free(void*); ++ * gcc.c-torture/execute/doloop-1.c, ++ gcc.c-torture/execute/doloop-2.c: New tests. + ++2012-01-09 Martin Jambor + -+extern int nand_curr_device; -+extern struct mtd_info nand_info[]; ++ PR tree-optimization/51759 ++ * g++.dg/ipa/pr51759.C: New test. + -+static int nand_dump(struct mtd_info *nand, unsigned long off, int only_oob) -+{ -+ int i; -+ unsigned char *datbuf, *oobbuf, *p; ++2012-01-09 Ramana Radhakrishnan + -+ datbuf = malloc(nand->writesize + nand->oobsize); -+ oobbuf = malloc(nand->oobsize); -+ off &= ~(nand->writesize - 1); -+ -+ printf("Page %08lx dump:\n", off); -+ i = nand->writesize >> 4; -+ p = datbuf; -+ -+ while (i--) { -+ if (!only_oob) -+ printf("\t%02x %02x %02x %02x %02x %02x %02x %02x" -+ " %02x %02x %02x %02x %02x %02x %02x %02x\n", -+ p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], -+ p[8], p[9], p[10], p[11], p[12], p[13], p[14], -+ p[15]); -+ p += 16; -+ } ++ Backport from mainline: ++ 2011-11-04 Jiangning Liu + -+ i = nand->oobsize >> 3; -+ free(datbuf); -+ free(oobbuf); ++ PR rtl-optimization/38644 ++ * gcc.target/arm/stack-red-zone.c: New. + -+ return 0; -+} ++2012-01-09 Andrew Stubbs + -+int do_nand(struct cmd_tbl_s * cmdtp, int flag, int argc, char *argv[]) -+{ -+ int dev; -+ unsigned long off; -+ char *cmd, *s; -+ struct mtd_info *nand; -+ -+ if (argc < 2) -+ goto usage; -+ -+ cmd = argv[1]; -+ -+ if (strcmp(cmd, "info") == 0) { -+ putc('\n'); -+ return 0; -+ } ++ Backport from mainline: + -+ if (strcmp(cmd, "device") == 0) { -+ if (argc < 3) { -+ putc('\n'); -+ } -+ dev = (int)simple_strtoul(argv[2], ((void *)0), 10); -+ nand_curr_device = dev; -+ return 0; -+ } ++ 2012-01-06 Andrew Stubbs + -+ if (strcmp(cmd, "bad") != 0 && strcmp(cmd, "erase") != 0 ) -+ goto usage; -+ -+ if (nand_curr_device < 0 ) { -+ return 1; -+ } -+ nand = &nand_info[nand_curr_device]; ++ * gcc.target/arm/headmerge-2.c: Adjust scan pattern. + -+ if (strcmp(cmd, "erase") == 0 || strcmp(cmd, "scrub") == 0) { -+ int clean = argc > 2 && !strcmp("clean", argv[2]); -+ int scrub = !strcmp(cmd, "scrub"); -+ return 0; -+ } ++2012-01-06 Richard Sandiford + -+ if (strncmp(cmd, "dump", 4) == 0) { -+ if (argc < 3) -+ goto usage; -+ -+ s = strchr(cmd, '.'); -+ off = (int)simple_strtoul(argv[2], ((void *)0), 16); -+ -+ if (s != ((void *)0) && strcmp(s, ".oob") == 0) -+ nand_dump(nand, off, 1); -+ else -+ nand_dump(nand, off, 0); -+ -+ return 0; -+ } -+usage: -+ cmd_usage(cmdtp); -+ return 1; -+} ++ PR middle-end/48660 ++ * g++.dg/pr48660.C: New test. ++ ++2012-01-06 Eric Botcazou ++ ++ * ada/acats/overflow.lst: Add cb20004. ++ ++2012-01-05 Eric Botcazou + -+void *ptr = do_nand; -Index: gcc/testsuite/gcc.target/i386/pr51393.c ++ * gcc.c-torture/execute/20120104-1.c: New test. ++ + 2012-01-04 Richard Guenther + + PR tree-optimization/49651 +Index: gcc/testsuite/g++.dg/pr48660.C =================================================================== ---- a/src/gcc/testsuite/gcc.target/i386/pr51393.c (revision -+++ b/src/gcc/testsuite/gcc.target/i386/pr51393.c (revision +--- a/src/gcc/testsuite/g++.dg/pr48660.C (revision ++++ b/src/gcc/testsuite/g++.dg/pr48660.C (revision @@ -0,0 +1,22 @@ -+/* { dg-do run } */ -+/* { dg-require-effective-target avx } */ -+/* { dg-require-effective-target lp64 } */ -+/* { dg-options "-O -mavx" } */ ++template struct val { char a[N]; }; + -+#include "avx-check.h" -+#include ++class Base ++{ ++public: ++ virtual val<1> get1() const = 0; ++ virtual val<2> get2() const = 0; ++ virtual val<3> get3() const = 0; ++ virtual val<4> get4() const = 0; ++}; + -+static void -+__attribute__((noinline)) -+avx_test (void) ++class Derived : public virtual Base +{ -+ long long in = 0x800000000ll; -+ long long out; ++public: ++ virtual val<1> get1() const { return foo->get1(); } ++ virtual val<2> get2() const { return foo->get2(); } ++ virtual val<3> get3() const { return foo->get3(); } ++ virtual val<4> get4() const { return foo->get4(); } ++ Base *foo; ++}; + -+ __m256i zero = _mm256_setzero_si256(); -+ __m256i tmp = _mm256_insert_epi64 (zero, in, 0); -+ out = _mm256_extract_epi64(tmp, 0); ++Base* make() { return new Derived; } +Index: gcc/testsuite/g++.dg/abi/mangle60.C +=================================================================== +--- a/src/gcc/testsuite/g++.dg/abi/mangle60.C (revision ++++ b/src/gcc/testsuite/g++.dg/abi/mangle60.C (revision +@@ -0,0 +1,21 @@ ++// PR c++/51854 ++// { dg-options "" } ++// { dg-excess-errors "" { xfail *-*-* } } ++ ++template struct A; ++ ++template ++char foo(U, V); ++ ++// { dg-final { scan-assembler "_Z3barIiEvP1AIXszcl3foocvT__ELCi0_42EEEE" } } ++template ++void bar(A *); ++ ++// { dg-final { scan-assembler "_Z3bazIiEvP1AIXszcl3foocvT__ELCf00000000_00000000EEEE" } } ++template ++void baz(A *); + -+ if (in != out) -+ abort (); ++int main() { ++ bar(0); ++ baz(0); +} -Index: gcc/testsuite/gcc.target/i386/pr48721.c +Index: gcc/testsuite/g++.dg/cpp0x/rv-bitfield2.C =================================================================== ---- a/src/gcc/testsuite/gcc.target/i386/pr48721.c (revision -+++ b/src/gcc/testsuite/gcc.target/i386/pr48721.c (revision -@@ -0,0 +1,51 @@ -+/* PR rtl-optimization/48721 */ -+/* { dg-do compile } */ -+/* { dg-options "-O -foptimize-sibling-calls -fsched2-use-superblocks -fschedule-insns2 -mtune=core2" } */ +--- a/src/gcc/testsuite/g++.dg/cpp0x/rv-bitfield2.C (revision ++++ b/src/gcc/testsuite/g++.dg/cpp0x/rv-bitfield2.C (revision +@@ -0,0 +1,17 @@ ++// PR c++/51868 ++// { dg-options -std=c++0x } + -+extern unsigned char a[]; -+extern int b[], d[], e[], f[], g[], *h[], m[], *n[], o[]; -+extern char c[]; ++struct A { ++ A() {} ++ A(const A&) {} ++ A(A&&) {} ++}; + -+struct S -+{ -+ unsigned char s1; -+ int s2, s3, s4, s5, s6, s7, s8; ++struct B { ++ A a; ++ int f : 1; +}; + -+__attribute__((noinline, noclone)) int -+foo (int x) -+{ -+ return 0; ++B func() { ++ return B(); +} +Index: gcc/testsuite/g++.dg/cpp0x/rv-bitfield.C +=================================================================== +--- a/src/gcc/testsuite/g++.dg/cpp0x/rv-bitfield.C (revision ++++ b/src/gcc/testsuite/g++.dg/cpp0x/rv-bitfield.C (revision +@@ -0,0 +1,12 @@ ++// { dg-options -std=c++0x } + -+int -+bar (int x, struct S *y) ++struct A +{ -+ int z; -+ switch (x) -+ { -+ case 1: -+ case 2: -+ { -+ int t2, t4, t5, t6, t7, t8; -+ z = o[y->s8 * 6]; -+ t8 = *n[m[x] * 5]; -+ t4 = *h[y->s7]; -+ t7 = z; -+ z = g[f[x] + y->s6]; -+ t6 = e[y->s5]; -+ t5 = d[c[x] + y->s3 * 17]; -+ if (z) -+ t2 = b[z]; -+ if (a[z] != y->s1) -+ return foo (x); -+ y->s8 = t8; -+ y->s4 = t4; -+ y->s7 = t7; -+ y->s6 = t6; -+ y->s5 = t5; -+ y->s2 = t2; -+ } -+ } -+ return 0; ++ int i : 1; ++}; ++ ++int main() ++{ ++ A a; ++ static_cast(a.i); +} -Index: gcc/testsuite/gcc.target/i386/movdi-rex64.c +Index: gcc/testsuite/g++.dg/torture/pr51344.C =================================================================== ---- a/src/gcc/testsuite/gcc.target/i386/movdi-rex64.c (revision -+++ b/src/gcc/testsuite/gcc.target/i386/movdi-rex64.c (revision +--- a/src/gcc/testsuite/g++.dg/torture/pr51344.C (revision ++++ b/src/gcc/testsuite/g++.dg/torture/pr51344.C (revision @@ -0,0 +1,11 @@ -+/* { dg-do compile { target *-*-linux* } } */ -+/* { dg-options "-fPIE" } */ ++/* { dg-do compile } */ ++class A; + -+char *strcpy (char *dest, const char *src); ++template ++class B ++{ ++ friend __attribute__((cdecl)) A& operator >>(A& a, B& b) ++ { ++ return a; ++ } ++}; +Index: gcc/testsuite/g++.dg/ipa/pr51759.C +=================================================================== +--- a/src/gcc/testsuite/g++.dg/ipa/pr51759.C (revision ++++ b/src/gcc/testsuite/g++.dg/ipa/pr51759.C (revision +@@ -0,0 +1,26 @@ ++/* { dg-do run } */ ++/* { dg-options "-O2" } */ + -+static __thread char buffer[25]; -+const char * error_message (void) ++extern "C" void abort (void); ++struct S ++{ ++ void __attribute__((noinline)) set(unsigned val) ++ { ++ data = val; ++ if (data != val) ++ abort (); ++ } ++ int pad0; ++ unsigned pad1 : 8; ++ unsigned data : 24; ++ int pad2; ++}; ++int main() +{ -+ strcpy (buffer, "Unknown code "); -+ return 0; ++ S s; ++ s.pad2 = -1; ++ s.set(0); ++ if (s.pad2 != -1) ++ abort (); +} -Index: gcc/testsuite/lib/gcc-dg.exp ++ +Index: gcc/cp/typeck.c =================================================================== ---- a/src/gcc/testsuite/lib/gcc-dg.exp (revision -+++ b/src/gcc/testsuite/lib/gcc-dg.exp (revision -@@ -565,6 +565,24 @@ +--- a/src/gcc/cp/typeck.c (revision ++++ b/src/gcc/cp/typeck.c (revision +@@ -5696,11 +5696,12 @@ + { + tree intype; + tree result; ++ cp_lvalue_kind clk; + + /* Assume the cast is valid. */ + *valid_p = true; + +- intype = TREE_TYPE (expr); ++ intype = unlowered_expr_type (expr); + + /* Save casted types in the function's used types hash table. */ + used_types_insert (type); +@@ -5766,22 +5767,29 @@ + cv2 T2 if cv2 T2 is reference-compatible with cv1 T1 (8.5.3)." */ + if (TREE_CODE (type) == REFERENCE_TYPE + && TYPE_REF_IS_RVALUE (type) +- && real_lvalue_p (expr) ++ && (clk = real_lvalue_p (expr)) + && reference_related_p (TREE_TYPE (type), intype) + && (c_cast_p || at_least_as_qualified_p (TREE_TYPE (type), intype))) + { +- /* Handle the lvalue case here by casting to lvalue reference and +- then changing it to an rvalue reference. Casting an xvalue to +- rvalue reference will be handled by the main code path. */ +- tree lref = cp_build_reference_type (TREE_TYPE (type), false); +- result = (perform_direct_initialization_if_possible +- (lref, expr, c_cast_p, complain)); +- result = cp_fold_convert (type, result); +- /* Make sure we don't fold back down to a named rvalue reference, +- because that would be an lvalue. */ +- if (DECL_P (result)) +- result = build1 (NON_LVALUE_EXPR, type, result); +- return convert_from_reference (result); ++ if (clk == clk_ordinary) ++ { ++ /* Handle the (non-bit-field) lvalue case here by casting to ++ lvalue reference and then changing it to an rvalue reference. ++ Casting an xvalue to rvalue reference will be handled by the ++ main code path. */ ++ tree lref = cp_build_reference_type (TREE_TYPE (type), false); ++ result = (perform_direct_initialization_if_possible ++ (lref, expr, c_cast_p, complain)); ++ result = cp_fold_convert (type, result); ++ /* Make sure we don't fold back down to a named rvalue reference, ++ because that would be an lvalue. */ ++ if (DECL_P (result)) ++ result = build1 (NON_LVALUE_EXPR, type, result); ++ return convert_from_reference (result); ++ } ++ else ++ /* For a bit-field or packed field, bind to a temporary. */ ++ expr = rvalue (expr); } - } -+# Scan Fortran modules for absence of a given regexp. -+# -+# Argument 0 is the module name -+# Argument 1 is the regexp to match -+proc scan-module-absence { args } { -+ set modfilename [string tolower [lindex $args 0]].mod -+ set fd [open $modfilename r] -+ set text [read $fd] -+ close $fd -+ -+ upvar 2 name testcase -+ if [regexp -- [lindex $args 1] $text] { -+ fail "$testcase scan-module [lindex $args 1]" -+ } else { -+ pass "$testcase scan-module [lindex $args 1]" -+ } -+} + /* Resolve overloaded address here rather than once in +Index: gcc/cp/ChangeLog +=================================================================== +--- a/src/gcc/cp/ChangeLog (revision ++++ b/src/gcc/cp/ChangeLog (revision +@@ -1,3 +1,19 @@ ++2012-01-19 Kai Tietz + - # Verify that the compiler output file exists, invoked via dg-final. - proc output-exists { args } { - # Process an optional target or xfail list. -Index: gcc/testsuite/gfortran.dg/move_alloc_8.f90 -=================================================================== ---- a/src/gcc/testsuite/gfortran.dg/move_alloc_8.f90 (revision -+++ b/src/gcc/testsuite/gfortran.dg/move_alloc_8.f90 (revision -@@ -0,0 +1,106 @@ -+! { dg-do compile } -+! -+! PR fortran/50684 -+! -+! Module "bug" contributed by Martin Steghöfer. -+! ++ PR c++/51344 ++ * decl2.c (save_template_attributes): Use merge_attributes ++ instead of chaining up via TREE_CHAIN. + -+MODULE BUG -+ TYPE MY_TYPE -+ INTEGER, ALLOCATABLE :: VALUE -+ END TYPE -+CONTAINS -+ SUBROUTINE POINTER_INTENT_IN_BUG_WORKING(POINTER_INTENT_IN_VARIABLE) -+ TYPE(MY_TYPE), POINTER, INTENT(IN) :: POINTER_INTENT_IN_VARIABLE -+ TYPE(MY_TYPE), POINTER :: POINTER_VARIABLE_LOCAL -+ INTEGER, ALLOCATABLE :: LOCAL_VALUE -+ -+ POINTER_VARIABLE_LOCAL=>POINTER_INTENT_IN_VARIABLE -+ CALL MOVE_ALLOC(POINTER_VARIABLE_LOCAL%VALUE, LOCAL_VALUE) -+ -+ RETURN -+ END SUBROUTINE POINTER_INTENT_IN_BUG_WORKING -+ -+ SUBROUTINE POINTER_INTENT_IN_BUG_FAILING(POINTER_INTENT_IN_VARIABLE) -+ TYPE(MY_TYPE), POINTER, INTENT(IN) :: POINTER_INTENT_IN_VARIABLE -+ INTEGER, ALLOCATABLE :: LOCAL_VALUE -+ -+ CALL MOVE_ALLOC(POINTER_INTENT_IN_VARIABLE%VALUE, LOCAL_VALUE) -+ -+ RETURN -+ END SUBROUTINE POINTER_INTENT_IN_BUG_FAILING -+end module bug -+ -+subroutine test1() -+ TYPE MY_TYPE -+ INTEGER, ALLOCATABLE :: VALUE -+ END TYPE -+CONTAINS -+ SUBROUTINE sub (dt) -+ type(MY_TYPE), intent(in) :: dt -+ INTEGER, ALLOCATABLE :: lv -+ call move_alloc(dt%VALUE, lv) ! { dg-error "cannot be INTENT.IN." } -+ END SUBROUTINE -+end subroutine test1 ++2012-01-16 Jakub Jelinek + -+subroutine test2 (x, px) -+ implicit none -+ type t -+ integer, allocatable :: a -+ end type t -+ -+ type t2 -+ type(t), pointer :: ptr -+ integer, allocatable :: a -+ end type t2 -+ -+ type(t2), intent(in) :: x -+ type(t2), pointer, intent(in) :: px -+ -+ integer, allocatable :: a -+ type(t2), pointer :: ta -+ -+ call move_alloc (px, ta) ! { dg-error "cannot be INTENT.IN." } -+ call move_alloc (x%a, a) ! { dg-error "cannot be INTENT.IN." } -+ call move_alloc (x%ptr%a, a) ! OK (3) -+ call move_alloc (px%a, a) ! OK (4) -+ call move_alloc (px%ptr%a, a) ! OK (5) -+end subroutine test2 ++ PR c++/51854 ++ * mangle.c (write_template_arg_literal): Sorry instead of aborting. + -+subroutine test3 (x, px) -+ implicit none -+ type t -+ integer, allocatable :: a -+ end type t -+ -+ type t2 -+ class(t), pointer :: ptr -+ integer, allocatable :: a -+ end type t2 -+ -+ type(t2), intent(in) :: x -+ class(t2), pointer, intent(in) :: px -+ -+ integer, allocatable :: a -+ class(t2), pointer :: ta -+ -+ call move_alloc (px, ta) ! { dg-error "cannot be INTENT.IN." } -+ call move_alloc (x%a, a) ! { dg-error "cannot be INTENT.IN." } -+ call move_alloc (x%ptr%a, a) ! OK (6) -+ call move_alloc (px%a, a) ! OK (7) -+ call move_alloc (px%ptr%a, a) ! OK (8) -+end subroutine test3 -+ -+subroutine test4() -+ TYPE MY_TYPE -+ INTEGER, ALLOCATABLE :: VALUE -+ END TYPE -+CONTAINS -+ SUBROUTINE sub (dt) -+ CLASS(MY_TYPE), intent(in) :: dt -+ INTEGER, ALLOCATABLE :: lv -+ call move_alloc(dt%VALUE, lv) ! { dg-error "cannot be INTENT.IN." } -+ END SUBROUTINE -+end subroutine test4 ++2012-01-16 Jason Merrill ++ ++ PR c++/51868 ++ * typeck.c (build_static_cast_1): Handle bit-fields properly. + -+! { dg-final { cleanup-modules "bug" } } -Index: gcc/testsuite/gfortran.dg/realloc_on_assign_8.f90 + 2011-12-20 Dodji Seketeli + + PR debug/49951 +Index: gcc/cp/decl2.c =================================================================== ---- a/src/gcc/testsuite/gfortran.dg/realloc_on_assign_8.f90 (revision -+++ b/src/gcc/testsuite/gfortran.dg/realloc_on_assign_8.f90 (revision -@@ -0,0 +1,17 @@ -+! { dg-do compile } -+! -+! PR fortran/51448 -+! -+! Contribued by François Willot -+! -+ PROGRAM MAIN -+ IMPLICIT NONE -+ TYPE mytype -+ REAL b(2) -+ END TYPE mytype -+ TYPE(mytype) a -+ DOUBLE PRECISION, ALLOCATABLE :: x(:) -+ ALLOCATE(x(2)) -+ a%b=0.0E0 -+ x=a%b -+ END -Index: gcc/testsuite/gfortran.dg/implicit_pure_2.f90 +--- a/src/gcc/cp/decl2.c (revision ++++ b/src/gcc/cp/decl2.c (revision +@@ -1185,9 +1185,9 @@ + + old_attrs = *q; + +- /* Place the late attributes at the beginning of the attribute ++ /* Merge the late attributes at the beginning with the attribute + list. */ +- TREE_CHAIN (tree_last (late_attrs)) = *q; ++ late_attrs = merge_attributes (late_attrs, *q); + *q = late_attrs; + + if (!DECL_P (*decl_p) && *decl_p == TYPE_MAIN_VARIANT (*decl_p)) +Index: gcc/cp/mangle.c =================================================================== ---- a/src/gcc/testsuite/gfortran.dg/implicit_pure_2.f90 (revision -+++ b/src/gcc/testsuite/gfortran.dg/implicit_pure_2.f90 (revision -@@ -0,0 +1,17 @@ -+! { dg-do compile } -+! PR 51502 - this was wrongly detected to be implicit pure. -+module m -+ integer :: i -+contains -+ subroutine foo(x) -+ integer, intent(inout) :: x -+ outer: block -+ block -+ i = 5 -+ end block -+ end block outer -+ end subroutine foo -+end module m -+ -+! { dg-final { scan-module-absence "m" "IMPLICIT_PURE" } } -+! { dg-final { cleanup-modules "m" } } -Index: gcc/testsuite/gfortran.dg/default_initialization_5.f90 -=================================================================== ---- a/src/gcc/testsuite/gfortran.dg/default_initialization_5.f90 (revision -+++ b/src/gcc/testsuite/gfortran.dg/default_initialization_5.f90 (revision -@@ -0,0 +1,66 @@ -+! { dg-do run } -+! { dg-options "-fdump-tree-original" } -+! -+! PR fortran/51435 -+! -+! Contributed by darmar.xxl@gmail.com -+! -+module arr_m -+ type arr_t -+ real(8), dimension(:), allocatable :: rsk -+ end type -+ type arr_t2 -+ integer :: a = 77 -+ end type -+end module arr_m -+!********************* -+module list_m -+ use arr_m -+ implicit none -+ -+ type(arr_t2), target :: tgt -+ -+ type my_list -+ type(arr_t), pointer :: head => null() -+ end type my_list -+ type my_list2 -+ type(arr_t2), pointer :: head => tgt -+ end type my_list2 -+end module list_m -+!*********************** -+module worker_mod -+ use list_m -+ implicit none -+ -+ type data_all_t -+ type(my_list) :: my_data -+ end type data_all_t -+ type data_all_t2 -+ type(my_list2) :: my_data -+ end type data_all_t2 -+contains -+ subroutine do_job() -+ type(data_all_t) :: dum -+ type(data_all_t2) :: dum2 -+ -+ if (associated(dum%my_data%head)) then -+ call abort() -+ else -+ print *, 'OK: do_job my_data%head is NOT associated' -+ end if -+ -+ if (dum2%my_data%head%a /= 77) & -+ call abort() -+ end subroutine -+end module -+!*************** -+program hello -+ use worker_mod -+ implicit none -+ call do_job() -+end program -+ -+! { dg-final { scan-tree-dump-times "my_data.head = 0B" 1 "original" } } -+! { dg-final { scan-tree-dump-times "my_data.head = &tgt" 1 "original" } } -+! { dg-final { cleanup-tree-dump "original" } } -+! { dg-final { cleanup-modules "arr_m list_m worker_mod" } } -Index: gcc/testsuite/gfortran.dg/warn_function_without_result_2.f90 -=================================================================== ---- a/src/gcc/testsuite/gfortran.dg/warn_function_without_result_2.f90 (revision -+++ b/src/gcc/testsuite/gfortran.dg/warn_function_without_result_2.f90 (revision -@@ -0,0 +1,19 @@ -+! { dg-do compile } -+! { dg-options "-Wall" } -+! -+! PR fortran/50923 -+! -+module m -+contains -+ integer pure function f() ! { dg-warning "Return value of function 'f' at .1. not set" } -+ end function f -+ integer pure function g() result(h) ! { dg-warning "Return value 'h' of function 'g' declared at .1. not set" } -+ end function g -+ integer pure function i() -+ i = 7 -+ end function i -+ integer pure function j() result(k) -+ k = 8 -+ end function j -+end module m -+! { dg-final { cleanup-modules "mod" } } -Index: gcc/testsuite/gcc.c-torture/execute/pr51466.c -=================================================================== ---- a/src/gcc/testsuite/gcc.c-torture/execute/pr51466.c (revision -+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr51466.c (revision -@@ -0,0 +1,43 @@ -+/* PR tree-optimization/51466 */ -+ -+extern void abort (void); -+ -+__attribute__((noinline, noclone)) int -+foo (int i) -+{ -+ volatile int v[4]; -+ int *p; -+ v[i] = 6; -+ p = (int *) &v[i]; -+ return *p; -+} -+ -+__attribute__((noinline, noclone)) int -+bar (int i) -+{ -+ volatile int v[4]; -+ int *p; -+ v[i] = 6; -+ p = (int *) &v[i]; -+ *p = 8; -+ return v[i]; -+} -+ -+__attribute__((noinline, noclone)) int -+baz (int i) -+{ -+ volatile int v[4]; -+ int *p; -+ v[i] = 6; -+ p = (int *) &v[0]; -+ *p = 8; -+ return v[i]; -+} -+ -+int -+main () -+{ -+ if (foo (3) != 6 || bar (2) != 8 || baz (0) != 8 || baz (1) != 6) -+ abort (); -+ return 0; -+} -Index: gcc/testsuite/gcc.c-torture/execute/20111212-1.c -=================================================================== ---- a/src/gcc/testsuite/gcc.c-torture/execute/20111212-1.c (revision -+++ b/src/gcc/testsuite/gcc.c-torture/execute/20111212-1.c (revision -@@ -0,0 +1,34 @@ -+/* PR tree-optimization/50569 */ -+/* Reported by Paul Koning */ -+/* Reduced testcase by Mikael Pettersson */ -+ -+struct event { -+ struct { -+ unsigned int sec; -+ } sent __attribute__((packed)); -+}; -+ -+void __attribute__((noinline,noclone)) frob_entry(char *buf) -+{ -+ struct event event; -+ -+ __builtin_memcpy(&event, buf, sizeof(event)); -+ if (event.sent.sec < 64) { -+ event.sent.sec = -1U; -+ __builtin_memcpy(buf, &event, sizeof(event)); -+ } -+} -+ -+int main(void) -+{ -+ union { -+ char buf[1 + sizeof(struct event)]; -+ int align; -+ } u; -+ -+ __builtin_memset(&u, 0, sizeof u); -+ -+ frob_entry(&u.buf[1]); -+ -+ return 0; -+} -Index: gcc/testsuite/gcc.c-torture/execute/pr51323.c -=================================================================== ---- a/src/gcc/testsuite/gcc.c-torture/execute/pr51323.c (revision -+++ b/src/gcc/testsuite/gcc.c-torture/execute/pr51323.c (revision -@@ -0,0 +1,35 @@ -+/* PR middle-end/51323 */ -+ -+extern void abort (void); -+struct S { int a, b, c; }; -+int v; -+ -+__attribute__((noinline, noclone)) void -+foo (int x, int y, int z) -+{ -+ if (x != v || y != 0 || z != 9) -+ abort (); -+} -+ -+static inline int -+baz (const struct S *p) -+{ -+ return p->b; -+} -+ -+__attribute__((noinline, noclone)) void -+bar (int x, struct S y) -+{ -+ foo (baz (&y), 0, x); -+} -+ -+int -+main () -+{ -+ struct S s; -+ v = 3; s.a = v - 1; s.b = v; s.c = v + 1; -+ bar (9, s); -+ v = 17; s.a = v - 1; s.b = v; s.c = v + 1; -+ bar (9, s); -+ return 0; -+} -Index: gcc/testsuite/gcc.c-torture/execute/20111208-1.c -=================================================================== ---- a/src/gcc/testsuite/gcc.c-torture/execute/20111208-1.c (revision -+++ b/src/gcc/testsuite/gcc.c-torture/execute/20111208-1.c (revision -@@ -0,0 +1,94 @@ -+/* PR tree-optimization/51315 */ -+/* Reported by Jurij Smakov */ -+ -+typedef unsigned int size_t; -+ -+extern void *memcpy (void *__restrict __dest, -+ __const void *__restrict __src, size_t __n) -+ __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); -+ -+extern size_t strlen (__const char *__s) -+ __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); -+ -+typedef short int int16_t; -+typedef int int32_t; -+ -+extern void abort (void); -+ -+int a; -+ -+static void __attribute__ ((noinline,noclone)) -+do_something (int item) -+{ -+ a = item; -+} -+ -+int -+pack_unpack (char *s, char *p) -+{ -+ char *send, *pend; -+ char type; -+ int integer_size; -+ -+ send = s + strlen (s); -+ pend = p + strlen (p); -+ -+ while (p < pend) -+ { -+ type = *p++; -+ -+ switch (type) -+ { -+ case 's': -+ integer_size = 2; -+ goto unpack_integer; -+ -+ case 'l': -+ integer_size = 4; -+ goto unpack_integer; -+ -+ unpack_integer: -+ switch (integer_size) -+ { -+ case 2: -+ { -+ union -+ { -+ int16_t i; -+ char a[sizeof (int16_t)]; -+ } -+ v; -+ memcpy (v.a, s, sizeof (int16_t)); -+ s += sizeof (int16_t); -+ do_something (v.i); -+ } -+ break; -+ -+ case 4: -+ { -+ union -+ { -+ int32_t i; -+ char a[sizeof (int32_t)]; -+ } -+ v; -+ memcpy (v.a, s, sizeof (int32_t)); -+ s += sizeof (int32_t); -+ do_something (v.i); -+ } -+ break; -+ } -+ break; -+ } -+ } -+ return (int) *s; -+} -+ -+int -+main (void) -+{ -+ int n = pack_unpack ("\200\001\377\376\035\300", "sl"); -+ if (n != 0) -+ abort (); -+ return 0; -+} -Index: gcc/testsuite/gnat.dg/frame_overflow.adb -=================================================================== ---- a/src/gcc/testsuite/gnat.dg/frame_overflow.adb (revision -+++ b/src/gcc/testsuite/gnat.dg/frame_overflow.adb (revision -@@ -1,27 +1,20 @@ - -- { dg-do compile } - --with System; -+package body Frame_Overflow is - --procedure frame_overflow is -- -- type Bitpos_Range_T is range 1..2**(System.Word_Size-1)-1; -- type Bitmap_Array_T is array (Bitpos_Range_T) of Boolean; -- -- type Bitmap_T is record -- Bits : Bitmap_Array_T := (others => False); -- end record; -- -- function -+ function -- { dg-error "too large" } - Set_In (Bitmap : Bitmap_T; Bitpos : Bitpos_Range_T) return Bitmap_T - is -- Result: Bitmap_T := Bitmap; -- { dg-error "Storage_Error" } -+ Result: Bitmap_T := Bitmap; - begin - Result.Bits (Bitpos) := True; - return Result; - end; - -- function Negate (Bitmap : Bitmap_T) return Bitmap_T is -- Result: Bitmap_T; -- { dg-error "Storage_Error" } -+ function -- { dg-error "too large" } -+ Negate (Bitmap : Bitmap_T) return Bitmap_T -+ is -+ Result: Bitmap_T; - begin - for E in Bitpos_Range_T loop - Result.Bits (E) := not Bitmap.Bits (E); -@@ -29,6 +22,4 @@ - return Result; - end; - --begin -- null; --end; -+end Frame_Overflow; -Index: gcc/testsuite/gnat.dg/frame_overflow.ads -=================================================================== ---- a/src/gcc/testsuite/gnat.dg/frame_overflow.ads (revision -+++ b/src/gcc/testsuite/gnat.dg/frame_overflow.ads (revision -@@ -0,0 +1,17 @@ -+with System; -+ -+package Frame_Overflow is -+ -+ type Bitpos_Range_T is range 1..2**(System.Word_Size-1)-1; -+ type Bitmap_Array_T is array (Bitpos_Range_T) of Boolean; -+ -+ type Bitmap_T is record -+ Bits : Bitmap_Array_T := (others => False); -+ end record; -+ -+ function -+ Set_In (Bitmap : Bitmap_T; Bitpos : Bitpos_Range_T) return Bitmap_T; -+ -+ function Negate (Bitmap : Bitmap_T) return Bitmap_T; -+ -+end Frame_Overflow; -Index: gcc/testsuite/gnat.dg/specs/addr1.ads -=================================================================== ---- a/src/gcc/testsuite/gnat.dg/specs/addr1.ads (revision -+++ b/src/gcc/testsuite/gnat.dg/specs/addr1.ads (revision -@@ -15,7 +15,7 @@ - end record; - for Rec2'Size use 64; - -- A: Arr (1 .. 12); -+ A: Arr (1 .. 4); - - Obj1: Rec1; - for Obj1'Address use A'Address; -- { dg-bogus "alignment" } -Index: gcc/testsuite/gcc.dg/pr45819.c -=================================================================== ---- a/src/gcc/testsuite/gcc.dg/pr45819.c (revision -+++ b/src/gcc/testsuite/gcc.dg/pr45819.c (revision -@@ -1,5 +1,5 @@ - /* { dg-do compile } */ --/* { dg-options "-O2 -fdump-tree-optimized" } */ -+/* { dg-options "-O2 -fdump-tree-optimized -w" } */ - - struct ehci_regs { - char x; -Index: gcc/testsuite/gcc.dg/gomp/pr51339.c -=================================================================== ---- a/src/gcc/testsuite/gcc.dg/gomp/pr51339.c (revision -+++ b/src/gcc/testsuite/gcc.dg/gomp/pr51339.c (revision -@@ -0,0 +1,15 @@ -+/* PR c/51339 */ -+/* { dg-do compile } */ -+/* { dg-options "-fopenmp" } */ -+ -+char g[] = "g"; -+ -+void -+foo (void) -+{ -+#pragma omp parallel sections firstprivate (g) lastprivate (g) -+ { -+ #pragma omp section -+ g[0] = 'h'; -+ } -+} -Index: gcc/testsuite/gcc.dg/pr50078.c -=================================================================== ---- a/src/gcc/testsuite/gcc.dg/pr50078.c (revision -+++ b/src/gcc/testsuite/gcc.dg/pr50078.c (revision -@@ -0,0 +1,14 @@ -+/* PR tree-optimization/50078 */ -+/* { dg-do compile } */ -+/* { dg-options "-O2" } */ -+ -+unsigned nonvolvar[2]; -+ -+void -+test (int arg) -+{ -+ unsigned v = *(volatile unsigned *) (&nonvolvar[arg]); -+ *(volatile unsigned *) (&nonvolvar[arg]) = v; -+} -+ -+/* { dg-final { scan-assembler-times "movl\[^\n\r\]*nonvolvar" 2 { target { { i?86-*-* x86_64-*-* } && nonpic } } } } */ -Index: gcc/testsuite/gcc.dg/debug/dwarf2/pr51410.c -=================================================================== ---- a/src/gcc/testsuite/gcc.dg/debug/dwarf2/pr51410.c (revision -+++ b/src/gcc/testsuite/gcc.dg/debug/dwarf2/pr51410.c (revision -@@ -0,0 +1,13 @@ -+/* PR debug/51410 */ -+/* { dg-do compile } */ -+/* { dg-options "-O0 -gdwarf-2 -dA -fno-merge-debug-strings" } */ -+ -+int x; -+ -+int -+foo (void) -+{ -+ return x; -+} -+ -+/* { dg-final { scan-assembler-times "\\(DIE\[^\\r\\n\]*DW_TAG_variable\\)" 1 } } */ -Index: gcc/testsuite/gcc.dg/volatile-bitfields-1.c -=================================================================== ---- a/src/gcc/testsuite/gcc.dg/volatile-bitfields-1.c (revision -+++ b/src/gcc/testsuite/gcc.dg/volatile-bitfields-1.c (revision -@@ -0,0 +1,23 @@ -+/* { dg-options "-fstrict-volatile-bitfields" } */ -+/* { dg-do run } */ -+ -+extern int puts(const char *); -+extern void abort(void) __attribute__((noreturn)); -+ -+typedef struct { -+ volatile unsigned short a:8, b:8; -+} BitStruct; -+ -+BitStruct bits = {1, 2}; -+ -+void check(int i, int j) -+{ -+ if (i != 1 || j != 2) puts("FAIL"), abort(); -+} -+ -+int main () -+{ -+ check(bits.a, bits.b); -+ -+ return 0; -+} -Index: gcc/testsuite/gcc.dg/pr51408.c -=================================================================== ---- a/src/gcc/testsuite/gcc.dg/pr51408.c (revision -+++ b/src/gcc/testsuite/gcc.dg/pr51408.c (revision -@@ -0,0 +1,22 @@ -+/* This testcase used to fail because of a bug in -+ arm.md:*minmax_arithsi. */ -+ -+/* { dg-do run } */ -+/* { dg-options "-O1" } */ -+ -+extern void abort (void); -+ -+int __attribute__((noinline)) -+foo (int a, int b) -+{ -+ int max = (b > 0) ? b : 0; -+ return max - a; -+} -+ -+int -+main (void) -+{ -+ if (foo (3, -1) != -3) -+ abort (); -+ return 0; -+} -Index: gcc/testsuite/gcc.dg/torture/pr50396.c -=================================================================== ---- a/src/gcc/testsuite/gcc.dg/torture/pr50396.c (revision -+++ b/src/gcc/testsuite/gcc.dg/torture/pr50396.c (revision -@@ -0,0 +1,22 @@ -+/* { dg-do run } */ -+/* { dg-add-options ieee } */ -+ -+extern void abort (void); -+typedef float vf128 __attribute__((vector_size(16))); -+typedef float vf64 __attribute__((vector_size(8))); -+int main() -+{ -+#if !__FINITE_MATH_ONLY__ -+#if __FLT_HAS_QUIET_NAN__ -+ vf128 v = (vf128){ 0.f, 0.f, 0.f, 0.f }; -+ vf64 u = (vf64){ 0.f, 0.f }; -+ v = v / (vf128){ 0.f, 0.f, 0.f, 0.f }; -+ if (v[0] == v[0]) -+ abort (); -+ u = u / (vf64){ 0.f, 0.f }; -+ if (u[0] == u[0]) -+ abort (); -+#endif -+#endif -+ return 0; -+} -Index: gcc/testsuite/gcc.dg/torture/pr51042.c -=================================================================== ---- a/src/gcc/testsuite/gcc.dg/torture/pr51042.c (revision -+++ b/src/gcc/testsuite/gcc.dg/torture/pr51042.c (revision -@@ -0,0 +1,22 @@ -+/* { dg-do compile } */ -+ -+int a, b; -+ -+void -+foo (int x) -+{ -+ int e[2]; -+ int d; -+ while (x) -+ { -+ for (d = 0; d <= 1; d = 1) -+ if (e[a]) -+ break; -+ for (b = 0; b <= 0; b = 1) -+ { -+ e[a] = a; -+ if (a) -+ break; -+ } -+ } -+} -Index: gcc/testsuite/gcc.dg/torture/pr51070-2.c -=================================================================== ---- a/src/gcc/testsuite/gcc.dg/torture/pr51070-2.c (revision -+++ b/src/gcc/testsuite/gcc.dg/torture/pr51070-2.c (revision -@@ -0,0 +1,35 @@ -+/* { dg-do compile } */ -+/* { dg-options "-fno-inline" } */ -+ -+int -+func_4 (int si1, int si2) -+{ -+ return si1; -+} -+ -+int -+func_14 (int left, int right) -+{ -+ return 1; -+} -+ -+int -+func_37 (int left, int right) -+{ -+ return left; -+} -+ -+int g_92[1024]; -+int g_95[1024]; -+int g_224; -+int g_352[1024]; -+int -+func_9 () -+{ -+ for (; g_224; g_224 += 1) -+ { -+ g_95[0] = func_4 (func_37 (g_92[g_224], 0), 0); -+ g_92[g_224] = 0, g_352[g_224] = func_14 (0, 0); -+ } -+ return 0; -+} -Index: gcc/testsuite/gcc.dg/torture/pr51070.c -=================================================================== ---- a/src/gcc/testsuite/gcc.dg/torture/pr51070.c (revision -+++ b/src/gcc/testsuite/gcc.dg/torture/pr51070.c (revision -@@ -0,0 +1,34 @@ -+/* { dg-do compile } */ -+ -+int -+func_4 (int si1, int si2) -+{ -+ return si1; -+} -+ -+int -+func_14 (int left, int right) -+{ -+ return 1; -+} -+ -+int -+func_37 (int left, int right) -+{ -+ return left; -+} -+ -+int g_92[1024]; -+int g_95[1024]; -+int g_224; -+int g_352[1024]; -+int -+func_9 () -+{ -+ for (; g_224; g_224 += 1) -+ { -+ g_95[0] = func_4 (func_37 (g_92[g_224], 0), 0); -+ g_92[g_224] = 0, g_352[g_224] = func_14 (0, 0); -+ } -+ return 0; -+} -Index: gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c -=================================================================== ---- a/src/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c (revision -+++ b/src/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c (revision -@@ -1,5 +1,5 @@ - /* { dg-do compile } */ --/* { dg-options "-O2 -fno-tree-ccp -fdump-tree-ealias" } */ -+/* { dg-options "-O2 -fno-tree-forwprop -fno-tree-ccp -fdump-tree-ealias" } */ - - extern void abort (void); - struct X { -Index: gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c -=================================================================== ---- a/src/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c (revision -+++ b/src/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-2.c (revision -@@ -1,5 +1,5 @@ - /* { dg-do compile } */ --/* { dg-options "-O2 -fno-tree-ccp -fdump-tree-ealias" } */ -+/* { dg-options "-O2 -fno-tree-forwprop -fno-tree-ccp -fdump-tree-ealias" } */ - - extern void abort (void); - struct X { -Index: gcc/testsuite/gcc.dg/tree-ssa/pr51583.c -=================================================================== ---- a/src/gcc/testsuite/gcc.dg/tree-ssa/pr51583.c (revision -+++ b/src/gcc/testsuite/gcc.dg/tree-ssa/pr51583.c (revision -@@ -0,0 +1,34 @@ -+/* { dg-do compile } */ -+/* { dg-options "-O1" } */ -+ -+typedef __complex__ double Value; -+ -+union U -+{ -+ Value v; -+ char c[sizeof(Value)]; -+}; -+ -+struct S -+{ -+ union U u; -+ int i,j; -+}; -+ -+Value gv; -+int gi, gj; -+ -+Value foo (void) -+{ -+ struct S s,t; -+ -+ t.i = gi; -+ t.j = gj; -+ t.u.v = gv; -+ t.u.c[0] = 0; -+ -+ s = t; -+ __imag__ s.u.v += s.i; -+ -+ return s.u.v; -+} -Index: gcc/testsuite/ChangeLog -=================================================================== ---- a/src/gcc/testsuite/ChangeLog (revision -+++ b/src/gcc/testsuite/ChangeLog (revision -@@ -1,3 +1,221 @@ -+2012-01-04 Richard Guenther -+ -+ PR tree-optimization/49651 -+ * gcc.dg/tree-ssa/pta-ptrarith-1.c: Adjust. -+ * gcc.dg/tree-ssa/pta-ptrarith-2.c: Likewise. -+ -+2012-01-03 Richard Guenther -+ -+ Backport from mainline -+ 2011-11-10 Richard Guenther -+ -+ PR tree-optimization/51042 -+ * gcc.dg/torture/pr51042.c: New testcase. -+ -+2012-01-03 Richard Guenther -+ -+ PR tree-optimization/51070 -+ * gcc.dg/torture/pr51070.c: New testcase. -+ * gcc.dg/torture/pr51070-2.c: Likewise. -+ -+2011-12-20 Dodji Seketeli -+ -+ PR debug/49951 -+ * g++.dg/gcov/gcov-2.C: Adjust. -+ -+2012-01-01 Thomas König -+ -+ Backport from trunk -+ PR fortran/51502 -+ * lib/gcc-dg.exp (scan-module-absence): New function. -+ * gfortran.dg/implicit_pure_2.f90: New test. -+ -+2011-12-28 Michael Meissner -+ -+ Backport from mainline -+ 2011-12-28 Michael Meissner -+ -+ PR target/51623 -+ * gcc.target/powerpc/pr51623.c: New file. -+ -+2011-12-28 Uros Bizjak -+ -+ * gcc.dg/torture/pr50396.c: Use dg-add-options ieee. -+ -+2011-12-23 Richard Guenther -+ -+ PR rtl-optimization/50396 -+ * gcc.dg/torture/pr50396.c: New testcase. -+ -+2011-12-22 Doug Kwan -+ -+ Backport from mainline -+ 2011-11-20 Joey Ye -+ -+ * gcc.dg/volatile-bitfields-1.c: New. -+ -+2011-12-21 Richard Earnshaw -+ -+ PR target/51643 -+ * gcc.target/arm/sibcall-2.c: New test. -+ -+2011-12-19 Martin Jambor -+ -+ PR tree-optimization/51583 -+ * gcc.dg/tree-ssa/pr51583.c: New test. -+ -+2011-12-16 Jason Merrill -+ -+ PR c++/51416 -+ * g++.dg/cpp0x/auto31.C: New. -+ -+2011-12-16 Jason Merrill -+ -+ PR c++/51331 -+ * g++.dg/init/value10.C: New. -+ -+2011-12-15 H.J. Lu -+ -+ Backport from mainline. -+ 2011-10-28 Chung-Lin Tang -+ -+ PR rtl-optimization/49720 -+ * g++.dg/torture/pr49720.C: New test. -+ -+2011-12-14 Jason Merrill -+ -+ PR c++/51248 -+ * g++.dg/other/enum2.C: New. -+ -+2011-12-13 Jason Merrill -+ -+ PR c++/51406 -+ PR c++/51161 -+ * g++.dg/cpp0x/rv-cast3.C: New. -+ * g++.dg/cpp0x/rv-cast4.C: New. -+ -+2011-12-12 Jakub Jelinek -+ -+ PR testsuite/51511 -+ * gcc.dg/pr45819.c: Add -w to dg-options. -+ -+ Backported from mainline -+ 2011-12-11 Jakub Jelinek -+ -+ PR tree-optimization/51485 -+ * g++.dg/vect/pr51485.cc: New test. -+ -+2011-12-12 Eric Botcazou -+ -+ * gcc.c-torture/execute/20111212-1.c: New test. -+ -+2011-12-11 Tobias Burnus -+ -+ PR fortran/50923 -+ * gfortran.dg/warn_function_without_result_2.f90: New. -+ -+2011-12-11 Thomas Koenig -+ -+ PR fortran/51338 -+ Backport from trunk -+ * gfortran.dg/assumed_charlen_substring_1.f90: New test. -+ -+2011-12-09 Jakub Jelinek -+ -+ Backport from mainline -+ 2011-12-08 Jakub Jelinek -+ -+ PR tree-optimization/51466 -+ * gcc.c-torture/execute/pr51466.c: New test. -+ -+ 2011-11-28 Jakub Jelinek -+ -+ PR tree-optimization/50078 -+ * gcc.dg/pr50078.c: New test. -+ -+2011-12-09 Kazu Hirata -+ -+ Backport from mainline: -+ -+ 2011-12-05 Kazu Hirata -+ -+ PR target/51408 -+ * gcc.dg/pr51408.c: New. -+ -+2011-12-08 Tobias Burnus -+ -+ PR fortran/51448 -+ * gfortran.dg/realloc_on_assign_8.f90: New. -+ -+2011-12-08 Teresa Johnson -+ -+ * gcc.target/i386/movdi-rex64.c: Remove unnecessary -+ unused label. -+ -+2011-12-08 Teresa Johnson -+ -+ * gcc.target/i386/movdi-rex64.c: Remove unnecessary -+ -Wwrite-strings option. -+ -+2011-12-08 Teresa Johnson -+ -+ * gcc.target/i386/movdi-rex64.c: New. -+ -+2011-12-08 Jakub Jelinek -+ -+ Backport from mainline -+ 2011-12-05 Jakub Jelinek -+ -+ PR debug/51410 -+ * gcc.dg/debug/dwarf2/pr51410.c: New test. -+ -+ PR c/51339 -+ * gcc.dg/gomp/pr51339.c: New test. -+ -+ 2011-12-05 Jakub Jelinek -+ Eric Botcazou -+ -+ PR middle-end/51323 -+ PR middle-end/50074 -+ * gcc.c-torture/execute/pr51323.c: New test. -+ -+ 2011-11-30 Jakub Jelinek -+ -+ PR rtl-optimization/48721 -+ * gcc.target/i386/pr48721.c: New test. -+ -+2011-12-08 Eric Botcazou -+ -+ * gcc.c-torture/execute/20111208-1.c: New test. -+ -+ Backport from mainline -+ 2011-09-25 Eric Botcazou -+ -+ * gnat.dg/frame_overflow.ads: New. -+ * gnat.dg/frame_overflow.adb: Adjust. -+ * gnat.dg/specs/addr1.ads: Likewise. -+ -+2011-12-06 Tobias Burnus -+ -+ PR fortran/51435 -+ * gfortran.dg/default_initialization_5.f90: New. -+ -+2011-12-06 Martin Jambor -+ -+ PR tree-optimization/50622 -+ * g++.dg/tree-ssa/pr50622.C: New test. -+ -+2011-12-04 Uros Bizjak -+ Jérémie Detrey -+ -+ PR target/51393 -+ * gcc.target/i386/pr51393.c: New test. -+ -+2011-12-03 Tobias Burnus -+ -+ PR fortran/50684 -+ * gfortran.dg/move_alloc_8.f90: New. -+ - 2011-11-25 Tobias Burnus - - PR fortran/50408 -@@ -75,9 +293,9 @@ - - 2011-10-20 Uros Bizjak - -- * gcc.dg/ipa/ipa-sra-2.c: Add dg-require-effective-target -- non_strict_align. -- * gcc.dg/ipa/ipa-sra-6.c: Ditto. -+ * gcc.dg/ipa/ipa-sra-2.c: Add dg-require-effective-target -+ non_strict_align. -+ * gcc.dg/ipa/ipa-sra-6.c: Ditto. - - 2011-10-19 Jason Merrill - -Index: gcc/testsuite/g++.dg/vect/pr51485.cc -=================================================================== ---- a/src/gcc/testsuite/g++.dg/vect/pr51485.cc (revision -+++ b/src/gcc/testsuite/g++.dg/vect/pr51485.cc (revision -@@ -0,0 +1,14 @@ -+/* { dg-do compile } */ -+ -+struct A { A (); unsigned int a; }; -+double bar (A a) throw () __attribute__((pure)); -+ -+void -+foo (unsigned int x, double *y, A *z) -+{ -+ unsigned int i; -+ for (i = 0; i < x; i++) -+ y[i] = bar (z[i]); -+} -+ -+/* { dg-final { cleanup-tree-dump "vect" } } */ -Index: gcc/testsuite/g++.dg/init/value10.C -=================================================================== ---- a/src/gcc/testsuite/g++.dg/init/value10.C (revision -+++ b/src/gcc/testsuite/g++.dg/init/value10.C (revision -@@ -0,0 +1,27 @@ -+// PR c++/51331 -+// { dg-do run } -+ -+struct A { -+ A(): x(10) {} -+ virtual ~A() {} -+ -+ int x; -+}; -+ -+struct B: public virtual A { -+}; -+ -+struct C: public virtual A { -+}; -+ -+struct D: public B, virtual public C { -+ D(): B(), C() {} // note an explicit call to C() which is auto-generated -+}; -+ -+int main() { -+ D* d = new D(); -+ -+ // Crashes here with the following message: -+ // *** glibc detected *** ./test: free(): invalid next size (fast) -+ delete d; -+} -Index: gcc/testsuite/g++.dg/other/enum2.C -=================================================================== ---- a/src/gcc/testsuite/g++.dg/other/enum2.C (revision -+++ b/src/gcc/testsuite/g++.dg/other/enum2.C (revision -@@ -0,0 +1,3 @@ -+// PR c++/51248 -+ -+enum E { e = sizeof(const E*) }; -Index: gcc/testsuite/g++.dg/tree-ssa/pr50622.C -=================================================================== ---- a/src/gcc/testsuite/g++.dg/tree-ssa/pr50622.C (revision -+++ b/src/gcc/testsuite/g++.dg/tree-ssa/pr50622.C (revision -@@ -0,0 +1,30 @@ -+// { dg-do compile } -+// { dg-options "-O2" } -+ -+typedef __complex__ double Value; -+struct LorentzVector -+{ -+ LorentzVector & operator+=(const LorentzVector & a) { -+ theX += a.theX; -+ theY += a.theY; -+ theZ += a.theZ; -+ theT += a.theT; -+ return *this; -+ } -+ -+ Value theX; -+ Value theY; -+ Value theZ; -+ Value theT; -+}; -+ -+inline LorentzVector -+operator+(LorentzVector a, const LorentzVector & b) { -+ return a += b; -+} -+ -+Value ex, et; -+LorentzVector sum() { -+ LorentzVector v1; v1.theX =ex; v1.theY =ex+et; v1.theZ =ex-et; v1.theT =et; -+ return v1+v1; -+} -Index: gcc/testsuite/g++.dg/cpp0x/auto31.C -=================================================================== ---- a/src/gcc/testsuite/g++.dg/cpp0x/auto31.C (revision -+++ b/src/gcc/testsuite/g++.dg/cpp0x/auto31.C (revision -@@ -0,0 +1,12 @@ -+// PR c++/51416 -+// { dg-options "-std=c++0x" } -+ -+template void foo(T, U... u) -+{ -+ auto foo(u...); // { dg-error "auto" } -+} -+ -+void bar() -+{ -+ foo(0); -+} -Index: gcc/testsuite/g++.dg/cpp0x/variadic103.C -=================================================================== ---- a/src/gcc/testsuite/g++.dg/cpp0x/variadic103.C (revision -+++ b/src/gcc/testsuite/g++.dg/cpp0x/variadic103.C (revision -@@ -5,7 +5,7 @@ - - template - void test() { -- T t(create()...); // { dg-error "unknown bound" } -+ T t(create()...); // { dg-error "incomplete" } - (void) t; - } - -Index: gcc/testsuite/g++.dg/cpp0x/rv-cast3.C -=================================================================== ---- a/src/gcc/testsuite/g++.dg/cpp0x/rv-cast3.C (revision -+++ b/src/gcc/testsuite/g++.dg/cpp0x/rv-cast3.C (revision -@@ -0,0 +1,18 @@ -+// PR c++/51406 -+// { dg-do run } -+// { dg-options "-std=c++0x" } -+ -+extern "C" int printf(const char *,...); -+extern "C" void abort(); -+ -+struct A { int a; A() : a(1) {} }; -+struct B { int b; B() : b(2) {} }; -+struct X : A, B {}; -+ -+int main() { -+ X x; -+ int a=static_cast(x).a; -+ int b=static_cast(x).b; -+ // printf ("%d %d\n", a, b); -+ if (a!=1 || b!=2) abort(); -+} -Index: gcc/testsuite/g++.dg/cpp0x/rv-cast4.C -=================================================================== ---- a/src/gcc/testsuite/g++.dg/cpp0x/rv-cast4.C (revision -+++ b/src/gcc/testsuite/g++.dg/cpp0x/rv-cast4.C (revision -@@ -0,0 +1,13 @@ -+// PR c++/51161 -+// { dg-options "-std=c++0x" } -+ -+struct A{}; -+struct B : A{}; -+struct C : A{}; -+struct D : B, C{}; -+ -+int main() -+{ -+ D d; -+ static_cast(d); // { dg-error "ambiguous" } -+} -Index: gcc/testsuite/g++.dg/gcov/gcov-2.C -=================================================================== ---- a/src/gcc/testsuite/g++.dg/gcov/gcov-2.C (revision -+++ b/src/gcc/testsuite/g++.dg/gcov/gcov-2.C (revision -@@ -20,7 +20,7 @@ - - void foo() - { -- C c; /* count(2) */ -+ C c; /* count(1) */ - c.seti (1); /* count(1) */ - } - -Index: gcc/testsuite/g++.dg/torture/pr49720.C -=================================================================== ---- a/src/gcc/testsuite/g++.dg/torture/pr49720.C (revision -+++ b/src/gcc/testsuite/g++.dg/torture/pr49720.C (revision -@@ -0,0 +1,8 @@ -+/* { dg-do compile } */ -+ -+extern char t_start[], t_end[], t_size[]; -+bool foo (void) -+{ -+ long size = reinterpret_cast(t_size); -+ return (size == t_end - t_start); -+} -Index: gcc/cp/typeck.c -=================================================================== ---- a/src/gcc/cp/typeck.c (revision -+++ b/src/gcc/cp/typeck.c (revision -@@ -5770,8 +5770,18 @@ - && reference_related_p (TREE_TYPE (type), intype) - && (c_cast_p || at_least_as_qualified_p (TREE_TYPE (type), intype))) - { -- expr = build_typed_address (expr, type); -- return convert_from_reference (expr); -+ /* Handle the lvalue case here by casting to lvalue reference and -+ then changing it to an rvalue reference. Casting an xvalue to -+ rvalue reference will be handled by the main code path. */ -+ tree lref = cp_build_reference_type (TREE_TYPE (type), false); -+ result = (perform_direct_initialization_if_possible -+ (lref, expr, c_cast_p, complain)); -+ result = cp_fold_convert (type, result); -+ /* Make sure we don't fold back down to a named rvalue reference, -+ because that would be an lvalue. */ -+ if (DECL_P (result)) -+ result = build1 (NON_LVALUE_EXPR, type, result); -+ return convert_from_reference (result); - } - - /* Resolve overloaded address here rather than once in -Index: gcc/cp/init.c -=================================================================== ---- a/src/gcc/cp/init.c (revision -+++ b/src/gcc/cp/init.c (revision -@@ -141,7 +141,9 @@ - zero-initialization does not simply mean filling the storage with - zero bytes. FIELD_SIZE, if non-NULL, is the bit size of the field, - subfields with bit positions at or above that bit size shouldn't -- be added. */ -+ be added. Note that this only works when the result is assigned -+ to a base COMPONENT_REF; if we only have a pointer to the base subobject, -+ expand_assignment will end up clearing the full size of TYPE. */ - - static tree - build_zero_init_1 (tree type, tree nelts, bool static_storage_p, -@@ -368,6 +370,12 @@ - tree - build_value_init_noctor (tree type, tsubst_flags_t complain) - { -+ if (!COMPLETE_TYPE_P (type)) -+ { -+ if (complain & tf_error) -+ error ("value-initialization of incomplete type %qT", type); -+ return error_mark_node; -+ } - if (CLASS_TYPE_P (type)) - { - gcc_assert (!TYPE_NEEDS_CONSTRUCTING (type)); -Index: gcc/cp/class.c -=================================================================== ---- a/src/gcc/cp/class.c (revision -+++ b/src/gcc/cp/class.c (revision -@@ -464,7 +464,14 @@ - /* Is this the base field created by build_base_field? */ - if (TREE_CODE (field) == FIELD_DECL - && DECL_FIELD_IS_BASE (field) -- && TREE_TYPE (field) == type) -+ && TREE_TYPE (field) == type -+ /* If we're looking for a field in the most-derived class, -+ also check the field offset; we can have two base fields -+ of the same type if one is an indirect virtual base and one -+ is a direct non-virtual base. */ -+ && (BINFO_INHERITANCE_CHAIN (d_binfo) -+ || tree_int_cst_equal (byte_position (field), -+ BINFO_OFFSET (binfo)))) - { - /* We don't use build_class_member_access_expr here, as that - has unnecessary checks, and more importantly results in -@@ -541,6 +548,10 @@ - { - tree pointer_type; - -+ /* If this is a non-empty base, use a COMPONENT_REF. */ -+ if (!is_empty_class (BINFO_TYPE (base))) -+ return build_simple_base_path (expr, base); -+ - pointer_type = build_pointer_type (expr_type); - - /* We use fold_build2 and fold_convert below to simplify the trees -Index: gcc/cp/decl.c -=================================================================== ---- a/src/gcc/cp/decl.c (revision -+++ b/src/gcc/cp/decl.c (revision -@@ -11540,15 +11540,19 @@ - static void - copy_type_enum (tree dst, tree src) - { -- TYPE_MIN_VALUE (dst) = TYPE_MIN_VALUE (src); -- TYPE_MAX_VALUE (dst) = TYPE_MAX_VALUE (src); -- TYPE_SIZE (dst) = TYPE_SIZE (src); -- TYPE_SIZE_UNIT (dst) = TYPE_SIZE_UNIT (src); -- SET_TYPE_MODE (dst, TYPE_MODE (src)); -- TYPE_PRECISION (dst) = TYPE_PRECISION (src); -- TYPE_ALIGN (dst) = TYPE_ALIGN (src); -- TYPE_USER_ALIGN (dst) = TYPE_USER_ALIGN (src); -- TYPE_UNSIGNED (dst) = TYPE_UNSIGNED (src); -+ tree t; -+ for (t = dst; t; t = TYPE_NEXT_VARIANT (t)) -+ { -+ TYPE_MIN_VALUE (t) = TYPE_MIN_VALUE (src); -+ TYPE_MAX_VALUE (t) = TYPE_MAX_VALUE (src); -+ TYPE_SIZE (t) = TYPE_SIZE (src); -+ TYPE_SIZE_UNIT (t) = TYPE_SIZE_UNIT (src); -+ SET_TYPE_MODE (dst, TYPE_MODE (src)); -+ TYPE_PRECISION (t) = TYPE_PRECISION (src); -+ TYPE_ALIGN (t) = TYPE_ALIGN (src); -+ TYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (src); -+ TYPE_UNSIGNED (t) = TYPE_UNSIGNED (src); -+ } - } - - /* Begin compiling the definition of an enumeration type. -@@ -11903,9 +11907,12 @@ - return; - } - -- /* Here there should not be any variants of this type. */ -+ /* If this is a forward declaration, there should not be any variants, -+ though we can get a variant in the middle of an enum-specifier with -+ wacky code like 'enum E { e = sizeof(const E*) };' */ - gcc_assert (enumtype == TYPE_MAIN_VARIANT (enumtype) -- && !TYPE_NEXT_VARIANT (enumtype)); -+ && (TYPE_VALUES (enumtype) -+ || !TYPE_NEXT_VARIANT (enumtype))); - } - - /* Build and install a CONST_DECL for an enumeration constant of the -@@ -13356,8 +13363,17 @@ - cleanup = call; - } - -+ /* build_delete sets the location of the destructor call to the -+ current location, even though the destructor is going to be -+ called later, at the end of the current scope. This can lead to -+ a "jumpy" behaviour for users of debuggers when they step around -+ the end of the block. So let's unset the location of the -+ destructor call instead. */ -+ if (cleanup != NULL && EXPR_P (cleanup)) -+ SET_EXPR_LOCATION (cleanup, UNKNOWN_LOCATION); - return cleanup; - } -+ - - /* When a stmt has been parsed, this function is called. */ - -Index: gcc/cp/ChangeLog -=================================================================== ---- a/src/gcc/cp/ChangeLog (revision -+++ b/src/gcc/cp/ChangeLog (revision -@@ -1,3 +1,34 @@ -+2011-12-20 Dodji Seketeli -+ -+ PR debug/49951 -+ * decl.c (cxx_maybe_build_cleanup): Don't set location of the call -+ to the destructor. -+ -+2011-12-16 Jason Merrill -+ -+ PR c++/51416 -+ * init.c (build_value_init_noctor): Check for incomplete type. -+ -+2011-12-16 Jason Merrill -+ -+ PR c++/51331 -+ * class.c (convert_to_base_statically): Just call -+ build_simple_base_path. -+ (build_simple_base_path): Check field offset. -+ -+2011-12-14 Jason Merrill -+ -+ PR c++/51248 -+ * decl.c (copy_type_enum): Also update variants. -+ (finish_enum): Allow variants of complete enums. -+ -+2011-12-13 Jason Merrill -+ -+ PR c++/51406 -+ PR c++/51161 -+ * typeck.c (build_static_cast_1): Fix cast of lvalue to -+ base rvalue reference. -+ - 2011-11-22 Paolo Carlini - - PR c++/51265 -Index: gcc/lto-cgraph.c -=================================================================== ---- a/src/gcc/lto-cgraph.c (revision -+++ b/src/gcc/lto-cgraph.c (revision -@@ -1792,9 +1792,9 @@ - { - const struct lto_function_header *header = - (const struct lto_function_header *) data; -- const int32_t cfg_offset = sizeof (struct lto_function_header); -- const int32_t main_offset = cfg_offset + header->cfg_size; -- const int32_t string_offset = main_offset + header->main_size; -+ const int cfg_offset = sizeof (struct lto_function_header); -+ const int main_offset = cfg_offset + header->cfg_size; -+ const int string_offset = main_offset + header->main_size; - struct data_in *data_in; - struct lto_input_block ib_main; - unsigned int i; -Index: gcc/lto-streamer-out.c -=================================================================== ---- a/src/gcc/lto-streamer-out.c (revision -+++ b/src/gcc/lto-streamer-out.c (revision -@@ -2408,7 +2408,7 @@ - enum gcc_plugin_symbol_kind kind; - enum gcc_plugin_symbol_visibility visibility; - int slot_num; -- uint64_t size; -+ unsigned HOST_WIDEST_INT size; - const char *comdat; - unsigned char c; - -@@ -2466,7 +2466,7 @@ - when symbol has attribute (visibility("hidden")) specified. - targetm.binds_local_p check DECL_VISIBILITY_SPECIFIED and gets this - right. */ -- -+ - if (DECL_EXTERNAL (t) - && !targetm.binds_local_p (t)) - visibility = GCCPV_DEFAULT; -@@ -2488,14 +2488,9 @@ - } - - if (kind == GCCPK_COMMON -- && DECL_SIZE (t) -- && TREE_CODE (DECL_SIZE (t)) == INTEGER_CST) -- { -- size = (HOST_BITS_PER_WIDE_INT >= 64) -- ? (uint64_t) int_size_in_bytes (TREE_TYPE (t)) -- : (((uint64_t) TREE_INT_CST_HIGH (DECL_SIZE_UNIT (t))) << 32) -- | TREE_INT_CST_LOW (DECL_SIZE_UNIT (t)); -- } -+ && DECL_SIZE_UNIT (t) -+ && TREE_CODE (DECL_SIZE_UNIT (t)) == INTEGER_CST) -+ size = TREE_INT_CST_LOW (DECL_SIZE_UNIT (t)); - else - size = 0; - -Index: gcc/expr.c -=================================================================== ---- a/src/gcc/expr.c (revision -+++ b/src/gcc/expr.c (revision -@@ -9189,8 +9189,16 @@ - && modifier != EXPAND_CONST_ADDRESS - && modifier != EXPAND_INITIALIZER) - /* If the field is volatile, we always want an aligned -- access. */ -- || (volatilep && flag_strict_volatile_bitfields > 0) -+ access. Do this in following two situations: -+ 1. the access is not already naturally -+ aligned, otherwise "normal" (non-bitfield) volatile fields -+ become non-addressable. -+ 2. the bitsize is narrower than the access size. Need -+ to extract bitfields from the access. */ -+ || (volatilep && flag_strict_volatile_bitfields > 0 -+ && (bitpos % GET_MODE_ALIGNMENT (mode) != 0 -+ || (mode1 != BLKmode -+ && bitsize < GET_MODE_SIZE (mode1) * BITS_PER_UNIT))) - /* If the field isn't aligned enough to fetch as a memref, - fetch it as a bit field. */ - || (mode1 != BLKmode -Index: gcc/ada/ChangeLog -=================================================================== ---- a/src/gcc/ada/ChangeLog (revision -+++ b/src/gcc/ada/ChangeLog (revision -@@ -1,3 +1,16 @@ -+2012-01-02 Eric Botcazou -+ -+ * gnatvsn.ads (Current_Year): Bump to 2011. -+ -+2011-12-08 Eric Botcazou -+ -+ PR tree-optimization/51315 -+ Backport from mainline -+ 2011-09-25 Eric Botcazou -+ -+ * gcc-interface/decl.c (gnat_to_gnu_entity) : Do not promote -+ the alignment if this doesn't prevent BLKmode access to the object. -+ - 2011-11-13 Iain Sandoe - - Backport from mainline r181474 -Index: gcc/ada/gnatvsn.ads -=================================================================== ---- a/src/gcc/ada/gnatvsn.ads (revision -+++ b/src/gcc/ada/gnatvsn.ads (revision -@@ -6,7 +6,7 @@ - -- -- - -- S p e c -- - -- -- ---- Copyright (C) 1992-2010, Free Software Foundation, Inc. -- -+-- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- - -- -- - -- GNAT is free software; you can redistribute it and/or modify it under -- - -- terms of the GNU General Public License as published by the Free Soft- -- -@@ -92,7 +92,7 @@ - Verbose_Library_Version : constant String := "GNAT Lib v" & Library_Version; - -- Version string stored in e.g. ALI files - -- Current_Year : constant String := "2010"; -+ Current_Year : constant String := "2011"; - -- Used in printing copyright messages - - end Gnatvsn; -Index: gcc/ada/gcc-interface/decl.c -=================================================================== ---- a/src/gcc/ada/gcc-interface/decl.c (revision -+++ b/src/gcc/ada/gcc-interface/decl.c (revision -@@ -808,16 +808,30 @@ - && No (Address_Clause (gnat_entity)))) - && TREE_CODE (TYPE_SIZE (gnu_type)) == INTEGER_CST) - { -- /* No point in jumping through all the hoops needed in order -+ unsigned int size_cap, align_cap; -+ -+ /* No point in promoting the alignment if this doesn't prevent -+ BLKmode access to the object, in particular block copy, as -+ this will for example disable the NRV optimization for it. -+ No point in jumping through all the hoops needed in order - to support BIGGEST_ALIGNMENT if we don't really have to. - So we cap to the smallest alignment that corresponds to - a known efficient memory access pattern of the target. */ -- unsigned int align_cap = Is_Atomic (gnat_entity) -- ? BIGGEST_ALIGNMENT -- : get_mode_alignment (ptr_mode); -+ if (Is_Atomic (gnat_entity)) -+ { -+ size_cap = UINT_MAX; -+ align_cap = BIGGEST_ALIGNMENT; -+ } -+ else -+ { -+ size_cap = MAX_FIXED_MODE_SIZE; -+ align_cap = get_mode_alignment (ptr_mode); -+ } - - if (!host_integerp (TYPE_SIZE (gnu_type), 1) -- || compare_tree_int (TYPE_SIZE (gnu_type), align_cap) >= 0) -+ || compare_tree_int (TYPE_SIZE (gnu_type), size_cap) > 0) -+ align = 0; -+ else if (compare_tree_int (TYPE_SIZE (gnu_type), align_cap) > 0) - align = align_cap; - else - align = ceil_alignment (tree_low_cst (TYPE_SIZE (gnu_type), 1)); -Index: gcc/lto-streamer-in.c -=================================================================== ---- a/src/gcc/lto-streamer-in.c (revision -+++ b/src/gcc/lto-streamer-in.c (revision -@@ -1366,9 +1366,9 @@ - { - const struct lto_function_header *header; - struct data_in *data_in; -- int32_t cfg_offset; -- int32_t main_offset; -- int32_t string_offset; -+ int cfg_offset; -+ int main_offset; -+ int string_offset; - struct lto_input_block ib_cfg; - struct lto_input_block ib_main; - -Index: gcc/c-decl.c -=================================================================== ---- a/src/gcc/c-decl.c (revision -+++ b/src/gcc/c-decl.c (revision -@@ -721,7 +721,7 @@ - - complete_array_type (&TREE_TYPE (decl), NULL_TREE, true); - -- layout_decl (decl, 0); -+ relayout_decl (decl); - } - } - } -@@ -1200,7 +1200,7 @@ - DECL_CHAIN (p) = BLOCK_VARS (block); - BLOCK_VARS (block) = p; - } -- else if (VAR_OR_FUNCTION_DECL_P (p)) -+ else if (VAR_OR_FUNCTION_DECL_P (p) && scope != file_scope) - { - /* For block local externs add a special - DECL_EXTERNAL decl for debug info generation. */ -@@ -4261,7 +4261,7 @@ - if (DECL_INITIAL (decl)) - TREE_TYPE (DECL_INITIAL (decl)) = type; - -- layout_decl (decl, 0); -+ relayout_decl (decl); - } - - if (TREE_CODE (decl) == VAR_DECL) -Index: gcc/fortran/trans-array.c -=================================================================== ---- a/src/gcc/fortran/trans-array.c (revision -+++ b/src/gcc/fortran/trans-array.c (revision -@@ -6772,8 +6772,17 @@ - gfc_array_index_type, cond, - lbound, gfc_index_one_node); - } -- else if (expr->expr_type == EXPR_VARIABLE) -+ -+ if (expr->expr_type == EXPR_FUNCTION) - { -+ /* A conversion function, so use the argument. */ -+ gcc_assert (expr->value.function.isym -+ && expr->value.function.isym->conversion); -+ expr = expr->value.function.actual->expr; -+ } -+ -+ if (expr->expr_type == EXPR_VARIABLE) -+ { - tmp = TREE_TYPE (expr->symtree->n.sym->backend_decl); - for (ref = expr->ref; ref; ref = ref->next) - { -@@ -6785,15 +6794,6 @@ - } - return GFC_TYPE_ARRAY_LBOUND(tmp, dim); - } -- else if (expr->expr_type == EXPR_FUNCTION) -- { -- /* A conversion function, so use the argument. */ -- expr = expr->value.function.actual->expr; -- if (expr->expr_type != EXPR_VARIABLE) -- return gfc_index_one_node; -- desc = TREE_TYPE (expr->symtree->n.sym->backend_decl); -- return get_std_lbound (expr, desc, dim, assumed_size); -- } - - return gfc_index_one_node; - } -Index: gcc/fortran/ChangeLog -=================================================================== ---- a/src/gcc/fortran/ChangeLog (revision -+++ b/src/gcc/fortran/ChangeLog (revision -@@ -1,3 +1,69 @@ -+2012-01-01 Thomas König -+ -+ Backport from trunk -+ PR fortran/51502 -+ * expr.c (gfc_check_vardef_context): When determining -+ implicit pure status, also check for variable definition -+ context. Walk up namespaces until a procedure is -+ found to reset the implict pure attribute. -+ * resolve.c (gfc_implicit_pure): Walk up namespaces -+ until a procedure is found. -+ -+2011-12-22 Toon Moene -+ -+ PR fortran/51310 -+ * resolve.c (build_default_init_expr): Allow non-allocatable, -+ non-compile-time-constant-shape arrays to have a default -+ initializer. -+ * invoke.texi: Delete the restriction on automatic arrays not -+ being initialized by -finit-=. -+ -+2011-12-15 Tobias Burnus -+ -+ PR fortran/51550 -+ PR fortran/47545 -+ PR fortran/49050 -+ PR fortran/51075 -+ * resolve.c (resolve_fl_derived0): Print not-implemented error -+ for deferred-length character components. -+ -+2011-12-11 Tobias Burnus -+ -+ PR fortran/50923 -+ * trans-decl.c (generate_local_decl): Set TREE_NO_WARNING only -+ if the front end has printed a warning. -+ (gfc_generate_function_code): Fix unset-result warning. -+ -+2011-12-11 Thomas Koenig -+ -+ PR fortran/51338 -+ Backport from trunk -+ * dependency.c (are_identical_variables): Handle case where -+ end fields of substring references are NULL. -+ -+2011-12-08 Toon Moene -+ -+ PR fortran/51310 -+ * invoke.texi: Itemize the cases for which -+ -finit-= doesn't work. -+ -+2011-12-08 Tobias Burnus -+ -+ PR fortran/51448 -+ * fortran/trans-array.c (get_std_lbound): Fix handling of -+ conversion functions. -+ -+2011-12-06 Tobias Burnus -+ -+ PR fortran/51435 -+ * expr.c (gfc_has_default_initializer): Fix handling of -+ DT with initialized pointer components. -+ -+2011-12-03 Tobias Burnus -+ -+ PR fortran/50684 -+ * check.c (variable_check): Fix intent(in) check. -+ - 2011-11-25 Tobias Burnus - - PR fortran/50408 -Index: gcc/fortran/expr.c -=================================================================== ---- a/src/gcc/fortran/expr.c (revision -+++ b/src/gcc/fortran/expr.c (revision -@@ -3679,6 +3679,8 @@ - if (!c->attr.pointer - && gfc_has_default_initializer (c->ts.u.derived)) - return true; -+ if (c->attr.pointer && c->initializer) -+ return true; - } - else - { -@@ -3689,6 +3691,7 @@ - return false; - } - -+ - /* Get an expression for a default initializer. */ - - gfc_expr * -@@ -4520,9 +4523,24 @@ - return FAILURE; - } - -- if (!pointer && gfc_implicit_pure (NULL) && gfc_impure_variable (sym)) -- gfc_current_ns->proc_name->attr.implicit_pure = 0; -+ if (!pointer && context && gfc_implicit_pure (NULL) -+ && gfc_impure_variable (sym)) -+ { -+ gfc_namespace *ns; -+ gfc_symbol *sym; - -+ for (ns = gfc_current_ns; ns; ns = ns->parent) -+ { -+ sym = ns->proc_name; -+ if (sym == NULL) -+ break; -+ if (sym->attr.flavor == FL_PROCEDURE) -+ { -+ sym->attr.implicit_pure = 0; -+ break; -+ } -+ } -+ } - /* Check variable definition context for associate-names. */ - if (!pointer && sym->assoc) - { -Index: gcc/fortran/resolve.c -=================================================================== ---- a/src/gcc/fortran/resolve.c (revision -+++ b/src/gcc/fortran/resolve.c (revision -@@ -9690,7 +9690,7 @@ - int i; - - /* These symbols should never have a default initialization. */ -- if ((sym->attr.dimension && !gfc_is_compile_time_shape (sym->as)) -+ if (sym->attr.allocatable - || sym->attr.external - || sym->attr.dummy - || sym->attr.pointer -@@ -11397,6 +11397,14 @@ - - for (c = sym->components; c != NULL; c = c->next) - { -+ /* See PRs 51550, 47545, 48654, 49050, 51075 - and 45170. */ -+ if (c->ts.type == BT_CHARACTER && c->ts.deferred) -+ { -+ gfc_error ("Deferred-length character component '%s' at %L is not " -+ "yet supported", c->name, &c->loc); -+ return FAILURE; -+ } -+ - /* F2008, C442. */ - if (c->attr.codimension /* FIXME: c->as check due to PR 43412. */ - && (!c->attr.allocatable || (c->as && c->as->type != AS_DEFERRED))) -@@ -12928,24 +12936,25 @@ - int - gfc_implicit_pure (gfc_symbol *sym) - { -- symbol_attribute attr; -+ gfc_namespace *ns; - - if (sym == NULL) - { -- /* Check if the current namespace is implicit_pure. */ -- sym = gfc_current_ns->proc_name; -- if (sym == NULL) -- return 0; -- attr = sym->attr; -- if (attr.flavor == FL_PROCEDURE -- && attr.implicit_pure && !attr.pure) -- return 1; -- return 0; -+ /* Check if the current procedure is implicit_pure. Walk up -+ the procedure list until we find a procedure. */ -+ for (ns = gfc_current_ns; ns; ns = ns->parent) -+ { -+ sym = ns->proc_name; -+ if (sym == NULL) -+ return 0; -+ -+ if (sym->attr.flavor == FL_PROCEDURE) -+ break; -+ } - } -- -- attr = sym->attr; -- -- return attr.flavor == FL_PROCEDURE && attr.implicit_pure && !attr.pure; -+ -+ return sym->attr.flavor == FL_PROCEDURE && sym->attr.implicit_pure -+ && !sym->attr.pure; - } - - -Index: gcc/fortran/trans-decl.c -=================================================================== ---- a/src/gcc/fortran/trans-decl.c (revision -+++ b/src/gcc/fortran/trans-decl.c (revision -@@ -4184,10 +4184,16 @@ - "declared INTENT(OUT) but was not set and " - "does not have a default initializer", - sym->name, &sym->declared_at); -+ if (sym->backend_decl != NULL_TREE) -+ TREE_NO_WARNING(sym->backend_decl) = 1; - } - else if (gfc_option.warn_unused_dummy_argument) -- gfc_warning ("Unused dummy argument '%s' at %L", sym->name, -+ { -+ gfc_warning ("Unused dummy argument '%s' at %L", sym->name, - &sym->declared_at); -+ if (sym->backend_decl != NULL_TREE) -+ TREE_NO_WARNING(sym->backend_decl) = 1; -+ } - } - - /* Warn for unused variables, but not if they're inside a common -@@ -4232,11 +4238,6 @@ - mark the symbol now, as well as in traverse_ns, to prevent - getting stuck in a circular dependency. */ - sym->mark = 1; -- -- /* We do not want the middle-end to warn about unused parameters -- as this was already done above. */ -- if (sym->attr.dummy && sym->backend_decl != NULL_TREE) -- TREE_NO_WARNING(sym->backend_decl) = 1; - } - else if (sym->attr.flavor == FL_PARAMETER) - { -@@ -4851,11 +4852,11 @@ - if (result == NULL_TREE) - { - /* TODO: move to the appropriate place in resolve.c. */ -- if (warn_return_type && !sym->attr.referenced && sym == sym->result) -+ if (warn_return_type && sym == sym->result) - gfc_warning ("Return value of function '%s' at %L not set", - sym->name, &sym->declared_at); -- -- TREE_NO_WARNING(sym->backend_decl) = 1; -+ if (warn_return_type) -+ TREE_NO_WARNING(sym->backend_decl) = 1; - } - else - gfc_add_expr_to_block (&body, gfc_generate_return ()); -Index: gcc/fortran/check.c -=================================================================== ---- a/src/gcc/fortran/check.c (revision -+++ b/src/gcc/fortran/check.c (revision -@@ -485,10 +485,31 @@ - && (gfc_current_intrinsic_arg[n]->intent == INTENT_OUT - || gfc_current_intrinsic_arg[n]->intent == INTENT_INOUT)) - { -- gfc_error ("'%s' argument of '%s' intrinsic at %L cannot be INTENT(IN)", -- gfc_current_intrinsic_arg[n]->name, gfc_current_intrinsic, -- &e->where); -- return FAILURE; -+ gfc_ref *ref; -+ bool pointer = e->symtree->n.sym->ts.type == BT_CLASS -+ && CLASS_DATA (e->symtree->n.sym) -+ ? CLASS_DATA (e->symtree->n.sym)->attr.class_pointer -+ : e->symtree->n.sym->attr.pointer; -+ -+ for (ref = e->ref; ref; ref = ref->next) -+ { -+ if (pointer && ref->type == REF_COMPONENT) -+ break; -+ if (ref->type == REF_COMPONENT -+ && ((ref->u.c.component->ts.type == BT_CLASS -+ && CLASS_DATA (ref->u.c.component)->attr.class_pointer) -+ || (ref->u.c.component->ts.type != BT_CLASS -+ && ref->u.c.component->attr.pointer))) -+ break; -+ } -+ -+ if (!ref) -+ { -+ gfc_error ("'%s' argument of '%s' intrinsic at %L cannot be " -+ "INTENT(IN)", gfc_current_intrinsic_arg[n]->name, -+ gfc_current_intrinsic, &e->where); -+ return FAILURE; -+ } - } - - if (e->expr_type == EXPR_VARIABLE -Index: gcc/fortran/dependency.c -=================================================================== ---- a/src/gcc/fortran/dependency.c (revision -+++ b/src/gcc/fortran/dependency.c (revision -@@ -163,9 +163,19 @@ - break; - - case REF_SUBSTRING: -- if (gfc_dep_compare_expr (r1->u.ss.start, r2->u.ss.start) != 0 -- || gfc_dep_compare_expr (r1->u.ss.end, r2->u.ss.end) != 0) -+ if (gfc_dep_compare_expr (r1->u.ss.start, r2->u.ss.start) != 0) - return false; -+ -+ /* If both are NULL, the end length compares equal, because we -+ are looking at the same variable. This can only happen for -+ assumed- or deferred-length character arguments. */ -+ -+ if (r1->u.ss.end == NULL && r2->u.ss.end == NULL) -+ break; -+ -+ if (gfc_dep_compare_expr (r1->u.ss.end, r2->u.ss.end) != 0) -+ return false; -+ - break; - - default: -Index: gcc/regmove.c -=================================================================== ---- a/src/gcc/regmove.c (revision -+++ b/src/gcc/regmove.c (revision -@@ -860,7 +860,7 @@ - if (REG_N_CALLS_CROSSED (REGNO (src)) == 0) - break; - -- if (call_used_regs [REGNO (dst)] -+ if ((HARD_REGISTER_P (dst) && call_used_regs [REGNO (dst)]) - || find_reg_fusage (p, CLOBBER, dst)) - break; - } -Index: gcc/df.h -=================================================================== ---- a/src/gcc/df.h (revision -+++ b/src/gcc/df.h (revision -@@ -53,7 +53,7 @@ - #define DF_RD 3 /* Reaching Defs. */ - #define DF_CHAIN 4 /* Def-Use and/or Use-Def Chains. */ - #define DF_WORD_LR 5 /* Subreg tracking lr. */ --#define DF_NOTE 6 /* REG_DEF and REG_UNUSED notes. */ -+#define DF_NOTE 6 /* REG_DEAD and REG_UNUSED notes. */ - #define DF_MD 7 /* Multiple Definitions. */ - - #define DF_LAST_PROBLEM_PLUS1 (DF_MD + 1) -Index: gcc/lto-section-in.c -=================================================================== ---- a/src/gcc/lto-section-in.c (revision -+++ b/src/gcc/lto-section-in.c (revision -@@ -296,7 +296,7 @@ - = (const struct lto_simple_header *) data; - - struct lto_input_block* ib_main; -- int32_t main_offset = sizeof (struct lto_simple_header); -+ int main_offset = sizeof (struct lto_simple_header); - - if (!data) - return NULL; -Index: gcc/tree-vect-data-refs.c -=================================================================== ---- a/src/gcc/tree-vect-data-refs.c (revision -+++ b/src/gcc/tree-vect-data-refs.c (revision -@@ -2631,6 +2631,16 @@ - return false; - } - -+ if (is_gimple_call (stmt)) -+ { -+ if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS)) -+ { -+ fprintf (vect_dump, "not vectorized: dr in a call "); -+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM); -+ } -+ return false; -+ } -+ - /* Update DR field in stmt_vec_info struct. */ - - /* If the dataref is in an inner-loop of the loop that is considered for -Index: gcc/calls.c -=================================================================== ---- a/src/gcc/calls.c (revision -+++ b/src/gcc/calls.c (revision -@@ -1548,6 +1548,131 @@ - return funexp; - } - -+/* Internal state for internal_arg_pointer_based_exp and its helpers. */ -+static struct -+{ -+ /* Last insn that has been scanned by internal_arg_pointer_based_exp_scan, -+ or NULL_RTX if none has been scanned yet. */ -+ rtx scan_start; -+ /* Vector indexed by REGNO - FIRST_PSEUDO_REGISTER, recording if a pseudo is -+ based on crtl->args.internal_arg_pointer. The element is NULL_RTX if the -+ pseudo isn't based on it, a CONST_INT offset if the pseudo is based on it -+ with fixed offset, or PC if this is with variable or unknown offset. */ -+ VEC(rtx, heap) *cache; -+} internal_arg_pointer_exp_state; -+ -+static rtx internal_arg_pointer_based_exp (rtx, bool); -+ -+/* Helper function for internal_arg_pointer_based_exp. Scan insns in -+ the tail call sequence, starting with first insn that hasn't been -+ scanned yet, and note for each pseudo on the LHS whether it is based -+ on crtl->args.internal_arg_pointer or not, and what offset from that -+ that pointer it has. */ -+ -+static void -+internal_arg_pointer_based_exp_scan (void) -+{ -+ rtx insn, scan_start = internal_arg_pointer_exp_state.scan_start; -+ -+ if (scan_start == NULL_RTX) -+ insn = get_insns (); -+ else -+ insn = NEXT_INSN (scan_start); -+ -+ while (insn) -+ { -+ rtx set = single_set (insn); -+ if (set && REG_P (SET_DEST (set)) && !HARD_REGISTER_P (SET_DEST (set))) -+ { -+ rtx val = NULL_RTX; -+ unsigned int idx = REGNO (SET_DEST (set)) - FIRST_PSEUDO_REGISTER; -+ /* Punt on pseudos set multiple times. */ -+ if (idx < VEC_length (rtx, internal_arg_pointer_exp_state.cache) -+ && (VEC_index (rtx, internal_arg_pointer_exp_state.cache, idx) -+ != NULL_RTX)) -+ val = pc_rtx; -+ else -+ val = internal_arg_pointer_based_exp (SET_SRC (set), false); -+ if (val != NULL_RTX) -+ { -+ if (idx -+ >= VEC_length (rtx, internal_arg_pointer_exp_state.cache)) -+ VEC_safe_grow_cleared (rtx, heap, -+ internal_arg_pointer_exp_state.cache, -+ idx + 1); -+ VEC_replace (rtx, internal_arg_pointer_exp_state.cache, -+ idx, val); -+ } -+ } -+ if (NEXT_INSN (insn) == NULL_RTX) -+ scan_start = insn; -+ insn = NEXT_INSN (insn); -+ } -+ -+ internal_arg_pointer_exp_state.scan_start = scan_start; -+} -+ -+/* Helper function for internal_arg_pointer_based_exp, called through -+ for_each_rtx. Return 1 if *LOC is a register based on -+ crtl->args.internal_arg_pointer. Return -1 if *LOC is not based on it -+ and the subexpressions need not be examined. Otherwise return 0. */ -+ -+static int -+internal_arg_pointer_based_exp_1 (rtx *loc, void *data ATTRIBUTE_UNUSED) -+{ -+ if (REG_P (*loc) && internal_arg_pointer_based_exp (*loc, false) != NULL_RTX) -+ return 1; -+ if (MEM_P (*loc)) -+ return -1; -+ return 0; -+} -+ -+/* Compute whether RTL is based on crtl->args.internal_arg_pointer. Return -+ NULL_RTX if RTL isn't based on it, a CONST_INT offset if RTL is based on -+ it with fixed offset, or PC if this is with variable or unknown offset. -+ TOPLEVEL is true if the function is invoked at the topmost level. */ -+ -+static rtx -+internal_arg_pointer_based_exp (rtx rtl, bool toplevel) -+{ -+ if (CONSTANT_P (rtl)) -+ return NULL_RTX; -+ -+ if (rtl == crtl->args.internal_arg_pointer) -+ return const0_rtx; -+ -+ if (REG_P (rtl) && HARD_REGISTER_P (rtl)) -+ return NULL_RTX; -+ -+ if (GET_CODE (rtl) == PLUS && CONST_INT_P (XEXP (rtl, 1))) -+ { -+ rtx val = internal_arg_pointer_based_exp (XEXP (rtl, 0), toplevel); -+ if (val == NULL_RTX || val == pc_rtx) -+ return val; -+ return plus_constant (val, INTVAL (XEXP (rtl, 1))); -+ } -+ -+ /* When called at the topmost level, scan pseudo assignments in between the -+ last scanned instruction in the tail call sequence and the latest insn -+ in that sequence. */ -+ if (toplevel) -+ internal_arg_pointer_based_exp_scan (); -+ -+ if (REG_P (rtl)) -+ { -+ unsigned int idx = REGNO (rtl) - FIRST_PSEUDO_REGISTER; -+ if (idx < VEC_length (rtx, internal_arg_pointer_exp_state.cache)) -+ return VEC_index (rtx, internal_arg_pointer_exp_state.cache, idx); -+ -+ return NULL_RTX; -+ } -+ -+ if (for_each_rtx (&rtl, internal_arg_pointer_based_exp_1, NULL)) -+ return pc_rtx; -+ -+ return NULL_RTX; -+} -+ - /* Return true if and only if SIZE storage units (usually bytes) - starting from address ADDR overlap with already clobbered argument - area. This function is used to determine if we should give up a -@@ -1557,20 +1682,17 @@ - mem_overlaps_already_clobbered_arg_p (rtx addr, unsigned HOST_WIDE_INT size) - { - HOST_WIDE_INT i; -+ rtx val; - -- if (addr == crtl->args.internal_arg_pointer) -- i = 0; -- else if (GET_CODE (addr) == PLUS -- && XEXP (addr, 0) == crtl->args.internal_arg_pointer -- && CONST_INT_P (XEXP (addr, 1))) -- i = INTVAL (XEXP (addr, 1)); -- /* Return true for arg pointer based indexed addressing. */ -- else if (GET_CODE (addr) == PLUS -- && (XEXP (addr, 0) == crtl->args.internal_arg_pointer -- || XEXP (addr, 1) == crtl->args.internal_arg_pointer)) -+ if (sbitmap_empty_p (stored_args_map)) -+ return false; -+ val = internal_arg_pointer_based_exp (addr, true); -+ if (val == NULL_RTX) -+ return false; -+ else if (val == pc_rtx) - return true; - else -- return false; -+ i = INTVAL (val); - - #ifdef ARGS_GROW_DOWNWARD - i = -i - size; -@@ -3175,6 +3297,8 @@ - } - - sbitmap_free (stored_args_map); -+ internal_arg_pointer_exp_state.scan_start = NULL_RTX; -+ VEC_free (rtx, heap, internal_arg_pointer_exp_state.cache); - } - else - { -Index: gcc/tree-ssa-pre.c -=================================================================== ---- a/src/gcc/tree-ssa-pre.c (revision -+++ b/src/gcc/tree-ssa-pre.c (revision -@@ -1545,7 +1545,7 @@ - tree newvuse = vuse; - VEC (vn_reference_op_s, heap) *newoperands = NULL; - bool changed = false, same_valid = true; -- unsigned int i, j; -+ unsigned int i, j, n; - vn_reference_op_t operand; - vn_reference_t newref; - -@@ -1554,100 +1554,83 @@ - { - pre_expr opresult; - pre_expr leader; -- tree oldop0 = operand->op0; -- tree oldop1 = operand->op1; -- tree oldop2 = operand->op2; -- tree op0 = oldop0; -- tree op1 = oldop1; -- tree op2 = oldop2; -+ tree op[3]; - tree type = operand->type; - vn_reference_op_s newop = *operand; -- -- if (op0 && TREE_CODE (op0) == SSA_NAME) -+ op[0] = operand->op0; -+ op[1] = operand->op1; -+ op[2] = operand->op2; -+ for (n = 0; n < 3; ++n) - { -- unsigned int op_val_id = VN_INFO (op0)->value_id; -- leader = find_leader_in_sets (op_val_id, set1, set2); -- opresult = phi_translate (leader, set1, set2, pred, phiblock); -- if (opresult && opresult != leader) -+ unsigned int op_val_id; -+ if (!op[n]) -+ continue; -+ if (TREE_CODE (op[n]) != SSA_NAME) - { -- tree name = get_representative_for (opresult); -- if (!name) -+ /* We can't possibly insert these. */ -+ if (n != 0 -+ && !is_gimple_min_invariant (op[n])) - break; -- op0 = name; -+ continue; - } -- else if (!opresult) -- break; -- } -- changed |= op0 != oldop0; -- -- if (op1 && TREE_CODE (op1) == SSA_NAME) -- { -- unsigned int op_val_id = VN_INFO (op1)->value_id; -+ op_val_id = VN_INFO (op[n])->value_id; - leader = find_leader_in_sets (op_val_id, set1, set2); -- opresult = phi_translate (leader, set1, set2, pred, phiblock); -- if (opresult && opresult != leader) -+ if (!leader) -+ break; -+ /* Make sure we do not recursively translate ourselves -+ like for translating a[n_1] with the leader for -+ n_1 being a[n_1]. */ -+ if (get_expression_id (leader) != get_expression_id (expr)) - { -- tree name = get_representative_for (opresult); -- if (!name) -+ opresult = phi_translate (leader, set1, set2, -+ pred, phiblock); -+ if (!opresult) - break; -- op1 = name; -+ if (opresult != leader) -+ { -+ tree name = get_representative_for (opresult); -+ if (!name) -+ break; -+ changed |= name != op[n]; -+ op[n] = name; -+ } - } -- else if (!opresult) -- break; - } -- /* We can't possibly insert these. */ -- else if (op1 && !is_gimple_min_invariant (op1)) -- break; -- changed |= op1 != oldop1; -- if (op2 && TREE_CODE (op2) == SSA_NAME) -+ if (n != 3) - { -- unsigned int op_val_id = VN_INFO (op2)->value_id; -- leader = find_leader_in_sets (op_val_id, set1, set2); -- opresult = phi_translate (leader, set1, set2, pred, phiblock); -- if (opresult && opresult != leader) -- { -- tree name = get_representative_for (opresult); -- if (!name) -- break; -- op2 = name; -- } -- else if (!opresult) -- break; -+ if (newoperands) -+ VEC_free (vn_reference_op_s, heap, newoperands); -+ return NULL; - } -- /* We can't possibly insert these. */ -- else if (op2 && !is_gimple_min_invariant (op2)) -- break; -- changed |= op2 != oldop2; -- - if (!newoperands) - newoperands = VEC_copy (vn_reference_op_s, heap, operands); - /* We may have changed from an SSA_NAME to a constant */ -- if (newop.opcode == SSA_NAME && TREE_CODE (op0) != SSA_NAME) -- newop.opcode = TREE_CODE (op0); -+ if (newop.opcode == SSA_NAME && TREE_CODE (op[0]) != SSA_NAME) -+ newop.opcode = TREE_CODE (op[0]); - newop.type = type; -- newop.op0 = op0; -- newop.op1 = op1; -- newop.op2 = op2; -+ newop.op0 = op[0]; -+ newop.op1 = op[1]; -+ newop.op2 = op[2]; - /* If it transforms a non-constant ARRAY_REF into a constant - one, adjust the constant offset. */ - if (newop.opcode == ARRAY_REF - && newop.off == -1 -- && TREE_CODE (op0) == INTEGER_CST -- && TREE_CODE (op1) == INTEGER_CST -- && TREE_CODE (op2) == INTEGER_CST) -+ && TREE_CODE (op[0]) == INTEGER_CST -+ && TREE_CODE (op[1]) == INTEGER_CST -+ && TREE_CODE (op[2]) == INTEGER_CST) - { -- double_int off = tree_to_double_int (op0); -+ double_int off = tree_to_double_int (op[0]); - off = double_int_add (off, - double_int_neg -- (tree_to_double_int (op1))); -- off = double_int_mul (off, tree_to_double_int (op2)); -+ (tree_to_double_int (op[1]))); -+ off = double_int_mul (off, tree_to_double_int (op[2])); - if (double_int_fits_in_shwi_p (off)) - newop.off = off.low; - } - VEC_replace (vn_reference_op_s, newoperands, j, &newop); - /* If it transforms from an SSA_NAME to an address, fold with - a preceding indirect reference. */ -- if (j > 0 && op0 && TREE_CODE (op0) == ADDR_EXPR -+ if (j > 0 && op[0] && TREE_CODE (op[0]) == ADDR_EXPR - && VEC_index (vn_reference_op_s, - newoperands, j - 1)->opcode == MEM_REF) - vn_reference_fold_indirect (&newoperands, &j); -Index: gcc/simplify-rtx.c -=================================================================== ---- a/src/gcc/simplify-rtx.c (revision -+++ b/src/gcc/simplify-rtx.c (revision -@@ -2777,7 +2777,7 @@ - } - } - } -- else -+ else if (SCALAR_INT_MODE_P (mode)) - { - /* 0/x is 0 (or x&0 if x has side-effects). */ - if (trueop0 == CONST0_RTX (mode) -@@ -4177,10 +4177,20 @@ - { - rtx x = XEXP (op0, 0); - rtx c = XEXP (op0, 1); -+ enum rtx_code invcode = op0code == PLUS ? MINUS : PLUS; -+ rtx tem = simplify_gen_binary (invcode, cmp_mode, op1, c); - -- c = simplify_gen_binary (op0code == PLUS ? MINUS : PLUS, -- cmp_mode, op1, c); -- return simplify_gen_relational (code, mode, cmp_mode, x, c); -+ /* Detect an infinite recursive condition, where we oscillate at this -+ simplification case between: -+ A + B == C <---> C - B == A, -+ where A, B, and C are all constants with non-simplifiable expressions, -+ usually SYMBOL_REFs. */ -+ if (GET_CODE (tem) == invcode -+ && CONSTANT_P (x) -+ && rtx_equal_p (c, XEXP (tem, 1))) -+ return NULL_RTX; -+ -+ return simplify_gen_relational (code, mode, cmp_mode, x, tem); - } - - /* (ne:SI (zero_extract:SI FOO (const_int 1) BAR) (const_int 0))) is -Index: gcc/tree-sra.c -=================================================================== ---- a/src/gcc/tree-sra.c (revision -+++ b/src/gcc/tree-sra.c (revision -@@ -1020,26 +1020,28 @@ - return false; - } - --/* Return true iff type of EXP is not sufficiently aligned. */ -+/* Return true if EXP is a memory reference less aligned than ALIGN. This is -+ invoked only on strict-alignment targets. */ - - static bool --tree_non_mode_aligned_mem_p (tree exp) -+tree_non_aligned_mem_p (tree exp, unsigned int align) - { -- enum machine_mode mode = TYPE_MODE (TREE_TYPE (exp)); -- unsigned int align; -+ unsigned int exp_align; - - if (TREE_CODE (exp) == VIEW_CONVERT_EXPR) - exp = TREE_OPERAND (exp, 0); - -- if (TREE_CODE (exp) == SSA_NAME -- || TREE_CODE (exp) == MEM_REF -- || mode == BLKmode -- || is_gimple_min_invariant (exp) -- || !STRICT_ALIGNMENT) -+ if (TREE_CODE (exp) == SSA_NAME || is_gimple_min_invariant (exp)) - return false; - -- align = get_object_alignment (exp, BIGGEST_ALIGNMENT); -- if (GET_MODE_ALIGNMENT (mode) > align) -+ /* get_object_alignment will fall back to BITS_PER_UNIT if it cannot -+ compute an explicit alignment. Pretend that dereferenced pointers -+ are always aligned on strict-alignment targets. */ -+ exp_align = get_object_alignment (exp, BIGGEST_ALIGNMENT); -+ if (TREE_CODE (exp) == MEM_REF || TREE_CODE (exp) == TARGET_MEM_REF) -+ exp_align = MAX (TYPE_ALIGN (TREE_TYPE (exp)), exp_align); -+ -+ if (exp_align < align) - return true; - - return false; -@@ -1071,7 +1073,11 @@ - if (lacc) - { - lacc->grp_assignment_write = 1; -- lacc->grp_unscalarizable_region |= tree_non_mode_aligned_mem_p (rhs); -+ if (STRICT_ALIGNMENT -+ && tree_non_aligned_mem_p (rhs, -+ get_object_alignment (lhs, -+ BIGGEST_ALIGNMENT))) -+ lacc->grp_unscalarizable_region = 1; - } - - if (racc) -@@ -1080,7 +1086,11 @@ - if (should_scalarize_away_bitmap && !gimple_has_volatile_ops (stmt) - && !is_gimple_reg_type (racc->type)) - bitmap_set_bit (should_scalarize_away_bitmap, DECL_UID (racc->base)); -- racc->grp_unscalarizable_region |= tree_non_mode_aligned_mem_p (lhs); -+ if (STRICT_ALIGNMENT -+ && tree_non_aligned_mem_p (lhs, -+ get_object_alignment (rhs, -+ BIGGEST_ALIGNMENT))) -+ racc->grp_unscalarizable_region = 1; - } - - if (lacc && racc -@@ -1435,29 +1445,61 @@ - return fold_build2_loc (loc, MEM_REF, exp_type, base, off); - } - -+DEF_VEC_ALLOC_P_STACK (tree); -+#define VEC_tree_stack_alloc(alloc) VEC_stack_alloc (tree, alloc) -+ - /* Construct a memory reference to a part of an aggregate BASE at the given -- OFFSET and of the same type as MODEL. In case this is a reference to a -- component, the function will replicate the last COMPONENT_REF of model's -- expr to access it. GSI and INSERT_AFTER have the same meaning as in -- build_ref_for_offset. */ -+ OFFSET and of the type of MODEL. In case this is a chain of references -+ to component, the function will replicate the chain of COMPONENT_REFs of -+ the expression of MODEL to access it. GSI and INSERT_AFTER have the same -+ meaning as in build_ref_for_offset. */ - - static tree - build_ref_for_model (location_t loc, tree base, HOST_WIDE_INT offset, - struct access *model, gimple_stmt_iterator *gsi, - bool insert_after) - { -+ tree type = model->type, t; -+ VEC(tree,stack) *cr_stack = NULL; -+ - if (TREE_CODE (model->expr) == COMPONENT_REF) - { -- tree t, exp_type, fld = TREE_OPERAND (model->expr, 1); -- offset -= int_bit_position (fld); -- exp_type = TREE_TYPE (TREE_OPERAND (model->expr, 0)); -- t = build_ref_for_offset (loc, base, offset, exp_type, gsi, insert_after); -- return fold_build3_loc (loc, COMPONENT_REF, TREE_TYPE (fld), t, fld, -- NULL_TREE); -+ tree expr = model->expr; -+ -+ /* Create a stack of the COMPONENT_REFs so later we can walk them in -+ order from inner to outer. */ -+ cr_stack = VEC_alloc (tree, stack, 6); -+ -+ do { -+ tree field = TREE_OPERAND (expr, 1); -+ offset -= int_bit_position (field); -+ -+ VEC_safe_push (tree, stack, cr_stack, expr); -+ -+ expr = TREE_OPERAND (expr, 0); -+ type = TREE_TYPE (expr); -+ } while (TREE_CODE (expr) == COMPONENT_REF); - } -- else -- return build_ref_for_offset (loc, base, offset, model->type, -- gsi, insert_after); -+ -+ t = build_ref_for_offset (loc, base, offset, type, gsi, insert_after); -+ -+ if (TREE_CODE (model->expr) == COMPONENT_REF) -+ { -+ unsigned i; -+ tree expr; -+ -+ /* Now replicate the chain of COMPONENT_REFs from inner to outer. */ -+ FOR_EACH_VEC_ELT_REVERSE (tree, cr_stack, i, expr) -+ { -+ tree field = TREE_OPERAND (expr, 1); -+ t = fold_build3_loc (loc, COMPONENT_REF, TREE_TYPE (field), t, field, -+ NULL_TREE); -+ } -+ -+ VEC_free (tree, stack, cr_stack); -+ } -+ -+ return t; - } - - /* Construct a memory reference consisting of component_refs and array_refs to -@@ -2594,6 +2636,10 @@ - rhs = get_access_replacement (racc); - if (!useless_type_conversion_p (lacc->type, racc->type)) - rhs = fold_build1_loc (loc, VIEW_CONVERT_EXPR, lacc->type, rhs); -+ -+ if (racc->grp_partial_lhs && lacc->grp_partial_lhs) -+ rhs = force_gimple_operand_gsi (old_gsi, rhs, true, NULL_TREE, -+ true, GSI_SAME_STMT); - } - else - { -@@ -2609,6 +2655,9 @@ - else - rhs = build_ref_for_model (loc, top_racc->base, offset, lacc, - new_gsi, true); -+ if (lacc->grp_partial_lhs) -+ rhs = force_gimple_operand_gsi (new_gsi, rhs, true, NULL_TREE, -+ false, GSI_NEW_STMT); - } - - stmt = gimple_build_assign (get_access_replacement (lacc), rhs); -@@ -3604,7 +3653,8 @@ - || gimple_code (access->stmt) == GIMPLE_ASM)) - return true; - -- if (tree_non_mode_aligned_mem_p (access->expr)) -+ if (STRICT_ALIGNMENT -+ && tree_non_aligned_mem_p (access->expr, TYPE_ALIGN (access->type))) - return true; - - return false; -Index: gcc/lto/lto.c -=================================================================== ---- a/src/gcc/lto/lto.c (revision -+++ b/src/gcc/lto/lto.c (revision -@@ -198,7 +198,7 @@ - uint32_t ix; - tree decl; - uint32_t i, j; -- -+ - ix = *data++; - decl = lto_streamer_cache_get (data_in->reader_cache, (int) ix); - if (TREE_CODE (decl) != FUNCTION_DECL) -@@ -241,9 +241,9 @@ - VEC(ld_plugin_symbol_resolution_t,heap) *resolutions) - { - const struct lto_decl_header *header = (const struct lto_decl_header *) data; -- const int32_t decl_offset = sizeof (struct lto_decl_header); -- const int32_t main_offset = decl_offset + header->decl_state_size; -- const int32_t string_offset = main_offset + header->main_size; -+ const int decl_offset = sizeof (struct lto_decl_header); -+ const int main_offset = decl_offset + header->decl_state_size; -+ const int string_offset = main_offset + header->main_size; - struct lto_input_block ib_main; - struct data_in *data_in; - unsigned int i; -@@ -291,17 +291,20 @@ - - if (data_ptr != data_end) - internal_error ("bytecode stream: garbage at the end of symbols section"); -- -+ - /* Set the current decl state to be the global state. */ - decl_data->current_decl_state = decl_data->global_decl_state; - - lto_data_in_delete (data_in); - } - --/* strtoll is not portable. */ --int64_t --lto_parse_hex (const char *p) { -- uint64_t ret = 0; -+/* Custom version of strtoll, which is not portable. */ -+ -+static HOST_WIDEST_INT -+lto_parse_hex (const char *p) -+{ -+ HOST_WIDEST_INT ret = 0; -+ - for (; *p != '\0'; ++p) - { - char c = *p; -@@ -317,6 +320,7 @@ - internal_error ("could not parse hex number"); - ret |= part; - } -+ - return ret; - } - -@@ -352,7 +356,7 @@ - { - int t; - char offset_p[17]; -- int64_t offset; -+ HOST_WIDEST_INT offset; - t = fscanf (resolution, "@0x%16s", offset_p); - if (t != 1) - internal_error ("could not parse file offset"); -Index: gcc/lto/lto.h -=================================================================== ---- a/src/gcc/lto/lto.h (revision -+++ b/src/gcc/lto/lto.h (revision -@@ -60,6 +60,4 @@ - size_t len; - }; - --int64_t lto_parse_hex (const char *p); -- - #endif /* LTO_H */ -Index: gcc/lto/ChangeLog -=================================================================== ---- a/src/gcc/lto/ChangeLog (revision -+++ b/src/gcc/lto/ChangeLog (revision -@@ -1,3 +1,10 @@ -+2011-12-13 Eric Botcazou -+ -+ * lto.h (lto_parse_hex): Delete. -+ * lto.c (lto_read_decls): Use 'int' for offsets. -+ (lto_parse_hex): Make static and return proper 64-bit host type. -+ (lto_resolution_read): Use proper 64-bit host type. -+ - 2011-10-26 Release Manager - - * GCC 4.6.2 released. -Index: gcc/ipa-prop.c -=================================================================== ---- a/src/gcc/ipa-prop.c (revision -+++ b/src/gcc/ipa-prop.c (revision -@@ -2868,9 +2868,9 @@ - { - const struct lto_function_header *header = - (const struct lto_function_header *) data; -- const int32_t cfg_offset = sizeof (struct lto_function_header); -- const int32_t main_offset = cfg_offset + header->cfg_size; -- const int32_t string_offset = main_offset + header->main_size; -+ const int cfg_offset = sizeof (struct lto_function_header); -+ const int main_offset = cfg_offset + header->cfg_size; -+ const int string_offset = main_offset + header->main_size; - struct data_in *data_in; - struct lto_input_block ib_main; - unsigned int i; -Index: gcc/tree-ssa-forwprop.c -=================================================================== ---- a/src/gcc/tree-ssa-forwprop.c (revision -+++ b/src/gcc/tree-ssa-forwprop.c (revision -@@ -872,7 +872,7 @@ - TREE_TYPE (gimple_assign_rhs1 (use_stmt)))) - { - tree *def_rhs_basep = &TREE_OPERAND (def_rhs, 0); -- tree new_offset, new_base, saved; -+ tree new_offset, new_base, saved, new_lhs; - while (handled_component_p (*def_rhs_basep)) - def_rhs_basep = &TREE_OPERAND (*def_rhs_basep, 0); - saved = *def_rhs_basep; -@@ -891,9 +891,12 @@ - *def_rhs_basep = build2 (MEM_REF, TREE_TYPE (*def_rhs_basep), - new_base, new_offset); - TREE_THIS_VOLATILE (*def_rhs_basep) = TREE_THIS_VOLATILE (lhs); -+ TREE_SIDE_EFFECTS (*def_rhs_basep) = TREE_SIDE_EFFECTS (lhs); - TREE_THIS_NOTRAP (*def_rhs_basep) = TREE_THIS_NOTRAP (lhs); -- gimple_assign_set_lhs (use_stmt, -- unshare_expr (TREE_OPERAND (def_rhs, 0))); -+ new_lhs = unshare_expr (TREE_OPERAND (def_rhs, 0)); -+ gimple_assign_set_lhs (use_stmt, new_lhs); -+ TREE_THIS_VOLATILE (new_lhs) = TREE_THIS_VOLATILE (lhs); -+ TREE_SIDE_EFFECTS (new_lhs) = TREE_SIDE_EFFECTS (lhs); - *def_rhs_basep = saved; - tidy_after_forward_propagate_addr (use_stmt); - /* Continue propagating into the RHS if this was not the -@@ -953,7 +956,7 @@ - TREE_TYPE (TREE_OPERAND (def_rhs, 0)))) - { - tree *def_rhs_basep = &TREE_OPERAND (def_rhs, 0); -- tree new_offset, new_base, saved; -+ tree new_offset, new_base, saved, new_rhs; - while (handled_component_p (*def_rhs_basep)) - def_rhs_basep = &TREE_OPERAND (*def_rhs_basep, 0); - saved = *def_rhs_basep; -@@ -972,9 +975,12 @@ - *def_rhs_basep = build2 (MEM_REF, TREE_TYPE (*def_rhs_basep), - new_base, new_offset); - TREE_THIS_VOLATILE (*def_rhs_basep) = TREE_THIS_VOLATILE (rhs); -+ TREE_SIDE_EFFECTS (*def_rhs_basep) = TREE_SIDE_EFFECTS (rhs); - TREE_THIS_NOTRAP (*def_rhs_basep) = TREE_THIS_NOTRAP (rhs); -- gimple_assign_set_rhs1 (use_stmt, -- unshare_expr (TREE_OPERAND (def_rhs, 0))); -+ new_rhs = unshare_expr (TREE_OPERAND (def_rhs, 0)); -+ gimple_assign_set_rhs1 (use_stmt, new_rhs); -+ TREE_THIS_VOLATILE (new_rhs) = TREE_THIS_VOLATILE (rhs); -+ TREE_SIDE_EFFECTS (new_rhs) = TREE_SIDE_EFFECTS (rhs); - *def_rhs_basep = saved; - fold_stmt_inplace (use_stmt); - tidy_after_forward_propagate_addr (use_stmt); -Index: gcc/varasm.c -=================================================================== ---- a/src/gcc/varasm.c (revision -+++ b/src/gcc/varasm.c (revision -@@ -6751,11 +6751,14 @@ - /* A non-decl is an entry in the constant pool. */ - if (!DECL_P (exp)) - local_p = true; -- /* Weakrefs may not bind locally, even though the weakref itself is -- always static and therefore local. -- FIXME: We can resolve this more curefuly by looking at the weakref -- alias. */ -- else if (lookup_attribute ("weakref", DECL_ATTRIBUTES (exp))) -+ /* Weakrefs may not bind locally, even though the weakref itself is always -+ static and therefore local. Similarly, the resolver for ifunc functions -+ might resolve to a non-local function. -+ FIXME: We can resolve the weakref case more curefuly by looking at the -+ weakref alias. */ -+ else if (lookup_attribute ("weakref", DECL_ATTRIBUTES (exp)) -+ || (TREE_CODE (exp) == FUNCTION_DECL -+ && lookup_attribute ("ifunc", DECL_ATTRIBUTES (exp)))) - local_p = false; - /* Static variables are always local. */ - else if (! TREE_PUBLIC (exp)) -Index: gcc/sched-deps.c -=================================================================== ---- a/src/gcc/sched-deps.c (revision -+++ b/src/gcc/sched-deps.c (revision -@@ -2687,7 +2687,11 @@ - else - sched_analyze_2 (deps, XEXP (link, 0), insn); - } -- if (find_reg_note (insn, REG_SETJMP, NULL)) -+ /* Don't schedule anything after a tail call, tail call needs -+ to use at least all call-saved registers. */ -+ if (SIBLING_CALL_P (insn)) -+ reg_pending_barrier = TRUE_BARRIER; -+ else if (find_reg_note (insn, REG_SETJMP, NULL)) - reg_pending_barrier = MOVE_BARRIER; - } - -Index: gcc/tree-outof-ssa.c -=================================================================== ---- a/src/gcc/tree-outof-ssa.c (revision -+++ b/src/gcc/tree-outof-ssa.c (revision -@@ -237,9 +237,10 @@ - - var = SSA_NAME_VAR (partition_to_var (SA.map, dest)); - src_mode = TYPE_MODE (TREE_TYPE (src)); -- dest_mode = promote_decl_mode (var, &unsignedp); -+ dest_mode = GET_MODE (SA.partition_to_pseudo[dest]); - gcc_assert (src_mode == TYPE_MODE (TREE_TYPE (var))); -- gcc_assert (dest_mode == GET_MODE (SA.partition_to_pseudo[dest])); -+ gcc_assert (!REG_P (SA.partition_to_pseudo[dest]) -+ || dest_mode == promote_decl_mode (var, &unsignedp)); - - if (src_mode != dest_mode) - { -Index: gcc/tree-ssa-structalias.c -=================================================================== ---- a/src/gcc/tree-ssa-structalias.c (revision -+++ b/src/gcc/tree-ssa-structalias.c (revision -@@ -308,6 +308,7 @@ - static varinfo_t first_or_preceding_vi_for_offset (varinfo_t, - unsigned HOST_WIDE_INT); - static varinfo_t lookup_vi_for_tree (tree); -+static inline bool type_can_have_subvars (const_tree); - - /* Pool of variable info structures. */ - static alloc_pool variable_info_pool; -@@ -3353,7 +3354,8 @@ - return; - - cs = *VEC_last (ce_s, *results); -- if (cs.type == DEREF) -+ if (cs.type == DEREF -+ && type_can_have_subvars (TREE_TYPE (t))) - { - /* For dereferences this means we have to defer it - to solving time. */ -@@ -4981,6 +4983,15 @@ - VEC_qsort (fieldoff_s, fieldstack, fieldoff_compare); - } - -+/* Return true if T is a type that can have subvars. */ -+ -+static inline bool -+type_can_have_subvars (const_tree t) -+{ -+ /* Aggregates without overlapping fields can have subvars. */ -+ return TREE_CODE (t) == RECORD_TYPE; -+} -+ - /* Return true if V is a tree that we can have subvars for. - Normally, this is any aggregate type. Also complex - types which are not gimple registers can have subvars. */ -@@ -4996,11 +5007,7 @@ - if (!DECL_P (v)) - return false; - -- /* Aggregates without overlapping fields can have subvars. */ -- if (TREE_CODE (TREE_TYPE (v)) == RECORD_TYPE) -- return true; -- -- return false; -+ return type_can_have_subvars (TREE_TYPE (v)); - } - - /* Return true if T is a type that does contain pointers. */ -Index: gcc/lto-opts.c -=================================================================== ---- a/src/gcc/lto-opts.c (revision -+++ b/src/gcc/lto-opts.c (revision -@@ -358,7 +358,7 @@ - size_t len, l, skip; - const char *data, *p; - const struct lto_simple_header *header; -- int32_t opts_offset; -+ int opts_offset; - struct lto_input_block ib; - - data = lto_get_section_data (file_data, LTO_section_opts, NULL, &len); -@@ -379,10 +379,10 @@ - - lto_check_version (header->lto_header.major_version, - header->lto_header.minor_version); -- -+ - LTO_INIT_INPUT_BLOCK (ib, p + opts_offset, 0, header->main_size); - input_options (&ib); -- -+ - skip = header->main_size + opts_offset; - l -= skip; - p += skip; -Index: gcc/config/alpha/linux-unwind.h -=================================================================== ---- a/src/gcc/config/alpha/linux-unwind.h (revision -+++ b/src/gcc/config/alpha/linux-unwind.h (revision -@@ -1,5 +1,5 @@ - /* DWARF2 EH unwinding support for Alpha Linux. -- Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc. -+ Copyright (C) 2004, 2005, 2009, 2011 Free Software Foundation, Inc. - - This file is part of GCC. - -@@ -36,16 +36,17 @@ - { - unsigned int *pc = context->ra; - struct sigcontext *sc; -- long new_cfa, i; -+ long new_cfa; -+ int i; - - if (pc[0] != 0x47fe0410 /* mov $30,$16 */ -- || pc[2] != 0x00000083 /* callsys */) -+ || pc[2] != 0x00000083) /* callsys */ - return _URC_END_OF_STACK; - if (context->cfa == 0) - return _URC_END_OF_STACK; - if (pc[1] == 0x201f0067) /* lda $0,NR_sigreturn */ - sc = context->cfa; -- else if (pc[1] == 0x201f015f) /* lda $0,NR_rt_sigreturn */ -+ else if (pc[1] == 0x201f015f) /* lda $0,NR_rt_sigreturn */ - { - struct rt_sigframe { - struct siginfo info; -@@ -55,6 +56,7 @@ - } - else - return _URC_END_OF_STACK; -+ - new_cfa = sc->sc_regs[30]; - fs->regs.cfa_how = CFA_REG_OFFSET; - fs->regs.cfa_reg = 30; -@@ -63,13 +65,13 @@ - { - fs->regs.reg[i].how = REG_SAVED_OFFSET; - fs->regs.reg[i].loc.offset -- = (long)&sc->sc_regs[i] - new_cfa; -+ = (long) &sc->sc_regs[i] - new_cfa; - } - for (i = 0; i < 31; ++i) - { - fs->regs.reg[i+32].how = REG_SAVED_OFFSET; - fs->regs.reg[i+32].loc.offset -- = (long)&sc->sc_fpregs[i] - new_cfa; -+ = (long) &sc->sc_fpregs[i] - new_cfa; - } - fs->regs.reg[64].how = REG_SAVED_OFFSET; - fs->regs.reg[64].loc.offset = (long)&sc->sc_pc - new_cfa; -@@ -78,3 +80,20 @@ - - return _URC_NO_REASON; - } -+ -+#define MD_FROB_UPDATE_CONTEXT alpha_frob_update_context -+ -+/* Fix up for signal handlers that don't have S flag set. */ -+ -+static void -+alpha_frob_update_context (struct _Unwind_Context *context, -+ _Unwind_FrameState *fs ATTRIBUTE_UNUSED) -+{ -+ unsigned int *pc = context->ra; -+ -+ if (pc[0] == 0x47fe0410 /* mov $30,$16 */ -+ && pc[2] == 0x00000083 /* callsys */ -+ && (pc[1] == 0x201f0067 /* lda $0,NR_sigreturn */ -+ || pc[1] == 0x201f015f)) /* lda $0,NR_rt_sigreturn */ -+ _Unwind_SetSignalFrame (context, 1); -+} -Index: gcc/config/sparc/sparc.md -=================================================================== ---- a/src/gcc/config/sparc/sparc.md (revision -+++ b/src/gcc/config/sparc/sparc.md (revision -@@ -28,6 +28,7 @@ - [(UNSPEC_MOVE_PIC 0) - (UNSPEC_UPDATE_RETURN 1) - (UNSPEC_LOAD_PCREL_SYM 2) -+ (UNSPEC_FRAME_BLOCKAGE 3) - (UNSPEC_MOVE_PIC_LABEL 5) - (UNSPEC_SETH44 6) - (UNSPEC_SETM44 7) -@@ -6338,6 +6339,25 @@ - "" - [(set_attr "length" "0")]) - -+;; Do not schedule instructions accessing memory before this point. -+ -+(define_expand "frame_blockage" -+ [(set (match_dup 0) -+ (unspec:BLK [(match_dup 1)] UNSPEC_FRAME_BLOCKAGE))] -+ "" -+{ -+ operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode)); -+ MEM_VOLATILE_P (operands[0]) = 1; -+ operands[1] = stack_pointer_rtx; -+}) -+ -+(define_insn "*frame_blockage" -+ [(set (match_operand:BLK 0 "" "") -+ (unspec:BLK [(match_operand:P 1 "" "")] UNSPEC_FRAME_BLOCKAGE))] -+ "" -+ "" -+ [(set_attr "length" "0")]) -+ - (define_expand "probe_stack" - [(set (match_operand 0 "memory_operand" "") (const_int 0))] - "" -Index: gcc/config/sparc/sparc.c -=================================================================== ---- a/src/gcc/config/sparc/sparc.c (revision -+++ b/src/gcc/config/sparc/sparc.c (revision -@@ -4569,8 +4569,9 @@ - else if (actual_fsize <= 8192) - { - insn = emit_insn (gen_stack_pointer_inc (GEN_INT (-4096))); -+ RTX_FRAME_RELATED_P (insn) = 1; -+ - /* %sp is still the CFA register. */ -- RTX_FRAME_RELATED_P (insn) = 1; - insn - = emit_insn (gen_stack_pointer_inc (GEN_INT (4096-actual_fsize))); - } -@@ -4592,8 +4593,18 @@ - else if (actual_fsize <= 8192) - { - insn = emit_insn (gen_save_register_window (GEN_INT (-4096))); -+ - /* %sp is not the CFA register anymore. */ - emit_insn (gen_stack_pointer_inc (GEN_INT (4096-actual_fsize))); -+ -+ /* Make sure no %fp-based store is issued until after the frame is -+ established. The offset between the frame pointer and the stack -+ pointer is calculated relative to the value of the stack pointer -+ at the end of the function prologue, and moving instructions that -+ access the stack via the frame pointer between the instructions -+ that decrement the stack pointer could result in accessing the -+ register window save area, which is volatile. */ -+ emit_insn (gen_frame_blockage ()); - } - else - { -Index: gcc/config/i386/i386.md -=================================================================== ---- a/src/gcc/config/i386/i386.md (revision -+++ b/src/gcc/config/i386/i386.md (revision -@@ -1960,7 +1960,7 @@ - - (define_insn "*movdi_internal_rex64" - [(set (match_operand:DI 0 "nonimmediate_operand" -- "=r,r ,r,m ,!m,*y,*y,?r ,m ,?*Ym,?*y,*x,*x,?r ,m,?*Yi,*x,?*x,?*Ym") -+ "=r,r ,r,m ,!o,*y,*y,?r ,m ,?*Ym,?*y,*x,*x,?r ,m,?*Yi,*x,?*x,?*Ym") - (match_operand:DI 1 "general_operand" - "Z ,rem,i,re,n ,C ,*y,*Ym,*y,r ,m ,C ,*x,*Yi,*x,r ,m ,*Ym,*x"))] - "TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))" -@@ -2905,7 +2905,7 @@ - - (define_insn "*movdf_internal_rex64" - [(set (match_operand:DF 0 "nonimmediate_operand" -- "=f,m,f,r ,m,!r,!m,Y2*x,Y2*x,Y2*x,m ,Yi,r ") -+ "=f,m,f,r ,m,!r,!o,Y2*x,Y2*x,Y2*x,m ,Yi,r ") - (match_operand:DF 1 "general_operand" - "fm,f,G,rm,r,F ,F ,C ,Y2*x,m ,Y2*x,r ,Yi"))] - "TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1])) -Index: gcc/config/i386/freebsd.h -=================================================================== ---- a/src/gcc/config/i386/freebsd.h (revision -+++ b/src/gcc/config/i386/freebsd.h (revision -@@ -147,3 +147,6 @@ - #if FBSD_MAJOR >= 6 - #define SUBTARGET32_DEFAULT_CPU "i486" - #endif -+ -+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack -+ -Index: gcc/config/i386/avxintrin.h -=================================================================== ---- a/src/gcc/config/i386/avxintrin.h (revision -+++ b/src/gcc/config/i386/avxintrin.h (revision -@@ -759,7 +759,7 @@ - - #ifdef __x86_64__ - extern __inline __m256i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) --_mm256_insert_epi64 (__m256i __X, int __D, int const __N) -+_mm256_insert_epi64 (__m256i __X, long long __D, int const __N) - { - __m128i __Y = _mm256_extractf128_si256 (__X, __N >> 1); - __Y = _mm_insert_epi64 (__Y, __D, __N % 2); -Index: gcc/config/avr/libgcc.S -=================================================================== ---- a/src/gcc/config/avr/libgcc.S (revision -+++ b/src/gcc/config/avr/libgcc.S (revision -@@ -582,7 +582,16 @@ - push r17 - push r28 - push r29 -+#if defined (__AVR_HAVE_8BIT_SP__) -+;; FIXME: __AVR_HAVE_8BIT_SP__ is set on device level, not on core level -+;; so this lines are dead code. To make it work, devices without -+;; SP_H must get their own multilib(s), see PR51345. - in r28,__SP_L__ -+ sub r28,r26 -+ clr r29 -+ out __SP_L__,r28 -+#else -+ in r28,__SP_L__ - in r29,__SP_H__ - sub r28,r26 - sbc r29,r27 -@@ -591,6 +600,7 @@ - out __SP_H__,r29 - out __SREG__,__tmp_reg__ - out __SP_L__,r28 -+#endif - #if defined (__AVR_HAVE_EIJMP_EICALL__) - eijmp - #else -@@ -625,6 +635,15 @@ - ldd r16,Y+4 - ldd r17,Y+3 - ldd r26,Y+2 -+#if defined (__AVR_HAVE_8BIT_SP__) -+;; FIXME: __AVR_HAVE_8BIT_SP__ is set on device level, not on core level -+;; so this lines are dead code. To make it work, devices without -+;; SP_H must get their own multilib(s). -+ ldd r29,Y+1 -+ add r28,r30 -+ out __SP_L__,r28 -+ mov r28, r26 -+#else - ldd r27,Y+1 - add r28,r30 - adc r29,__zero_reg__ -@@ -635,6 +654,7 @@ - out __SP_L__,r28 - mov_l r28, r26 - mov_h r29, r27 -+#endif - ret - .endfunc - #endif /* defined (L_epilogue) */ -Index: gcc/config/avr/avr.md -=================================================================== ---- a/src/gcc/config/avr/avr.md (revision -+++ b/src/gcc/config/avr/avr.md (revision -@@ -299,7 +299,7 @@ - [(set (match_operand:HI 0 "stack_register_operand" "=q") - (unspec_volatile:HI [(match_operand:HI 1 "register_operand" "r")] - UNSPECV_WRITE_SP_IRQ_OFF))] -- "" -+ "!AVR_HAVE_8BIT_SP" - "out __SP_H__, %B1 - out __SP_L__, %A1" - [(set_attr "length" "2") -@@ -309,7 +309,7 @@ - [(set (match_operand:HI 0 "stack_register_operand" "=q") - (unspec_volatile:HI [(match_operand:HI 1 "register_operand" "r")] - UNSPECV_WRITE_SP_IRQ_ON))] -- "" -+ "!AVR_HAVE_8BIT_SP" - "cli - out __SP_H__, %B1 - sei -Index: gcc/config/avr/avr-devices.c -=================================================================== ---- a/src/gcc/config/avr/avr-devices.c (revision -+++ b/src/gcc/config/avr/avr-devices.c (revision -@@ -70,7 +70,7 @@ - { "attiny2313a", ARCH_AVR25, "__AVR_ATtiny2313A__", 1, 0x0060, "tn2313a" }, - { "attiny24", ARCH_AVR25, "__AVR_ATtiny24__", 1, 0x0060, "tn24" }, - { "attiny24a", ARCH_AVR25, "__AVR_ATtiny24A__", 1, 0x0060, "tn24a" }, -- { "attiny4313", ARCH_AVR25, "__AVR_ATtiny4313__", 1, 0x0060, "tn4313" }, -+ { "attiny4313", ARCH_AVR25, "__AVR_ATtiny4313__", 0, 0x0060, "tn4313" }, - { "attiny44", ARCH_AVR25, "__AVR_ATtiny44__", 0, 0x0060, "tn44" }, - { "attiny44a", ARCH_AVR25, "__AVR_ATtiny44A__", 0, 0x0060, "tn44a" }, - { "attiny84", ARCH_AVR25, "__AVR_ATtiny84__", 0, 0x0060, "tn84" }, -@@ -88,7 +88,7 @@ - { "attiny87", ARCH_AVR25, "__AVR_ATtiny87__", 0, 0x0100, "tn87" }, - { "attiny48", ARCH_AVR25, "__AVR_ATtiny48__", 0, 0x0100, "tn48" }, - { "attiny88", ARCH_AVR25, "__AVR_ATtiny88__", 0, 0x0100, "tn88" }, -- { "at86rf401", ARCH_AVR25, "__AVR_AT86RF401__", 1, 0x0060, "86401" }, -+ { "at86rf401", ARCH_AVR25, "__AVR_AT86RF401__", 0, 0x0060, "86401" }, - /* Classic, > 8K, <= 64K. */ - { "avr3", ARCH_AVR3, NULL, 0, 0x0060, "43355" }, - { "at43usb355", ARCH_AVR3, "__AVR_AT43USB355__", 0, 0x0060, "43355" }, -Index: gcc/config/avr/avr.c -=================================================================== ---- a/src/gcc/config/avr/avr.c (revision -+++ b/src/gcc/config/avr/avr.c (revision -@@ -1879,9 +1879,12 @@ - } - else if (test_hard_reg_class (STACK_REG, src)) - { -- *l = 2; -- return (AS2 (in,%A0,__SP_L__) CR_TAB -- AS2 (in,%B0,__SP_H__)); -+ *l = 2; -+ return AVR_HAVE_8BIT_SP -+ ? (AS2 (in,%A0,__SP_L__) CR_TAB -+ AS1 (clr,%B0)) -+ : (AS2 (in,%A0,__SP_L__) CR_TAB -+ AS2 (in,%B0,__SP_H__)); - } - - if (AVR_HAVE_MOVW) -@@ -5173,10 +5176,10 @@ - - default_file_start (); - --/* fprintf (asm_out_file, "\t.arch %s\n", avr_mcu_name);*/ -- fputs ("__SREG__ = 0x3f\n" -- "__SP_H__ = 0x3e\n" -- "__SP_L__ = 0x3d\n", asm_out_file); -+ fputs ("__SREG__ = 0x3f\n", asm_out_file); -+ if (!AVR_HAVE_8BIT_SP) -+ fputs ("__SP_H__ = 0x3e\n", asm_out_file); -+ fputs ("__SP_L__ = 0x3d\n", asm_out_file); - - fputs ("__tmp_reg__ = 0\n" - "__zero_reg__ = 1\n", asm_out_file); -Index: gcc/config/rs6000/rs6000.c -=================================================================== ---- a/src/gcc/config/rs6000/rs6000.c (revision -+++ b/src/gcc/config/rs6000/rs6000.c (revision -@@ -2612,6 +2612,7 @@ - off. */ - rs6000_altivec_abi = 1; - TARGET_ALTIVEC_VRSAVE = 1; -+ rs6000_current_abi = ABI_DARWIN; - - if (DEFAULT_ABI == ABI_DARWIN - && TARGET_64BIT) -@@ -16614,7 +16615,7 @@ - if (TARGET_RELOCATABLE - && in_section != toc_section - && in_section != text_section -- && !unlikely_text_section_p (in_section) -+ && (in_section && (in_section->common.flags & SECTION_CODE)) == 0 - && !recurse - && GET_CODE (x) != CONST_INT - && GET_CODE (x) != CONST_DOUBLE -@@ -20645,56 +20646,52 @@ - { - int i; - rtx spe_save_area_ptr; -- -+ int save_ptr_to_sp; -+ int ool_adjust = 0; -+ - /* Determine whether we can address all of the registers that need -- to be saved with an offset from the stack pointer that fits in -+ to be saved with an offset from frame_reg_rtx that fits in - the small const field for SPE memory instructions. */ -- int spe_regs_addressable_via_sp -- = (SPE_CONST_OFFSET_OK(info->spe_gp_save_offset + sp_offset -- + (32 - info->first_gp_reg_save - 1) * reg_size) -+ int spe_regs_addressable -+ = (SPE_CONST_OFFSET_OK (info->spe_gp_save_offset + sp_offset -+ + reg_size * (32 - info->first_gp_reg_save - 1)) - && saving_GPRs_inline); - int spe_offset; -- -- if (spe_regs_addressable_via_sp) -+ -+ if (spe_regs_addressable) - { - spe_save_area_ptr = frame_reg_rtx; -+ save_ptr_to_sp = info->total_size - sp_offset; - spe_offset = info->spe_gp_save_offset + sp_offset; - } - else - { - /* Make r11 point to the start of the SPE save area. We need - to be careful here if r11 is holding the static chain. If -- it is, then temporarily save it in r0. We would use r0 as -- our base register here, but using r0 as a base register in -- loads and stores means something different from what we -- would like. */ -- int ool_adjust = (saving_GPRs_inline -- ? 0 -- : (info->first_gp_reg_save -- - (FIRST_SAVRES_REGISTER+1))*8); -- HOST_WIDE_INT offset = (info->spe_gp_save_offset -- + sp_offset - ool_adjust); -+ it is, then temporarily save it in r0. */ -+ int offset; - -+ if (!saving_GPRs_inline) -+ ool_adjust = 8 * (info->first_gp_reg_save -+ - (FIRST_SAVRES_REGISTER + 1)); -+ offset = info->spe_gp_save_offset + sp_offset - ool_adjust; -+ spe_save_area_ptr = gen_rtx_REG (Pmode, 11); -+ save_ptr_to_sp = info->total_size - sp_offset + offset; -+ spe_offset = 0; -+ - if (using_static_chain_p) - { - rtx r0 = gen_rtx_REG (Pmode, 0); - gcc_assert (info->first_gp_reg_save > 11); -- -- emit_move_insn (r0, gen_rtx_REG (Pmode, 11)); -+ -+ emit_move_insn (r0, spe_save_area_ptr); - } -- -- spe_save_area_ptr = gen_rtx_REG (Pmode, 11); -- insn = emit_insn (gen_addsi3 (spe_save_area_ptr, -- frame_reg_rtx, -- GEN_INT (offset))); -- /* We need to make sure the move to r11 gets noted for -- properly outputting unwind information. */ -- if (!saving_GPRs_inline) -- rs6000_frame_related (insn, frame_reg_rtx, offset, -- NULL_RTX, NULL_RTX); -- spe_offset = 0; -+ emit_insn (gen_addsi3 (spe_save_area_ptr, -+ frame_reg_rtx, GEN_INT (offset))); -+ if (REGNO (frame_reg_rtx) == 11) -+ sp_offset = -info->spe_gp_save_offset + ool_adjust; - } -- -+ - if (saving_GPRs_inline) - { - for (i = 0; i < 32 - info->first_gp_reg_save; i++) -@@ -20706,36 +20703,34 @@ - /* We're doing all this to ensure that the offset fits into - the immediate offset of 'evstdd'. */ - gcc_assert (SPE_CONST_OFFSET_OK (reg_size * i + spe_offset)); -- -+ - offset = GEN_INT (reg_size * i + spe_offset); - addr = gen_rtx_PLUS (Pmode, spe_save_area_ptr, offset); - mem = gen_rtx_MEM (V2SImode, addr); -- -+ - insn = emit_move_insn (mem, reg); -- -- rs6000_frame_related (insn, spe_save_area_ptr, -- info->spe_gp_save_offset -- + sp_offset + reg_size * i, -- offset, const0_rtx); -+ -+ rs6000_frame_related (insn, -+ spe_save_area_ptr, save_ptr_to_sp, -+ NULL_RTX, NULL_RTX); - } - } - else - { - rtx par; +--- a/src/gcc/cp/mangle.c (revision ++++ b/src/gcc/cp/mangle.c (revision +@@ -2770,7 +2770,8 @@ + break; -- par = rs6000_make_savres_rtx (info, gen_rtx_REG (Pmode, 11), -- 0, reg_mode, -+ par = rs6000_make_savres_rtx (info, spe_save_area_ptr, -+ ool_adjust, reg_mode, - /*savep=*/true, /*gpr=*/true, - /*lr=*/false); - insn = emit_insn (par); -- rs6000_frame_related (insn, frame_ptr_rtx, info->total_size, -+ rs6000_frame_related (insn, spe_save_area_ptr, save_ptr_to_sp, - NULL_RTX, NULL_RTX); - } -- -- -+ - /* Move the static chain pointer back. */ -- if (using_static_chain_p && !spe_regs_addressable_via_sp) -- emit_move_insn (gen_rtx_REG (Pmode, 11), gen_rtx_REG (Pmode, 0)); -+ if (using_static_chain_p && !spe_regs_addressable) -+ emit_move_insn (spe_save_area_ptr, gen_rtx_REG (Pmode, 0)); + default: +- gcc_unreachable (); ++ sorry ("mangling %C", TREE_CODE (value)); ++ break; } - else if (!WORLD_SAVE_P (info) && !saving_GPRs_inline) - { -@@ -20744,10 +20739,12 @@ - /* Need to adjust r11 (r12) if we saved any FPRs. */ - if (info->first_fp_reg_save != 64) - { -- rtx dest_reg = gen_rtx_REG (reg_mode, DEFAULT_ABI == ABI_AIX -- ? 12 : 11); -- rtx offset = GEN_INT (sp_offset -- + (-8 * (64-info->first_fp_reg_save))); -+ rtx dest_reg = gen_rtx_REG (Pmode, DEFAULT_ABI == ABI_AIX ? 12 : 11); -+ int save_off = 8 * (64 - info->first_fp_reg_save); -+ rtx offset = GEN_INT (sp_offset - save_off); -+ -+ if (REGNO (dest_reg) == REGNO (frame_reg_rtx)) -+ sp_offset = save_off; - emit_insn (gen_add3_insn (dest_reg, frame_reg_rtx, offset)); - } - -@@ -21623,40 +21620,39 @@ - && info->first_gp_reg_save != 32) - { - /* Determine whether we can address all of the registers that need -- to be saved with an offset from the stack pointer that fits in -- the small const field for SPE memory instructions. */ -- int spe_regs_addressable_via_sp -- = (SPE_CONST_OFFSET_OK(info->spe_gp_save_offset + sp_offset -- + (32 - info->first_gp_reg_save - 1) * reg_size) -+ to be saved with an offset from frame_reg_rtx that fits in -+ the small const field for SPE memory instructions. */ -+ int spe_regs_addressable -+ = (SPE_CONST_OFFSET_OK (info->spe_gp_save_offset + sp_offset -+ + reg_size * (32 - info->first_gp_reg_save - 1)) - && restoring_GPRs_inline); - int spe_offset; -+ int ool_adjust = 0; - -- if (spe_regs_addressable_via_sp) -+ if (spe_regs_addressable) - spe_offset = info->spe_gp_save_offset + sp_offset; - else -- { -+ { - rtx old_frame_reg_rtx = frame_reg_rtx; -- /* Make r11 point to the start of the SPE save area. We worried about -- not clobbering it when we were saving registers in the prologue. -- There's no need to worry here because the static chain is passed -- anew to every function. */ -- int ool_adjust = (restoring_GPRs_inline -- ? 0 -- : (info->first_gp_reg_save -- - (FIRST_SAVRES_REGISTER+1))*8); -+ /* Make r11 point to the start of the SPE save area. We worried about -+ not clobbering it when we were saving registers in the prologue. -+ There's no need to worry here because the static chain is passed -+ anew to every function. */ - -- if (frame_reg_rtx == sp_reg_rtx) -- frame_reg_rtx = gen_rtx_REG (Pmode, 11); -- emit_insn (gen_addsi3 (frame_reg_rtx, old_frame_reg_rtx, -+ if (!restoring_GPRs_inline) -+ ool_adjust = 8 * (info->first_gp_reg_save -+ - (FIRST_SAVRES_REGISTER + 1)); -+ frame_reg_rtx = gen_rtx_REG (Pmode, 11); -+ emit_insn (gen_addsi3 (frame_reg_rtx, old_frame_reg_rtx, - GEN_INT (info->spe_gp_save_offset - + sp_offset - - ool_adjust))); - /* Keep the invariant that frame_reg_rtx + sp_offset points - at the top of the stack frame. */ -- sp_offset = -info->spe_gp_save_offset; -+ sp_offset = -info->spe_gp_save_offset + ool_adjust; - -- spe_offset = 0; -- } -+ spe_offset = 0; -+ } - - if (restoring_GPRs_inline) - { -@@ -21696,8 +21692,8 @@ - { - rtx par; - -- par = rs6000_make_savres_rtx (info, gen_rtx_REG (Pmode, 11), -- 0, reg_mode, -+ par = rs6000_make_savres_rtx (info, frame_reg_rtx, -+ ool_adjust, reg_mode, - /*savep=*/false, /*gpr=*/true, - /*lr=*/true); - emit_jump_insn (par); -@@ -21718,12 +21714,12 @@ - sp_offset, can_use_exit); - else - { -- emit_insn (gen_add3_insn (gen_rtx_REG (Pmode, DEFAULT_ABI == ABI_AIX -- ? 12 : 11), -- frame_reg_rtx, -+ rtx src_reg = gen_rtx_REG (Pmode, DEFAULT_ABI == ABI_AIX ? 12 : 11); -+ -+ emit_insn (gen_add3_insn (src_reg, frame_reg_rtx, - GEN_INT (sp_offset - info->fp_size))); -- if (REGNO (frame_reg_rtx) == 11) -- sp_offset += info->fp_size; -+ if (REGNO (frame_reg_rtx) == REGNO (src_reg)) -+ sp_offset = info->fp_size; - } - par = rs6000_make_savres_rtx (info, frame_reg_rtx, -@@ -27764,7 +27760,7 @@ - if (strcmp (r, rs6000_opt_vars[i].name) == 0) - { - size_t j = rs6000_opt_vars[i].global_offset; -- ((int *) &global_options)[j] = !invert; -+ *((int *) ((char *)&global_options + j)) = !invert; - error_p = false; - break; - } -Index: gcc/config/arm/arm.c + write_char ('E'); +Index: gcc/expr.c =================================================================== ---- a/src/gcc/config/arm/arm.c (revision -+++ b/src/gcc/config/arm/arm.c (revision -@@ -5077,6 +5077,14 @@ - if (IS_STACKALIGN (func_type)) - return false; - -+ /* The AAPCS says that, on bare-metal, calls to unresolved weak -+ references should become a NOP. Don't convert such calls into -+ sibling calls. */ -+ if (TARGET_AAPCS_BASED -+ && arm_abi == ARM_ABI_AAPCS -+ && DECL_WEAK (decl)) -+ return false; -+ - /* Everything else is ok. */ - return true; +--- a/src/gcc/expr.c (revision ++++ b/src/gcc/expr.c (revision +@@ -2180,6 +2180,111 @@ + return tgtblk; } -Index: gcc/config/arm/arm.md -=================================================================== ---- a/src/gcc/config/arm/arm.md (revision -+++ b/src/gcc/config/arm/arm.md (revision -@@ -3272,7 +3272,7 @@ - bool need_else; - - if (which_alternative != 0 || operands[3] != const0_rtx -- || (code != PLUS && code != MINUS && code != IOR && code != XOR)) -+ || (code != PLUS && code != IOR && code != XOR)) - need_else = true; - else - need_else = false; -Index: libstdc++-v3/include/std/condition_variable -=================================================================== ---- a/src/libstdc++-v3/include/std/condition_variable (revision -+++ b/src/libstdc++-v3/include/std/condition_variable (revision -@@ -198,10 +198,25 @@ - void - wait(_Lock& __lock) - { -- unique_lock __my_lock(_M_mutex); -- __lock.unlock(); -- _M_cond.wait(__my_lock); -- __lock.lock(); -+ // scoped unlock - unlocks in ctor, re-locks in dtor -+ struct _Unlock { -+ explicit _Unlock(_Lock& __lk) : _M_lock(__lk) { __lk.unlock(); } -+ ~_Unlock() noexcept(false) -+ { -+ if (uncaught_exception()) -+ __try { _M_lock.lock(); } __catch(...) { } -+ else -+ _M_lock.lock(); -+ } -+ _Lock& _M_lock; -+ }; -+ -+ unique_lock __my_lock(_M_mutex); -+ _Unlock __unlock(__lock); -+ // _M_mutex must be unlocked before re-locking __lock so move -+ // ownership of _M_mutex lock to an object with shorter lifetime. -+ unique_lock __my_lock2(std::move(__my_lock)); -+ _M_cond.wait(__my_lock2); - } - - -Index: libstdc++-v3/include/ext/type_traits.h -=================================================================== ---- a/src/libstdc++-v3/include/ext/type_traits.h (revision -+++ b/src/libstdc++-v3/include/ext/type_traits.h (revision -@@ -1,6 +1,7 @@ - // -*- C++ -*- - --// Copyright (C) 2005, 2006, 2007, 2009 Free Software Foundation, Inc. -+// Copyright (C) 2005, 2006, 2007, 2009, 2010, 2011 -+// Free Software Foundation, Inc. - // - // This file is part of the GNU ISO C++ Library. This library is free - // software; you can redistribute it and/or modify it under the terms -@@ -161,44 +162,50 @@ - struct __promote - { typedef double __type; }; - -+ // No nested __type member for non-integer non-floating point types, -+ // allows this type to be used for SFINAE to constrain overloads in -+ // and to only the intended types. - template - struct __promote<_Tp, false> -- { typedef _Tp __type; }; -+ { }; - -- template -+ template<> -+ struct __promote -+ { typedef long double __type; }; -+ -+ template<> -+ struct __promote -+ { typedef double __type; }; -+ -+ template<> -+ struct __promote -+ { typedef float __type; }; -+ -+ template::__type, -+ typename _Up2 = typename __promote<_Up>::__type> - struct __promote_2 - { -- private: -- typedef typename __promote<_Tp>::__type __type1; -- typedef typename __promote<_Up>::__type __type2; -- -- public: -- typedef __typeof__(__type1() + __type2()) __type; -+ typedef __typeof__(_Tp2() + _Up2()) __type; - }; - -- template -+ template::__type, -+ typename _Up2 = typename __promote<_Up>::__type, -+ typename _Vp2 = typename __promote<_Vp>::__type> - struct __promote_3 - { -- private: -- typedef typename __promote<_Tp>::__type __type1; -- typedef typename __promote<_Up>::__type __type2; -- typedef typename __promote<_Vp>::__type __type3; -- -- public: -- typedef __typeof__(__type1() + __type2() + __type3()) __type; -+ typedef __typeof__(_Tp2() + _Up2() + _Vp2()) __type; - }; - -- template -+ template::__type, -+ typename _Up2 = typename __promote<_Up>::__type, -+ typename _Vp2 = typename __promote<_Vp>::__type, -+ typename _Wp2 = typename __promote<_Wp>::__type> - struct __promote_4 - { -- private: -- typedef typename __promote<_Tp>::__type __type1; -- typedef typename __promote<_Up>::__type __type2; -- typedef typename __promote<_Vp>::__type __type3; -- typedef typename __promote<_Wp>::__type __type4; -- -- public: -- typedef __typeof__(__type1() + __type2() + __type3() + __type4()) __type; -+ typedef __typeof__(_Tp2() + _Up2() + _Vp2() + _Wp2()) __type; - }; - - _GLIBCXX_END_NAMESPACE_VERSION -Index: libstdc++-v3/include/bits/shared_ptr.h -=================================================================== ---- a/src/libstdc++-v3/include/bits/shared_ptr.h (revision -+++ b/src/libstdc++-v3/include/bits/shared_ptr.h (revision -@@ -100,6 +100,8 @@ - constexpr shared_ptr() - : __shared_ptr<_Tp>() { } - -+ shared_ptr(const shared_ptr&) = default; // never throws -+ - /** - * @brief Construct a %shared_ptr that owns the pointer @a __p. - * @param __p A pointer that is convertible to element_type*. -@@ -264,6 +266,8 @@ - constexpr shared_ptr(nullptr_t __p) - : __shared_ptr<_Tp>(__p) { } - -+ shared_ptr& operator=(const shared_ptr&) = default; -+ - template - shared_ptr& - operator=(const shared_ptr<_Tp1>& __r) // never throws -Index: libstdc++-v3/include/bits/stl_numeric.h -=================================================================== ---- a/src/libstdc++-v3/include/bits/stl_numeric.h (revision -+++ b/src/libstdc++-v3/include/bits/stl_numeric.h (revision -@@ -222,10 +222,10 @@ - /** - * @brief Return list of partial sums - * -- * Accumulates the values in the range [first,last) using operator+(). -+ * Accumulates the values in the range [first,last) using the @c + operator. - * As each successive input value is added into the total, that partial sum -- * is written to @a result. Therefore, the first value in result is the -- * first value of the input, the second value in result is the sum of the -+ * is written to @p result. Therefore, the first value in @p result is the -+ * first value of the input, the second value in @p result is the sum of the - * first and second input values, and so on. - * - * @param first Start of input range. -@@ -261,15 +261,16 @@ - /** - * @brief Return list of partial sums - * -- * Accumulates the values in the range [first,last) using operator+(). -+ * Accumulates the values in the range [first,last) using @p binary_op. - * As each successive input value is added into the total, that partial sum -- * is written to @a result. Therefore, the first value in result is the -- * first value of the input, the second value in result is the sum of the -+ * is written to @a result. Therefore, the first value in @p result is the -+ * first value of the input, the second value in @p result is the sum of the - * first and second input values, and so on. - * - * @param first Start of input range. - * @param last End of input range. - * @param result Output to write sums to. -+ * @param binary_op Function object. - * @return Iterator pointing just beyond the values written to result. - */ - template -+ inline auto -+ _Construct_default_a_impl(_Tp* __ptr, _Allocator& __alloc, void*) -+ -> decltype(__alloc.construct(__ptr)) -+ { return __alloc.construct(__ptr); } - -+ template -+ inline void -+ _Construct_default_a_impl(_Tp* __ptr, _Allocator& __alloc, ...) -+ { _Construct(__ptr); } -+ -+ template -+ inline void -+ _Construct_default_a(_Tp* __ptr, _Allocator& __alloc) -+ { _Construct_default_a_impl(__ptr, __alloc, nullptr); } -+ - // __uninitialized_default_a - // Fills [first, last) with std::distance(first, last) default - // constructed value_types(s), constructed with the allocator alloc. -@@ -544,7 +559,7 @@ - __try - { - for (; __cur != __last; ++__cur) -- __alloc.construct(std::__addressof(*__cur)); -+ _Construct_default_a(std::__addressof(*__cur), __alloc); - } - __catch(...) - { -@@ -573,7 +588,7 @@ - __try - { - for (; __n > 0; --__n, ++__cur) -- __alloc.construct(std::__addressof(*__cur)); -+ _Construct_default_a(std::__addressof(*__cur), __alloc); - } - __catch(...) - { -Index: libstdc++-v3/include/bits/shared_ptr_base.h -=================================================================== ---- a/src/libstdc++-v3/include/bits/shared_ptr_base.h (revision -+++ b/src/libstdc++-v3/include/bits/shared_ptr_base.h (revision -@@ -799,7 +799,8 @@ - : _M_ptr(__p), _M_refcount(__r._M_refcount) // never throws - { } - -- // generated copy constructor, assignment, destructor are fine. -+ __shared_ptr(const __shared_ptr&) = default; // never throws -+ __shared_ptr& operator=(const __shared_ptr&) = default; // never throws - - template::value>::type> -Index: libstdc++-v3/include/bits/regex.h -=================================================================== ---- a/src/libstdc++-v3/include/bits/regex.h (revision -+++ b/src/libstdc++-v3/include/bits/regex.h (revision -@@ -2219,7 +2219,7 @@ - regex_constants::match_flag_type __flags - = regex_constants::match_default) - { -- std::string __result; -+ basic_string<_Ch_type> __result; - regex_replace(std::back_inserter(__result), - __s.begin(), __s.end(), __e, __fmt, __flags); - return __result; -Index: libstdc++-v3/include/c_global/cmath -=================================================================== ---- a/src/libstdc++-v3/include/c_global/cmath (revision -+++ b/src/libstdc++-v3/include/c_global/cmath (revision -@@ -1,7 +1,7 @@ - // -*- C++ -*- C forwarding header. - - // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, --// 2006, 2007, 2008, 2009, 2010 -+// 2006, 2007, 2008, 2009, 2010, 2011 - // Free Software Foundation, Inc. - // - // This file is part of the GNU ISO C++ Library. This library is free -@@ -156,10 +156,7 @@ - - template - inline -- typename __gnu_cxx::__promote_2< -- typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value -- && __is_arithmetic<_Up>::__value, -- _Tp>::__type, _Up>::__type -+ typename __gnu_cxx::__promote_2<_Tp, _Up>::__type - atan2(_Tp __y, _Up __x) - { - typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; -@@ -374,10 +371,7 @@ - template - inline -- typename __gnu_cxx::__promote_2< -- typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value -- && __is_arithmetic<_Up>::__value, -- _Tp>::__type, _Up>::__type -+ typename __gnu_cxx::__promote_2<_Tp, _Up>::__type - pow(_Tp __x, _Up __y) - { - typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; -Index: libstdc++-v3/ChangeLog -=================================================================== ---- a/src/libstdc++-v3/ChangeLog (revision -+++ b/src/libstdc++-v3/ChangeLog (revision -@@ -1,3 +1,79 @@ -+2012-01-03 Chase Douglas -+ Jonathan Wakely -+ -+ * include/bits/shared_ptr.h: Default copy ctor and assignment. -+ * include/bits/shared_ptr_base.h: Likewise. -+ * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust dg-error -+ line numbers. -+ * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Likewise. -+ -+2011-12-30 Paolo Carlini -+ -+ PR libstdc++/51711 -+ * include/bits/regex.h (regex_replace): Fix thinko. -+ * testsuite/28_regex/algorithms/regex_replace/char/51711.cc: New. -+ * testsuite/28_regex/algorithms/regex_replace/wchar_t/51711.cc: -+ Likewise. -+ -+2011-12-19 Jonathan Wakely -+ -+ PR libstdc++/51626 -+ * include/bits/stl_uninitialized.h (_Construct_default_a_impl): Define -+ overloaded functions to conditionally use allocator::construct. -+ (_Construct_default_a): Define to dispatch to appropriate -+ _Construct_default_a_impl overload. -+ (__uninitialized_default_a, __uninitialized_default_n_a): Use -+ _Construct_default_a. -+ * testsuite/20_util/allocator/51626.cc: New. -+ -+2011-12-19 Jonathan Wakely -+ -+ * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Adjust -+ dg-error line numbers. -+ * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Likewise. -+ * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Likewise. -+ * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Likewise. -+ -+2011-12-19 Jonathan Wakely -+ -+ * include/c_global/cmath: Update copyright years. -+ * include/ext/type_traits.h: Likewise. -+ -+2011-12-19 Jonathan Wakely ++/* Copy BLKmode value SRC into a register of mode MODE. Return the ++ register if it contains any data, otherwise return null. + -+ Backport from mainline -+ 2011-11-13 Paolo Carlini -+ -+ * include/c_global/cmath (atan2, pow): Simplify constraining on the -+ return type. -+ -+ Backport from mainline -+ 2011-11-12 Jonathan Wakely -+ -+ PR libstdc++/51083 -+ * include/ext/type_traits.h (__promote): Only define __type member -+ for integral and floating point types, to prevent math functions -+ participating in overload resolution for other types. -+ (__promote_2, __promote_3, __promote_4): Use __promote in default -+ template argument values, so deduction only succeeds for integral and -+ floating point types. -+ * testsuite/26_numerics/cmath/51083.cc: New. -+ * testsuite/26_numerics/complex/51083.cc: New. -+ * testsuite/tr1/8_c_compatibility/cmath/51083.cc: New. -+ * testsuite/tr1/8_c_compatibility/complex/51083.cc: New. -+ -+2011-12-19 Jonathan Wakely -+ -+ PR libstdc++/50862 -+ * include/std/condition_variable (condition_variable_any::wait): Fix -+ deadlock and ensure _Lock::lock() is called on exit. -+ * testsuite/30_threads/condition_variable_any/50862.cc: New. -+ -+2011-12-18 Jonathan Wakely -+ -+ PR libstdc++/51540 -+ * include/bits/stl_numeric.h (partial_sum): Adjust doxygen comments. -+ - 2011-11-20 Andreas Tobler - - * configure: Regenerate. -Index: libstdc++-v3/testsuite/28_regex/algorithms/regex_replace/wchar_t/51711.cc -=================================================================== ---- a/src/libstdc++-v3/testsuite/28_regex/algorithms/regex_replace/wchar_t/51711.cc (revision -+++ b/src/libstdc++-v3/testsuite/28_regex/algorithms/regex_replace/wchar_t/51711.cc (revision -@@ -0,0 +1,31 @@ -+// { dg-options "-std=gnu++0x" } -+// { dg-do compile } -+ -+// Copyright (C) 2011 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+// -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+// -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING3. If not see -+// . -+// -+ -+#include -+#include -+ -+// libstdc++/51711 -+void test01() -+{ -+ std::wstring toProcess(L"Bug\r\n"); -+ std::wstring result __attribute__((unused)) -+ = std::regex_replace(toProcess, std::wregex(L"\\r"), std::wstring(L"\\r")); -+} -Index: libstdc++-v3/testsuite/28_regex/algorithms/regex_replace/char/51711.cc -=================================================================== ---- a/src/libstdc++-v3/testsuite/28_regex/algorithms/regex_replace/char/51711.cc (revision -+++ b/src/libstdc++-v3/testsuite/28_regex/algorithms/regex_replace/char/51711.cc (revision -@@ -0,0 +1,31 @@ -+// { dg-options "-std=gnu++0x" } -+// { dg-do compile } -+ -+// Copyright (C) 2011 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+// -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+// -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING3. If not see -+// . -+// -+ -+#include -+#include -+ -+// libstdc++/51711 -+void test01() -+{ -+ std::string toProcess("Bug\r\n"); -+ std::string result __attribute__((unused)) -+ = std::regex_replace(toProcess, std::regex("\\r"), std::string("\\r")); -+} -Index: libstdc++-v3/testsuite/26_numerics/complex/51083.cc -=================================================================== ---- a/src/libstdc++-v3/testsuite/26_numerics/complex/51083.cc (revision -+++ b/src/libstdc++-v3/testsuite/26_numerics/complex/51083.cc (revision -@@ -0,0 +1,54 @@ -+// { dg-options "-std=gnu++0x" } -+// -+// Copyright (C) 2011 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+// -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+// -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING3. If not see -+// . -+ -+#include ++ This is used on targets that return BLKmode values in registers. */ + -+namespace a ++rtx ++copy_blkmode_to_reg (enum machine_mode mode, tree src) +{ -+ template class Mat { }; ++ int i, n_regs; ++ unsigned HOST_WIDE_INT bitpos, xbitpos, padding_correction = 0, bytes; ++ unsigned int bitsize; ++ rtx *dst_words, dst, x, src_word = NULL_RTX, dst_word = NULL_RTX; ++ enum machine_mode dst_mode; + -+ template struct Mat2 : Mat { }; ++ gcc_assert (TYPE_MODE (TREE_TYPE (src)) == BLKmode); + -+ template int arg(Mat) { return 1; } -+ template int conj(Mat) { return 1; } -+ template int imag(Mat) { return 1; } -+ template int norm(Mat) { return 1; } -+ template int proj(Mat) { return 1; } -+ template int real(Mat) { return 1; } ++ x = expand_normal (src); + -+ template int pow(Mat, U) { return 1; } -+ template int pow(T, Mat) { return 1; } -+} -+ -+int main() -+{ -+ int __attribute__((unused)) i; ++ bytes = int_size_in_bytes (TREE_TYPE (src)); ++ if (bytes == 0) ++ return NULL_RTX; + -+ using namespace std; ++ /* If the structure doesn't take up a whole number of words, see ++ whether the register value should be padded on the left or on ++ the right. Set PADDING_CORRECTION to the number of padding ++ bits needed on the left side. ++ ++ In most ABIs, the structure will be returned at the least end of ++ the register, which translates to right padding on little-endian ++ targets and left padding on big-endian targets. The opposite ++ holds if the structure is returned at the most significant ++ end of the register. */ ++ if (bytes % UNITS_PER_WORD != 0 ++ && (targetm.calls.return_in_msb (TREE_TYPE (src)) ++ ? !BYTES_BIG_ENDIAN ++ : BYTES_BIG_ENDIAN)) ++ padding_correction = (BITS_PER_WORD - ((bytes % UNITS_PER_WORD) ++ * BITS_PER_UNIT)); ++ ++ n_regs = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; ++ dst_words = XALLOCAVEC (rtx, n_regs); ++ bitsize = MIN (TYPE_ALIGN (TREE_TYPE (src)), BITS_PER_WORD); ++ ++ /* Copy the structure BITSIZE bits at a time. */ ++ for (bitpos = 0, xbitpos = padding_correction; ++ bitpos < bytes * BITS_PER_UNIT; ++ bitpos += bitsize, xbitpos += bitsize) ++ { ++ /* We need a new destination pseudo each time xbitpos is ++ on a word boundary and when xbitpos == padding_correction ++ (the first time through). */ ++ if (xbitpos % BITS_PER_WORD == 0 ++ || xbitpos == padding_correction) ++ { ++ /* Generate an appropriate register. */ ++ dst_word = gen_reg_rtx (word_mode); ++ dst_words[xbitpos / BITS_PER_WORD] = dst_word; + -+ a::Mat2< std::complex > c; -+ i = arg(c); -+ i = conj(c); -+ i = imag(c); -+ i = norm(c); -+ i = proj(c); -+ i = real(c); -+ i = pow(std::complex(), c); -+ i = pow(c, std::complex()); -+} -Index: libstdc++-v3/testsuite/26_numerics/cmath/51083.cc -=================================================================== ---- a/src/libstdc++-v3/testsuite/26_numerics/cmath/51083.cc (revision -+++ b/src/libstdc++-v3/testsuite/26_numerics/cmath/51083.cc (revision -@@ -0,0 +1,62 @@ -+// { dg-options "-std=gnu++0x" } -+// -+// Copyright (C) 2011 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+// -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+// -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING3. If not see -+// . ++ /* Clear the destination before we move anything into it. */ ++ emit_move_insn (dst_word, CONST0_RTX (word_mode)); ++ } + -+#include ++ /* We need a new source operand each time bitpos is on a word ++ boundary. */ ++ if (bitpos % BITS_PER_WORD == 0) ++ src_word = operand_subword_force (x, bitpos / BITS_PER_WORD, BLKmode); ++ ++ /* Use bitpos for the source extraction (left justified) and ++ xbitpos for the destination store (right justified). */ ++ store_bit_field (dst_word, bitsize, xbitpos % BITS_PER_WORD, word_mode, ++ extract_bit_field (src_word, bitsize, ++ bitpos % BITS_PER_WORD, 1, false, ++ NULL_RTX, word_mode, word_mode)); ++ } + -+namespace a -+{ -+ template class Mat { }; ++ if (mode == BLKmode) ++ { ++ /* Find the smallest integer mode large enough to hold the ++ entire structure. */ ++ for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); ++ mode != VOIDmode; ++ mode = GET_MODE_WIDER_MODE (mode)) ++ /* Have we found a large enough mode? */ ++ if (GET_MODE_SIZE (mode) >= bytes) ++ break; + -+ template struct Mat2 : Mat { }; ++ /* A suitable mode should have been found. */ ++ gcc_assert (mode != VOIDmode); ++ } + -+ template -+ int fdim(Mat) { return 1; } ++ if (GET_MODE_SIZE (mode) < GET_MODE_SIZE (word_mode)) ++ dst_mode = word_mode; ++ else ++ dst_mode = mode; ++ dst = gen_reg_rtx (dst_mode); + -+ template -+ int floor(Mat, U) { return 1; } -+ template -+ int floor(T, Mat) { return 1; } -+ -+ template -+ int fma(Mat, U, V) { return 1; } -+ template -+ int fma(T, Mat, V) { return 1; } -+ template -+ int fma(T, U, Mat) { return 1; } -+} ++ for (i = 0; i < n_regs; i++) ++ emit_move_insn (operand_subword (dst, i, 0, dst_mode), dst_words[i]); + -+int main() -+{ -+ int __attribute__((unused)) i; ++ if (mode != dst_mode) ++ dst = gen_lowpart (mode, dst); + -+ using namespace std; ++ return dst; ++} ++ + /* Add a USE expression for REG to the (possibly empty) list pointed + to by CALL_FUSAGE. REG must denote a hard register. */ + +@@ -4382,7 +4487,9 @@ + if (TREE_CODE (from) == CALL_EXPR && ! aggregate_value_p (from, from) + && COMPLETE_TYPE_P (TREE_TYPE (from)) + && TREE_CODE (TYPE_SIZE (TREE_TYPE (from))) == INTEGER_CST +- && ! (((TREE_CODE (to) == VAR_DECL || TREE_CODE (to) == PARM_DECL) ++ && ! (((TREE_CODE (to) == VAR_DECL ++ || TREE_CODE (to) == PARM_DECL ++ || TREE_CODE (to) == RESULT_DECL) + && REG_P (DECL_RTL (to))) + || TREE_CODE (to) == SSA_NAME)) + { +@@ -4428,12 +4535,15 @@ + rtx temp; + + push_temp_slots (); +- temp = expand_expr (from, NULL_RTX, GET_MODE (to_rtx), EXPAND_NORMAL); ++ if (REG_P (to_rtx) && TYPE_MODE (TREE_TYPE (from)) == BLKmode) ++ temp = copy_blkmode_to_reg (GET_MODE (to_rtx), from); ++ else ++ temp = expand_expr (from, NULL_RTX, GET_MODE (to_rtx), EXPAND_NORMAL); + + if (GET_CODE (to_rtx) == PARALLEL) + emit_group_load (to_rtx, temp, TREE_TYPE (from), + int_size_in_bytes (TREE_TYPE (from))); +- else ++ else if (temp) + emit_move_insn (to_rtx, temp); + + preserve_temp_slots (to_rtx); +@@ -8533,10 +8643,15 @@ + return temp; + } + +- /* If the mode of DECL_RTL does not match that of the decl, it +- must be a promoted value. We return a SUBREG of the wanted mode, +- but mark it so that we know that it was already extended. */ +- if (REG_P (decl_rtl) && GET_MODE (decl_rtl) != DECL_MODE (exp)) ++ /* If the mode of DECL_RTL does not match that of the decl, ++ there are two cases: we are dealing with a BLKmode value ++ that is returned in a register, or we are dealing with ++ a promoted value. In the latter case, return a SUBREG ++ of the wanted mode, but mark it so that we know that it ++ was already extended. */ ++ if (REG_P (decl_rtl) ++ && DECL_MODE (exp) != BLKmode ++ && GET_MODE (decl_rtl) != DECL_MODE (exp)) + { + enum machine_mode pmode; + +Index: gcc/expr.h +=================================================================== +--- a/src/gcc/expr.h (revision ++++ b/src/gcc/expr.h (revision +@@ -324,6 +324,8 @@ + /* Copy BLKmode object from a set of registers. */ + extern rtx copy_blkmode_from_reg (rtx, rtx, tree); + ++extern rtx copy_blkmode_to_reg (enum machine_mode, tree); ++ + /* Mark REG as holding a parameter for the next CALL_INSN. */ + extern void use_reg (rtx *, rtx); + +Index: gcc/recog.c +=================================================================== +--- a/src/gcc/recog.c (revision ++++ b/src/gcc/recog.c (revision +@@ -3023,6 +3023,7 @@ + static int search_ofs; + enum reg_class cl; + HARD_REG_SET live; ++ df_ref *def_rec; + int i; + + gcc_assert (from < MAX_INSNS_PER_PEEP2 + 1); +@@ -3036,12 +3037,14 @@ + + while (from != to) + { +- HARD_REG_SET this_live; ++ gcc_assert (peep2_insn_data[from].insn != NULL_RTX); + ++ /* Don't use registers set or clobbered by the insn. */ ++ for (def_rec = DF_INSN_DEFS (peep2_insn_data[from].insn); ++ *def_rec; def_rec++) ++ SET_HARD_REG_BIT (live, DF_REF_REGNO (*def_rec)); + -+ a::Mat2 c; -+ i = fdim(c); -+ i = floor(c, 0.); -+ i = floor(0., c); -+ i = floor(c, 1); -+ i = floor(1, c); -+ i = fma(c, 0., 1.); -+ i = fma(0., c, 1.); -+ i = fma(0., 1., c); -+ i = fma(c, 0., 1); -+ i = fma(0., c, 1); -+ i = fma(0., 1, c); -+} -Index: libstdc++-v3/testsuite/30_threads/condition_variable_any/50862.cc + from = peep2_buf_position (from + 1); +- gcc_assert (peep2_insn_data[from].insn != NULL_RTX); +- REG_SET_TO_HARD_REG_SET (this_live, peep2_insn_data[from].live_before); +- IOR_HARD_REG_SET (live, this_live); + } + + cl = (class_str[0] == 'r' ? GENERAL_REGS +Index: gcc/ada/ChangeLog =================================================================== ---- a/src/libstdc++-v3/testsuite/30_threads/condition_variable_any/50862.cc (revision -+++ b/src/libstdc++-v3/testsuite/30_threads/condition_variable_any/50862.cc (revision -@@ -0,0 +1,80 @@ -+// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* } } -+// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* } } -+// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } } -+// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } } -+// { dg-require-cstdint "" } -+// { dg-require-gthreads "" } -+// { dg-require-sched-yield "" } -+ -+// Copyright (C) 2011 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING3. If not see -+// . -+ -+#include -+#include -+#include -+#include -+#include -+ -+struct scoped_thread -+{ -+ ~scoped_thread() { if (t.joinable()) t.join(); } -+ std::thread t; -+}; -+ -+int main() -+{ -+ typedef std::unique_lock Lock; +--- a/src/gcc/ada/ChangeLog (revision ++++ b/src/gcc/ada/ChangeLog (revision +@@ -1,3 +1,7 @@ ++2012-01-09 Eric Botcazou + -+ std::mutex m; -+ std::condition_variable_any cond; -+ unsigned int product = 0; -+ const unsigned int count = 10; -+ -+ // writing to stream causes timing changes which makes deadlock easier -+ // to reproduce - do not remove -+ std::ostringstream out; -+ -+ // create consumers -+ std::array threads; -+ for (std::size_t i = 0; i < threads.size(); ++i) -+ threads[i].t -+ = std::thread( [&] -+ { -+ for (unsigned int i = 0; i < count; ++i) -+ { -+ std::this_thread::yield(); -+ Lock lock(m); -+ while(product == 0) -+ cond.wait(lock); -+ out << "got product " -+ << std::this_thread::get_id() -+ << ' ' << product << std::endl; -+ --product; -+ } -+ } ); ++ * gcc-interface/trans.c (addressable_p) : Fix thinko. + -+ // single producer -+ for (std::size_t i = 0; i < threads.size() * count; ++i) -+ { -+ std::this_thread::yield(); -+ Lock lock(m); -+ ++product; -+ out << "setting product " << std::this_thread::get_id() -+ << ' ' << product << std::endl; -+ cond.notify_one(); -+ } -+} -Index: libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_integer_neg.cc + 2012-01-02 Eric Botcazou + + * gnatvsn.ads (Current_Year): Bump to 2011. +Index: gcc/ada/gcc-interface/trans.c =================================================================== ---- a/src/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_integer_neg.cc (revision -+++ b/src/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_integer_neg.cc (revision -@@ -36,4 +36,4 @@ - } +--- a/src/gcc/ada/gcc-interface/trans.c (revision ++++ b/src/gcc/ada/gcc-interface/trans.c (revision +@@ -6,7 +6,7 @@ + * * + * C Implementation File * + * * +- * Copyright (C) 1992-2011, Free Software Foundation, Inc. * ++ * Copyright (C) 1992-2012, Free Software Foundation, Inc. * + * * + * GNAT is free software; you can redistribute it and/or modify it under * + * terms of the GNU General Public License as published by the Free Soft- * +@@ -7409,7 +7409,7 @@ + || DECL_ALIGN (TREE_OPERAND (gnu_expr, 1)) + >= TYPE_ALIGN (TREE_TYPE (gnu_expr)))) + /* The field of a padding record is always addressable. */ +- || TYPE_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_expr, 0)))) ++ || TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_expr, 0)))) + && addressable_p (TREE_OPERAND (gnu_expr, 0), NULL_TREE)); - // { dg-error "invalid use of incomplete" "" { target *-*-* } 28 } --// { dg-error "declaration of" "" { target *-*-* } 106 } -+// { dg-error "declaration of" "" { target *-*-* } 107 } -Index: libstdc++-v3/testsuite/ext/type_traits/add_unsigned_floating_neg.cc -=================================================================== ---- a/src/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_floating_neg.cc (revision -+++ b/src/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_floating_neg.cc (revision -@@ -35,4 +35,4 @@ + case ARRAY_REF: case ARRAY_RANGE_REF: +Index: gcc/c-decl.c +=================================================================== +--- a/src/gcc/c-decl.c (revision ++++ b/src/gcc/c-decl.c (revision +@@ -9782,6 +9782,9 @@ + collect_source_ref (LOCATION_FILE (decl_sloc (decl, false))); } - // { dg-error "instantiated from" "" { target *-*-* } 28 } --// { dg-error "no type" "" { target *-*-* } 69 } -+// { dg-error "no type" "" { target *-*-* } 70 } -Index: libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_floating_neg.cc -=================================================================== ---- a/src/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_floating_neg.cc (revision -+++ b/src/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_floating_neg.cc (revision -@@ -35,4 +35,4 @@ - } ++/* Preserve the external declarations scope across a garbage collect. */ ++static GTY(()) tree ext_block; ++ + /* Collect all references relevant to SOURCE_FILE. */ - // { dg-error "instantiated from" "" { target *-*-* } 28 } --// { dg-error "no type" "" { target *-*-* } 112 } -+// { dg-error "no type" "" { target *-*-* } 113 } -Index: libstdc++-v3/testsuite/ext/type_traits/add_unsigned_integer_neg.cc -=================================================================== ---- a/src/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_integer_neg.cc (revision -+++ b/src/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_integer_neg.cc (revision -@@ -36,4 +36,4 @@ - } + static void +@@ -9792,6 +9795,8 @@ - // { dg-error "invalid use of incomplete" "" { target *-*-* } 28 } --// { dg-error "declaration of" "" { target *-*-* } 63 } -+// { dg-error "declaration of" "" { target *-*-* } 64 } -Index: libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/51083.cc -=================================================================== ---- a/src/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/51083.cc (revision -+++ b/src/libstdc++-v3/testsuite/tr1/8_c_compatibility/complex/51083.cc (revision -@@ -0,0 +1,54 @@ -+// { dg-options "-std=gnu++0x" } -+// -+// Copyright (C) 2011 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+// -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+// -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING3. If not see -+// . -+ -+#include + FOR_EACH_VEC_ELT (tree, all_translation_units, i, t) + collect_ada_nodes (BLOCK_VARS (DECL_INITIAL (t)), source_file); + -+namespace a -+{ -+ template class Mat { }; ++ collect_ada_nodes (BLOCK_VARS (ext_block), source_file); + } + + /* Iterate over all global declarations and call CALLBACK. */ +@@ -9810,11 +9815,11 @@ + for (decl = BLOCK_VARS (decls); decl; decl = TREE_CHAIN (decl)) + callback (decl); + } + -+ template struct Mat2 : Mat { }; ++ for (decl = BLOCK_VARS (ext_block); decl; decl = TREE_CHAIN (decl)) ++ callback (decl); + } + +-/* Preserve the external declarations scope across a garbage collect. */ +-static GTY(()) tree ext_block; +- + void + c_write_global_declarations (void) + { +Index: gcc/fortran/ChangeLog +=================================================================== +--- a/src/gcc/fortran/ChangeLog (revision ++++ b/src/gcc/fortran/ChangeLog (revision +@@ -1,3 +1,17 @@ ++2012-01-19 Tobias Burnus + -+ template int arg(Mat) { return 1; } -+ template int conj(Mat) { return 1; } -+ template int imag(Mat) { return 1; } -+ template int norm(Mat) { return 1; } -+ template int proj(Mat) { return 1; } -+ template int real(Mat) { return 1; } ++ PR fortran/51904 ++ *expr.c (gfc_build_intrinsic_call): Also set the symtree. + -+ template int pow(Mat, U) { return 1; } -+ template int pow(T, Mat) { return 1; } -+} ++2012-01-14 Tobias Burnus + -+int main() -+{ -+ int __attribute__((unused)) i; ++ Backported from mainline ++ 2012-01-14 Tobias Burnus + -+ using namespace std::tr1; ++ PR fortran/51800 ++ * resolve.c (build_default_init_expr): Also initialize ++ nonconstant-length strings with -finit-character=. + -+ a::Mat2< std::complex > c; -+ i = arg(c); -+ i = conj(c); -+ i = imag(c); -+ i = norm(c); -+ i = proj(c); -+ i = real(c); -+ i = pow(std::complex(), c); -+ i = pow(c, std::complex()); -+} -Index: libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/51083.cc + 2012-01-01 Thomas König + + Backport from trunk +Index: gcc/fortran/expr.c =================================================================== ---- a/src/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/51083.cc (revision -+++ b/src/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/51083.cc (revision -@@ -0,0 +1,62 @@ -+// { dg-options "-std=gnu++0x" } -+// -+// Copyright (C) 2011 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+// -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+// -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING3. If not see -+// . -+ -+#include +--- a/src/gcc/fortran/expr.c (revision ++++ b/src/gcc/fortran/expr.c (revision +@@ -4363,6 +4363,11 @@ + result->value.function.name = name; + result->value.function.isym = isym; + ++ result->symtree = gfc_find_symtree (gfc_current_ns->sym_root, name); ++ gcc_assert (result->symtree ++ && (result->symtree->n.sym->attr.flavor == FL_PROCEDURE ++ || result->symtree->n.sym->attr.flavor == FL_UNKNOWN)); ++ + va_start (ap, numarg); + atail = NULL; + for (i = 0; i < numarg; ++i) +Index: gcc/fortran/resolve.c +=================================================================== +--- a/src/gcc/fortran/resolve.c (revision ++++ b/src/gcc/fortran/resolve.c (revision +@@ -9814,6 +9814,26 @@ + gfc_free_expr (init_expr); + init_expr = NULL; + } ++ if (!init_expr && gfc_option.flag_init_character == GFC_INIT_CHARACTER_ON ++ && sym->ts.u.cl->length) ++ { ++ gfc_actual_arglist *arg; ++ init_expr = gfc_get_expr (); ++ init_expr->where = sym->declared_at; ++ init_expr->ts = sym->ts; ++ init_expr->expr_type = EXPR_FUNCTION; ++ init_expr->value.function.isym = ++ gfc_intrinsic_function_by_id (GFC_ISYM_REPEAT); ++ init_expr->value.function.name = "repeat"; ++ arg = gfc_get_actual_arglist (); ++ arg->expr = gfc_get_character_expr (sym->ts.kind, &sym->declared_at, ++ NULL, 1); ++ arg->expr->value.character.string[0] ++ = gfc_option.flag_init_character_value; ++ arg->next = gfc_get_actual_arglist (); ++ arg->next->expr = gfc_copy_expr (sym->ts.u.cl->length); ++ init_expr->value.function.actual = arg; ++ } + break; + + default: +@@ -9840,10 +9860,12 @@ + if (init == NULL) + return; + +- /* For saved variables, we don't want to add an initializer at +- function entry, so we just add a static initializer. */ ++ /* For saved variables, we don't want to add an initializer at function ++ entry, so we just add a static initializer. Note that automatic variables ++ are stack allocated even with -fno-automatic. */ + if (sym->attr.save || sym->ns->save_all +- || gfc_option.flag_max_stack_var_size == 0) ++ || (gfc_option.flag_max_stack_var_size == 0 ++ && (!sym->attr.dimension || !is_non_constant_shape_array (sym)))) + { + /* Don't clobber an existing initializer! */ + gcc_assert (sym->value == NULL); +Index: gcc/ipa-split.c +=================================================================== +--- a/src/gcc/ipa-split.c (revision ++++ b/src/gcc/ipa-split.c (revision +@@ -130,6 +130,10 @@ + + struct split_point best_split_point; + ++/* Set of basic blocks that are not allowed to dominate a split point. */ ++ ++static bitmap forbidden_dominators; ++ + static tree find_retval (basic_block return_bb); + + /* Callback for walk_stmt_load_store_addr_ops. If T is non-SSA automatic +@@ -270,6 +274,83 @@ + return ok; + } + ++/* If STMT is a call, check the callee against a list of forbidden ++ predicate functions. If a match is found, look for uses of the ++ call result in condition statements that compare against zero. ++ For each such use, find the block targeted by the condition ++ statement for the nonzero result, and set the bit for this block ++ in the forbidden dominators bitmap. The purpose of this is to avoid ++ selecting a split point where we are likely to lose the chance ++ to optimize away an unused function call. */ + -+namespace a ++static void ++check_forbidden_calls (gimple stmt) +{ -+ template class Mat { }; -+ -+ template struct Mat2 : Mat { }; ++ imm_use_iterator use_iter; ++ use_operand_p use_p; ++ tree lhs; + -+ template -+ int fdim(Mat) { return 1; } ++ /* At the moment, __builtin_constant_p is the only forbidden ++ predicate function call (see PR49642). */ ++ if (!gimple_call_builtin_p (stmt, BUILT_IN_CONSTANT_P)) ++ return; + -+ template -+ int floor(Mat, U) { return 1; } -+ template -+ int floor(T, Mat) { return 1; } -+ -+ template -+ int fma(Mat, U, V) { return 1; } -+ template -+ int fma(T, Mat, V) { return 1; } -+ template -+ int fma(T, U, Mat) { return 1; } -+} ++ lhs = gimple_call_lhs (stmt); + -+int main() -+{ -+ int __attribute__((unused)) i; ++ if (!lhs || TREE_CODE (lhs) != SSA_NAME) ++ return; + -+ using namespace std::tr1; ++ FOR_EACH_IMM_USE_FAST (use_p, use_iter, lhs) ++ { ++ tree op1; ++ basic_block use_bb, forbidden_bb; ++ enum tree_code code; ++ edge true_edge, false_edge; ++ gimple use_stmt = USE_STMT (use_p); ++ ++ if (gimple_code (use_stmt) != GIMPLE_COND) ++ continue; ++ ++ /* Assuming canonical form for GIMPLE_COND here, with constant ++ in second position. */ ++ op1 = gimple_cond_rhs (use_stmt); ++ code = gimple_cond_code (use_stmt); ++ use_bb = gimple_bb (use_stmt); ++ ++ extract_true_false_edges_from_block (use_bb, &true_edge, &false_edge); ++ ++ /* We're only interested in comparisons that distinguish ++ unambiguously from zero. */ ++ if (!integer_zerop (op1) || code == LE_EXPR || code == GE_EXPR) ++ continue; ++ ++ if (code == EQ_EXPR) ++ forbidden_bb = false_edge->dest; ++ else ++ forbidden_bb = true_edge->dest; + -+ a::Mat2 c; -+ i = fdim(c); -+ i = floor(c, 0.); -+ i = floor(0., c); -+ i = floor(c, 1); -+ i = floor(1, c); -+ i = fma(c, 0., 1.); -+ i = fma(0., c, 1.); -+ i = fma(0., 1., c); -+ i = fma(c, 0., 1); -+ i = fma(0., c, 1); -+ i = fma(0., 1, c); ++ bitmap_set_bit (forbidden_dominators, forbidden_bb->index); ++ } +} -Index: libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc -=================================================================== ---- a/src/libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc (revision -+++ b/src/libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc (revision -@@ -35,6 +35,6 @@ - // { dg-error "incomplete" "" { target *-*-* } 766 } - - std::shared_ptr p9(ap()); // { dg-error "here" } -- // { dg-error "incomplete" "" { target *-*-* } 858 } -+ // { dg-error "incomplete" "" { target *-*-* } 859 } - - } -Index: libstdc++-v3/testsuite/20_util/allocator/51626.cc -=================================================================== ---- a/src/libstdc++-v3/testsuite/20_util/allocator/51626.cc (revision -+++ b/src/libstdc++-v3/testsuite/20_util/allocator/51626.cc (revision -@@ -0,0 +1,66 @@ -+// Copyright (C) 2011 Free Software Foundation, Inc. -+// -+// This file is part of the GNU ISO C++ Library. This library is free -+// software; you can redistribute it and/or modify it under the -+// terms of the GNU General Public License as published by the -+// Free Software Foundation; either version 3, or (at your option) -+// any later version. -+ -+// This library is distributed in the hope that it will be useful, -+// but WITHOUT ANY WARRANTY; without even the implied warranty of -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+// GNU General Public License for more details. -+ -+// You should have received a copy of the GNU General Public License along -+// with this library; see the file COPYING3. If not see -+// . -+ -+// { dg-options "-std=gnu++0x" } -+ -+#include -+#include -+#include -+ -+int count = 0; -+ -+template -+ struct allocator98 : std::allocator -+ { -+ template struct rebind { typedef allocator98 other; }; + -+ allocator98() { } ++/* If BB is dominated by any block in the forbidden dominators set, ++ return TRUE; else FALSE. */ + -+ template allocator98(const allocator98&) { }; ++static bool ++dominated_by_forbidden (basic_block bb) ++{ ++ unsigned dom_bb; ++ bitmap_iterator bi; + -+ void construct(T* p, const T& val) ++ EXECUTE_IF_SET_IN_BITMAP (forbidden_dominators, 1, dom_bb, bi) + { -+ ++count; -+ std::allocator::construct(p, val); ++ if (dominated_by_p (CDI_DOMINATORS, bb, BASIC_BLOCK (dom_bb))) ++ return true; + } -+ }; -+ -+template -+ struct allocator11 : std::allocator -+ { -+ template struct rebind { typedef allocator11 other; }; + -+ allocator11() { } -+ -+ template allocator11(const allocator11&) { }; ++ return false; ++} + -+ template -+ void construct(T* p, Args&&... args) -+ { -+ ++count; -+ std::allocator::construct(p, std::forward(args)...); -+ } -+ }; + /* We found an split_point CURRENT. NON_SSA_VARS is bitmap of all non ssa + variables used and RETURN_BB is return basic block. + See if we can split function here. */ +@@ -411,6 +492,18 @@ + " Refused: split part has non-ssa uses\n"); + return; + } + -+int main() -+{ -+ std::vector< int, allocator98 > v98(1); -+ VERIFY( count == 0 ); ++ /* If the split point is dominated by a forbidden block, reject ++ the split. */ ++ if (!bitmap_empty_p (forbidden_dominators) ++ && dominated_by_forbidden (current->entry_bb)) ++ { ++ if (dump_file && (dump_flags & TDF_DETAILS)) ++ fprintf (dump_file, ++ " Refused: split point dominated by forbidden block\n"); ++ return; ++ } + -+ std::vector< int, allocator11 > v11(1); -+ VERIFY( count == 1 ); -+} -Index: libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc + /* See if retval used by return bb is computed by header or split part. + When it is computed by split part, we need to produce return statement + in the split part and add code to header to pass it around. +@@ -1329,6 +1422,10 @@ + return 0; + } + ++ /* Initialize bitmap to track forbidden calls. */ ++ forbidden_dominators = BITMAP_ALLOC (NULL); ++ calculate_dominance_info (CDI_DOMINATORS); ++ + /* Compute local info about basic blocks and determine function size/time. */ + VEC_safe_grow_cleared (bb_info, heap, bb_info_vec, last_basic_block + 1); + memset (&best_split_point, 0, sizeof (best_split_point)); +@@ -1350,6 +1447,7 @@ + this_time = estimate_num_insns (stmt, &eni_time_weights) * freq; + size += this_size; + time += this_time; ++ check_forbidden_calls (stmt); + + if (dump_file && (dump_flags & TDF_DETAILS)) + { +@@ -1371,6 +1469,7 @@ + BITMAP_FREE (best_split_point.split_bbs); + todo = TODO_update_ssa | TODO_cleanup_cfg; + } ++ BITMAP_FREE (forbidden_dominators); + VEC_free (bb_info, heap, bb_info_vec); + bb_info_vec = NULL; + return todo; +Index: gcc/loop-doloop.c +=================================================================== +--- a/src/gcc/loop-doloop.c (revision ++++ b/src/gcc/loop-doloop.c (revision +@@ -334,14 +334,11 @@ + describes the loop, DESC describes the number of iterations of the + loop, and DOLOOP_INSN is the low-overhead looping insn to emit at the + end of the loop. CONDITION is the condition separated from the +- DOLOOP_SEQ. COUNT is the number of iterations of the LOOP. +- ZERO_EXTEND_P says to zero extend COUNT after the increment of it to +- word_mode from FROM_MODE. */ ++ DOLOOP_SEQ. COUNT is the number of iterations of the LOOP. */ + + static void + doloop_modify (struct loop *loop, struct niter_desc *desc, +- rtx doloop_seq, rtx condition, rtx count, +- bool zero_extend_p, enum machine_mode from_mode) ++ rtx doloop_seq, rtx condition, rtx count) + { + rtx counter_reg; + rtx tmp, noloop = NULL_RTX; +@@ -415,12 +412,8 @@ + } + + if (increment_count) +- count = simplify_gen_binary (PLUS, from_mode, count, const1_rtx); ++ count = simplify_gen_binary (PLUS, mode, count, const1_rtx); + +- if (zero_extend_p) +- count = simplify_gen_unary (ZERO_EXTEND, word_mode, +- count, from_mode); +- + /* Insert initialization of the count register into the loop header. */ + start_sequence (); + tmp = force_operand (count, counter_reg); +@@ -555,7 +548,6 @@ + struct niter_desc *desc; + unsigned word_mode_size; + unsigned HOST_WIDE_INT word_mode_max; +- bool zero_extend_p = false; + + if (dump_file) + fprintf (dump_file, "Doloop: Processing loop %d.\n", loop->num); +@@ -630,7 +622,8 @@ + { + if (word_mode_size > GET_MODE_BITSIZE (mode)) + { +- zero_extend_p = true; ++ count = simplify_gen_unary (ZERO_EXTEND, word_mode, ++ count, mode); + iterations = simplify_gen_unary (ZERO_EXTEND, word_mode, + iterations, mode); + iterations_max = simplify_gen_unary (ZERO_EXTEND, word_mode, +@@ -674,8 +667,7 @@ + return false; + } + +- doloop_modify (loop, desc, doloop_seq, condition, count, +- zero_extend_p, mode); ++ doloop_modify (loop, desc, doloop_seq, condition, count); + return true; + } + +Index: gcc/tree-sra.c =================================================================== ---- a/src/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc (revision -+++ b/src/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc (revision -@@ -42,8 +42,8 @@ - return 0; +--- a/src/gcc/tree-sra.c (revision ++++ b/src/gcc/tree-sra.c (revision +@@ -1047,6 +1047,25 @@ + return false; } --// { dg-warning "note" "" { target *-*-* } 354 } --// { dg-warning "note" "" { target *-*-* } 1085 } -+// { dg-warning "note" "" { target *-*-* } 358 } -+// { dg-warning "note" "" { target *-*-* } 1086 } - // { dg-warning "note" "" { target *-*-* } 468 } - // { dg-warning "note" "" { target *-*-* } 586 } - // { dg-warning "note" "" { target *-*-* } 1049 } -Index: Makefile.def -=================================================================== ---- a/src/Makefile.def (revision -+++ b/src/Makefile.def (revision -@@ -353,6 +353,7 @@ - dependencies = { module=install-gcc ; on=install-fixincludes; }; - dependencies = { module=install-gcc ; on=install-lto-plugin; }; - dependencies = { module=install-strip-gcc ; on=install-strip-fixincludes; }; -+dependencies = { module=install-strip-gcc ; on=install-strip-lto-plugin; }; - - dependencies = { module=configure-libcpp; on=configure-libiberty; hard=true; }; - dependencies = { module=configure-libcpp; on=configure-intl; }; -Index: ChangeLog -=================================================================== ---- a/src/ChangeLog (revision -+++ b/src/ChangeLog (revision -@@ -1,3 +1,13 @@ -+2012-01-02 Richard Guenther -+ -+ PR bootstrap/51686 -+ * Makefile.def (install-strip-gcc): Depend on install-strip-lto-plugin. -+ * Makefile.in: Regenerate. -+ -+2011-12-18 Eric Botcazou -+ -+ * configure: Regenerate. -+ - 2011-11-20 Andreas Tobler - - * libtool.m4: Additional FreeBSD 10 fixes. -Index: lto-plugin/configure -=================================================================== ---- a/src/lto-plugin/configure (revision -+++ b/src/lto-plugin/configure (revision -@@ -622,6 +622,7 @@ - GREP - SED - LIBTOOL -+ac_lto_plugin_warn_cflags - am__fastdepCC_FALSE - am__fastdepCC_TRUE - CCDEPMODE -@@ -4040,6 +4041,45 @@ - fi - fi - -+ac_lto_plugin_warn_cflags= -+save_CFLAGS="$CFLAGS" -+for option in -Wall; do -+ as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh` -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5 -+$as_echo_n "checking whether $CC supports $option... " >&6; } -+if { as_var=$as_acx_Woption; eval "test \"\${$as_var+set}\" = set"; }; then : -+ $as_echo_n "(cached) " >&6 -+else -+ CFLAGS="$option" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ ++/* Return true if EXP is a memory reference less aligned than what the access ++ ACC would require. This is invoked only on strict-alignment targets. */ + -+int -+main () ++static bool ++tree_non_aligned_mem_for_access_p (tree exp, struct access *acc) +{ ++ unsigned int acc_align; + -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ eval "$as_acx_Woption=yes" -+else -+ eval "$as_acx_Woption=no" -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ -+fi -+eval ac_res=\$$as_acx_Woption -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -+$as_echo "$ac_res" >&6; } -+ if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; then : -+ ac_lto_plugin_warn_cflags="$ac_lto_plugin_warn_cflags${ac_lto_plugin_warn_cflags:+ }$option" -+fi -+ done -+CFLAGS="$save_CFLAGS" -+ - case `pwd` in - *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -@@ -10498,7 +10538,7 @@ - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 10501 "configure" -+#line 10541 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -10604,7 +10644,7 @@ - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF --#line 10607 "configure" -+#line 10647 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -Index: lto-plugin/Makefile.in -=================================================================== ---- a/src/lto-plugin/Makefile.in (revision -+++ b/src/lto-plugin/Makefile.in (revision -@@ -47,6 +47,7 @@ - $(top_srcdir)/../config/lead-dot.m4 \ - $(top_srcdir)/../config/lthostflags.m4 \ - $(top_srcdir)/../config/override.m4 \ -+ $(top_srcdir)/../config/warnings.m4 \ - $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ - $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ - $(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac -@@ -167,6 +168,7 @@ - abs_top_srcdir = @abs_top_srcdir@ - ac_ct_CC = @ac_ct_CC@ - ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -+ac_lto_plugin_warn_cflags = @ac_lto_plugin_warn_cflags@ - am__include = @am__include@ - am__leading_dot = @am__leading_dot@ - am__quote = @am__quote@ -@@ -227,7 +229,7 @@ - gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) - libexecsubdir := $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version) - AM_CPPFLAGS = -I$(top_srcdir)/../include $(DEFS) --AM_CFLAGS = -Wall -Werror -+AM_CFLAGS = @ac_lto_plugin_warn_cflags@ - AM_LIBTOOLFLAGS = --tag=disable-static - libexecsub_LTLIBRARIES = liblto_plugin.la - gcc_build_dir = ../$(host_subdir)/gcc -Index: lto-plugin/configure.ac -=================================================================== ---- a/src/lto-plugin/configure.ac (revision -+++ b/src/lto-plugin/configure.ac (revision -@@ -6,6 +6,7 @@ - AM_MAINTAINER_MODE - AC_PROG_CC - AC_SYS_LARGEFILE -+ACX_PROG_CC_WARNING_OPTS([-Wall], [ac_lto_plugin_warn_cflags]) - AM_PROG_LIBTOOL - ACX_LT_HOST_FLAGS - AC_SUBST(target_noncanonical) -Index: lto-plugin/ChangeLog -=================================================================== ---- a/src/lto-plugin/ChangeLog (revision -+++ b/src/lto-plugin/ChangeLog (revision -@@ -1,3 +1,16 @@ -+2012-01-03 Richard Guenther ++ /* The alignment of the access is that of its expression. However, it may ++ have been artificially increased, e.g. by a local alignment promotion, ++ so we cap it to the alignment of the type of the base, on the grounds ++ that valid sub-accesses cannot be more aligned than that. */ ++ acc_align = get_object_alignment (acc->expr, BIGGEST_ALIGNMENT); ++ if (acc->base && acc_align > TYPE_ALIGN (TREE_TYPE (acc->base))) ++ acc_align = TYPE_ALIGN (TREE_TYPE (acc->base)); + -+ Backport from mainline -+ 2011-08-10 Richard Guenther ++ return tree_non_aligned_mem_p (exp, acc_align); ++} + -+ PR bootstrap/49907 -+ lto-plugin/ -+ * configure.ac: Use ACX_PROG_CC_WARNING_OPTS to detect -Wall presence. -+ * Makefile.am (AM_CFLAGS): Adjust. Do not build with -Werror. -+ * configure: Regenerate. -+ * Makefile.in: Likewise. -+ * aclocal.m4: Likewise. -+ - 2011-11-20 Andreas Tobler - - * configure: Regenerate. -Index: lto-plugin/Makefile.am -=================================================================== ---- a/src/lto-plugin/Makefile.am (revision -+++ b/src/lto-plugin/Makefile.am (revision -@@ -8,7 +8,7 @@ - libexecsubdir := $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version) - - AM_CPPFLAGS = -I$(top_srcdir)/../include $(DEFS) --AM_CFLAGS = -Wall -Werror -+AM_CFLAGS = @ac_lto_plugin_warn_cflags@ - AM_LIBTOOLFLAGS = --tag=disable-static - - libexecsub_LTLIBRARIES = liblto_plugin.la -Index: lto-plugin/aclocal.m4 -=================================================================== ---- a/src/lto-plugin/aclocal.m4 (revision -+++ b/src/lto-plugin/aclocal.m4 (revision -@@ -973,6 +973,7 @@ - m4_include([../config/lead-dot.m4]) - m4_include([../config/lthostflags.m4]) - m4_include([../config/override.m4]) -+m4_include([../config/warnings.m4]) - m4_include([../libtool.m4]) - m4_include([../ltoptions.m4]) - m4_include([../ltsugar.m4]) -Index: config/ChangeLog + /* Scan expressions occuring in STMT, create access structures for all accesses + to candidates for scalarization and remove those candidates which occur in + statements or expressions that prevent them from being split apart. Return +@@ -1073,10 +1092,7 @@ + if (lacc) + { + lacc->grp_assignment_write = 1; +- if (STRICT_ALIGNMENT +- && tree_non_aligned_mem_p (rhs, +- get_object_alignment (lhs, +- BIGGEST_ALIGNMENT))) ++ if (STRICT_ALIGNMENT && tree_non_aligned_mem_for_access_p (rhs, lacc)) + lacc->grp_unscalarizable_region = 1; + } + +@@ -1086,10 +1102,7 @@ + if (should_scalarize_away_bitmap && !gimple_has_volatile_ops (stmt) + && !is_gimple_reg_type (racc->type)) + bitmap_set_bit (should_scalarize_away_bitmap, DECL_UID (racc->base)); +- if (STRICT_ALIGNMENT +- && tree_non_aligned_mem_p (lhs, +- get_object_alignment (rhs, +- BIGGEST_ALIGNMENT))) ++ if (STRICT_ALIGNMENT && tree_non_aligned_mem_for_access_p (lhs, racc)) + racc->grp_unscalarizable_region = 1; + } + +Index: gcc/config/sparc/sol2-unwind.h =================================================================== ---- a/src/config/ChangeLog (revision -+++ b/src/config/ChangeLog (revision -@@ -1,3 +1,7 @@ -+2011-12-18 Eric Botcazou +--- a/src/gcc/config/sparc/sol2-unwind.h (revision ++++ b/src/gcc/config/sparc/sol2-unwind.h (revision +@@ -1,5 +1,5 @@ + /* DWARF2 EH unwinding support for SPARC Solaris. +- Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. ++ Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc. + + This file is part of GCC. + +@@ -34,7 +34,7 @@ + #define IS_SIGHANDLER sparc64_is_sighandler + + static int +-sparc64_is_sighandler (unsigned int *pc, unsigned int *savpc, int *nframes) ++sparc64_is_sighandler (unsigned int *pc, void *cfa, int *nframes) + { + if (/* Solaris 8 - single-threaded + ---------------------------- +@@ -110,38 +110,58 @@ + && pc[ 0] == 0x81c7e008 + && pc[ 1] == 0x81e80000) + { +- if (/* Solaris 8 /usr/lib/sparcv9/libthread.so.1 +- ------------------------------------------ +- Before patch 108827-08: +- : st %g4, [ %i1 + 0x1c ] ++ /* We have observed different calling frames among different ++ versions of the operating system, so that we need to ++ discriminate using the upper frame. We look for the return ++ address of the caller frame (there is an offset of 15 double ++ words between the frame address and the place where this return ++ address is stored) in order to do some more pattern matching. */ ++ unsigned int cuh_pattern ++ = *(unsigned int *)(*(unsigned long *)(cfa + 15*8) - 4); + +- Since patch 108827-08: +- : st %l0, [ %i4 + 0x10 ] */ +- savpc[-1] == 0xc826601c +- || savpc[-1] == 0xe0272010) ++ if (cuh_pattern == 0xd25fa7ef) + { +- /* We need to move up three frames: ++ /* This matches the call_user_handler pattern for Solaris 10. ++ There are 2 cases so we look for the return address of the ++ caller's caller frame in order to do more pattern matching. */ ++ unsigned long sah_address = *(unsigned long *)(cfa + 176 + 15*8); + ++ if (sah_address && *(unsigned int *)(sah_address - 4) == 0x92100019) ++ /* This is the same setup as for Solaris 9, see below. */ ++ *nframes = 3; ++ else ++ /* The sigacthandler frame isn't present in the chain. ++ We need to move up two frames: + -+ * acx.m4 (Test for GNAT): Update comment and add quotes in final test. + <-- context->cfa + __sighndlr +- sigacthandler ++ call_user_handler frame + +- */ +- *nframes = 2; ++ */ ++ *nframes = 2; + } +- else /* Solaris 8 /usr/lib/lwp/sparcv9/libthread.so.1, Solaris 9+ +- ---------------------------------------------------------- */ +- { +- /* We need to move up three frames: ++ else if (cuh_pattern == 0x9410001a || cuh_pattern == 0x94100013) ++ /* This matches the call_user_handler pattern for Solaris 9 and ++ for Solaris 8 running inside Solaris Containers respectively ++ We need to move up three frames: + + <-- context->cfa + __sighndlr + call_user_handler + sigacthandler + +- */ +- *nframes = 3; +- } ++ */ ++ *nframes = 3; ++ else ++ /* This is the default Solaris 8 case. ++ We need to move up two frames: ++ ++ <-- context->cfa ++ __sighndlr ++ sigacthandler ++ ++ */ ++ *nframes = 2; + return 1; + } + +@@ -172,7 +192,7 @@ + #define IS_SIGHANDLER sparc_is_sighandler + + static int +-sparc_is_sighandler (unsigned int *pc, unsigned int * savpc, int *nframes) ++sparc_is_sighandler (unsigned int *pc, void *cfa, int *nframes) + { + if (/* Solaris 8, 9 - single-threaded + ------------------------------- +@@ -200,7 +220,7 @@ + && pc[-1] == 0x9410001a + && pc[ 0] == 0x80a62008) + { +- /* Need to move up one frame: ++ /* We need to move up one frame: + + <-- context->cfa + sigacthandler +@@ -231,7 +251,7 @@ + && pc[ 1] == 0x81e80000 + && pc[ 2] == 0x80a26000) + { +- /* Need to move up one frame: ++ /* We need to move up one frame: + + <-- context->cfa + __libthread_segvhdlr +@@ -258,33 +278,58 @@ + && pc[ 0] == 0x81c7e008 + && pc[ 1] == 0x81e80000) + { +- if (/* Solaris 8 /usr/lib/libthread.so.1 +- ---------------------------------- +- : mov %i0, %o0 */ +- savpc[-1] == 0x90100018) ++ /* We have observed different calling frames among different ++ versions of the operating system, so that we need to ++ discriminate using the upper frame. We look for the return ++ address of the caller frame (there is an offset of 15 words ++ between the frame address and the place where this return ++ address is stored) in order to do some more pattern matching. */ ++ unsigned int cuh_pattern ++ = *(unsigned int *)(*(unsigned int *)(cfa + 15*4) - 4); ++ ++ if (cuh_pattern == 0xd407a04c) + { +- /* We need to move up two frames: ++ /* This matches the call_user_handler pattern for Solaris 10. ++ There are 2 cases so we look for the return address of the ++ caller's caller frame in order to do more pattern matching. */ ++ unsigned int sah_address = *(unsigned int *)(cfa + 96 + 15*4); + ++ if (sah_address && *(unsigned int *)(sah_address - 4) == 0x92100019) ++ /* This is the same setup as for Solaris 9, see below. */ ++ *nframes = 3; ++ else ++ /* The sigacthandler frame isn't present in the chain. ++ We need to move up two frames: + - 2011-10-26 Release Manager + <-- context->cfa + __sighndlr +- sigacthandler ++ call_user_handler frame + +- */ +- *nframes = 2; ++ */ ++ *nframes = 2; + } +- else /* Solaris 8 /usr/lib/lwp/libthread.so.1, Solaris 9+ +- -------------------------------------------------- */ +- { +- /* We need to move up three frames: ++ else if (cuh_pattern == 0x9410001a || cuh_pattern == 0x9410001b) ++ /* This matches the call_user_handler pattern for Solaris 9 and ++ for Solaris 8 running inside Solaris Containers respectively. ++ We need to move up three frames: + + <-- context->cfa + __sighndlr + call_user_handler + sigacthandler + +- */ +- *nframes = 3; +- } ++ */ ++ *nframes = 3; ++ else ++ /* This is the default Solaris 8 case. ++ We need to move up two frames: ++ ++ <-- context->cfa ++ __sighndlr ++ sigacthandler ++ ++ */ ++ *nframes = 2; + return 1; + } + +@@ -322,7 +367,7 @@ + return _URC_NO_REASON; + } + +- if (IS_SIGHANDLER (pc, (unsigned int *)fp->fr_savpc, &nframes)) ++ if (IS_SIGHANDLER (pc, this_cfa, &nframes)) + { + struct handler_args { + struct frame frwin; +Index: gcc/config/i386/i386.md +=================================================================== +--- a/src/gcc/config/i386/i386.md (revision ++++ b/src/gcc/config/i386/i386.md (revision +@@ -3647,7 +3647,7 @@ + (match_operand:SI 1 "nonimmediate_operand" "rm,0,r ,m ,r ,m")))] + "TARGET_64BIT" + "@ +- mov\t{%k1, %k0|%k0, %k1} ++ mov{l}\t{%1, %k0|%k0, %1} + # + movd\t{%1, %0|%0, %1} + movd\t{%1, %0|%0, %1} +@@ -9222,7 +9222,7 @@ + (match_dup 0))) + (set (match_dup 1) + (if_then_else:SWI48 (ne (reg:CCZ FLAGS_REG) (const_int 0)) +- (match_operand:SWI48 3 "register_operand" "r") ++ (match_operand:SWI48 3 "register_operand" "") + (match_dup 1)))] + "TARGET_CMOVE" + "operands[4] = GEN_INT (GET_MODE_BITSIZE (mode));") +Index: gcc/config/i386/driver-i386.c +=================================================================== +--- a/src/gcc/config/i386/driver-i386.c (revision ++++ b/src/gcc/config/i386/driver-i386.c (revision +@@ -507,7 +507,7 @@ + processor = PROCESSOR_AMDFAM10; + else if (has_sse2 || has_longmode) + processor = PROCESSOR_K8; +- else if (has_3dnowp) ++ else if (has_3dnowp && family == 6) + processor = PROCESSOR_ATHLON; + else if (has_mmx) + processor = PROCESSOR_K6; +Index: gcc/config/avr/avr.c +=================================================================== +--- a/src/gcc/config/avr/avr.c (revision ++++ b/src/gcc/config/avr/avr.c (revision +@@ -5154,6 +5154,7 @@ + if (new_decl_p + && decl && DECL_P (decl) + && NULL_TREE == DECL_INITIAL (decl) ++ && !DECL_EXTERNAL (decl) + && avr_progmem_p (decl, DECL_ATTRIBUTES (decl))) + { + warning (OPT_Wuninitialized, +Index: gcc/config/rs6000/rs6000.md +=================================================================== +--- a/src/gcc/config/rs6000/rs6000.md (revision ++++ b/src/gcc/config/rs6000/rs6000.md (revision +@@ -12241,8 +12241,8 @@ + " + { + operands[3] = gen_reg_rtx (SImode); +- operands[4] = gen_rtx_MEM (DImode, +- gen_rtx_PLUS (DImode, stack_pointer_rtx, ++ operands[4] = gen_rtx_MEM (SImode, ++ gen_rtx_PLUS (SImode, stack_pointer_rtx, + GEN_INT (20))); - * GCC 4.6.2 released. -Index: config/acx.m4 + operands[5] = gen_rtx_MEM (SImode, +Index: gcc/config/arm/arm.c +=================================================================== +--- a/src/gcc/config/arm/arm.c (revision ++++ b/src/gcc/config/arm/arm.c (revision +@@ -20867,6 +20867,8 @@ + gcc_assert (amount >= 0); + if (amount) + { ++ emit_insn (gen_blockage ()); ++ + if (amount < 512) + emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, + GEN_INT (amount))); +Index: gcc/config/arm/arm.md =================================================================== ---- a/src/config/acx.m4 (revision -+++ b/src/config/acx.m4 (revision -@@ -356,9 +356,9 @@ - ac_c_preproc_warn_flag=yes])# AC_PROG_CPP_WERROR - - # Test for GNAT. --# We require the gnatbind program, and a compiler driver that --# understands Ada. We use the user's CC setting, already found, --# and possibly add $1 to the command-line parameters. -+# We require the gnatbind & gnatmake programs, as well as a compiler driver -+# that understands Ada. We use the user's CC setting, already found, and -+# possibly add $1 to the command-line parameters. - # - # Sets the shell variable have_gnat to yes or no as appropriate, and - # substitutes GNATBIND and GNATMAKE. -@@ -387,7 +387,7 @@ - fi - rm -f conftest.*]) - --if test x$GNATBIND != xno && test x$GNATMAKE != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then -+if test "x$GNATBIND" != xno && test "x$GNATMAKE" != xno && test x$acx_cv_cc_gcc_supports_ada != xno; then - have_gnat=yes - else - have_gnat=no +--- a/src/gcc/config/arm/arm.md (revision ++++ b/src/gcc/config/arm/arm.md (revision +@@ -7346,7 +7346,7 @@ + (not:SI (match_operator:SI 1 "arm_comparison_operator" + [(match_operand 2 "cc_register" "") (const_int 0)])))] + "TARGET_ARM" +- "mov%D1\\t%0, #0\;mvn%d1\\t%0, #1" ++ "mvn%D1\\t%0, #0\;mvn%d1\\t%0, #1" + [(set_attr "conds" "use") + (set_attr "insn" "mov") + (set_attr "length" "8")] +Index: gcc/config/mips/mips.md +=================================================================== +--- a/src/gcc/config/mips/mips.md (revision ++++ b/src/gcc/config/mips/mips.md (revision +@@ -4707,7 +4707,7 @@ + ;; of _gp from the start of this function. Operand 1 is the incoming + ;; function address. + (define_insn_and_split "loadgp_newabi_" +- [(set (match_operand:P 0 "register_operand" "=d") ++ [(set (match_operand:P 0 "register_operand" "=&d") + (unspec:P [(match_operand:P 1) + (match_operand:P 2 "register_operand" "d")] + UNSPEC_LOADGP))] reverted: --- gcc-4.6-4.6.2/debian/patches/gcc-volatile-bitfields.diff +++ gcc-4.6-4.6.2.orig/debian/patches/gcc-volatile-bitfields.diff @@ -1,23 +0,0 @@ -# DP: Volatile bitfields vs. inline asm memory constraints, taken from the trunk -# DP: http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01477.html - - gcc/ - * expr.c (expand_expr_real_1): Only use BLKmode for volatile - accesses which are not naturally aligned. - ---- a/src/gcc/expr.c -+++ b/src/gcc/expr.c -@@ -9147,8 +9147,11 @@ - && modifier != EXPAND_CONST_ADDRESS - && modifier != EXPAND_INITIALIZER) - /* If the field is volatile, we always want an aligned -- access. */ -- || (volatilep && flag_strict_volatile_bitfields > 0) -+ access. Only do this if the access is not already naturally -+ aligned, otherwise "normal" (non-bitfield) volatile fields -+ become non-addressable. */ -+ || (volatilep && flag_strict_volatile_bitfields > 0 -+ && (bitpos % GET_MODE_ALIGNMENT (mode) != 0)) - /* If the field isn't aligned enough to fetch as a memref, - fetch it as a bit field. */ - || (mode1 != BLKmode diff -u gcc-4.6-4.6.2/debian/patches/svn-updates.diff gcc-4.6-4.6.2/debian/patches/svn-updates.diff --- gcc-4.6-4.6.2/debian/patches/svn-updates.diff +++ gcc-4.6-4.6.2/debian/patches/svn-updates.diff @@ -1,10 +1,10 @@ -# DP: updates from the 4.6 branch upto 20120104 (r182882). +# DP: updates from the 4.6 branch upto 20120120 (r183333). last_updated() { cat > ${dir}LAST_UPDATED < ++ ++ PR target/48743 ++ * config/i386/driver-i386.c (host_detect_local_cpu): Also check ++ family to distinguish PROCESSOR_ATHLON. ++ ++2012-01-18 Bill Schmidt ++ ++ PR tree-optimization/49642 ++ * ipa-split.c (forbidden_dominators): New variable. ++ (check_forbidden_calls): New function. ++ (dominated_by_forbidden): Likewise. ++ (consider_split): Check for forbidden dominators. ++ (execute_split_functions): Initialize and free forbidden ++ dominators info; call check_forbidden_calls. ++ ++2012-01-18 David Edelsohn ++ ++ * config/rs6000/rs6000.md (call_value_indirect_aix32): Fix typo ++ in mode of operand[4]. ++ ++2012-01-15 Uros Bizjak ++ ++ PR rtl-optimization/51821 ++ * recog.c (peep2_find_free_register): Determine clobbered registers ++ from insn pattern. ++ ++2012-01-12 Georg-Johann Lay ++ ++ Backport from mainline r183129 ++ PR target/51756 ++ * config/avr/avr.c (avr_encode_section_info): Test for absence of ++ DECL_EXTERNAL when checking for initializers of progmem variables. ++ ++22012-01-12 Matthew Gretton-Dann ++ ++ Backport from mainline ++ 2012-01-11 Matthew Gretton-Dann ++ ++ * config/arm/arm.md (mov_notscc): Use MVN for false condition. ++ ++2012-01-12 Uros Bizjak ++ ++ * config/i386/i386.md (*zero_extendsidi2_rex64): Correct movl template. ++ (x86_shift_adj_1): Remove operand constraint from operand 3. ++ ++2012-01-10 Joseph Myers ++ ++ Revert: ++ ++ 2008-09-18 Andrew Pinski ++ ++ PR rtl-opt/37451 ++ * loop-doloop.c (doloop_modify): New argument zero_extend_p and ++ zero extend count after the correction to it is done. ++ (doloop_optimize): Update call to doloop_modify, don't zero extend ++ count before call. ++ ++ 2008-11-03 Andrew Pinski ++ ++ PR rtl-opt/37782 ++ * loop-doloop.c (doloop_modify): Add from_mode argument that says what ++ mode count is in. ++ (doloop_optimize): Update call to doloop_modify. ++ ++2012-01-09 Richard Sandiford ++ ++ * config/mips/mips.md (loadgp_newabi_): Add missing earlyclobber. ++ ++2012-01-09 Eric Botcazou ++ ++ * config/sparc/sol2-unwind.h (sparc64_is_sighandler): Check that the ++ purported sigacthandler address isn't null before dereferencing it. ++ (sparc_is_sighandler): Likewise. ++ ++2012-01-09 Ramana Radhakrishnan ++ ++ Backport from mainline ++ 2011-11-04 Jiangning Liu ++ ++ PR rtl-optimization/38644 ++ * config/arm/arm.c (thumb1_expand_epilogue): Add memory barrier ++ for epilogue having stack adjustment. ++ ++2012-01-09 Eric Botcazou ++ ++ PR ada/41929 ++ * config/sparc/sol2-unwind.h (sparc64_is_sighandler): Remove SAVPC and ++ add CFA. Revert back to old code for Solaris 8+ multi-threaded. ++ (sparc_is_sighandler): Likewise. ++ (MD_FALLBACK_FRAME_STATE_FOR): Adjust call to IS_SIGHANDLER. ++ ++2012-01-06 Eric Botcazou ++ ++ Backport from mainline ++ 2012-01-06 Arnaud Charlet ++ ++ * c-decl.c (ext_block): Moved up. ++ (collect_all_refs, for_each_global_decl): Take ext_block into account. ++ ++2012-01-06 Richard Sandiford ++ ++ PR middle-end/48660 ++ * expr.h (copy_blkmode_to_reg): Declare. ++ * expr.c (copy_blkmode_to_reg): New function. ++ (expand_assignment): Don't expand register RESULT_DECLs before ++ the lhs. Use copy_blkmode_to_reg to copy BLKmode values into a ++ RESULT_DECL register. ++ (expand_expr_real_1): Handle BLKmode decls when looking for promotion. ++ ++2012-01-05 Eric Botcazou ++ ++ PR tree-optimization/51315 ++ * tree-sra.c (tree_non_aligned_mem_for_access_p): New predicate. ++ (build_accesses_from_assign): Use it instead of tree_non_aligned_mem_p. ++ ++2012-01-04 Eric Botcazou ++ ++ PR tree-optimization/51624 ++ * tree-sra.c (build_ref_for_model): When replicating a chain of ++ COMPONENT_REFs, stop as soon as the offset would become negative. ++ +2012-01-04 Richard Guenther + + PR tree-optimization/49651 + * tree-ssa-structalias.c (type_can_have_subvars): New function. + (var_can_have_subvars): Use it. -+ (get_constraint_for_1): Only consider subfields if there -+ can be any. ++ (get_constraint_for_1): Only consider subfields if there can be any. + +2012-01-03 Sandra Loosemore + @@ -774,8 +895,7 @@ + + PR target/51623 + * config/rs6000/rs6000.c (rs6000_assemble_integer): Don't call -+ unlikely_text_section_p. Instead check for being in a code -+ section. ++ unlikely_text_section_p. Instead check for being in a code section. + +2011-12-23 Richard Guenther + @@ -1199,7 +1319,7 @@ 2011-10-26 Release Manager * GCC 4.6.2 released. -@@ -144,8 +618,8 @@ +@@ -144,8 +738,8 @@ 2011-10-07 Bernd Schmidt @@ -1210,7 +1330,7 @@ 2011-10-06 Jakub Jelinek -@@ -252,7 +726,7 @@ +@@ -252,7 +846,7 @@ * config/rs6000/rs6000.md (probe_stack): Use explicit operand. * config/rs6000/rs6000.c (output_probe_stack_range): Likewise. @@ -1219,6 +1339,18 @@ * tree-vect-stmts.c (vect_transform_stmt): Remove unused local variable ORIG_SCALAR_STMT. +Index: gcc/testsuite/gcc.target/arm/headmerge-2.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/arm/headmerge-2.c (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/testsuite/gcc.target/arm/headmerge-2.c (.../branches/gcc-4_6-branch) +@@ -1,6 +1,6 @@ + /* { dg-do compile } */ + /* { dg-options "-O2" } */ +-/* { dg-final { scan-assembler-times "120" 1 } } */ ++/* { dg-final { scan-assembler-times "120\n" 1 } } */ + + extern void foo1 (int); + extern void foo2 (int); Index: gcc/testsuite/gcc.target/arm/pr49641.c =================================================================== --- a/src/gcc/testsuite/gcc.target/arm/pr49641.c (.../tags/gcc_4_6_2_release) @@ -1242,6 +1374,23 @@ + y = 0; + foo(&v); +} +Index: gcc/testsuite/gcc.target/arm/stack-red-zone.c +=================================================================== +--- a/src/gcc/testsuite/gcc.target/arm/stack-red-zone.c (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/testsuite/gcc.target/arm/stack-red-zone.c (.../branches/gcc-4_6-branch) +@@ -0,0 +1,12 @@ ++/* No stack red zone. PR38644. */ ++/* { dg-options "-mthumb -O2" } */ ++/* { dg-final { scan-assembler "ldrb\[^\n\]*\\n\[\t \]*add\[\t \]*sp" } } */ ++ ++extern int doStreamReadBlock (int *, char *, int size, int); ++ ++char readStream (int *s) ++{ ++ char c = 0; ++ doStreamReadBlock (s, &c, 1, *s); ++ return c; ++} Index: gcc/testsuite/gcc.target/arm/sibcall-2.c =================================================================== --- a/src/gcc/testsuite/gcc.target/arm/sibcall-2.c (.../tags/gcc_4_6_2_release) @@ -1703,6 +1852,28 @@ + +! { dg-final { scan-module-absence "m" "IMPLICIT_PURE" } } +! { dg-final { cleanup-modules "m" } } +Index: gcc/testsuite/gfortran.dg/intrinsic_size_2.f90 +=================================================================== +--- a/src/gcc/testsuite/gfortran.dg/intrinsic_size_2.f90 (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/testsuite/gfortran.dg/intrinsic_size_2.f90 (.../branches/gcc-4_6-branch) +@@ -0,0 +1,17 @@ ++! { dg-do compile } ++! ++! PR fortran/51904 ++! ++! Contributed by David Sagan. ++! ++ ++call qp_draw_polyline_basic([1.0,2.0]) ++contains ++subroutine qp_draw_polyline_basic (x) ++ implicit none ++ real :: x(:), f ++ integer :: i ++ f = 0 ++ print *, size(f*x) ++end subroutine ++end Index: gcc/testsuite/gfortran.dg/default_initialization_5.f90 =================================================================== --- a/src/gcc/testsuite/gfortran.dg/default_initialization_5.f90 (.../tags/gcc_4_6_2_release) @@ -1774,6 +1945,26 @@ +! { dg-final { scan-tree-dump-times "my_data.head = &tgt" 1 "original" } } +! { dg-final { cleanup-tree-dump "original" } } +! { dg-final { cleanup-modules "arr_m list_m worker_mod" } } +Index: gcc/testsuite/gfortran.dg/init_flag_9.f90 +=================================================================== +--- a/src/gcc/testsuite/gfortran.dg/init_flag_9.f90 (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/testsuite/gfortran.dg/init_flag_9.f90 (.../branches/gcc-4_6-branch) +@@ -0,0 +1,15 @@ ++! { dg-do run } ++! { dg-options "-finit-character=89" } ++! ++! PR fortran/51800 ++! ++ ++subroutine foo(n) ++ character(len=n) :: str ++! print *, str ++ if (str /= repeat ('Y', n)) call abort() ++end subroutine foo ++ ++call foo(3) ++call foo(10) ++end Index: gcc/testsuite/gfortran.dg/pr50875.f90 =================================================================== --- a/src/gcc/testsuite/gfortran.dg/pr50875.f90 (.../tags/gcc_4_6_2_release) @@ -1900,6 +2091,75 @@ + +! { dg-final { scan-module "b" "IMPLICIT_PURE" } } +! { dg-final { cleanup-modules "b" } } +Index: gcc/testsuite/gfortran.dg/init_flag_8.f90 +=================================================================== +--- a/src/gcc/testsuite/gfortran.dg/init_flag_8.f90 (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/testsuite/gfortran.dg/init_flag_8.f90 (.../branches/gcc-4_6-branch) +@@ -0,0 +1,18 @@ ++! { dg-do compile } ++! { dg-options "-fno-automatic -finit-local-zero" } ++! ++! PR fortran/51800 ++! ++! Contributed by Mario Baumann ++! ++ SUBROUTINE FOO( N, A ) ++ IMPLICIT NONE ++ INTEGER :: N ++ INTEGER :: A(1:N) ++ INTEGER :: J ++ INTEGER :: DUMMY(1:N) ++ DO J=1,N ++ DUMMY(J) = 0 ++ A(J) = DUMMY(J) ++ END DO ++ END SUBROUTINE FOO +Index: gcc/testsuite/gcc.c-torture/execute/doloop-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.c-torture/execute/doloop-1.c (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/testsuite/gcc.c-torture/execute/doloop-1.c (.../branches/gcc-4_6-branch) +@@ -0,0 +1,18 @@ ++#include ++ ++extern void exit (int); ++extern void abort (void); ++ ++volatile unsigned int i; ++ ++int ++main (void) ++{ ++ unsigned char z = 0; ++ ++ do ++i; ++ while (--z > 0); ++ if (i != UCHAR_MAX + 1U) ++ abort (); ++ exit (0); ++} +Index: gcc/testsuite/gcc.c-torture/execute/20120111-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.c-torture/execute/20120111-1.c (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/testsuite/gcc.c-torture/execute/20120111-1.c (.../branches/gcc-4_6-branch) +@@ -0,0 +1,18 @@ ++#include ++#include ++ ++uint32_t f0a (uint64_t arg2) __attribute__((noinline)); ++ ++uint32_t ++f0a (uint64_t arg) ++{ ++ return ~(arg > -3); ++} ++ ++int main() { ++ uint32_t r1; ++ r1 = f0a (12094370573988097329ULL); ++ if (r1 != ~0U) ++ abort (); ++ return 0; ++} Index: gcc/testsuite/gcc.c-torture/execute/pr51466.c =================================================================== --- a/src/gcc/testsuite/gcc.c-torture/execute/pr51466.c (.../tags/gcc_4_6_2_release) @@ -1987,6 +2247,35 @@ + + return 0; +} +Index: gcc/testsuite/gcc.c-torture/execute/20120105-1.c +=================================================================== +--- a/src/gcc/testsuite/gcc.c-torture/execute/20120105-1.c (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/testsuite/gcc.c-torture/execute/20120105-1.c (.../branches/gcc-4_6-branch) +@@ -0,0 +1,24 @@ ++struct __attribute__((packed)) S ++{ ++ int a, b, c; ++}; ++ ++static int __attribute__ ((noinline,noclone)) ++extract(const char *p) ++{ ++ struct S s; ++ __builtin_memcpy (&s, p, sizeof(struct S)); ++ return s.a; ++} ++ ++volatile int i; ++ ++int main (void) ++{ ++ char p[sizeof(struct S) + 1]; ++ ++ __builtin_memset (p, 0, sizeof(struct S) + 1); ++ i = extract (p + 1); ++ ++ return 0; ++} Index: gcc/testsuite/gcc.c-torture/execute/pr51323.c =================================================================== --- a/src/gcc/testsuite/gcc.c-torture/execute/pr51323.c (.../tags/gcc_4_6_2_release) @@ -2126,6 +2415,29 @@ + abort (); + return 0; +} +Index: gcc/testsuite/gcc.c-torture/execute/doloop-2.c +=================================================================== +--- a/src/gcc/testsuite/gcc.c-torture/execute/doloop-2.c (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/testsuite/gcc.c-torture/execute/doloop-2.c (.../branches/gcc-4_6-branch) +@@ -0,0 +1,18 @@ ++#include ++ ++extern void exit (int); ++extern void abort (void); ++ ++volatile unsigned int i; ++ ++int ++main (void) ++{ ++ unsigned short z = 0; ++ ++ do ++i; ++ while (--z > 0); ++ if (i != USHRT_MAX + 1U) ++ abort (); ++ exit (0); ++} Index: gcc/testsuite/gcc.c-torture/compile/pr51077.c =================================================================== --- a/src/gcc/testsuite/gcc.c-torture/compile/pr51077.c (.../tags/gcc_4_6_2_release) @@ -2346,6 +2658,36 @@ +} + +/* { dg-final { scan-assembler-times "\\(DIE\[^\\r\\n\]*DW_TAG_variable\\)" 1 } } */ +Index: gcc/testsuite/gcc.dg/pr51821.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/pr51821.c (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/testsuite/gcc.dg/pr51821.c (.../branches/gcc-4_6-branch) +@@ -0,0 +1,25 @@ ++/* { dg-do run } */ ++/* { dg-options "-std=c99 -O2" } */ ++/* { dg-options "-std=c99 -O2 -msse" { target { i?86-*-* x86_64-*-* } } } */ ++/* { dg-require-effective-target sse_runtime { target { i?86-*-* x86_64-*-* } } } */ ++ ++extern void abort (void); ++ ++unsigned int __attribute__((noinline)) ++test (int shift_size) ++{ ++ unsigned long long res = ~0; ++ ++ return res << shift_size; ++} ++ ++int ++main () ++{ ++ int dst = 32; ++ ++ if (test (dst) != 0) ++ abort (); ++ ++ return 0; ++} Index: gcc/testsuite/gcc.dg/volatile-bitfields-1.c =================================================================== --- a/src/gcc/testsuite/gcc.dg/volatile-bitfields-1.c (.../tags/gcc_4_6_2_release) @@ -2534,6 +2876,60 @@ + } + return 0; +} +Index: gcc/testsuite/gcc.dg/tree-ssa/pr49642.c +=================================================================== +--- a/src/gcc/testsuite/gcc.dg/tree-ssa/pr49642.c (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/testsuite/gcc.dg/tree-ssa/pr49642.c (.../branches/gcc-4_6-branch) +@@ -0,0 +1,49 @@ ++/* Verify that ipa-split is disabled following __builtin_constant_p. */ ++ ++/* { dg-do compile } */ ++/* { dg-options "-O2 -fdump-tree-optimized" } */ ++ ++typedef unsigned int u32; ++typedef unsigned long long u64; ++ ++static inline __attribute__((always_inline)) __attribute__((const)) ++int __ilog2_u32(u32 n) ++{ ++ int bit; ++ asm ("cntlzw %0,%1" : "=r" (bit) : "r" (n)); ++ return 31 - bit; ++} ++ ++ ++static inline __attribute__((always_inline)) __attribute__((const)) ++int __ilog2_u64(u64 n) ++{ ++ int bit; ++ asm ("cntlzd %0,%1" : "=r" (bit) : "r" (n)); ++ return 63 - bit; ++} ++ ++ ++ ++static u64 ehca_map_vaddr(void *caddr); ++ ++struct ehca_shca { ++ u32 hca_cap_mr_pgsize; ++}; ++ ++static u64 ehca_get_max_hwpage_size(struct ehca_shca *shca) ++{ ++ return 1UL << ( __builtin_constant_p(shca->hca_cap_mr_pgsize) ? ( (shca->hca_cap_mr_pgsize) < 1 ? ____ilog2_NaN() : (shca->hca_cap_mr_pgsize) & (1ULL << 63) ? 63 : (shca->hca_cap_mr_pgsize) & (1ULL << 62) ? 62 : (shca->hca_cap_mr_pgsize) & (1ULL << 61) ? 61 : (shca->hca_cap_mr_pgsize) & (1ULL << 60) ? 60 : (shca->hca_cap_mr_pgsize) & (1ULL << 59) ? 59 : (shca->hca_cap_mr_pgsize) & (1ULL << 58) ? 58 : (shca->hca_cap_mr_pgsize) & (1ULL << 57) ? 57 : (shca->hca_cap_mr_pgsize) & (1ULL << 56) ? 56 : (shca->hca_cap_mr_pgsize) & (1ULL << 55) ? 55 : (shca->hca_cap_mr_pgsize) & (1ULL << 54) ? 54 : (shca->hca_cap_mr_pgsize) & (1ULL << 53) ? 53 : (shca->hca_cap_mr_pgsize) & (1ULL << 52) ? 52 : (shca->hca_cap_mr_pgsize) & (1ULL << 51) ? 51 : (shca->hca_cap_mr_pgsize) & (1ULL << 50) ? 50 : (shca->hca_cap_mr_pgsize) & (1ULL << 49) ? 49 : (shca->hca_cap_mr_pgsize) & (1ULL << 48) ? 48 : (shca->hca_cap_mr_pgsize) & (1ULL << 47) ? 47 : (shca->hca_cap_mr_pgsize) & (1ULL << 46) ? 46 : (shca->hca_cap_mr_pgsize) & (1ULL << 45) ? 45 : (shca->hca_cap_mr_pgsize) & (1ULL << 44) ? 44 : (shca->hca_cap_mr_pgsize) & (1ULL << 43) ? 43 : (shca->hca_cap_mr_pgsize) & (1ULL << 42) ? 42 : (shca->hca_cap_mr_pgsize) & (1ULL << 41) ? 41 : (shca->hca_cap_mr_pgsize) & (1ULL << 40) ? 40 : (shca->hca_cap_mr_pgsize) & (1ULL << 39) ? 39 : (shca->hca_cap_mr_pgsize) & (1ULL << 38) ? 38 : (shca->hca_cap_mr_pgsize) & (1ULL << 37) ? 37 : (shca->hca_cap_mr_pgsize) & (1ULL << 36) ? 36 : (shca->hca_cap_mr_pgsize) & (1ULL << 35) ? 35 : (shca->hca_cap_mr_pgsize) & (1ULL << 34) ? 34 : (shca->hca_cap_mr_pgsize) & (1ULL << 33) ? 33 : (shca->hca_cap_mr_pgsize) & (1ULL << 32) ? 32 : (shca->hca_cap_mr_pgsize) & (1ULL << 31) ? 31 : (shca->hca_cap_mr_pgsize) & (1ULL << 30) ? 30 : (shca->hca_cap_mr_pgsize) & (1ULL << 29) ? 29 : (shca->hca_cap_mr_pgsize) & (1ULL << 28) ? 28 : (shca->hca_cap_mr_pgsize) & (1ULL << 27) ? 27 : (shca->hca_cap_mr_pgsize) & (1ULL << 26) ? 26 : (shca->hca_cap_mr_pgsize) & (1ULL << 25) ? 25 : (shca->hca_cap_mr_pgsize) & (1ULL << 24) ? 24 : (shca->hca_cap_mr_pgsize) & (1ULL << 23) ? 23 : (shca->hca_cap_mr_pgsize) & (1ULL << 22) ? 22 : (shca->hca_cap_mr_pgsize) & (1ULL << 21) ? 21 : (shca->hca_cap_mr_pgsize) & (1ULL << 20) ? 20 : (shca->hca_cap_mr_pgsize) & (1ULL << 19) ? 19 : (shca->hca_cap_mr_pgsize) & (1ULL << 18) ? 18 : (shca->hca_cap_mr_pgsize) & (1ULL << 17) ? 17 : (shca->hca_cap_mr_pgsize) & (1ULL << 16) ? 16 : (shca->hca_cap_mr_pgsize) & (1ULL << 15) ? 15 : (shca->hca_cap_mr_pgsize) & (1ULL << 14) ? 14 : (shca->hca_cap_mr_pgsize) & (1ULL << 13) ? 13 : (shca->hca_cap_mr_pgsize) & (1ULL << 12) ? 12 : (shca->hca_cap_mr_pgsize) & (1ULL << 11) ? 11 : (shca->hca_cap_mr_pgsize) & (1ULL << 10) ? 10 : (shca->hca_cap_mr_pgsize) & (1ULL << 9) ? 9 : (shca->hca_cap_mr_pgsize) & (1ULL << 8) ? 8 : (shca->hca_cap_mr_pgsize) & (1ULL << 7) ? 7 : (shca->hca_cap_mr_pgsize) & (1ULL << 6) ? 6 : (shca->hca_cap_mr_pgsize) & (1ULL << 5) ? 5 : (shca->hca_cap_mr_pgsize) & (1ULL << 4) ? 4 : (shca->hca_cap_mr_pgsize) & (1ULL << 3) ? 3 : (shca->hca_cap_mr_pgsize) & (1ULL << 2) ? 2 : (shca->hca_cap_mr_pgsize) & (1ULL << 1) ? 1 : (shca->hca_cap_mr_pgsize) & (1ULL << 0) ? 0 : ____ilog2_NaN() ) : (sizeof(shca->hca_cap_mr_pgsize) <= 4) ? __ilog2_u32(shca->hca_cap_mr_pgsize) : __ilog2_u64(shca->hca_cap_mr_pgsize) ); ++} ++ ++int x(struct ehca_shca *shca) { ++ return ehca_get_max_hwpage_size(shca); ++} ++ ++int y(struct ehca_shca *shca) ++{ ++ return ehca_get_max_hwpage_size(shca); ++} ++ ++/* { dg-final { scan-tree-dump-times "____ilog2_NaN" 0 "optimized" } } */ ++/* { dg-final { cleanup-tree-dump "optimized" } } */ Index: gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c =================================================================== --- a/src/gcc/testsuite/gcc.dg/tree-ssa/pta-ptrarith-1.c (.../tags/gcc_4_6_2_release) @@ -2716,11 +3112,107 @@ +} + +/* { dg-final { scan-assembler "printf" } } */ +Index: gcc/testsuite/ada/acats/overflow.lst +=================================================================== +--- a/src/gcc/testsuite/ada/acats/overflow.lst (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/testsuite/ada/acats/overflow.lst (.../branches/gcc-4_6-branch) +@@ -14,3 +14,4 @@ + c460008 + c460011 + c4a012b ++cb20004 Index: gcc/testsuite/ChangeLog =================================================================== --- a/src/gcc/testsuite/ChangeLog (.../tags/gcc_4_6_2_release) +++ b/src/gcc/testsuite/ChangeLog (.../branches/gcc-4_6-branch) -@@ -1,3 +1,287 @@ +@@ -1,3 +1,374 @@ ++2012-01-20 Kai Tietz ++ ++ * g++.dg/torture/pr51344.C: Fix typo. ++ ++2012-01-19 Kai Tietz ++ ++ * g++.dg/torture/pr51344.C: New test. ++ ++2012-01-19 Tobias Burnus ++ ++ PR fortran/51904 ++ * gfortran.dg/intrinsic_size_2.f90: New. ++ ++2012-01-18 Bill Schmidt ++ ++ PR tree-optimization/49642 ++ * gcc.dg/tree-ssa/pr49642.c: New test. ++ ++2012-01-16 Jason Merrill ++ ++ PR c++/51854 ++ * g++.dg/abi/mangle60.C: New. ++ ++ PR c++/51868 ++ * g++.dg/cpp0x/rv-bitfield.C: New. ++ * g++.dg/cpp0x/rv-bitfield2.C: New. ++ ++2012-01-15 Uros Bizjak ++ ++ PR rtl-optimization/51821 ++ * gcc.dg/pr51821.c: New test. ++ ++2012-01-14 Tobias Burnus ++ ++ Backported from mainline ++ 2012-01-14 Tobias Burnus ++ ++ PR fortran/51800 ++ * gfortran.dg/init_flag_8.f90: New. ++ * gfortran.dg/init_flag_9.f90: New. ++ ++2012-01-12 Matthew Gretton-Dann ++ ++ Backport from mainline: ++ 2012-01-11 Matthew Gretton-Dann ++ ++ * testsuite/gcc.c-torture/execute/20120110-1.c: New testcase. ++ ++2012-01-10 Joseph Myers ++ ++ * gcc.c-torture/execute/doloop-1.c, ++ gcc.c-torture/execute/doloop-2.c: New tests. ++ ++2012-01-09 Martin Jambor ++ ++ PR tree-optimization/51759 ++ * g++.dg/ipa/pr51759.C: New test. ++ ++2012-01-09 Ramana Radhakrishnan ++ ++ Backport from mainline: ++ 2011-11-04 Jiangning Liu ++ ++ PR rtl-optimization/38644 ++ * gcc.target/arm/stack-red-zone.c: New. ++ ++2012-01-09 Andrew Stubbs ++ ++ Backport from mainline: ++ ++ 2012-01-06 Andrew Stubbs ++ ++ * gcc.target/arm/headmerge-2.c: Adjust scan pattern. ++ ++2012-01-06 Richard Sandiford ++ ++ PR middle-end/48660 ++ * g++.dg/pr48660.C: New test. ++ ++2012-01-06 Eric Botcazou ++ ++ * ada/acats/overflow.lst: Add cb20004. ++ ++2012-01-05 Eric Botcazou ++ ++ * gcc.c-torture/execute/20120104-1.c: New test. ++ +2012-01-04 Richard Guenther + + PR tree-optimization/49651 @@ -3008,7 +3500,7 @@ 2011-10-26 Release Manager * GCC 4.6.2 released. -@@ -9,9 +293,9 @@ +@@ -9,9 +380,9 @@ 2011-10-20 Uros Bizjak @@ -3040,6 +3532,59 @@ +} + +/* { dg-final { cleanup-tree-dump "vect" } } */ +Index: gcc/testsuite/g++.dg/pr48660.C +=================================================================== +--- a/src/gcc/testsuite/g++.dg/pr48660.C (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/testsuite/g++.dg/pr48660.C (.../branches/gcc-4_6-branch) +@@ -0,0 +1,22 @@ ++template struct val { char a[N]; }; ++ ++class Base ++{ ++public: ++ virtual val<1> get1() const = 0; ++ virtual val<2> get2() const = 0; ++ virtual val<3> get3() const = 0; ++ virtual val<4> get4() const = 0; ++}; ++ ++class Derived : public virtual Base ++{ ++public: ++ virtual val<1> get1() const { return foo->get1(); } ++ virtual val<2> get2() const { return foo->get2(); } ++ virtual val<3> get3() const { return foo->get3(); } ++ virtual val<4> get4() const { return foo->get4(); } ++ Base *foo; ++}; ++ ++Base* make() { return new Derived; } +Index: gcc/testsuite/g++.dg/abi/mangle60.C +=================================================================== +--- a/src/gcc/testsuite/g++.dg/abi/mangle60.C (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/testsuite/g++.dg/abi/mangle60.C (.../branches/gcc-4_6-branch) +@@ -0,0 +1,21 @@ ++// PR c++/51854 ++// { dg-options "" } ++// { dg-excess-errors "" { xfail *-*-* } } ++ ++template struct A; ++ ++template ++char foo(U, V); ++ ++// { dg-final { scan-assembler "_Z3barIiEvP1AIXszcl3foocvT__ELCi0_42EEEE" } } ++template ++void bar(A *); ++ ++// { dg-final { scan-assembler "_Z3bazIiEvP1AIXszcl3foocvT__ELCf00000000_00000000EEEE" } } ++template ++void baz(A *); ++ ++int main() { ++ bar(0); ++ baz(0); ++} Index: gcc/testsuite/g++.dg/init/value10.C =================================================================== --- a/src/gcc/testsuite/g++.dg/init/value10.C (.../tags/gcc_4_6_2_release) @@ -3252,6 +3797,45 @@ +} + +template void Boo(int); +Index: gcc/testsuite/g++.dg/cpp0x/rv-bitfield2.C +=================================================================== +--- a/src/gcc/testsuite/g++.dg/cpp0x/rv-bitfield2.C (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/testsuite/g++.dg/cpp0x/rv-bitfield2.C (.../branches/gcc-4_6-branch) +@@ -0,0 +1,17 @@ ++// PR c++/51868 ++// { dg-options -std=c++0x } ++ ++struct A { ++ A() {} ++ A(const A&) {} ++ A(A&&) {} ++}; ++ ++struct B { ++ A a; ++ int f : 1; ++}; ++ ++B func() { ++ return B(); ++} +Index: gcc/testsuite/g++.dg/cpp0x/rv-bitfield.C +=================================================================== +--- a/src/gcc/testsuite/g++.dg/cpp0x/rv-bitfield.C (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/testsuite/g++.dg/cpp0x/rv-bitfield.C (.../branches/gcc-4_6-branch) +@@ -0,0 +1,12 @@ ++// { dg-options -std=c++0x } ++ ++struct A ++{ ++ int i : 1; ++}; ++ ++int main() ++{ ++ A a; ++ static_cast(a.i); ++} Index: gcc/testsuite/g++.dg/cpp0x/rv-cast3.C =================================================================== --- a/src/gcc/testsuite/g++.dg/cpp0x/rv-cast3.C (.../tags/gcc_4_6_2_release) @@ -3306,6 +3890,22 @@ c.seti (1); /* count(1) */ } +Index: gcc/testsuite/g++.dg/torture/pr51344.C +=================================================================== +--- a/src/gcc/testsuite/g++.dg/torture/pr51344.C (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/testsuite/g++.dg/torture/pr51344.C (.../branches/gcc-4_6-branch) +@@ -0,0 +1,11 @@ ++/* { dg-do compile } */ ++class A; ++ ++template ++class B ++{ ++ friend __attribute__((cdecl)) A& operator >>(A& a, B& b) ++ { ++ return a; ++ } ++}; Index: gcc/testsuite/g++.dg/torture/pr49720.C =================================================================== --- a/src/gcc/testsuite/g++.dg/torture/pr49720.C (.../tags/gcc_4_6_2_release) @@ -3319,6 +3919,37 @@ + long size = reinterpret_cast(t_size); + return (size == t_end - t_start); +} +Index: gcc/testsuite/g++.dg/ipa/pr51759.C +=================================================================== +--- a/src/gcc/testsuite/g++.dg/ipa/pr51759.C (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/testsuite/g++.dg/ipa/pr51759.C (.../branches/gcc-4_6-branch) +@@ -0,0 +1,26 @@ ++/* { dg-do run } */ ++/* { dg-options "-O2" } */ ++ ++extern "C" void abort (void); ++struct S ++{ ++ void __attribute__((noinline)) set(unsigned val) ++ { ++ data = val; ++ if (data != val) ++ abort (); ++ } ++ int pad0; ++ unsigned pad1 : 8; ++ unsigned data : 24; ++ int pad2; ++}; ++int main() ++{ ++ S s; ++ s.pad2 = -1; ++ s.set(0); ++ if (s.pad2 != -1) ++ abort (); ++} ++ Index: gcc/cp/typeck.c =================================================================== --- a/src/gcc/cp/typeck.c (.../tags/gcc_4_6_2_release) @@ -3334,24 +3965,50 @@ } /* Handle complex lvalues (when permitted) -@@ -5772,8 +5770,18 @@ +@@ -5698,11 +5696,12 @@ + { + tree intype; + tree result; ++ cp_lvalue_kind clk; + + /* Assume the cast is valid. */ + *valid_p = true; + +- intype = TREE_TYPE (expr); ++ intype = unlowered_expr_type (expr); + + /* Save casted types in the function's used types hash table. */ + used_types_insert (type); +@@ -5768,12 +5767,29 @@ + cv2 T2 if cv2 T2 is reference-compatible with cv1 T1 (8.5.3)." */ + if (TREE_CODE (type) == REFERENCE_TYPE + && TYPE_REF_IS_RVALUE (type) +- && real_lvalue_p (expr) ++ && (clk = real_lvalue_p (expr)) && reference_related_p (TREE_TYPE (type), intype) && (c_cast_p || at_least_as_qualified_p (TREE_TYPE (type), intype))) { - expr = build_typed_address (expr, type); - return convert_from_reference (expr); -+ /* Handle the lvalue case here by casting to lvalue reference and -+ then changing it to an rvalue reference. Casting an xvalue to -+ rvalue reference will be handled by the main code path. */ -+ tree lref = cp_build_reference_type (TREE_TYPE (type), false); -+ result = (perform_direct_initialization_if_possible -+ (lref, expr, c_cast_p, complain)); -+ result = cp_fold_convert (type, result); -+ /* Make sure we don't fold back down to a named rvalue reference, -+ because that would be an lvalue. */ -+ if (DECL_P (result)) -+ result = build1 (NON_LVALUE_EXPR, type, result); -+ return convert_from_reference (result); ++ if (clk == clk_ordinary) ++ { ++ /* Handle the (non-bit-field) lvalue case here by casting to ++ lvalue reference and then changing it to an rvalue reference. ++ Casting an xvalue to rvalue reference will be handled by the ++ main code path. */ ++ tree lref = cp_build_reference_type (TREE_TYPE (type), false); ++ result = (perform_direct_initialization_if_possible ++ (lref, expr, c_cast_p, complain)); ++ result = cp_fold_convert (type, result); ++ /* Make sure we don't fold back down to a named rvalue reference, ++ because that would be an lvalue. */ ++ if (DECL_P (result)) ++ result = build1 (NON_LVALUE_EXPR, type, result); ++ return convert_from_reference (result); ++ } ++ else ++ /* For a bit-field or packed field, bind to a temporary. */ ++ expr = rvalue (expr); } /* Resolve overloaded address here rather than once in @@ -3484,7 +4141,23 @@ =================================================================== --- a/src/gcc/cp/ChangeLog (.../tags/gcc_4_6_2_release) +++ b/src/gcc/cp/ChangeLog (.../branches/gcc-4_6-branch) -@@ -1,3 +1,63 @@ +@@ -1,3 +1,79 @@ ++2012-01-19 Kai Tietz ++ ++ PR c++/51344 ++ * decl2.c (save_template_attributes): Use merge_attributes ++ instead of chaining up via TREE_CHAIN. ++ ++2012-01-16 Jakub Jelinek ++ ++ PR c++/51854 ++ * mangle.c (write_template_arg_literal): Sorry instead of aborting. ++ ++2012-01-16 Jason Merrill ++ ++ PR c++/51868 ++ * typeck.c (build_static_cast_1): Handle bit-fields properly. ++ +2011-12-20 Dodji Seketeli + + PR debug/49951 @@ -3608,6 +4281,22 @@ type = TREE_TYPE (expr); break; +Index: gcc/cp/decl2.c +=================================================================== +--- a/src/gcc/cp/decl2.c (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/cp/decl2.c (.../branches/gcc-4_6-branch) +@@ -1185,9 +1185,9 @@ + + old_attrs = *q; + +- /* Place the late attributes at the beginning of the attribute ++ /* Merge the late attributes at the beginning with the attribute + list. */ +- TREE_CHAIN (tree_last (late_attrs)) = *q; ++ late_attrs = merge_attributes (late_attrs, *q); + *q = late_attrs; + + if (!DECL_P (*decl_p) && *decl_p == TYPE_MAIN_VARIANT (*decl_p)) Index: gcc/cp/call.c =================================================================== --- a/src/gcc/cp/call.c (.../tags/gcc_4_6_2_release) @@ -3620,6 +4309,20 @@ return cp_build_unary_op (code, arg1, candidates != 0, complain); case ARRAY_REF: +Index: gcc/cp/mangle.c +=================================================================== +--- a/src/gcc/cp/mangle.c (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/cp/mangle.c (.../branches/gcc-4_6-branch) +@@ -2770,7 +2770,8 @@ + break; + + default: +- gcc_unreachable (); ++ sorry ("mangling %C", TREE_CODE (value)); ++ break; + } + + write_char ('E'); Index: gcc/lto-cgraph.c =================================================================== --- a/src/gcc/lto-cgraph.c (.../tags/gcc_4_6_2_release) @@ -3950,7 +4653,168 @@ =================================================================== --- a/src/gcc/expr.c (.../tags/gcc_4_6_2_release) +++ b/src/gcc/expr.c (.../branches/gcc-4_6-branch) -@@ -9189,8 +9189,16 @@ +@@ -2180,6 +2180,111 @@ + return tgtblk; + } + ++/* Copy BLKmode value SRC into a register of mode MODE. Return the ++ register if it contains any data, otherwise return null. ++ ++ This is used on targets that return BLKmode values in registers. */ ++ ++rtx ++copy_blkmode_to_reg (enum machine_mode mode, tree src) ++{ ++ int i, n_regs; ++ unsigned HOST_WIDE_INT bitpos, xbitpos, padding_correction = 0, bytes; ++ unsigned int bitsize; ++ rtx *dst_words, dst, x, src_word = NULL_RTX, dst_word = NULL_RTX; ++ enum machine_mode dst_mode; ++ ++ gcc_assert (TYPE_MODE (TREE_TYPE (src)) == BLKmode); ++ ++ x = expand_normal (src); ++ ++ bytes = int_size_in_bytes (TREE_TYPE (src)); ++ if (bytes == 0) ++ return NULL_RTX; ++ ++ /* If the structure doesn't take up a whole number of words, see ++ whether the register value should be padded on the left or on ++ the right. Set PADDING_CORRECTION to the number of padding ++ bits needed on the left side. ++ ++ In most ABIs, the structure will be returned at the least end of ++ the register, which translates to right padding on little-endian ++ targets and left padding on big-endian targets. The opposite ++ holds if the structure is returned at the most significant ++ end of the register. */ ++ if (bytes % UNITS_PER_WORD != 0 ++ && (targetm.calls.return_in_msb (TREE_TYPE (src)) ++ ? !BYTES_BIG_ENDIAN ++ : BYTES_BIG_ENDIAN)) ++ padding_correction = (BITS_PER_WORD - ((bytes % UNITS_PER_WORD) ++ * BITS_PER_UNIT)); ++ ++ n_regs = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; ++ dst_words = XALLOCAVEC (rtx, n_regs); ++ bitsize = MIN (TYPE_ALIGN (TREE_TYPE (src)), BITS_PER_WORD); ++ ++ /* Copy the structure BITSIZE bits at a time. */ ++ for (bitpos = 0, xbitpos = padding_correction; ++ bitpos < bytes * BITS_PER_UNIT; ++ bitpos += bitsize, xbitpos += bitsize) ++ { ++ /* We need a new destination pseudo each time xbitpos is ++ on a word boundary and when xbitpos == padding_correction ++ (the first time through). */ ++ if (xbitpos % BITS_PER_WORD == 0 ++ || xbitpos == padding_correction) ++ { ++ /* Generate an appropriate register. */ ++ dst_word = gen_reg_rtx (word_mode); ++ dst_words[xbitpos / BITS_PER_WORD] = dst_word; ++ ++ /* Clear the destination before we move anything into it. */ ++ emit_move_insn (dst_word, CONST0_RTX (word_mode)); ++ } ++ ++ /* We need a new source operand each time bitpos is on a word ++ boundary. */ ++ if (bitpos % BITS_PER_WORD == 0) ++ src_word = operand_subword_force (x, bitpos / BITS_PER_WORD, BLKmode); ++ ++ /* Use bitpos for the source extraction (left justified) and ++ xbitpos for the destination store (right justified). */ ++ store_bit_field (dst_word, bitsize, xbitpos % BITS_PER_WORD, word_mode, ++ extract_bit_field (src_word, bitsize, ++ bitpos % BITS_PER_WORD, 1, false, ++ NULL_RTX, word_mode, word_mode)); ++ } ++ ++ if (mode == BLKmode) ++ { ++ /* Find the smallest integer mode large enough to hold the ++ entire structure. */ ++ for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); ++ mode != VOIDmode; ++ mode = GET_MODE_WIDER_MODE (mode)) ++ /* Have we found a large enough mode? */ ++ if (GET_MODE_SIZE (mode) >= bytes) ++ break; ++ ++ /* A suitable mode should have been found. */ ++ gcc_assert (mode != VOIDmode); ++ } ++ ++ if (GET_MODE_SIZE (mode) < GET_MODE_SIZE (word_mode)) ++ dst_mode = word_mode; ++ else ++ dst_mode = mode; ++ dst = gen_reg_rtx (dst_mode); ++ ++ for (i = 0; i < n_regs; i++) ++ emit_move_insn (operand_subword (dst, i, 0, dst_mode), dst_words[i]); ++ ++ if (mode != dst_mode) ++ dst = gen_lowpart (mode, dst); ++ ++ return dst; ++} ++ + /* Add a USE expression for REG to the (possibly empty) list pointed + to by CALL_FUSAGE. REG must denote a hard register. */ + +@@ -4382,7 +4487,9 @@ + if (TREE_CODE (from) == CALL_EXPR && ! aggregate_value_p (from, from) + && COMPLETE_TYPE_P (TREE_TYPE (from)) + && TREE_CODE (TYPE_SIZE (TREE_TYPE (from))) == INTEGER_CST +- && ! (((TREE_CODE (to) == VAR_DECL || TREE_CODE (to) == PARM_DECL) ++ && ! (((TREE_CODE (to) == VAR_DECL ++ || TREE_CODE (to) == PARM_DECL ++ || TREE_CODE (to) == RESULT_DECL) + && REG_P (DECL_RTL (to))) + || TREE_CODE (to) == SSA_NAME)) + { +@@ -4428,12 +4535,15 @@ + rtx temp; + + push_temp_slots (); +- temp = expand_expr (from, NULL_RTX, GET_MODE (to_rtx), EXPAND_NORMAL); ++ if (REG_P (to_rtx) && TYPE_MODE (TREE_TYPE (from)) == BLKmode) ++ temp = copy_blkmode_to_reg (GET_MODE (to_rtx), from); ++ else ++ temp = expand_expr (from, NULL_RTX, GET_MODE (to_rtx), EXPAND_NORMAL); + + if (GET_CODE (to_rtx) == PARALLEL) + emit_group_load (to_rtx, temp, TREE_TYPE (from), + int_size_in_bytes (TREE_TYPE (from))); +- else ++ else if (temp) + emit_move_insn (to_rtx, temp); + + preserve_temp_slots (to_rtx); +@@ -8533,10 +8643,15 @@ + return temp; + } + +- /* If the mode of DECL_RTL does not match that of the decl, it +- must be a promoted value. We return a SUBREG of the wanted mode, +- but mark it so that we know that it was already extended. */ +- if (REG_P (decl_rtl) && GET_MODE (decl_rtl) != DECL_MODE (exp)) ++ /* If the mode of DECL_RTL does not match that of the decl, ++ there are two cases: we are dealing with a BLKmode value ++ that is returned in a register, or we are dealing with ++ a promoted value. In the latter case, return a SUBREG ++ of the wanted mode, but mark it so that we know that it ++ was already extended. */ ++ if (REG_P (decl_rtl) ++ && DECL_MODE (exp) != BLKmode ++ && GET_MODE (decl_rtl) != DECL_MODE (exp)) + { + enum machine_mode pmode; + +@@ -9189,8 +9304,16 @@ && modifier != EXPAND_CONST_ADDRESS && modifier != EXPAND_INITIALIZER) /* If the field is volatile, we always want an aligned @@ -3969,6 +4833,50 @@ /* If the field isn't aligned enough to fetch as a memref, fetch it as a bit field. */ || (mode1 != BLKmode +Index: gcc/expr.h +=================================================================== +--- a/src/gcc/expr.h (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/expr.h (.../branches/gcc-4_6-branch) +@@ -324,6 +324,8 @@ + /* Copy BLKmode object from a set of registers. */ + extern rtx copy_blkmode_from_reg (rtx, rtx, tree); + ++extern rtx copy_blkmode_to_reg (enum machine_mode, tree); ++ + /* Mark REG as holding a parameter for the next CALL_INSN. */ + extern void use_reg (rtx *, rtx); + +Index: gcc/recog.c +=================================================================== +--- a/src/gcc/recog.c (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/recog.c (.../branches/gcc-4_6-branch) +@@ -3023,6 +3023,7 @@ + static int search_ofs; + enum reg_class cl; + HARD_REG_SET live; ++ df_ref *def_rec; + int i; + + gcc_assert (from < MAX_INSNS_PER_PEEP2 + 1); +@@ -3036,12 +3037,14 @@ + + while (from != to) + { +- HARD_REG_SET this_live; ++ gcc_assert (peep2_insn_data[from].insn != NULL_RTX); + ++ /* Don't use registers set or clobbered by the insn. */ ++ for (def_rec = DF_INSN_DEFS (peep2_insn_data[from].insn); ++ *def_rec; def_rec++) ++ SET_HARD_REG_BIT (live, DF_REF_REGNO (*def_rec)); ++ + from = peep2_buf_position (from + 1); +- gcc_assert (peep2_insn_data[from].insn != NULL_RTX); +- REG_SET_TO_HARD_REG_SET (this_live, peep2_insn_data[from].live_before); +- IOR_HARD_REG_SET (live, this_live); + } + + cl = (class_str[0] == 'r' ? GENERAL_REGS Index: gcc/ada/mlib-tgt-specific-darwin.adb =================================================================== --- a/src/gcc/ada/mlib-tgt-specific-darwin.adb (.../tags/gcc_4_6_2_release) @@ -4049,7 +4957,11 @@ =================================================================== --- a/src/gcc/ada/ChangeLog (.../tags/gcc_4_6_2_release) +++ b/src/gcc/ada/ChangeLog (.../branches/gcc-4_6-branch) -@@ -1,3 +1,46 @@ +@@ -1,3 +1,50 @@ ++2012-01-09 Eric Botcazou ++ ++ * gcc-interface/trans.c (addressable_p) : Fix thinko. ++ +2012-01-02 Eric Botcazou + + * gnatvsn.ads (Current_Year): Bump to 2011. @@ -4227,6 +5139,28 @@ align = align_cap; else align = ceil_alignment (tree_low_cst (TYPE_SIZE (gnu_type), 1)); +Index: gcc/ada/gcc-interface/trans.c +=================================================================== +--- a/src/gcc/ada/gcc-interface/trans.c (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/ada/gcc-interface/trans.c (.../branches/gcc-4_6-branch) +@@ -6,7 +6,7 @@ + * * + * C Implementation File * + * * +- * Copyright (C) 1992-2011, Free Software Foundation, Inc. * ++ * Copyright (C) 1992-2012, Free Software Foundation, Inc. * + * * + * GNAT is free software; you can redistribute it and/or modify it under * + * terms of the GNU General Public License as published by the Free Soft- * +@@ -7409,7 +7409,7 @@ + || DECL_ALIGN (TREE_OPERAND (gnu_expr, 1)) + >= TYPE_ALIGN (TREE_TYPE (gnu_expr)))) + /* The field of a padding record is always addressable. */ +- || TYPE_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_expr, 0)))) ++ || TYPE_IS_PADDING_P (TREE_TYPE (TREE_OPERAND (gnu_expr, 0)))) + && addressable_p (TREE_OPERAND (gnu_expr, 0), NULL_TREE)); + + case ARRAY_REF: case ARRAY_RANGE_REF: Index: gcc/ada/Make-generated.in =================================================================== --- a/src/gcc/ada/Make-generated.in (.../tags/gcc_4_6_2_release) @@ -4317,6 +5251,40 @@ } if (TREE_CODE (decl) == VAR_DECL) +@@ -9782,6 +9782,9 @@ + collect_source_ref (LOCATION_FILE (decl_sloc (decl, false))); + } + ++/* Preserve the external declarations scope across a garbage collect. */ ++static GTY(()) tree ext_block; ++ + /* Collect all references relevant to SOURCE_FILE. */ + + static void +@@ -9792,6 +9795,8 @@ + + FOR_EACH_VEC_ELT (tree, all_translation_units, i, t) + collect_ada_nodes (BLOCK_VARS (DECL_INITIAL (t)), source_file); ++ ++ collect_ada_nodes (BLOCK_VARS (ext_block), source_file); + } + + /* Iterate over all global declarations and call CALLBACK. */ +@@ -9810,11 +9815,11 @@ + for (decl = BLOCK_VARS (decls); decl; decl = TREE_CHAIN (decl)) + callback (decl); + } ++ ++ for (decl = BLOCK_VARS (ext_block); decl; decl = TREE_CHAIN (decl)) ++ callback (decl); + } + +-/* Preserve the external declarations scope across a garbage collect. */ +-static GTY(()) tree ext_block; +- + void + c_write_global_declarations (void) + { Index: gcc/fortran/trans-array.c =================================================================== --- a/src/gcc/fortran/trans-array.c (.../tags/gcc_4_6_2_release) @@ -4360,7 +5328,21 @@ =================================================================== --- a/src/gcc/fortran/ChangeLog (.../tags/gcc_4_6_2_release) +++ b/src/gcc/fortran/ChangeLog (.../branches/gcc-4_6-branch) -@@ -1,3 +1,84 @@ +@@ -1,3 +1,98 @@ ++2012-01-19 Tobias Burnus ++ ++ PR fortran/51904 ++ *expr.c (gfc_build_intrinsic_call): Also set the symtree. ++ ++2012-01-14 Tobias Burnus ++ ++ Backported from mainline ++ 2012-01-14 Tobias Burnus ++ ++ PR fortran/51800 ++ * resolve.c (build_default_init_expr): Also initialize ++ nonconstant-length strings with -finit-character=. ++ +2012-01-01 Thomas König + + Backport from trunk @@ -4466,7 +5448,19 @@ /* Get an expression for a default initializer. */ gfc_expr * -@@ -4520,9 +4523,24 @@ +@@ -4360,6 +4363,11 @@ + result->value.function.name = name; + result->value.function.isym = isym; + ++ result->symtree = gfc_find_symtree (gfc_current_ns->sym_root, name); ++ gcc_assert (result->symtree ++ && (result->symtree->n.sym->attr.flavor == FL_PROCEDURE ++ || result->symtree->n.sym->attr.flavor == FL_UNKNOWN)); ++ + va_start (ap, numarg); + atail = NULL; + for (i = 0; i < numarg; ++i) +@@ -4520,9 +4528,24 @@ return FAILURE; } @@ -4545,7 +5539,50 @@ || sym->attr.external || sym->attr.dummy || sym->attr.pointer -@@ -11394,6 +11397,14 @@ +@@ -9811,6 +9814,26 @@ + gfc_free_expr (init_expr); + init_expr = NULL; + } ++ if (!init_expr && gfc_option.flag_init_character == GFC_INIT_CHARACTER_ON ++ && sym->ts.u.cl->length) ++ { ++ gfc_actual_arglist *arg; ++ init_expr = gfc_get_expr (); ++ init_expr->where = sym->declared_at; ++ init_expr->ts = sym->ts; ++ init_expr->expr_type = EXPR_FUNCTION; ++ init_expr->value.function.isym = ++ gfc_intrinsic_function_by_id (GFC_ISYM_REPEAT); ++ init_expr->value.function.name = "repeat"; ++ arg = gfc_get_actual_arglist (); ++ arg->expr = gfc_get_character_expr (sym->ts.kind, &sym->declared_at, ++ NULL, 1); ++ arg->expr->value.character.string[0] ++ = gfc_option.flag_init_character_value; ++ arg->next = gfc_get_actual_arglist (); ++ arg->next->expr = gfc_copy_expr (sym->ts.u.cl->length); ++ init_expr->value.function.actual = arg; ++ } + break; + + default: +@@ -9837,10 +9860,12 @@ + if (init == NULL) + return; + +- /* For saved variables, we don't want to add an initializer at +- function entry, so we just add a static initializer. */ ++ /* For saved variables, we don't want to add an initializer at function ++ entry, so we just add a static initializer. Note that automatic variables ++ are stack allocated even with -fno-automatic. */ + if (sym->attr.save || sym->ns->save_all +- || gfc_option.flag_max_stack_var_size == 0) ++ || (gfc_option.flag_max_stack_var_size == 0 ++ && (!sym->attr.dimension || !is_non_constant_shape_array (sym)))) + { + /* Don't clobber an existing initializer! */ + gcc_assert (sym->value == NULL); +@@ -11394,6 +11419,14 @@ for (c = sym->components; c != NULL; c = c->next) { @@ -4560,7 +5597,7 @@ /* F2008, C442. */ if (c->attr.codimension /* FIXME: c->as check due to PR 43412. */ && (!c->attr.allocatable || (c->as && c->as->type != AS_DEFERRED))) -@@ -12925,24 +12936,25 @@ +@@ -12925,24 +12958,25 @@ int gfc_implicit_pure (gfc_symbol *sym) { @@ -4785,6 +5822,151 @@ #define DF_MD 7 /* Multiple Definitions. */ #define DF_LAST_PROBLEM_PLUS1 (DF_MD + 1) +Index: gcc/ipa-split.c +=================================================================== +--- a/src/gcc/ipa-split.c (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/ipa-split.c (.../branches/gcc-4_6-branch) +@@ -130,6 +130,10 @@ + + struct split_point best_split_point; + ++/* Set of basic blocks that are not allowed to dominate a split point. */ ++ ++static bitmap forbidden_dominators; ++ + static tree find_retval (basic_block return_bb); + + /* Callback for walk_stmt_load_store_addr_ops. If T is non-SSA automatic +@@ -270,6 +274,83 @@ + return ok; + } + ++/* If STMT is a call, check the callee against a list of forbidden ++ predicate functions. If a match is found, look for uses of the ++ call result in condition statements that compare against zero. ++ For each such use, find the block targeted by the condition ++ statement for the nonzero result, and set the bit for this block ++ in the forbidden dominators bitmap. The purpose of this is to avoid ++ selecting a split point where we are likely to lose the chance ++ to optimize away an unused function call. */ ++ ++static void ++check_forbidden_calls (gimple stmt) ++{ ++ imm_use_iterator use_iter; ++ use_operand_p use_p; ++ tree lhs; ++ ++ /* At the moment, __builtin_constant_p is the only forbidden ++ predicate function call (see PR49642). */ ++ if (!gimple_call_builtin_p (stmt, BUILT_IN_CONSTANT_P)) ++ return; ++ ++ lhs = gimple_call_lhs (stmt); ++ ++ if (!lhs || TREE_CODE (lhs) != SSA_NAME) ++ return; ++ ++ FOR_EACH_IMM_USE_FAST (use_p, use_iter, lhs) ++ { ++ tree op1; ++ basic_block use_bb, forbidden_bb; ++ enum tree_code code; ++ edge true_edge, false_edge; ++ gimple use_stmt = USE_STMT (use_p); ++ ++ if (gimple_code (use_stmt) != GIMPLE_COND) ++ continue; ++ ++ /* Assuming canonical form for GIMPLE_COND here, with constant ++ in second position. */ ++ op1 = gimple_cond_rhs (use_stmt); ++ code = gimple_cond_code (use_stmt); ++ use_bb = gimple_bb (use_stmt); ++ ++ extract_true_false_edges_from_block (use_bb, &true_edge, &false_edge); ++ ++ /* We're only interested in comparisons that distinguish ++ unambiguously from zero. */ ++ if (!integer_zerop (op1) || code == LE_EXPR || code == GE_EXPR) ++ continue; ++ ++ if (code == EQ_EXPR) ++ forbidden_bb = false_edge->dest; ++ else ++ forbidden_bb = true_edge->dest; ++ ++ bitmap_set_bit (forbidden_dominators, forbidden_bb->index); ++ } ++} ++ ++/* If BB is dominated by any block in the forbidden dominators set, ++ return TRUE; else FALSE. */ ++ ++static bool ++dominated_by_forbidden (basic_block bb) ++{ ++ unsigned dom_bb; ++ bitmap_iterator bi; ++ ++ EXECUTE_IF_SET_IN_BITMAP (forbidden_dominators, 1, dom_bb, bi) ++ { ++ if (dominated_by_p (CDI_DOMINATORS, bb, BASIC_BLOCK (dom_bb))) ++ return true; ++ } ++ ++ return false; ++} ++ + /* We found an split_point CURRENT. NON_SSA_VARS is bitmap of all non ssa + variables used and RETURN_BB is return basic block. + See if we can split function here. */ +@@ -411,6 +492,18 @@ + " Refused: split part has non-ssa uses\n"); + return; + } ++ ++ /* If the split point is dominated by a forbidden block, reject ++ the split. */ ++ if (!bitmap_empty_p (forbidden_dominators) ++ && dominated_by_forbidden (current->entry_bb)) ++ { ++ if (dump_file && (dump_flags & TDF_DETAILS)) ++ fprintf (dump_file, ++ " Refused: split point dominated by forbidden block\n"); ++ return; ++ } ++ + /* See if retval used by return bb is computed by header or split part. + When it is computed by split part, we need to produce return statement + in the split part and add code to header to pass it around. +@@ -1329,6 +1422,10 @@ + return 0; + } + ++ /* Initialize bitmap to track forbidden calls. */ ++ forbidden_dominators = BITMAP_ALLOC (NULL); ++ calculate_dominance_info (CDI_DOMINATORS); ++ + /* Compute local info about basic blocks and determine function size/time. */ + VEC_safe_grow_cleared (bb_info, heap, bb_info_vec, last_basic_block + 1); + memset (&best_split_point, 0, sizeof (best_split_point)); +@@ -1350,6 +1447,7 @@ + this_time = estimate_num_insns (stmt, &eni_time_weights) * freq; + size += this_size; + time += this_time; ++ check_forbidden_calls (stmt); + + if (dump_file && (dump_flags & TDF_DETAILS)) + { +@@ -1371,6 +1469,7 @@ + BITMAP_FREE (best_split_point.split_bbs); + todo = TODO_update_ssa | TODO_cleanup_cfg; + } ++ BITMAP_FREE (forbidden_dominators); + VEC_free (bb_info, heap, bb_info_vec); + bb_info_vec = NULL; + return todo; Index: gcc/lto-section-in.c =================================================================== --- a/src/gcc/lto-section-in.c (.../tags/gcc_4_6_2_release) @@ -5010,6 +6192,69 @@ } else { +Index: gcc/loop-doloop.c +=================================================================== +--- a/src/gcc/loop-doloop.c (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/loop-doloop.c (.../branches/gcc-4_6-branch) +@@ -334,14 +334,11 @@ + describes the loop, DESC describes the number of iterations of the + loop, and DOLOOP_INSN is the low-overhead looping insn to emit at the + end of the loop. CONDITION is the condition separated from the +- DOLOOP_SEQ. COUNT is the number of iterations of the LOOP. +- ZERO_EXTEND_P says to zero extend COUNT after the increment of it to +- word_mode from FROM_MODE. */ ++ DOLOOP_SEQ. COUNT is the number of iterations of the LOOP. */ + + static void + doloop_modify (struct loop *loop, struct niter_desc *desc, +- rtx doloop_seq, rtx condition, rtx count, +- bool zero_extend_p, enum machine_mode from_mode) ++ rtx doloop_seq, rtx condition, rtx count) + { + rtx counter_reg; + rtx tmp, noloop = NULL_RTX; +@@ -415,12 +412,8 @@ + } + + if (increment_count) +- count = simplify_gen_binary (PLUS, from_mode, count, const1_rtx); ++ count = simplify_gen_binary (PLUS, mode, count, const1_rtx); + +- if (zero_extend_p) +- count = simplify_gen_unary (ZERO_EXTEND, word_mode, +- count, from_mode); +- + /* Insert initialization of the count register into the loop header. */ + start_sequence (); + tmp = force_operand (count, counter_reg); +@@ -555,7 +548,6 @@ + struct niter_desc *desc; + unsigned word_mode_size; + unsigned HOST_WIDE_INT word_mode_max; +- bool zero_extend_p = false; + + if (dump_file) + fprintf (dump_file, "Doloop: Processing loop %d.\n", loop->num); +@@ -630,7 +622,8 @@ + { + if (word_mode_size > GET_MODE_BITSIZE (mode)) + { +- zero_extend_p = true; ++ count = simplify_gen_unary (ZERO_EXTEND, word_mode, ++ count, mode); + iterations = simplify_gen_unary (ZERO_EXTEND, word_mode, + iterations, mode); + iterations_max = simplify_gen_unary (ZERO_EXTEND, word_mode, +@@ -674,8 +667,7 @@ + return false; + } + +- doloop_modify (loop, desc, doloop_seq, condition, count, +- zero_extend_p, mode); ++ doloop_modify (loop, desc, doloop_seq, condition, count); + return true; + } + Index: gcc/tree-ssa-pre.c =================================================================== --- a/src/gcc/tree-ssa-pre.c (.../tags/gcc_4_6_2_release) @@ -5248,7 +6493,7 @@ =================================================================== --- a/src/gcc/tree-sra.c (.../tags/gcc_4_6_2_release) +++ b/src/gcc/tree-sra.c (.../branches/gcc-4_6-branch) -@@ -1020,26 +1020,28 @@ +@@ -1020,31 +1020,52 @@ return false; } @@ -5288,33 +6533,51 @@ return true; return false; -@@ -1071,7 +1073,11 @@ + } + ++/* Return true if EXP is a memory reference less aligned than what the access ++ ACC would require. This is invoked only on strict-alignment targets. */ ++ ++static bool ++tree_non_aligned_mem_for_access_p (tree exp, struct access *acc) ++{ ++ unsigned int acc_align; ++ ++ /* The alignment of the access is that of its expression. However, it may ++ have been artificially increased, e.g. by a local alignment promotion, ++ so we cap it to the alignment of the type of the base, on the grounds ++ that valid sub-accesses cannot be more aligned than that. */ ++ acc_align = get_object_alignment (acc->expr, BIGGEST_ALIGNMENT); ++ if (acc->base && acc_align > TYPE_ALIGN (TREE_TYPE (acc->base))) ++ acc_align = TYPE_ALIGN (TREE_TYPE (acc->base)); ++ ++ return tree_non_aligned_mem_p (exp, acc_align); ++} ++ + /* Scan expressions occuring in STMT, create access structures for all accesses + to candidates for scalarization and remove those candidates which occur in + statements or expressions that prevent them from being split apart. Return +@@ -1071,7 +1092,8 @@ if (lacc) { lacc->grp_assignment_write = 1; - lacc->grp_unscalarizable_region |= tree_non_mode_aligned_mem_p (rhs); -+ if (STRICT_ALIGNMENT -+ && tree_non_aligned_mem_p (rhs, -+ get_object_alignment (lhs, -+ BIGGEST_ALIGNMENT))) ++ if (STRICT_ALIGNMENT && tree_non_aligned_mem_for_access_p (rhs, lacc)) + lacc->grp_unscalarizable_region = 1; } if (racc) -@@ -1080,7 +1086,11 @@ +@@ -1080,7 +1102,8 @@ if (should_scalarize_away_bitmap && !gimple_has_volatile_ops (stmt) && !is_gimple_reg_type (racc->type)) bitmap_set_bit (should_scalarize_away_bitmap, DECL_UID (racc->base)); - racc->grp_unscalarizable_region |= tree_non_mode_aligned_mem_p (lhs); -+ if (STRICT_ALIGNMENT -+ && tree_non_aligned_mem_p (lhs, -+ get_object_alignment (rhs, -+ BIGGEST_ALIGNMENT))) ++ if (STRICT_ALIGNMENT && tree_non_aligned_mem_for_access_p (lhs, racc)) + racc->grp_unscalarizable_region = 1; } if (lacc && racc -@@ -1435,29 +1445,61 @@ +@@ -1435,29 +1458,67 @@ return fold_build2_loc (loc, MEM_REF, exp_type, base, off); } @@ -5355,8 +6618,14 @@ + + do { + tree field = TREE_OPERAND (expr, 1); -+ offset -= int_bit_position (field); ++ HOST_WIDE_INT bit_pos = int_bit_position (field); + ++ /* We can be called with a model different from the one associated ++ with BASE so we need to avoid going up the chain too far. */ ++ if (offset - bit_pos < 0) ++ break; ++ ++ offset -= bit_pos; + VEC_safe_push (tree, stack, cr_stack, expr); + + expr = TREE_OPERAND (expr, 0); @@ -5389,7 +6658,7 @@ } /* Construct a memory reference consisting of component_refs and array_refs to -@@ -2594,6 +2636,10 @@ +@@ -2594,6 +2655,10 @@ rhs = get_access_replacement (racc); if (!useless_type_conversion_p (lacc->type, racc->type)) rhs = fold_build1_loc (loc, VIEW_CONVERT_EXPR, lacc->type, rhs); @@ -5400,7 +6669,7 @@ } else { -@@ -2609,6 +2655,9 @@ +@@ -2609,6 +2674,9 @@ else rhs = build_ref_for_model (loc, top_racc->base, offset, lacc, new_gsi, true); @@ -5410,7 +6679,7 @@ } stmt = gimple_build_assign (get_access_replacement (lacc), rhs); -@@ -3604,7 +3653,8 @@ +@@ -3604,7 +3672,8 @@ || gimple_code (access->stmt) == GIMPLE_ASM)) return true; @@ -7650,6 +8919,214 @@ %{mv8plus:-Av8plus} \ %{mcpu=v9:-Av9} \ %{mcpu=ultrasparc:%{!mv8plus:-Av9a}} \ +Index: gcc/config/sparc/sol2-unwind.h +=================================================================== +--- a/src/gcc/config/sparc/sol2-unwind.h (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/config/sparc/sol2-unwind.h (.../branches/gcc-4_6-branch) +@@ -1,5 +1,5 @@ + /* DWARF2 EH unwinding support for SPARC Solaris. +- Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. ++ Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc. + + This file is part of GCC. + +@@ -34,7 +34,7 @@ + #define IS_SIGHANDLER sparc64_is_sighandler + + static int +-sparc64_is_sighandler (unsigned int *pc, unsigned int *savpc, int *nframes) ++sparc64_is_sighandler (unsigned int *pc, void *cfa, int *nframes) + { + if (/* Solaris 8 - single-threaded + ---------------------------- +@@ -110,38 +110,58 @@ + && pc[ 0] == 0x81c7e008 + && pc[ 1] == 0x81e80000) + { +- if (/* Solaris 8 /usr/lib/sparcv9/libthread.so.1 +- ------------------------------------------ +- Before patch 108827-08: +- : st %g4, [ %i1 + 0x1c ] ++ /* We have observed different calling frames among different ++ versions of the operating system, so that we need to ++ discriminate using the upper frame. We look for the return ++ address of the caller frame (there is an offset of 15 double ++ words between the frame address and the place where this return ++ address is stored) in order to do some more pattern matching. */ ++ unsigned int cuh_pattern ++ = *(unsigned int *)(*(unsigned long *)(cfa + 15*8) - 4); + +- Since patch 108827-08: +- : st %l0, [ %i4 + 0x10 ] */ +- savpc[-1] == 0xc826601c +- || savpc[-1] == 0xe0272010) ++ if (cuh_pattern == 0xd25fa7ef) + { +- /* We need to move up three frames: ++ /* This matches the call_user_handler pattern for Solaris 10. ++ There are 2 cases so we look for the return address of the ++ caller's caller frame in order to do more pattern matching. */ ++ unsigned long sah_address = *(unsigned long *)(cfa + 176 + 15*8); + ++ if (sah_address && *(unsigned int *)(sah_address - 4) == 0x92100019) ++ /* This is the same setup as for Solaris 9, see below. */ ++ *nframes = 3; ++ else ++ /* The sigacthandler frame isn't present in the chain. ++ We need to move up two frames: ++ + <-- context->cfa + __sighndlr +- sigacthandler ++ call_user_handler frame + +- */ +- *nframes = 2; ++ */ ++ *nframes = 2; + } +- else /* Solaris 8 /usr/lib/lwp/sparcv9/libthread.so.1, Solaris 9+ +- ---------------------------------------------------------- */ +- { +- /* We need to move up three frames: ++ else if (cuh_pattern == 0x9410001a || cuh_pattern == 0x94100013) ++ /* This matches the call_user_handler pattern for Solaris 9 and ++ for Solaris 8 running inside Solaris Containers respectively ++ We need to move up three frames: + + <-- context->cfa + __sighndlr + call_user_handler + sigacthandler + +- */ +- *nframes = 3; +- } ++ */ ++ *nframes = 3; ++ else ++ /* This is the default Solaris 8 case. ++ We need to move up two frames: ++ ++ <-- context->cfa ++ __sighndlr ++ sigacthandler ++ ++ */ ++ *nframes = 2; + return 1; + } + +@@ -172,7 +192,7 @@ + #define IS_SIGHANDLER sparc_is_sighandler + + static int +-sparc_is_sighandler (unsigned int *pc, unsigned int * savpc, int *nframes) ++sparc_is_sighandler (unsigned int *pc, void *cfa, int *nframes) + { + if (/* Solaris 8, 9 - single-threaded + ------------------------------- +@@ -200,7 +220,7 @@ + && pc[-1] == 0x9410001a + && pc[ 0] == 0x80a62008) + { +- /* Need to move up one frame: ++ /* We need to move up one frame: + + <-- context->cfa + sigacthandler +@@ -231,7 +251,7 @@ + && pc[ 1] == 0x81e80000 + && pc[ 2] == 0x80a26000) + { +- /* Need to move up one frame: ++ /* We need to move up one frame: + + <-- context->cfa + __libthread_segvhdlr +@@ -258,33 +278,58 @@ + && pc[ 0] == 0x81c7e008 + && pc[ 1] == 0x81e80000) + { +- if (/* Solaris 8 /usr/lib/libthread.so.1 +- ---------------------------------- +- : mov %i0, %o0 */ +- savpc[-1] == 0x90100018) ++ /* We have observed different calling frames among different ++ versions of the operating system, so that we need to ++ discriminate using the upper frame. We look for the return ++ address of the caller frame (there is an offset of 15 words ++ between the frame address and the place where this return ++ address is stored) in order to do some more pattern matching. */ ++ unsigned int cuh_pattern ++ = *(unsigned int *)(*(unsigned int *)(cfa + 15*4) - 4); ++ ++ if (cuh_pattern == 0xd407a04c) + { +- /* We need to move up two frames: ++ /* This matches the call_user_handler pattern for Solaris 10. ++ There are 2 cases so we look for the return address of the ++ caller's caller frame in order to do more pattern matching. */ ++ unsigned int sah_address = *(unsigned int *)(cfa + 96 + 15*4); + ++ if (sah_address && *(unsigned int *)(sah_address - 4) == 0x92100019) ++ /* This is the same setup as for Solaris 9, see below. */ ++ *nframes = 3; ++ else ++ /* The sigacthandler frame isn't present in the chain. ++ We need to move up two frames: ++ + <-- context->cfa + __sighndlr +- sigacthandler ++ call_user_handler frame + +- */ +- *nframes = 2; ++ */ ++ *nframes = 2; + } +- else /* Solaris 8 /usr/lib/lwp/libthread.so.1, Solaris 9+ +- -------------------------------------------------- */ +- { +- /* We need to move up three frames: ++ else if (cuh_pattern == 0x9410001a || cuh_pattern == 0x9410001b) ++ /* This matches the call_user_handler pattern for Solaris 9 and ++ for Solaris 8 running inside Solaris Containers respectively. ++ We need to move up three frames: + + <-- context->cfa + __sighndlr + call_user_handler + sigacthandler + +- */ +- *nframes = 3; +- } ++ */ ++ *nframes = 3; ++ else ++ /* This is the default Solaris 8 case. ++ We need to move up two frames: ++ ++ <-- context->cfa ++ __sighndlr ++ sigacthandler ++ ++ */ ++ *nframes = 2; + return 1; + } + +@@ -322,7 +367,7 @@ + return _URC_NO_REASON; + } + +- if (IS_SIGHANDLER (pc, (unsigned int *)fp->fr_savpc, &nframes)) ++ if (IS_SIGHANDLER (pc, this_cfa, &nframes)) + { + struct handler_args { + struct frame frwin; Index: gcc/config/i386/i386.md =================================================================== --- a/src/gcc/config/i386/i386.md (.../tags/gcc_4_6_2_release) @@ -7672,6 +9149,15 @@ (match_operand:DF 1 "general_operand" "fm,f,G,rm,r,F ,F ,C ,Y2*x,m ,Y2*x,r ,Yi"))] "TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1])) +@@ -3647,7 +3647,7 @@ + (match_operand:SI 1 "nonimmediate_operand" "rm,0,r ,m ,r ,m")))] + "TARGET_64BIT" + "@ +- mov\t{%k1, %k0|%k0, %k1} ++ mov{l}\t{%1, %k0|%k0, %1} + # + movd\t{%1, %0|%0, %1} + movd\t{%1, %0|%0, %1} @@ -5103,7 +5103,7 @@ && reload_completed && (SSE_REG_P (operands[0]) @@ -7753,6 +9239,15 @@ [(set (match_dup 0) (float:MODEF (match_dup 1)))]) (define_insn "*float2_i387_with_temp" +@@ -9222,7 +9222,7 @@ + (match_dup 0))) + (set (match_dup 1) + (if_then_else:SWI48 (ne (reg:CCZ FLAGS_REG) (const_int 0)) +- (match_operand:SWI48 3 "register_operand" "r") ++ (match_operand:SWI48 3 "register_operand" "") + (match_dup 1)))] + "TARGET_CMOVE" + "operands[4] = GEN_INT (GET_MODE_BITSIZE (mode));") @@ -14625,7 +14625,7 @@ emit_insn (gen_sse4_1_round2 (operands[0], operands[1], GEN_INT (0x04))); @@ -7884,6 +9379,19 @@ + +#define TARGET_ASM_FILE_END file_end_indicate_exec_stack + +Index: gcc/config/i386/driver-i386.c +=================================================================== +--- a/src/gcc/config/i386/driver-i386.c (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/config/i386/driver-i386.c (.../branches/gcc-4_6-branch) +@@ -507,7 +507,7 @@ + processor = PROCESSOR_AMDFAM10; + else if (has_sse2 || has_longmode) + processor = PROCESSOR_K8; +- else if (has_3dnowp) ++ else if (has_3dnowp && family == 6) + processor = PROCESSOR_ATHLON; + else if (has_mmx) + processor = PROCESSOR_K6; Index: gcc/config/i386/avxintrin.h =================================================================== --- a/src/gcc/config/i386/avxintrin.h (.../tags/gcc_4_6_2_release) @@ -8048,7 +9556,15 @@ } if (AVR_HAVE_MOVW) -@@ -5173,10 +5176,10 @@ +@@ -5151,6 +5154,7 @@ + if (new_decl_p + && decl && DECL_P (decl) + && NULL_TREE == DECL_INITIAL (decl) ++ && !DECL_EXTERNAL (decl) + && avr_progmem_p (decl, DECL_ATTRIBUTES (decl))) + { + warning (OPT_Wuninitialized, +@@ -5173,10 +5177,10 @@ default_file_start (); @@ -8350,6 +9866,21 @@ error_p = false; break; } +Index: gcc/config/rs6000/rs6000.md +=================================================================== +--- a/src/gcc/config/rs6000/rs6000.md (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/config/rs6000/rs6000.md (.../branches/gcc-4_6-branch) +@@ -12241,8 +12241,8 @@ + " + { + operands[3] = gen_reg_rtx (SImode); +- operands[4] = gen_rtx_MEM (DImode, +- gen_rtx_PLUS (DImode, stack_pointer_rtx, ++ operands[4] = gen_rtx_MEM (SImode, ++ gen_rtx_PLUS (SImode, stack_pointer_rtx, + GEN_INT (20))); + + operands[5] = gen_rtx_MEM (SImode, Index: gcc/config/darwin.c =================================================================== --- a/src/gcc/config/darwin.c (.../tags/gcc_4_6_2_release) @@ -8682,6 +10213,15 @@ } /* Expand an expression EXP that calls a built-in function, +@@ -20859,6 +20867,8 @@ + gcc_assert (amount >= 0); + if (amount) + { ++ emit_insn (gen_blockage ()); ++ + if (amount < 512) + emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, + GEN_INT (amount))); Index: gcc/config/arm/arm.md =================================================================== --- a/src/gcc/config/arm/arm.md (.../tags/gcc_4_6_2_release) @@ -8695,6 +10235,15 @@ need_else = true; else need_else = false; +@@ -7346,7 +7346,7 @@ + (not:SI (match_operator:SI 1 "arm_comparison_operator" + [(match_operand 2 "cc_register" "") (const_int 0)])))] + "TARGET_ARM" +- "mov%D1\\t%0, #0\;mvn%d1\\t%0, #1" ++ "mvn%D1\\t%0, #0\;mvn%d1\\t%0, #1" + [(set_attr "conds" "use") + (set_attr "insn" "mov") + (set_attr "length" "8")] Index: gcc/config/pa/pa.c =================================================================== --- a/src/gcc/config/pa/pa.c (.../tags/gcc_4_6_2_release) @@ -8725,6 +10274,19 @@ && (!TARGET_64BIT \ || GET_CODE (X) != CONST_DOUBLE) \ && (!TARGET_64BIT \ +Index: gcc/config/mips/mips.md +=================================================================== +--- a/src/gcc/config/mips/mips.md (.../tags/gcc_4_6_2_release) ++++ b/src/gcc/config/mips/mips.md (.../branches/gcc-4_6-branch) +@@ -4707,7 +4707,7 @@ + ;; of _gp from the start of this function. Operand 1 is the incoming + ;; function address. + (define_insn_and_split "loadgp_newabi_" +- [(set (match_operand:P 0 "register_operand" "=d") ++ [(set (match_operand:P 0 "register_operand" "=&d") + (unspec:P [(match_operand:P 1) + (match_operand:P 2 "register_operand" "d")] + UNSPEC_LOADGP))] Index: gcc/reload1.c =================================================================== --- a/src/gcc/reload1.c (.../tags/gcc_4_6_2_release)