Index: libitm/ChangeLog =================================================================== --- libitm/ChangeLog (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libitm/ChangeLog (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,3 +1,12 @@ +2012-04-04 H.J. Lu + + Backported from mainline + 2012-04-04 H.J. Lu + + PR libitm/52854 + * config/x86/target.h (gtm_jmpbuf): Replace long with long long + for x86-64. + 2012-03-22 Release Manager * GCC 4.7.0 released. Index: libitm/config/x86/target.h =================================================================== --- libitm/config/x86/target.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libitm/config/x86/target.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -29,13 +29,13 @@ typedef struct gtm_jmpbuf { void *cfa; - unsigned long rbx; - unsigned long rbp; - unsigned long r12; - unsigned long r13; - unsigned long r14; - unsigned long r15; - unsigned long rip; + unsigned long long rbx; + unsigned long long rbp; + unsigned long long r12; + unsigned long long r13; + unsigned long long r14; + unsigned long long r15; + unsigned long long rip; } gtm_jmpbuf; #else typedef struct gtm_jmpbuf Index: Makefile.in =================================================================== --- Makefile.in (.../tags/gcc_4_7_0_release) (wersja 187906) +++ Makefile.in (.../branches/gcc-4_7-branch) (wersja 187906) @@ -2426,11 +2426,12 @@ true ; \ fi -# install-no-fixedincludes is used because Cygnus can not distribute -# the fixed header files. +# install-no-fixedincludes is used to allow the elaboration of binary packages +# suitable for distribution, where we cannot include the fixed system header +# files. .PHONY: install-no-fixedincludes install-no-fixedincludes: installdirs install-host-nogcc \ - install-target gcc-no-fixedincludes + install-target gcc-install-no-fixedincludes .PHONY: install-strip install-strip: @@ -40721,25 +40722,16 @@ check-go: check-gcc-go check-target-libgo -# Install the gcc headers files, but not the fixed include files, -# which Cygnus is not allowed to distribute. This rule is very -# dependent on the workings of the gcc Makefile.in. -.PHONY: gcc-no-fixedincludes -gcc-no-fixedincludes: +# The gcc part of install-no-fixedincludes, which relies on an intimate +# knowledge of how a number of gcc internal targets (inter)operate. Delegate. +.PHONY: gcc-install-no-fixedincludes +gcc-install-no-fixedincludes: @if [ -f ./gcc/Makefile ]; then \ - rm -rf gcc/tmp-include; \ - mv gcc/include gcc/tmp-include 2>/dev/null; \ - mkdir gcc/include; \ - cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \ - touch gcc/stmp-fixinc gcc/include/fixed; \ - rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \ r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - (cd ./gcc && \ - $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ - rm -rf gcc/include; \ - mv gcc/tmp-include gcc/include 2>/dev/null; \ + (cd ./gcc \ + && $(MAKE) $(GCC_FLAGS_TO_PASS) install-no-fixedincludes); \ else true; fi @endif gcc Index: libgomp/ChangeLog =================================================================== --- libgomp/ChangeLog (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libgomp/ChangeLog (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,3 +1,8 @@ +2012-03-22 Jakub Jelinek + + PR middle-end/52547 + * testsuite/libgomp.c/pr52547.c: New test. + 2012-03-22 Release Manager * GCC 4.7.0 released. Index: libgomp/testsuite/libgomp.c/pr52547.c =================================================================== --- libgomp/testsuite/libgomp.c/pr52547.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ libgomp/testsuite/libgomp.c/pr52547.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,36 @@ +/* PR middle-end/52547 */ +/* { dg-do run } */ + +extern void abort (void); + +__attribute__((noinline, noclone)) int +baz (int *x, int (*fn) (int *)) +{ + return fn (x); +} + +__attribute__((noinline, noclone)) int +foo (int x, int *y) +{ + int i, e = 0; +#pragma omp parallel for reduction(|:e) + for (i = 0; i < x; ++i) + { + __label__ lab; + int bar (int *z) { return z - y; } + if (baz (&y[i], bar) != i) + e |= 1; + } + return e; +} + +int +main () +{ + int a[100], i; + for (i = 0; i < 100; i++) + a[i] = i; + if (foo (100, a)) + abort (); + return 0; +} Index: libstdc++-v3/configure =================================================================== --- libstdc++-v3/configure (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/configure (.../branches/gcc-4_7-branch) (wersja 187906) @@ -3025,7 +3025,8 @@ target_alias=${target_alias-$host_alias} # Handy for debugging: -#AC_MSG_NOTICE($build / $host / $target / $host_alias / $target_alias); sleep 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: $build / $host / $target / $host_alias / $target_alias" >&5 +$as_echo "$as_me: $build / $host / $target / $host_alias / $target_alias" >&6;}; sleep 5 if test "$build" != "$host"; then # We are being configured with some form of cross compiler. @@ -11497,7 +11498,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11500 "configure" +#line 11501 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11603,7 +11604,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11606 "configure" +#line 11607 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14961,7 +14962,7 @@ # # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style. cat > conftest.$ac_ext << EOF -#line 14964 "configure" +#line 14965 "configure" struct S { ~S(); }; void bar(); void foo() @@ -15296,7 +15297,7 @@ # Fake what AC_TRY_COMPILE does. cat > conftest.$ac_ext << EOF -#line 15299 "configure" +#line 15300 "configure" int main() { typedef bool atomic_type; @@ -15331,7 +15332,7 @@ rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15334 "configure" +#line 15335 "configure" int main() { typedef short atomic_type; @@ -15366,7 +15367,7 @@ rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15369 "configure" +#line 15370 "configure" int main() { // NB: _Atomic_word not necessarily int. @@ -15402,7 +15403,7 @@ rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15405 "configure" +#line 15406 "configure" int main() { typedef long long atomic_type; @@ -15446,11 +15447,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - # Set atomicity_dir to builtins if all of above tests pass. + # Set atomicity_dir to builtins if all but the long long test above passes. if test $glibcxx_cv_atomic_bool = yes \ && test $glibcxx_cv_atomic_short = yes \ - && test $glibcxx_cv_atomic_int = yes \ - && test $glibcxx_cv_atomic_long_long = yes ; then + && test $glibcxx_cv_atomic_int = yes; then $as_echo "#define _GLIBCXX_ATOMIC_BUILTINS 1" >>confdefs.h Index: libstdc++-v3/src/Makefile.in =================================================================== --- libstdc++-v3/src/Makefile.in (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/src/Makefile.in (.../branches/gcc-4_7-branch) (wersja 187906) @@ -88,20 +88,22 @@ am__installdirs = "$(DESTDIR)$(toolexeclibdir)" LTLIBRARIES = $(toolexeclib_LTLIBRARIES) am__DEPENDENCIES_1 = -am_libstdc___la_OBJECTS = +@GLIBCXX_LDBL_COMPAT_TRUE@am__objects_1 = compatibility-ldbl.lo +@ENABLE_PARALLEL_TRUE@am__objects_2 = compatibility-parallel_list.lo \ +@ENABLE_PARALLEL_TRUE@ compatibility-parallel_list-2.lo +am__objects_3 = compatibility.lo compatibility-debug_list.lo \ + compatibility-debug_list-2.lo compatibility-list.lo \ + compatibility-list-2.lo $(am__objects_1) $(am__objects_2) +am__objects_4 = compatibility-c++0x.lo compatibility-atomic-c++0x.lo \ + compatibility-thread-c++0x.lo +am_libstdc___la_OBJECTS = $(am__objects_3) $(am__objects_4) libstdc___la_OBJECTS = $(am_libstdc___la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = am__depfiles_maybe = -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) SOURCES = $(libstdc___la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ @@ -331,7 +333,27 @@ # Cross compiler support. toolexeclib_LTLIBRARIES = libstdc++.la -libstdc___la_SOURCES = +@GLIBCXX_LDBL_COMPAT_FALSE@ldbl_compat_sources = +@GLIBCXX_LDBL_COMPAT_TRUE@ldbl_compat_sources = compatibility-ldbl.cc +@ENABLE_PARALLEL_FALSE@parallel_compat_sources = +@ENABLE_PARALLEL_TRUE@parallel_compat_sources = \ +@ENABLE_PARALLEL_TRUE@ compatibility-parallel_list.cc compatibility-parallel_list-2.cc + +cxx98_sources = \ + compatibility.cc \ + compatibility-debug_list.cc \ + compatibility-debug_list-2.cc \ + compatibility-list.cc \ + compatibility-list-2.cc \ + ${ldbl_compat_sources} \ + ${parallel_compat_sources} + +cxx11_sources = \ + compatibility-c++0x.cc \ + compatibility-atomic-c++0x.cc \ + compatibility-thread-c++0x.cc + +libstdc___la_SOURCES = $(cxx98_sources) $(cxx11_sources) libstdc___la_LIBADD = \ $(GLIBCXX_LIBS) \ $(top_builddir)/libsupc++/libsupc++convenience.la \ @@ -349,6 +371,9 @@ libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS) +# Use special rules for parallel mode compilation. +PARALLEL_FLAGS = -fopenmp -D_GLIBCXX_PARALLEL -I$(glibcxx_builddir)/../libgomp + # AM_CXXFLAGS needs to be in each subdirectory so that it can be # modified in a per-library or per-sub-library way. Need to manually # set this option because CONFIG_CXXFLAGS has to be after @@ -356,12 +381,10 @@ # as the occasion calls for it. AM_CXXFLAGS = \ $(XTEMPLATE_FLAGS) \ - $(WARN_CXXFLAGS) \ - $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) + $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) -# libstdc++ libtool notes +# Libtool notes # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is # last. (That way, things like -O2 passed down from the toplevel can @@ -379,10 +402,11 @@ # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to # attempt to infer which configuration to use -LTCXXCOMPILE = $(LIBTOOL) --tag CXX \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile \ - $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = \ + $(LIBTOOL) --tag CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) @@ -392,8 +416,11 @@ # course is problematic at this point. So, we get the top-level # directory to configure libstdc++-v3 to use gcc as the C++ # compilation driver. -CXXLINK = $(LIBTOOL) --tag CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ - $(CXX) $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ +CXXLINK = \ + $(LIBTOOL) --tag CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ @ENABLE_SYMVERS_TRUE@CLEANFILES = libstdc++-symbols.ver $(version_dep) @ENABLE_SYMVERS_DARWIN_TRUE@@ENABLE_SYMVERS_TRUE@version_arg = -Wl,-exported_symbols_list,libstdc++-symbols.explist @@ -423,6 +450,7 @@ all: all-recursive .SUFFIXES: +.SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/fragment.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ @@ -493,6 +521,15 @@ distclean-compile: -rm -f *.tab.c +.cc.o: + $(CXXCOMPILE) -c -o $@ $< + +.cc.obj: + $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cc.lo: + $(LTCXXCOMPILE) -c -o $@ $< + mostlyclean-libtool: -rm -f *.lo @@ -757,9 +794,41 @@ uninstall-toolexeclibLTLIBRARIES -vpath % $(top_srcdir)/src -vpath % $(top_srcdir) +vpath % $(top_srcdir)/src/c++98 +vpath % $(top_srcdir)/src/c++11 +compatibility-parallel_list.lo: compatibility-parallel_list.cc + $(LTCXXCOMPILE) -c $< +compatibility-parallel_list.o: compatibility-parallel_list.cc + $(CXXCOMPILE) -c $< +compatibility-parallel_list-2.lo: compatibility-parallel_list-2.cc + $(LTCXXCOMPILE) -c $< +compatibility-parallel_list-2.o: compatibility-parallel_list-2.cc + $(CXXCOMPILE) -c $< + +# Use special rules for compatibility-ldbl.cc compilation, as we need to +# pass -mlong-double-64. +@GLIBCXX_LDBL_COMPAT_TRUE@compatibility-ldbl.lo: compatibility-ldbl.cc +@GLIBCXX_LDBL_COMPAT_TRUE@ $(LTCXXCOMPILE) -mlong-double-64 -c $< +@GLIBCXX_LDBL_COMPAT_TRUE@compatibility-ldbl.o: compatibility-ldbl.cc +@GLIBCXX_LDBL_COMPAT_TRUE@ $(CXXCOMPILE) -mlong-double-64 -c $< + +# Use special rules for C++11 files/objects. +compatibility-c++0x.lo: compatibility-c++0x.cc + $(LTCXXCOMPILE) -std=gnu++11 -c $< +compatibility-c++0x.o: compatibility-c++0x.cc + $(CXXCOMPILE) -std=gnu++11 -c $< + +compatibility-atomic-c++0x.lo: compatibility-atomic-c++0x.cc + $(LTCXXCOMPILE) -std=gnu++11 -c $< +compatibility-atomic-c++0x.o: compatibility-atomic-c++0x.cc + $(CXXCOMPILE) -std=gnu++11 -c $< + +compatibility-thread-c++0x.lo: compatibility-thread-c++0x.cc + $(LTCXXCOMPILE) -std=gnu++11 -c $< +compatibility-thread-c++0x.o: compatibility-thread-c++0x.cc + $(CXXCOMPILE) -std=gnu++11 -c $< + # Symbol versioning for shared libraries. @ENABLE_SYMVERS_TRUE@libstdc++-symbols.ver: ${glibcxx_srcdir}/$(SYMVER_FILE) \ @ENABLE_SYMVERS_TRUE@ $(port_specific_symbol_files) @@ -777,7 +846,7 @@ @ENABLE_SYMVERS_TRUE@ fi; \ @ENABLE_SYMVERS_TRUE@ fi @ENABLE_SYMVERS_TRUE@ $(EGREP) -v '^[ ]*#(#| |$$)' $@.tmp | \ -@ENABLE_SYMVERS_TRUE@ $(COMPILE) -E -P -include config.h - > $@ || (rm -f $@ ; exit 1) +@ENABLE_SYMVERS_TRUE@ $(CC) -E -P -include ../config.h - > $@ || (rm -f $@ ; exit 1) @ENABLE_SYMVERS_TRUE@ rm -f $@.tmp @ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@libstdc++-symbols.ver-sun : libstdc++-symbols.ver \ @ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@ $(toplevel_srcdir)/contrib/make_sunver.pl \ @@ -800,7 +869,6 @@ @ENABLE_SYMVERS_DARWIN_TRUE@@ENABLE_SYMVERS_TRUE@ > $@ || (rm -f $@ ; exit 1) # Control additional build primary rules. -# EXTRA_LTLIBRARIES = all-once: libstdc++convenience.la $(STAMP_DEBUG) install-data-once: $(STAMP_INSTALL_DEBUG) @@ -846,7 +914,7 @@ mv Makefile Makefile.tmp; \ sed -e 's,all-local: all-once,all-local:,' \ -e 's,install-data-local: install-data-once,install-data-local:,' \ - -e 's,src/c,src/debug/c,' \ + -e '/vpath/!s,src/c,src/debug/c,' \ < Makefile.tmp > Makefile ; \ $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' \ toolexeclibdir=$(glibcxx_toolexeclibdir)/debug all) ; Index: libstdc++-v3/src/Makefile.am =================================================================== --- libstdc++-v3/src/Makefile.am (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/src/Makefile.am (.../branches/gcc-4_7-branch) (wersja 187906) @@ -29,11 +29,38 @@ # Cross compiler support. toolexeclib_LTLIBRARIES = libstdc++.la -vpath % $(top_srcdir)/src -vpath % $(top_srcdir) +vpath % $(top_srcdir)/src/c++98 +vpath % $(top_srcdir)/src/c++11 -libstdc___la_SOURCES = +if GLIBCXX_LDBL_COMPAT +ldbl_compat_sources = compatibility-ldbl.cc +else +ldbl_compat_sources = +endif +if ENABLE_PARALLEL +parallel_compat_sources = \ + compatibility-parallel_list.cc compatibility-parallel_list-2.cc +else +parallel_compat_sources = +endif + +cxx98_sources = \ + compatibility.cc \ + compatibility-debug_list.cc \ + compatibility-debug_list-2.cc \ + compatibility-list.cc \ + compatibility-list-2.cc \ + ${ldbl_compat_sources} \ + ${parallel_compat_sources} + +cxx11_sources = \ + compatibility-c++0x.cc \ + compatibility-atomic-c++0x.cc \ + compatibility-thread-c++0x.cc + +libstdc___la_SOURCES = $(cxx98_sources) $(cxx11_sources) + libstdc___la_LIBADD = \ $(GLIBCXX_LIBS) \ $(top_builddir)/libsupc++/libsupc++convenience.la \ @@ -52,6 +79,43 @@ libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS) +# Use special rules for parallel mode compilation. +PARALLEL_FLAGS = -fopenmp -D_GLIBCXX_PARALLEL -I$(glibcxx_builddir)/../libgomp +compatibility-parallel_list.lo: compatibility-parallel_list.cc + $(LTCXXCOMPILE) -c $< +compatibility-parallel_list.o: compatibility-parallel_list.cc + $(CXXCOMPILE) -c $< + +compatibility-parallel_list-2.lo: compatibility-parallel_list-2.cc + $(LTCXXCOMPILE) -c $< +compatibility-parallel_list-2.o: compatibility-parallel_list-2.cc + $(CXXCOMPILE) -c $< + +# Use special rules for compatibility-ldbl.cc compilation, as we need to +# pass -mlong-double-64. +if GLIBCXX_LDBL_COMPAT +compatibility-ldbl.lo: compatibility-ldbl.cc + $(LTCXXCOMPILE) -mlong-double-64 -c $< +compatibility-ldbl.o: compatibility-ldbl.cc + $(CXXCOMPILE) -mlong-double-64 -c $< +endif + +# Use special rules for C++11 files/objects. +compatibility-c++0x.lo: compatibility-c++0x.cc + $(LTCXXCOMPILE) -std=gnu++11 -c $< +compatibility-c++0x.o: compatibility-c++0x.cc + $(CXXCOMPILE) -std=gnu++11 -c $< + +compatibility-atomic-c++0x.lo: compatibility-atomic-c++0x.cc + $(LTCXXCOMPILE) -std=gnu++11 -c $< +compatibility-atomic-c++0x.o: compatibility-atomic-c++0x.cc + $(CXXCOMPILE) -std=gnu++11 -c $< + +compatibility-thread-c++0x.lo: compatibility-thread-c++0x.cc + $(LTCXXCOMPILE) -std=gnu++11 -c $< +compatibility-thread-c++0x.o: compatibility-thread-c++0x.cc + $(CXXCOMPILE) -std=gnu++11 -c $< + # AM_CXXFLAGS needs to be in each subdirectory so that it can be # modified in a per-library or per-sub-library way. Need to manually # set this option because CONFIG_CXXFLAGS has to be after @@ -59,13 +123,10 @@ # as the occasion calls for it. AM_CXXFLAGS = \ $(XTEMPLATE_FLAGS) \ - $(WARN_CXXFLAGS) \ - $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) + $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) +# Libtool notes -# libstdc++ libtool notes - # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is # last. (That way, things like -O2 passed down from the toplevel can # be overridden by --enable-debug.) @@ -82,10 +143,11 @@ # correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe # CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to # attempt to infer which configuration to use -LTCXXCOMPILE = $(LIBTOOL) --tag CXX \ - $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile \ - $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = \ + $(LIBTOOL) --tag CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) @@ -95,9 +157,13 @@ # course is problematic at this point. So, we get the top-level # directory to configure libstdc++-v3 to use gcc as the C++ # compilation driver. -CXXLINK = $(LIBTOOL) --tag CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \ - $(CXX) $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ +CXXLINK = \ + $(LIBTOOL) --tag CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ + # Symbol versioning for shared libraries. if ENABLE_SYMVERS libstdc++-symbols.ver: ${glibcxx_srcdir}/$(SYMVER_FILE) \ @@ -116,7 +182,7 @@ fi; \ fi $(EGREP) -v '^[ ]*#(#| |$$)' $@.tmp | \ - $(COMPILE) -E -P -include config.h - > $@ || (rm -f $@ ; exit 1) + $(CC) -E -P -include ../config.h - > $@ || (rm -f $@ ; exit 1) rm -f $@.tmp CLEANFILES = libstdc++-symbols.ver @@ -165,7 +231,6 @@ # Control additional build primary rules. -# EXTRA_LTLIBRARIES = all-once: libstdc++convenience.la $(STAMP_DEBUG) install-data-once: $(STAMP_INSTALL_DEBUG) @@ -228,7 +293,7 @@ mv Makefile Makefile.tmp; \ sed -e 's,all-local: all-once,all-local:,' \ -e 's,install-data-local: install-data-once,install-data-local:,' \ - -e 's,src/c,src/debug/c,' \ + -e '/vpath/!s,src/c,src/debug/c,' \ < Makefile.tmp > Makefile ; \ $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' \ toolexeclibdir=$(glibcxx_toolexeclibdir)/debug all) ; Index: libstdc++-v3/src/c++98/Makefile.in =================================================================== --- libstdc++-v3/src/c++98/Makefile.in (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/src/c++98/Makefile.in (.../branches/gcc-4_7-branch) (wersja 187906) @@ -76,23 +76,18 @@ @ENABLE_EXTERN_TEMPLATE_TRUE@ misc-inst.lo ostream-inst.lo \ @ENABLE_EXTERN_TEMPLATE_TRUE@ sstream-inst.lo streambuf-inst.lo \ @ENABLE_EXTERN_TEMPLATE_TRUE@ wlocale-inst.lo -@GLIBCXX_LDBL_COMPAT_TRUE@am__objects_3 = compatibility-ldbl.lo -@ENABLE_PARALLEL_TRUE@am__objects_4 = parallel_settings.lo \ -@ENABLE_PARALLEL_TRUE@ compatibility-parallel_list.lo \ -@ENABLE_PARALLEL_TRUE@ compatibility-parallel_list-2.lo -am__objects_5 = basic_file.lo c++locale.lo $(am__objects_2) \ - $(am__objects_3) $(am__objects_4) -am__objects_6 = bitmap_allocator.lo pool_allocator.lo mt_allocator.lo \ - codecvt.lo compatibility.lo compatibility-debug_list.lo \ - compatibility-debug_list-2.lo compatibility-list.lo \ - compatibility-list-2.lo complex_io.lo ctype.lo globals_io.lo \ - hash_tr1.lo hashtable_tr1.lo ios.lo ios_failure.lo ios_init.lo \ +@ENABLE_PARALLEL_TRUE@am__objects_3 = parallel_settings.lo +am__objects_4 = basic_file.lo c++locale.lo $(am__objects_2) \ + $(am__objects_3) +am__objects_5 = bitmap_allocator.lo pool_allocator.lo mt_allocator.lo \ + codecvt.lo complex_io.lo ctype.lo globals_io.lo hash_tr1.lo \ + hashtable_tr1.lo ios.lo ios_failure.lo ios_init.lo \ ios_locale.lo list.lo locale.lo locale_init.lo \ locale_facets.lo localename.lo math_stubs_float.lo \ math_stubs_long_double.lo stdexcept.lo strstream.lo tree.lo \ istream.lo streambuf.lo valarray.lo $(am__objects_1) \ - $(am__objects_5) -am_libc__98convenience_la_OBJECTS = $(am__objects_6) + $(am__objects_4) +am_libc__98convenience_la_OBJECTS = $(am__objects_5) libc__98convenience_la_OBJECTS = $(am_libc__98convenience_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = @@ -315,7 +310,7 @@ AM_CPPFLAGS = $(GLIBCXX_INCLUDES) # Convenience library for C++98 runtime. -noinst_LTLIBRARIES = libc++98convenience.la +noinst_LTLIBRARIES = libc++98convenience.la headers = # Source files linked in via configuration/make substitution for a @@ -337,15 +332,10 @@ # particular host, but with ad hoc naming rules. host_sources_extra = \ basic_file.cc c++locale.cc \ - ${inst_sources} ${ldbl_compat_sources} ${parallel_sources} + ${inst_sources} ${parallel_sources} @ENABLE_PARALLEL_FALSE@parallel_sources = -@ENABLE_PARALLEL_TRUE@parallel_sources = parallel_settings.cc \ -@ENABLE_PARALLEL_TRUE@ compatibility-parallel_list.cc \ -@ENABLE_PARALLEL_TRUE@ compatibility-parallel_list-2.cc - -@GLIBCXX_LDBL_COMPAT_FALSE@ldbl_compat_sources = -@GLIBCXX_LDBL_COMPAT_TRUE@ldbl_compat_sources = compatibility-ldbl.cc +@ENABLE_PARALLEL_TRUE@parallel_sources = parallel_settings.cc @ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS = @ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates @ENABLE_EXTERN_TEMPLATE_FALSE@inst_sources = @@ -370,11 +360,6 @@ pool_allocator.cc \ mt_allocator.cc \ codecvt.cc \ - compatibility.cc \ - compatibility-debug_list.cc \ - compatibility-debug_list-2.cc \ - compatibility-list.cc \ - compatibility-list-2.cc \ complex_io.cc \ ctype.cc \ globals_io.cc \ @@ -417,9 +402,7 @@ AM_CXXFLAGS = \ $(PIC_CXXFLAGS) \ $(XTEMPLATE_FLAGS) \ - $(WARN_CXXFLAGS) \ - $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) + $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) AM_MAKEFLAGS = \ "gxx_include_dir=$(gxx_include_dir)" @@ -445,9 +428,11 @@ # attempt to infer which configuration to use. # We have to put --tag disable-shared after --tag CXX lest things # CXX undo the affect of disable-shared. -LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \ - --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) @@ -457,9 +442,11 @@ # course is problematic at this point. So, we get the top-level # directory to configure libstdc++-v3 to use gcc as the C++ # compilation driver. -CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \ - --mode=link $(CXX) \ - $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ +CXXLINK = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ all: all-am @@ -726,7 +713,6 @@ $(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_CC) ./$@ || true vpath % $(top_srcdir)/src/c++98 -vpath % $(top_srcdir) strstream.lo: strstream.cc $(LTCXXCOMPILE) -I$(GLIBCXX_INCLUDE_DIR)/backward -Wno-deprecated -c $< strstream.o: strstream.cc @@ -744,23 +730,6 @@ parallel_settings.o: parallel_settings.cc $(CXXCOMPILE) $(PARALLEL_FLAGS) -c $< -compatibility-parallel_list.lo: compatibility-parallel_list.cc - $(LTCXXCOMPILE) -c $< -compatibility-parallel_list.o: compatibility-parallel_list.cc - $(CXXCOMPILE) -c $< - -compatibility-parallel_list-2.lo: compatibility-parallel_list-2.cc - $(LTCXXCOMPILE) -c $< -compatibility-parallel_list-2.o: compatibility-parallel_list-2.cc - $(CXXCOMPILE) -c $< - -# Use special rules for compatibility-ldbl.cc compilation, as we need to -# pass -mlong-double-64. -@GLIBCXX_LDBL_COMPAT_TRUE@compatibility-ldbl.lo: compatibility-ldbl.cc -@GLIBCXX_LDBL_COMPAT_TRUE@ $(LTCXXCOMPILE) -mlong-double-64 -c $< -@GLIBCXX_LDBL_COMPAT_TRUE@compatibility-ldbl.o: compatibility-ldbl.cc -@GLIBCXX_LDBL_COMPAT_TRUE@ $(CXXCOMPILE) -mlong-double-64 -c $< - # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: Index: libstdc++-v3/src/c++98/compatibility-list.cc =================================================================== --- libstdc++-v3/src/c++98/compatibility-list.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/src/c++98/compatibility-list.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,6 +1,6 @@ // Compatibility symbols for previous versions, list bits -*- C++ -*- -// Copyright (C) 2010, 2011 Free Software Foundation, Inc. +// Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the Index: libstdc++-v3/src/c++98/compatibility-ldbl.cc =================================================================== --- libstdc++-v3/src/c++98/compatibility-ldbl.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/src/c++98/compatibility-ldbl.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,6 +1,6 @@ // Compatibility symbols for -mlong-double-64 compatibility -*- C++ -*- -// Copyright (C) 2006, 2008, 2009, 2010, 2011 +// Copyright (C) 2006, 2008, 2009, 2010, 2011, 2012 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free Index: libstdc++-v3/src/c++98/compatibility.cc =================================================================== --- libstdc++-v3/src/c++98/compatibility.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/src/c++98/compatibility.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -199,7 +199,7 @@ #endif _GLIBCXX_END_NAMESPACE_VERSION -} // namespace +} // namespace std // NB: These symbols renames should go into the shared library only, @@ -228,7 +228,7 @@ #endif _GLIBCXX_END_NAMESPACE_VERSION -} // namespace +} // namespace std /* gcc-4.0.0 @@ -357,7 +357,7 @@ #endif _GLIBCXX_END_NAMESPACE_VERSION -} // namespace +} // namespace std // The rename syntax for default exported names is // asm (".symver name1,exportedname@GLIBCXX_3.4") Index: libstdc++-v3/src/c++98/compatibility-list-2.cc =================================================================== --- libstdc++-v3/src/c++98/compatibility-list-2.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/src/c++98/compatibility-list-2.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,6 +1,6 @@ // Compatibility symbols for previous versions, list bits -*- C++ -*- -// Copyright (C) 2011 Free Software Foundation, Inc. +// Copyright (C) 2011, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -24,6 +24,8 @@ #include +#ifdef PIC + #ifndef _GLIBCXX_BEGIN_NAMESPACE_COMPAT # define _GLIBCXX_BEGIN_NAMESPACE_COMPAT #endif @@ -111,3 +113,5 @@ _GLIBCXX_END_NAMESPACE_COMPAT } // namespace std + +#endif Index: libstdc++-v3/src/c++98/Makefile.am =================================================================== --- libstdc++-v3/src/c++98/Makefile.am (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/src/c++98/Makefile.am (.../branches/gcc-4_7-branch) (wersja 187906) @@ -25,7 +25,7 @@ include $(top_srcdir)/fragment.am # Convenience library for C++98 runtime. -noinst_LTLIBRARIES = libc++98convenience.la +noinst_LTLIBRARIES = libc++98convenience.la headers = @@ -74,7 +74,7 @@ # particular host, but with ad hoc naming rules. host_sources_extra = \ basic_file.cc c++locale.cc \ - ${inst_sources} ${ldbl_compat_sources} ${parallel_sources} + ${inst_sources} ${parallel_sources} c++locale.cc: ${glibcxx_srcdir}/$(CLOCALE_CC) $(LN_S) ${glibcxx_srcdir}/$(CLOCALE_CC) ./$@ || true @@ -83,19 +83,11 @@ $(LN_S) ${glibcxx_srcdir}/$(BASIC_FILE_CC) ./$@ || true if ENABLE_PARALLEL -parallel_sources = parallel_settings.cc \ - compatibility-parallel_list.cc \ - compatibility-parallel_list-2.cc +parallel_sources = parallel_settings.cc else parallel_sources = endif -if GLIBCXX_LDBL_COMPAT -ldbl_compat_sources = compatibility-ldbl.cc -else -ldbl_compat_sources = -endif - if ENABLE_EXTERN_TEMPLATE XTEMPLATE_FLAGS = -fno-implicit-templates inst_sources = \ @@ -122,11 +114,6 @@ pool_allocator.cc \ mt_allocator.cc \ codecvt.cc \ - compatibility.cc \ - compatibility-debug_list.cc \ - compatibility-debug_list-2.cc \ - compatibility-list.cc \ - compatibility-list-2.cc \ complex_io.cc \ ctype.cc \ globals_io.cc \ @@ -153,7 +140,6 @@ ${host_sources_extra} vpath % $(top_srcdir)/src/c++98 -vpath % $(top_srcdir) libc__98convenience_la_SOURCES = $(sources) @@ -180,25 +166,6 @@ parallel_settings.o: parallel_settings.cc $(CXXCOMPILE) $(PARALLEL_FLAGS) -c $< -compatibility-parallel_list.lo: compatibility-parallel_list.cc - $(LTCXXCOMPILE) -c $< -compatibility-parallel_list.o: compatibility-parallel_list.cc - $(CXXCOMPILE) -c $< - -compatibility-parallel_list-2.lo: compatibility-parallel_list-2.cc - $(LTCXXCOMPILE) -c $< -compatibility-parallel_list-2.o: compatibility-parallel_list-2.cc - $(CXXCOMPILE) -c $< - -if GLIBCXX_LDBL_COMPAT -# Use special rules for compatibility-ldbl.cc compilation, as we need to -# pass -mlong-double-64. -compatibility-ldbl.lo: compatibility-ldbl.cc - $(LTCXXCOMPILE) -mlong-double-64 -c $< -compatibility-ldbl.o: compatibility-ldbl.cc - $(CXXCOMPILE) -mlong-double-64 -c $< -endif - # AM_CXXFLAGS needs to be in each subdirectory so that it can be # modified in a per-library or per-sub-library way. Need to manually # set this option because CONFIG_CXXFLAGS has to be after @@ -207,9 +174,7 @@ AM_CXXFLAGS = \ $(PIC_CXXFLAGS) \ $(XTEMPLATE_FLAGS) \ - $(WARN_CXXFLAGS) \ - $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) + $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) AM_MAKEFLAGS = \ "gxx_include_dir=$(gxx_include_dir)" @@ -234,9 +199,11 @@ # attempt to infer which configuration to use. # We have to put --tag disable-shared after --tag CXX lest things # CXX undo the affect of disable-shared. -LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \ - --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) @@ -246,6 +213,8 @@ # course is problematic at this point. So, we get the top-level # directory to configure libstdc++-v3 to use gcc as the C++ # compilation driver. -CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \ - --mode=link $(CXX) \ - $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ +CXXLINK = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ Index: libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc =================================================================== --- libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc (.../tags/gcc_4_7_0_release) (wersja 0) +++ libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,72 @@ +// Compatibility symbols for previous versions, C++0x bits -*- C++ -*- + +// Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +#include +#include + +#ifndef __GXX_EXPERIMENTAL_CXX0X__ +# error "compatibility-c++0x.cc must be compiled with -std=gnu++0x" +#endif + +#define _GLIBCXX_ASM_SYMVER(cur, old, version) \ + asm (".symver " #cur "," #old "@@@" #version); + +// XXX GLIBCXX_ABI Deprecated +// gcc-4.6.0 +// export changes +#if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \ + && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \ + && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT) + +namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) +{ + const std::error_category* future_category = &std::future_category(); +} + +_GLIBCXX_ASM_SYMVER(_ZN9__gnu_cxx15future_categoryE, _ZSt15future_category, GLIBCXX_3.4.14) + +#endif + +// XXX GLIBCXX_ABI Deprecated +// gcc-4.6.0 +// export changes +#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) +#if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \ + && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \ + && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT) + +namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) +{ + std::defer_lock_t defer_lock; + std::try_to_lock_t try_to_lock; + std::adopt_lock_t adopt_lock; +} + +_GLIBCXX_ASM_SYMVER(_ZN9__gnu_cxx10adopt_lockE, _ZSt10adopt_lock, GLIBCXX_3.4.11) +_GLIBCXX_ASM_SYMVER(_ZN9__gnu_cxx10defer_lockE, _ZSt10defer_lock, GLIBCXX_3.4.11) +_GLIBCXX_ASM_SYMVER(_ZN9__gnu_cxx11try_to_lockE, _ZSt11try_to_lock, GLIBCXX_3.4.11) + + +#endif +#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 Index: libstdc++-v3/src/c++11/Makefile.in =================================================================== --- libstdc++-v3/src/c++11/Makefile.in (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/src/c++11/Makefile.in (.../branches/gcc-4_7-branch) (wersja 187906) @@ -66,11 +66,10 @@ CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libc__11convenience_la_LIBADD = -am__objects_1 = chrono.lo condition_variable.lo compatibility-c++0x.lo \ - compatibility-atomic-c++0x.lo debug.lo functexcept.lo \ - functional.lo future.lo hash_c++0x.lo hashtable_c++0x.lo \ - limits.lo mutex.lo placeholders.lo regex.lo shared_ptr.lo \ - system_error.lo thread.lo +am__objects_1 = chrono.lo condition_variable.lo debug.lo \ + functexcept.lo functional.lo future.lo hash_c++0x.lo \ + hashtable_c++0x.lo limits.lo mutex.lo placeholders.lo regex.lo \ + shared_ptr.lo system_error.lo thread.lo @ENABLE_EXTERN_TEMPLATE_TRUE@am__objects_2 = fstream-inst.lo \ @ENABLE_EXTERN_TEMPLATE_TRUE@ string-inst.lo wstring-inst.lo am_libc__11convenience_la_OBJECTS = $(am__objects_1) $(am__objects_2) @@ -301,8 +300,6 @@ sources = \ chrono.cc \ condition_variable.cc \ - compatibility-c++0x.cc \ - compatibility-atomic-c++0x.cc \ debug.cc \ functexcept.cc \ functional.cc \ @@ -333,11 +330,10 @@ # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden # as the occasion calls for it. AM_CXXFLAGS = \ + -std=gnu++11 \ $(PIC_CXXFLAGS) \ $(XTEMPLATE_FLAGS) \ - $(WARN_CXXFLAGS) \ - $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) -std=gnu++11 + $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) AM_MAKEFLAGS = \ "gxx_include_dir=$(gxx_include_dir)" @@ -363,9 +359,11 @@ # attempt to infer which configuration to use. # We have to put --tag disable-shared after --tag CXX lest things # CXX undo the affect of disable-shared. -LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \ - --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) @@ -375,9 +373,11 @@ # course is problematic at this point. So, we get the top-level # directory to configure libstdc++-v3 to use gcc as the C++ # compilation driver. -CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \ - --mode=link $(CXX) \ - $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ +CXXLINK = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ all: all-am @@ -612,7 +612,6 @@ vpath % $(top_srcdir)/src/c++11 -vpath % $(top_srcdir) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. Index: libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc =================================================================== --- libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/src/c++11/compatibility-atomic-c++0x.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,6 +1,6 @@ // compatibility -*- C++ -*- -// Copyright (C) 2008, 2009, 2010, 2011 +// Copyright (C) 2008, 2009, 2010, 2011, 2012 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -30,6 +30,8 @@ // XXX GLIBCXX_ABI Deprecated // gcc-4.7.0 +#ifdef PIC + #define LOGSIZE 4 namespace @@ -133,6 +135,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace std +#endif // XXX GLIBCXX_ABI Deprecated // gcc-4.5.0 Index: libstdc++-v3/src/c++11/mutex.cc =================================================================== --- libstdc++-v3/src/c++11/mutex.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/src/c++11/mutex.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,6 +1,6 @@ // mutex -*- C++ -*- -// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2008, 2009, 2010, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -92,30 +92,6 @@ } _GLIBCXX_END_NAMESPACE_VERSION -} // namespace +} // namespace std -// XXX GLIBCXX_ABI Deprecated -// gcc-4.6.0 -// export changes -#if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \ - && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \ - && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT) - -namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) -{ - std::defer_lock_t defer_lock; - std::try_to_lock_t try_to_lock; - std::adopt_lock_t adopt_lock; -} - -#define _GLIBCXX_ASM_SYMVER(cur, old, version) \ - asm (".symver " #cur "," #old "@@" #version); - -_GLIBCXX_ASM_SYMVER(_ZN9__gnu_cxx10adopt_lockE, _ZSt10adopt_lock, GLIBCXX_3.4.11) -_GLIBCXX_ASM_SYMVER(_ZN9__gnu_cxx10defer_lockE, _ZSt10defer_lock, GLIBCXX_3.4.11) -_GLIBCXX_ASM_SYMVER(_ZN9__gnu_cxx11try_to_lockE, _ZSt11try_to_lock, GLIBCXX_3.4.11) - - -#endif - #endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 Index: libstdc++-v3/src/c++11/future.cc =================================================================== --- libstdc++-v3/src/c++11/future.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/src/c++11/future.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -96,23 +96,3 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace std - -// XXX GLIBCXX_ABI Deprecated -// gcc-4.6.0 -// export changes -#if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \ - && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE) \ - && defined(_GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT) - -namespace __gnu_cxx _GLIBCXX_VISIBILITY(default) -{ - const std::error_category* future_category = &__future_category_instance(); -} - -#define _GLIBCXX_ASM_SYMVER(cur, old, version) \ - asm (".symver " #cur "," #old "@@@" #version); - -_GLIBCXX_ASM_SYMVER(_ZN9__gnu_cxx15future_categoryE, _ZSt15future_category, GLIBCXX_3.4.14) - -#endif - Index: libstdc++-v3/src/c++11/Makefile.am =================================================================== --- libstdc++-v3/src/c++11/Makefile.am (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/src/c++11/Makefile.am (.../branches/gcc-4_7-branch) (wersja 187906) @@ -32,8 +32,6 @@ sources = \ chrono.cc \ condition_variable.cc \ - compatibility-c++0x.cc \ - compatibility-atomic-c++0x.cc \ debug.cc \ functexcept.cc \ functional.cc \ @@ -60,7 +58,6 @@ endif vpath % $(top_srcdir)/src/c++11 -vpath % $(top_srcdir) libc__11convenience_la_SOURCES = $(sources) $(inst_sources) @@ -70,11 +67,10 @@ # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden # as the occasion calls for it. AM_CXXFLAGS = \ + -std=gnu++11 \ $(PIC_CXXFLAGS) \ $(XTEMPLATE_FLAGS) \ - $(WARN_CXXFLAGS) \ - $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) -std=gnu++11 + $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) AM_MAKEFLAGS = \ "gxx_include_dir=$(gxx_include_dir)" @@ -99,9 +95,11 @@ # attempt to infer which configuration to use. # We have to put --tag disable-shared after --tag CXX lest things # CXX undo the affect of disable-shared. -LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \ - --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) @@ -111,6 +109,8 @@ # course is problematic at this point. So, we get the top-level # directory to configure libstdc++-v3 to use gcc as the C++ # compilation driver. -CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \ - --mode=link $(CXX) \ - $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ +CXXLINK = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ Index: libstdc++-v3/src/c++11/compatibility-c++0x.cc =================================================================== --- libstdc++-v3/src/c++11/compatibility-c++0x.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/src/c++11/compatibility-c++0x.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,6 +1,6 @@ // Compatibility symbols for previous versions, C++0x bits -*- C++ -*- -// Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. +// Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -30,6 +30,8 @@ # error "compatibility-c++0x.cc must be compiled with -std=gnu++0x" #endif +#ifdef PIC + namespace std _GLIBCXX_VISIBILITY(default) { // gcc-4.4.0 @@ -119,3 +121,4 @@ } // namespace chrono } +#endif Index: libstdc++-v3/include/Makefile.in =================================================================== --- libstdc++-v3/include/Makefile.in (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/Makefile.in (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1497,7 +1497,7 @@ sed -e "s,define __GLIBCXX__,define __GLIBCXX__ $$date," \ -e "s,define _GLIBCXX_INLINE_VERSION, define _GLIBCXX_INLINE_VERSION $$ns_version," \ -e "s,define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY, define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY $$visibility," \ - -e "s,define _GLIBCXX_EXTERN_TEMPLATE, define _GLIBCXX_EXTERN_TEMPLATE $$externtemplate," \ + -e "s,define _GLIBCXX_EXTERN_TEMPLATE$$, define _GLIBCXX_EXTERN_TEMPLATE $$externtemplate," \ -e "$$ldbl_compat" \ < ${glibcxx_srcdir}/include/bits/c++config > $@ ;\ sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \ Index: libstdc++-v3/include/debug/forward_list =================================================================== --- libstdc++-v3/include/debug/forward_list (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/debug/forward_list (.../branches/gcc-4_7-branch) (wersja 187906) @@ -414,6 +414,10 @@ } void + splice_after(const_iterator __pos, forward_list& __list) + { splice_after(__pos, std::move(__list)); } + + void splice_after(const_iterator __pos, forward_list&& __list, const_iterator __i) { @@ -436,6 +440,11 @@ } void + splice_after(const_iterator __pos, forward_list& __list, + const_iterator __i) + { splice_after(__pos, std::move(__list), __i); } + + void splice_after(const_iterator __pos, forward_list&& __list, const_iterator __before, const_iterator __last) { @@ -481,6 +490,11 @@ } void + splice_after(const_iterator __pos, forward_list& __list, + const_iterator __before, const_iterator __last) + { splice_after(__pos, std::move(__list), __before, __last); } + + void remove(const _Tp& __val) { _Base_iterator __x = _Base::before_begin(); @@ -561,6 +575,10 @@ } } + void + merge(forward_list& __list) + { merge(std::move(__list)); } + template void merge(forward_list&& __list, _Comp __comp) @@ -580,6 +598,11 @@ } } + template + void + merge(forward_list& __list, _Comp __comp) + { merge(std::move(__list), __comp); } + using _Base::sort; using _Base::reverse; @@ -733,8 +756,12 @@ typedef typename _It::iterator_type _BaseIt; static bool - _M_Is(_BaseIt __it, const _Sequence* __seq) + _S_Is(_BaseIt __it, const _Sequence* __seq) { return __it == __seq->_M_base().cbefore_begin(); } + + static bool + _S_Is_Beginnest(_BaseIt __it, const _Sequence* __seq) + { return _S_Is(__it, __seq); } }; } Index: libstdc++-v3/include/debug/safe_iterator.tcc =================================================================== --- libstdc++-v3/include/debug/safe_iterator.tcc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/debug/safe_iterator.tcc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,6 +1,6 @@ // Debugging iterator implementation (out of line) -*- C++ -*- -// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 +// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011, 2012 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -91,10 +91,11 @@ /* We can only test for equality, but check if one of the iterators is at an extreme. */ /* Optim for classic [begin, it) or [it, end) ranges, limit checks - * when code is valid. */ - if (_M_is_begin() || __rhs._M_is_end()) + * when code is valid. Note, for the special case of forward_list, + * before_begin replaces the role of begin. */ + if (_M_is_beginnest() || __rhs._M_is_end()) return true; - if (_M_is_end() || __rhs._M_is_begin()) + if (_M_is_end() || __rhs._M_is_beginnest()) return false; // Assume that this is a valid range; we can't check anything else Index: libstdc++-v3/include/debug/safe_iterator.h =================================================================== --- libstdc++-v3/include/debug/safe_iterator.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/debug/safe_iterator.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,6 +1,6 @@ // Safe iterator implementation -*- C++ -*- -// Copyright (C) 2003, 2004, 2005, 2006, 2009, 2010, 2011 +// Copyright (C) 2003, 2004, 2005, 2006, 2009, 2010, 2011, 2012 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -50,8 +50,12 @@ typedef typename _It::iterator_type _BaseIt; static bool - _M_Is(_BaseIt __it, const _Sequence* __seq) + _S_Is(_BaseIt, const _Sequence*) { return false; } + + static bool + _S_Is_Beginnest(_BaseIt __it, const _Sequence* __seq) + { return __it == __seq->_M_base().begin(); } }; /** Iterators that derive from _Safe_iterator_base but that aren't @@ -169,7 +173,25 @@ ._M_iterator(__x, "other")); } +#ifdef __GXX_EXPERIMENTAL_CXX0X__ /** + * @brief Move construction. + * @post __x is singular and unattached + */ + _Safe_iterator(_Safe_iterator&& __x) : _M_current() + { + _GLIBCXX_DEBUG_VERIFY(!__x._M_singular() + || __x._M_current == _Iterator(), + _M_message(__msg_init_copy_singular) + ._M_iterator(*this, "this") + ._M_iterator(__x, "other")); + std::swap(_M_current, __x._M_current); + this->_M_attach(__x._M_sequence); + __x._M_detach(); + } +#endif + + /** * @brief Converting constructor from a mutable iterator to a * constant iterator. */ @@ -208,7 +230,28 @@ return *this; } +#ifdef __GXX_EXPERIMENTAL_CXX0X__ /** + * @brief Move assignment. + * @post __x is singular and unattached + */ + _Safe_iterator& + operator=(_Safe_iterator&& __x) + { + _GLIBCXX_DEBUG_VERIFY(!__x._M_singular() + || __x._M_current == _Iterator(), + _M_message(__msg_copy_singular) + ._M_iterator(*this, "this") + ._M_iterator(__x, "other")); + _M_current = __x._M_current; + _M_attach(__x._M_sequence); + __x._M_detach(); + __x._M_current = _Iterator(); + return *this; + } +#endif + + /** * @brief Iterator dereference. * @pre iterator is dereferenceable */ @@ -422,7 +465,17 @@ /// Is this iterator equal to the sequence's before_begin() iterator if /// any? bool _M_is_before_begin() const - { return _BeforeBeginHelper<_Sequence>::_M_Is(base(), _M_get_sequence()); } + { + return _BeforeBeginHelper<_Sequence>::_S_Is(base(), _M_get_sequence()); + } + + /// Is this iterator equal to the sequence's before_begin() iterator if + /// any or begin() otherwise? + bool _M_is_beginnest() const + { + return _BeforeBeginHelper<_Sequence>::_S_Is_Beginnest(base(), + _M_get_sequence()); + } }; template Index: libstdc++-v3/include/std/bitset =================================================================== --- libstdc++-v3/include/std/bitset (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/std/bitset (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1377,7 +1377,7 @@ size_t __pos, size_t __n, _CharT __zero, _CharT __one) { reset(); - const size_t __nbits = std::min(_Nb, std::min(__n, __len - __pos)); + const size_t __nbits = std::min(_Nb, std::min(__n, size_t(__len - __pos))); for (size_t __i = __nbits; __i > 0; --__i) { const _CharT __c = __s[__pos + __nbits - __i]; Index: libstdc++-v3/include/std/scoped_allocator =================================================================== --- libstdc++-v3/include/std/scoped_allocator (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/std/scoped_allocator (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2011 Free Software Foundation, Inc. +// Copyright (C) 2011, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -77,7 +77,7 @@ template inline auto - __do_outermost(_Alloc& __a, _Alloc&) -> decltype(__a.outer_allocator()) + __do_outermost(_Alloc& __a, _Alloc*) -> decltype(__a.outer_allocator()) { return __a.outer_allocator(); } template @@ -87,8 +87,8 @@ template inline auto - __outermost(_Alloc& __a) -> decltype(__do_outermost(__a, __a)) - { return __do_outermost(__a, __a); } + __outermost(_Alloc& __a) -> decltype(__do_outermost(__a, &__a)) + { return __do_outermost(__a, &__a); } template class scoped_allocator_adaptor; Index: libstdc++-v3/include/std/array =================================================================== --- libstdc++-v3/include/std/array (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/std/array (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,6 +1,7 @@ // -*- C++ -*- -// Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 +// Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -174,8 +175,9 @@ const_reference at(size_type __n) const { - return __n < _Nm ? - _M_instance[__n] : __throw_out_of_range(__N("array::at")); + if (__n >= _Nm) + std::__throw_out_of_range(__N("array::at")); + return _M_instance[__n]; } #endif Index: libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp =================================================================== --- libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 +// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -188,7 +188,11 @@ __try { while (child_it != p_icp->end()) - a_p_children[child_i++] = recursive_copy_node(*(child_it++)); + { + a_p_children[child_i] = recursive_copy_node(*(child_it)); + child_i++; + child_it++; + } p_ret = s_inode_allocator.allocate(1); } __catch(...) Index: libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_base.hpp =================================================================== --- libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_base.hpp (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_base.hpp (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2005, 2006, 2009, 2011 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 2009, 2011, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -50,7 +50,11 @@ /// Base type for PATRICIA trees. struct pat_trie_base { - /// Three types of nodes. + /** + * @brief Three types of nodes. + * + * i_node is used by _Inode, leaf_node by _Leaf, and head_node by _Head. + */ enum node_type { i_node, Index: libstdc++-v3/include/ext/functional =================================================================== --- libstdc++-v3/include/ext/functional (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/ext/functional (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,6 +1,6 @@ // Functional extensions -*- C++ -*- -// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 +// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2012 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -183,7 +183,13 @@ * @addtogroup SGIextensions */ template - struct identity : public std::_Identity<_Tp> {}; + struct identity +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + : public std::unary_function<_Tp,_Tp>, + public std::_Identity<_Tp> {}; +#else + : public std::_Identity<_Tp> {}; +#endif /** @c select1st and @c select2nd are extensions provided by SGI. Their * @c operator()s @@ -197,11 +203,23 @@ */ /// An \link SGIextensions SGI extension \endlink. template - struct select1st : public std::_Select1st<_Pair> {}; + struct select1st +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + : public std::unary_function<_Pair, typename _Pair::first_type>, + public std::_Select1st<_Pair> {}; +#else + : public std::_Select1st<_Pair> {}; +#endif /// An \link SGIextensions SGI extension \endlink. template - struct select2nd : public std::_Select2nd<_Pair> {}; + struct select2nd +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + : public std::unary_function<_Pair, typename _Pair::second_type>, + public std::_Select2nd<_Pair> {}; +#else + : public std::_Select2nd<_Pair> {}; +#endif /** @} */ // extension documented next Index: libstdc++-v3/include/bits/hashtable.h =================================================================== --- libstdc++-v3/include/bits/hashtable.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/bits/hashtable.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,6 +1,7 @@ // hashtable.h header -*- C++ -*- -// Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 +// Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -596,6 +597,12 @@ // reserve, if present, comes from _Rehash_base. private: + // Helper rehash method used when keys are unique. + void _M_rehash_aux(size_type __n, std::true_type); + + // Helper rehash method used when keys can be non-unique. + void _M_rehash_aux(size_type __n, std::false_type); + // Unconditionally change size of bucket array to n, restore hash policy // state to __state on exception. void _M_rehash(size_type __n, const _RehashPolicyState& __state); @@ -1592,41 +1599,143 @@ { __try { - _Bucket* __new_buckets = _M_allocate_buckets(__n); - _Node* __p = _M_begin(); - _M_before_begin._M_nxt = nullptr; - std::size_t __cur_bbegin_bkt; - while (__p) + _M_rehash_aux(__n, integral_constant()); + } + __catch(...) + { + // A failure here means that buckets allocation failed. We only + // have to restore hash policy previous state. + _M_rehash_policy._M_reset(__state); + __throw_exception_again; + } + } + + // Rehash when there is no equivalent elements. + template + void + _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal, + _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>:: + _M_rehash_aux(size_type __n, std::true_type) + { + _Bucket* __new_buckets = _M_allocate_buckets(__n); + _Node* __p = _M_begin(); + _M_before_begin._M_nxt = nullptr; + std::size_t __bbegin_bkt; + while (__p) + { + _Node* __next = __p->_M_next(); + std::size_t __bkt = _HCBase::_M_bucket_index(__p, __n); + if (!__new_buckets[__bkt]) { - _Node* __next = __p->_M_next(); - std::size_t __new_index = _HCBase::_M_bucket_index(__p, __n); - if (!__new_buckets[__new_index]) + __p->_M_nxt = _M_before_begin._M_nxt; + _M_before_begin._M_nxt = __p; + __new_buckets[__bkt] = &_M_before_begin; + if (__p->_M_nxt) + __new_buckets[__bbegin_bkt] = __p; + __bbegin_bkt = __bkt; + } + else + { + __p->_M_nxt = __new_buckets[__bkt]->_M_nxt; + __new_buckets[__bkt]->_M_nxt = __p; + } + __p = __next; + } + _M_deallocate_buckets(_M_buckets, _M_bucket_count); + _M_bucket_count = __n; + _M_buckets = __new_buckets; + } + + // Rehash when there can be equivalent elements, preserve their relative + // order. + template + void + _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal, + _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>:: + _M_rehash_aux(size_type __n, std::false_type) + { + _Bucket* __new_buckets = _M_allocate_buckets(__n); + + _Node* __p = _M_begin(); + _M_before_begin._M_nxt = nullptr; + std::size_t __bbegin_bkt; + std::size_t __prev_bkt; + _Node* __prev_p = nullptr; + bool __check_bucket = false; + + while (__p) + { + _Node* __next = __p->_M_next(); + std::size_t __bkt = _HCBase::_M_bucket_index(__p, __n); + + if (__prev_p && __prev_bkt == __bkt) + { + // Previous insert was already in this bucket, we insert after + // the previously inserted one to preserve equivalent elements + // relative order. + __p->_M_nxt = __prev_p->_M_nxt; + __prev_p->_M_nxt = __p; + + // Inserting after a node in a bucket require to check that we + // haven't change the bucket last node, in this case next + // bucket containing its before begin node must be updated. We + // schedule a check as soon as we move out of the sequence of + // equivalent nodes to limit the number of checks. + __check_bucket = true; + } + else + { + if (__check_bucket) { + // Check if we shall update the next bucket because of insertions + // into __prev_bkt bucket. + if (__prev_p->_M_nxt) + { + std::size_t __next_bkt + = _HCBase::_M_bucket_index(__prev_p->_M_next(), __n); + if (__next_bkt != __prev_bkt) + __new_buckets[__next_bkt] = __prev_p; + } + __check_bucket = false; + } + if (!__new_buckets[__bkt]) + { __p->_M_nxt = _M_before_begin._M_nxt; _M_before_begin._M_nxt = __p; - __new_buckets[__new_index] = &_M_before_begin; + __new_buckets[__bkt] = &_M_before_begin; if (__p->_M_nxt) - __new_buckets[__cur_bbegin_bkt] = __p; - __cur_bbegin_bkt = __new_index; + __new_buckets[__bbegin_bkt] = __p; + __bbegin_bkt = __bkt; } else { - __p->_M_nxt = __new_buckets[__new_index]->_M_nxt; - __new_buckets[__new_index]->_M_nxt = __p; + __p->_M_nxt = __new_buckets[__bkt]->_M_nxt; + __new_buckets[__bkt]->_M_nxt = __p; } - __p = __next; } - _M_deallocate_buckets(_M_buckets, _M_bucket_count); - _M_bucket_count = __n; - _M_buckets = __new_buckets; + + __prev_p = __p; + __prev_bkt = __bkt; + __p = __next; } - __catch(...) + + if (__check_bucket && __prev_p->_M_nxt) { - // A failure here means that buckets allocation failed. We only - // have to restore hash policy previous state. - _M_rehash_policy._M_reset(__state); - __throw_exception_again; + std::size_t __next_bkt + = _HCBase::_M_bucket_index(__prev_p->_M_next(), __n); + if (__next_bkt != __prev_bkt) + __new_buckets[__next_bkt] = __prev_p; } + + _M_deallocate_buckets(_M_buckets, _M_bucket_count); + _M_bucket_count = __n; + _M_buckets = __new_buckets; } _GLIBCXX_END_NAMESPACE_VERSION Index: libstdc++-v3/include/bits/stl_algobase.h =================================================================== --- libstdc++-v3/include/bits/stl_algobase.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/bits/stl_algobase.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -982,14 +982,26 @@ __lg(int __n) { return sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); } + inline unsigned + __lg(unsigned __n) + { return sizeof(int) * __CHAR_BIT__ - 1 - __builtin_clz(__n); } + inline long __lg(long __n) { return sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); } + inline unsigned long + __lg(unsigned long __n) + { return sizeof(long) * __CHAR_BIT__ - 1 - __builtin_clzl(__n); } + inline long long __lg(long long __n) { return sizeof(long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); } + inline unsigned long long + __lg(unsigned long long __n) + { return sizeof(long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); } + _GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_ALGO Index: libstdc++-v3/include/bits/hashtable_policy.h =================================================================== --- libstdc++-v3/include/bits/hashtable_policy.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/bits/hashtable_policy.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -533,7 +533,9 @@ // Specialization using EBO. template - struct _Hashtable_ebo_helper<_Nm, _Tp, true> : private _Tp + struct _Hashtable_ebo_helper<_Nm, _Tp, true> + // See PR53067. + : public _Tp { _Hashtable_ebo_helper() = default; _Hashtable_ebo_helper(const _Tp& __tp) : _Tp(__tp) @@ -595,8 +597,9 @@ template struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, _Hash, false> - : private _Hashtable_ebo_helper<0, _ExtractKey>, - private _Hashtable_ebo_helper<1, _Hash> + // See PR53067. + : public _Hashtable_ebo_helper<0, _ExtractKey>, + public _Hashtable_ebo_helper<1, _Hash> { private: typedef _Hashtable_ebo_helper<0, _ExtractKey> _EboExtractKey; @@ -669,9 +672,10 @@ typename _H1, typename _H2> struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, _Default_ranged_hash, false> - : private _Hashtable_ebo_helper<0, _ExtractKey>, - private _Hashtable_ebo_helper<1, _H1>, - private _Hashtable_ebo_helper<2, _H2> + // See PR53067. + : public _Hashtable_ebo_helper<0, _ExtractKey>, + public _Hashtable_ebo_helper<1, _H1>, + public _Hashtable_ebo_helper<2, _H2> { private: typedef _Hashtable_ebo_helper<0, _ExtractKey> _EboExtractKey; @@ -748,9 +752,10 @@ typename _H1, typename _H2> struct _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, _Default_ranged_hash, true> - : private _Hashtable_ebo_helper<0, _ExtractKey>, - private _Hashtable_ebo_helper<1, _H1>, - private _Hashtable_ebo_helper<2, _H2> + // See PR53067. + : public _Hashtable_ebo_helper<0, _ExtractKey>, + public _Hashtable_ebo_helper<1, _H1>, + public _Hashtable_ebo_helper<2, _H2> { private: typedef _Hashtable_ebo_helper<0, _ExtractKey> _EboExtractKey; @@ -853,9 +858,10 @@ typename _H1, typename _H2, typename _Hash, bool __cache_hash_code> struct _Hashtable_base + // See PR53067. : public _Hash_code_base<_Key, _Value, _ExtractKey, _H1, _H2, _Hash, __cache_hash_code>, - private _Hashtable_ebo_helper<0, _Equal> + public _Hashtable_ebo_helper<0, _Equal> { private: typedef _Hashtable_ebo_helper<0, _Equal> _EboEqual; @@ -906,7 +912,8 @@ typename _H1, typename _H2, typename _Hash> struct _Local_iterator_base<_Key, _Value, _ExtractKey, _H1, _H2, _Hash, true> - : private _H2 + // See PR53067. + : public _H2 { _Local_iterator_base() = default; _Local_iterator_base(_Hash_node<_Value, true>* __p, @@ -937,8 +944,9 @@ typename _H1, typename _H2, typename _Hash> struct _Local_iterator_base<_Key, _Value, _ExtractKey, _H1, _H2, _Hash, false> - : private _Hash_code_base<_Key, _Value, _ExtractKey, - _H1, _H2, _Hash, false> + // See PR53067. + : public _Hash_code_base<_Key, _Value, _ExtractKey, + _H1, _H2, _Hash, false> { _Local_iterator_base() = default; _Local_iterator_base(_Hash_node<_Value, false>* __p, Index: libstdc++-v3/include/bits/forward_list.h =================================================================== --- libstdc++-v3/include/bits/forward_list.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/bits/forward_list.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +// Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -53,15 +53,6 @@ _Fwd_list_node_base* _M_next; _Fwd_list_node_base* - _M_transfer_after(_Fwd_list_node_base* __begin) - { - _Fwd_list_node_base* __end = __begin; - while (__end && __end->_M_next) - __end = __end->_M_next; - return _M_transfer_after(__begin, __end); - } - - _Fwd_list_node_base* _M_transfer_after(_Fwd_list_node_base* __begin, _Fwd_list_node_base* __end) { @@ -606,8 +597,8 @@ * in the range [@a __first,@a __last). * * Note that the assignment completely changes the %forward_list and - * that the resulting %forward_list's size is the same as the number - * of elements assigned. Old data may be lost. + * that the number of elements of the resulting %forward_list's is the + * same as the number of elements assigned. Old data is lost. */ template void @@ -622,10 +613,10 @@ * @param __n Number of elements to be assigned. * @param __val Value to be assigned. * - * This function fills a %forward_list with @a __n copies of the given - * value. Note that the assignment completely changes the - * %forward_list and that the resulting %forward_list's size is the - * same as the number of elements assigned. Old data may be lost. + * This function fills a %forward_list with @a __n copies of the + * given value. Note that the assignment completely changes the + * %forward_list, and that the resulting %forward_list has __n + * elements. Old data is lost. */ void assign(size_type __n, const _Tp& __val) @@ -744,7 +735,7 @@ { return this->_M_impl._M_head._M_next == 0; } /** - * Returns the largest possible size of %forward_list. + * Returns the largest possible number of elements of %forward_list. */ size_type max_size() const noexcept @@ -926,7 +917,8 @@ * does not invalidate iterators and references. */ iterator - insert_after(const_iterator __pos, std::initializer_list<_Tp> __il); + insert_after(const_iterator __pos, std::initializer_list<_Tp> __il) + { return insert_after(__pos, __il.begin(), __il.end()); } /** * @brief Removes the element pointed to by the iterator following @@ -997,9 +989,9 @@ * * This function will %resize the %forward_list to the specified * number of elements. If the number is smaller than the - * %forward_list's current size the %forward_list is truncated, - * otherwise the %forward_list is extended and the new elements - * are default constructed. + * %forward_list's current number of elements the %forward_list + * is truncated, otherwise the %forward_list is extended and the + * new elements are default constructed. */ void resize(size_type __sz); @@ -1012,9 +1004,9 @@ * * This function will %resize the %forward_list to the specified * number of elements. If the number is smaller than the - * %forward_list's current size the %forward_list is truncated, - * otherwise the %forward_list is extended and new elements are - * populated with given data. + * %forward_list's current number of elements the %forward_list + * is truncated, otherwise the %forward_list is extended and new + * elements are populated with given data. */ void resize(size_type __sz, const value_type& __val); @@ -1048,9 +1040,13 @@ splice_after(const_iterator __pos, forward_list&& __list) { if (!__list.empty()) - _M_splice_after(__pos, std::move(__list)); + _M_splice_after(__pos, __list.before_begin(), __list.end()); } + void + splice_after(const_iterator __pos, forward_list& __list) + { splice_after(__pos, std::move(__list)); } + /** * @brief Insert element from another %forward_list. * @param __pos Iterator referencing the element to insert after. @@ -1063,16 +1059,13 @@ */ void splice_after(const_iterator __pos, forward_list&& __list, + const_iterator __i); + + void + splice_after(const_iterator __pos, forward_list& __list, const_iterator __i) - { - const_iterator __j = __i; - ++__j; - if (__pos == __i || __pos == __j) - return; + { splice_after(__pos, std::move(__list), __i); } - splice_after(__pos, std::move(__list), __i, __j); - } - /** * @brief Insert range from another %forward_list. * @param __pos Iterator referencing the element to insert after. @@ -1087,9 +1080,15 @@ * Undefined if @a __pos is in (__before,__last). */ void - splice_after(const_iterator __pos, forward_list&& __list, - const_iterator __before, const_iterator __last); + splice_after(const_iterator __pos, forward_list&&, + const_iterator __before, const_iterator __last) + { _M_splice_after(__pos, __before, __last); } + void + splice_after(const_iterator __pos, forward_list&, + const_iterator __before, const_iterator __last) + { _M_splice_after(__pos, __before, __last); } + /** * @brief Remove all elements equal to value. * @param __val The value to remove. @@ -1131,7 +1130,7 @@ */ void unique() - { this->unique(std::equal_to<_Tp>()); } + { unique(std::equal_to<_Tp>()); } /** * @brief Remove consecutive elements satisfying a predicate. @@ -1160,8 +1159,12 @@ */ void merge(forward_list&& __list) - { this->merge(std::move(__list), std::less<_Tp>()); } + { merge(std::move(__list), std::less<_Tp>()); } + void + merge(forward_list& __list) + { merge(std::move(__list)); } + /** * @brief Merge sorted lists according to comparison function. * @param __list Sorted list to merge. @@ -1177,6 +1180,11 @@ void merge(forward_list&& __list, _Comp __comp); + template + void + merge(forward_list& __list, _Comp __comp) + { merge(std::move(__list), __comp); } + /** * @brief Sort the elements of the list. * @@ -1185,7 +1193,7 @@ */ void sort() - { this->sort(std::less<_Tp>()); } + { sort(std::less<_Tp>()); } /** * @brief Sort the forward_list using a comparison function. @@ -1225,7 +1233,8 @@ // Called by splice_after and insert_after. iterator - _M_splice_after(const_iterator __pos, forward_list&& __list); + _M_splice_after(const_iterator __pos, const_iterator __before, + const_iterator __last); // Called by forward_list(n). void @@ -1240,11 +1249,11 @@ * @brief Forward list equality comparison. * @param __lx A %forward_list * @param __ly A %forward_list of the same type as @a __lx. - * @return True iff the size and elements of the forward lists are equal. + * @return True iff the elements of the forward lists are equal. * - * This is an equivalence relation. It is linear in the size of the - * forward lists. Deques are considered equivalent if corresponding - * elements compare equal. + * This is an equivalence relation. It is linear in the number of + * elements of the forward lists. Deques are considered equivalent + * if corresponding elements compare equal. */ template bool @@ -1257,8 +1266,9 @@ * @param __ly A %forward_list of the same type as @a __lx. * @return True iff @a __lx is lexicographically less than @a __ly. * - * This is a total ordering relation. It is linear in the size of the - * forward lists. The elements must be comparable with @c <. + * This is a total ordering relation. It is linear in the number of + * elements of the forward lists. The elements must be comparable + * with @c <. * * See std::lexicographical_compare() for how the determination is made. */ Index: libstdc++-v3/include/bits/stl_vector.h =================================================================== --- libstdc++-v3/include/bits/stl_vector.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/bits/stl_vector.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -419,36 +419,18 @@ * @brief %Vector move assignment operator. * @param __x A %vector of identical element and allocator types. * - * The contents of @a __x are moved into this %vector (without copying). + * The contents of @a __x are moved into this %vector (without copying, + * if the allocators permit it). * @a __x is a valid, but unspecified %vector. */ vector& operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move()) { - if (_Alloc_traits::_S_propagate_on_move_assign()) - { - // We're moving the rvalue's allocator so can move the data too. - const vector __tmp(std::move(*this)); // discard existing data - this->_M_impl._M_swap_data(__x._M_impl); - std::__alloc_on_move(_M_get_Tp_allocator(), - __x._M_get_Tp_allocator()); - } - else if (_Alloc_traits::_S_always_equal() - || __x._M_get_Tp_allocator() == this->_M_get_Tp_allocator()) - { - // The rvalue's allocator can free our storage and vice versa, - // so can swap the data storage after destroying our contents. - this->clear(); - this->_M_impl._M_swap_data(__x._M_impl); - } - else - { - // The rvalue's allocator cannot be moved, or is not equal, - // so we need to individually move each element. - this->assign(std::__make_move_if_noexcept_iterator(__x.begin()), - std::__make_move_if_noexcept_iterator(__x.end())); - __x.clear(); - } + constexpr bool __move_storage = + _Alloc_traits::_S_propagate_on_move_assign() + || _Alloc_traits::_S_always_equal(); + _M_move_assign(std::move(__x), + integral_constant()); return *this; } @@ -1337,6 +1319,39 @@ std::_Destroy(__pos, this->_M_impl._M_finish, _M_get_Tp_allocator()); this->_M_impl._M_finish = __pos; } + +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + private: + // Constant-time move assignment when source object's memory can be + // moved, either because the source's allocator will move too + // or because the allocators are equal. + void + _M_move_assign(vector&& __x, std::true_type) noexcept + { + const vector __tmp(std::move(*this)); + this->_M_impl._M_swap_data(__x._M_impl); + if (_Alloc_traits::_S_propagate_on_move_assign()) + std::__alloc_on_move(_M_get_Tp_allocator(), + __x._M_get_Tp_allocator()); + } + + // Do move assignment when it might not be possible to move source + // object's memory, resulting in a linear-time operation. + void + _M_move_assign(vector&& __x, std::false_type) + { + if (__x._M_get_Tp_allocator() == this->_M_get_Tp_allocator()) + _M_move_assign(std::move(__x), std::true_type()); + else + { + // The rvalue's allocator cannot be moved and is not equal, + // so we need to individually move each element. + this->assign(std::__make_move_if_noexcept_iterator(__x.begin()), + std::__make_move_if_noexcept_iterator(__x.end())); + __x.clear(); + } + } +#endif }; Index: libstdc++-v3/include/bits/ptr_traits.h =================================================================== --- libstdc++-v3/include/bits/ptr_traits.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/bits/ptr_traits.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -140,14 +140,8 @@ /// Type used to represent the difference between two pointers typedef typename __ptrtr_diff_type<_Ptr>::__type difference_type; - private: template using rebind = typename __ptrtr_rebind<_Ptr, _Up>::__type; - - // allocator_traits needs to use __rebind - template friend struct allocator_traits; - template friend struct pointer_traits; - template friend class __ptrtr_rebind_helper2; }; /** Index: libstdc++-v3/include/bits/stl_algo.h =================================================================== --- libstdc++-v3/include/bits/stl_algo.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/bits/stl_algo.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -244,7 +244,6 @@ } } -#ifdef __GXX_EXPERIMENTAL_CXX0X__ /// This is an overload used by find_if_not() for the Input Iterator case. template inline _InputIterator @@ -303,8 +302,30 @@ return __last; } } -#endif + /// Provided for stable_partition to use. + template + inline _InputIterator + __find_if_not(_InputIterator __first, _InputIterator __last, + _Predicate __pred) + { + return std::__find_if_not(__first, __last, __pred, + std::__iterator_category(__first)); + } + + /// Like find_if_not(), but uses and updates a count of the + /// remaining range length instead of comparing against an end + /// iterator. + template + _InputIterator + __find_if_not_n(_InputIterator __first, _Distance& __len, _Predicate __pred) + { + for (; __len; --__len, ++__first) + if (!bool(__pred(*__first))) + break; + return __first; + } + // set_difference // set_intersection // set_symmetric_difference @@ -789,8 +810,7 @@ __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate, typename iterator_traits<_InputIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); - return std::__find_if_not(__first, __last, __pred, - std::__iterator_category(__first)); + return std::__find_if_not(__first, __last, __pred); } /** @@ -1784,30 +1804,39 @@ // partition /// This is a helper function... + /// Requires __len != 0 and !__pred(*__first), + /// same as __stable_partition_adaptive. template _ForwardIterator __inplace_stable_partition(_ForwardIterator __first, - _ForwardIterator __last, _Predicate __pred, _Distance __len) { if (__len == 1) - return __pred(*__first) ? __last : __first; + return __first; _ForwardIterator __middle = __first; std::advance(__middle, __len / 2); - _ForwardIterator __begin = std::__inplace_stable_partition(__first, - __middle, - __pred, - __len / 2); - _ForwardIterator __end = std::__inplace_stable_partition(__middle, __last, - __pred, - __len - - __len / 2); - std::rotate(__begin, __middle, __end); - std::advance(__begin, std::distance(__middle, __end)); - return __begin; + _ForwardIterator __left_split = + std::__inplace_stable_partition(__first, __pred, __len / 2); + // Advance past true-predicate values to satisfy this + // function's preconditions. + _Distance __right_len = __len - __len / 2; + _ForwardIterator __right_split = + std::__find_if_not_n(__middle, __right_len, __pred); + if (__right_len) + __right_split = std::__inplace_stable_partition(__middle, + __pred, + __right_len); + std::rotate(__left_split, __middle, __right_split); + std::advance(__left_split, std::distance(__middle, __right_split)); + return __left_split; } /// This is a helper function... + /// Requires __first != __last and !__pred(*__first) + /// and __len == distance(__first, __last). + /// + /// !__pred(*__first) allows us to guarantee that we don't + /// move-assign an element onto itself. template _ForwardIterator @@ -1821,6 +1850,12 @@ { _ForwardIterator __result1 = __first; _Pointer __result2 = __buffer; + // The precondition guarantees that !__pred(*__first), so + // move that element to the buffer before starting the loop. + // This ensures that we only call __pred once per element. + *__result2 = _GLIBCXX_MOVE(*__first); + ++__result2; + ++__first; for (; __first != __last; ++__first) if (__pred(*__first)) { @@ -1839,17 +1874,23 @@ { _ForwardIterator __middle = __first; std::advance(__middle, __len / 2); - _ForwardIterator __begin = + _ForwardIterator __left_split = std::__stable_partition_adaptive(__first, __middle, __pred, __len / 2, __buffer, __buffer_size); - _ForwardIterator __end = - std::__stable_partition_adaptive(__middle, __last, __pred, - __len - __len / 2, - __buffer, __buffer_size); - std::rotate(__begin, __middle, __end); - std::advance(__begin, std::distance(__middle, __end)); - return __begin; + // Advance past true-predicate values to satisfy this + // function's preconditions. + _Distance __right_len = __len - __len / 2; + _ForwardIterator __right_split = + std::__find_if_not_n(__middle, __right_len, __pred); + if (__right_len) + __right_split = + std::__stable_partition_adaptive(__right_split, __last, __pred, + __right_len, + __buffer, __buffer_size); + std::rotate(__left_split, __middle, __right_split); + std::advance(__left_split, std::distance(__middle, __right_split)); + return __left_split; } } @@ -1882,6 +1923,8 @@ typename iterator_traits<_ForwardIterator>::value_type>) __glibcxx_requires_valid_range(__first, __last); + __first = std::__find_if_not(__first, __last, __pred); + if (__first == __last) return __first; else @@ -1901,7 +1944,7 @@ _DistanceType(__buf.size())); else return - std::__inplace_stable_partition(__first, __last, __pred, + std::__inplace_stable_partition(__first, __pred, _DistanceType(__buf.requested_size())); } } Index: libstdc++-v3/include/bits/forward_list.tcc =================================================================== --- libstdc++-v3/include/bits/forward_list.tcc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/bits/forward_list.tcc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -225,22 +225,37 @@ template typename forward_list<_Tp, _Alloc>::iterator forward_list<_Tp, _Alloc>:: - _M_splice_after(const_iterator __pos, forward_list&& __list) + _M_splice_after(const_iterator __pos, + const_iterator __before, const_iterator __last) { _Node_base* __tmp = const_cast<_Node_base*>(__pos._M_node); - iterator __before = __list.before_begin(); - return iterator(__tmp->_M_transfer_after(__before._M_node)); + _Node_base* __b = const_cast<_Node_base*>(__before._M_node); + _Node_base* __end = __b; + + while (__end && __end->_M_next != __last._M_node) + __end = __end->_M_next; + + if (__b != __end) + return iterator(__tmp->_M_transfer_after(__b, __end)); + else + return iterator(__tmp); } template void forward_list<_Tp, _Alloc>:: splice_after(const_iterator __pos, forward_list&&, - const_iterator __before, const_iterator __last) + const_iterator __i) { + const_iterator __j = __i; + ++__j; + + if (__pos == __i || __pos == __j) + return; + _Node_base* __tmp = const_cast<_Node_base*>(__pos._M_node); - __tmp->_M_transfer_after(const_cast<_Node_base*>(__before._M_node), - const_cast<_Node_base*>(__last._M_node)); + __tmp->_M_transfer_after(const_cast<_Node_base*>(__i._M_node), + const_cast<_Node_base*>(__j._M_node)); } template @@ -251,7 +266,7 @@ if (__n) { forward_list __tmp(__n, __val, get_allocator()); - return _M_splice_after(__pos, std::move(__tmp)); + return _M_splice_after(__pos, __tmp.before_begin(), __tmp.end()); } else return iterator(const_cast<_Node_base*>(__pos._M_node)); @@ -266,26 +281,12 @@ { forward_list __tmp(__first, __last, get_allocator()); if (!__tmp.empty()) - return _M_splice_after(__pos, std::move(__tmp)); + return _M_splice_after(__pos, __tmp.before_begin(), __tmp.end()); else return iterator(const_cast<_Node_base*>(__pos._M_node)); } template - typename forward_list<_Tp, _Alloc>::iterator - forward_list<_Tp, _Alloc>:: - insert_after(const_iterator __pos, std::initializer_list<_Tp> __il) - { - if (__il.size()) - { - forward_list __tmp(__il, get_allocator()); - return _M_splice_after(__pos, std::move(__tmp)); - } - else - return iterator(const_cast<_Node_base*>(__pos._M_node)); - } - - template void forward_list<_Tp, _Alloc>:: remove(const _Tp& __val) Index: libstdc++-v3/include/bits/shared_ptr_base.h =================================================================== --- libstdc++-v3/include/bits/shared_ptr_base.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/bits/shared_ptr_base.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -343,6 +343,8 @@ _Sp_counted_deleter(_Ptr __p, _Deleter __d, const _Alloc& __a) : _M_ptr(__p), _M_del(__d, __a) { } + ~_Sp_counted_deleter() noexcept { } + virtual void _M_dispose() noexcept { _M_del._M_del(_M_ptr); } @@ -401,6 +403,8 @@ std::forward<_Args>(__args)...); // might throw } + ~_Sp_counted_ptr_inplace() noexcept { } + virtual void _M_dispose() noexcept { allocator_traits<_Alloc>::destroy(_M_impl, _M_impl._M_ptr); } Index: libstdc++-v3/include/bits/deque.tcc =================================================================== --- libstdc++-v3/include/bits/deque.tcc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/bits/deque.tcc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,7 +1,7 @@ // Deque implementation (out of line) -*- C++ -*- // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, -// 2009, 2010, 2011 +// 2009, 2010, 2011, 2012 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -175,12 +175,12 @@ { if (__position._M_cur == this->_M_impl._M_start._M_cur) { - push_front(std::forward<_Args>(__args)...); + emplace_front(std::forward<_Args>(__args)...); return this->_M_impl._M_start; } else if (__position._M_cur == this->_M_impl._M_finish._M_cur) { - push_back(std::forward<_Args>(__args)...); + emplace_back(std::forward<_Args>(__args)...); iterator __tmp = this->_M_impl._M_finish; --__tmp; return __tmp; Index: libstdc++-v3/include/bits/random.tcc =================================================================== --- libstdc++-v3/include/bits/random.tcc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/bits/random.tcc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -730,40 +730,65 @@ independent_bits_engine<_RandomNumberEngine, __w, _UIntType>:: operator()() { - const long double __r = static_cast(_M_b.max()) - - static_cast(_M_b.min()) + 1.0L; - const result_type __m = std::log(__r) / std::log(2.0L); - result_type __n, __n0, __y0, __y1, __s0, __s1; + typedef typename _RandomNumberEngine::result_type _Eresult_type; + const _Eresult_type __r + = (_M_b.max() - _M_b.min() < std::numeric_limits<_Eresult_type>::max() + ? _M_b.max() - _M_b.min() + 1 : 0); + const unsigned __edig = std::numeric_limits<_Eresult_type>::digits; + const unsigned __m = __r ? std::__lg(__r) : __edig; + + typedef typename std::common_type<_Eresult_type, result_type>::type + __ctype; + const unsigned __cdig = std::numeric_limits<__ctype>::digits; + + unsigned __n, __n0; + __ctype __s0, __s1, __y0, __y1; + for (size_t __i = 0; __i < 2; ++__i) { __n = (__w + __m - 1) / __m + __i; __n0 = __n - __w % __n; - const result_type __w0 = __w / __n; - const result_type __w1 = __w0 + 1; - __s0 = result_type(1) << __w0; - __s1 = result_type(1) << __w1; - __y0 = __s0 * (__r / __s0); - __y1 = __s1 * (__r / __s1); - if (__r - __y0 <= __y0 / __n) + const unsigned __w0 = __w / __n; // __w0 <= __m + + __s0 = 0; + __s1 = 0; + if (__w0 < __cdig) + { + __s0 = __ctype(1) << __w0; + __s1 = __s0 << 1; + } + + __y0 = 0; + __y1 = 0; + if (__r) + { + __y0 = __s0 * (__r / __s0); + if (__s1) + __y1 = __s1 * (__r / __s1); + + if (__r - __y0 <= __y0 / __n) + break; + } + else break; } result_type __sum = 0; for (size_t __k = 0; __k < __n0; ++__k) { - result_type __u; + __ctype __u; do __u = _M_b() - _M_b.min(); - while (__u >= __y0); - __sum = __s0 * __sum + __u % __s0; + while (__y0 && __u >= __y0); + __sum = __s0 * __sum + (__s0 ? __u % __s0 : __u); } for (size_t __k = __n0; __k < __n; ++__k) { - result_type __u; + __ctype __u; do __u = _M_b() - _M_b.min(); - while (__u >= __y1); - __sum = __s1 * __sum + __u % __s1; + while (__y1 && __u >= __y1); + __sum = __s1 * __sum + (__s1 ? __u % __s1 : __u); } return __sum; } @@ -840,12 +865,11 @@ operator()(_UniformRandomNumberGenerator& __urng, const param_type& __param) { - typedef typename std::make_unsigned::type __urngtype; + typedef typename _UniformRandomNumberGenerator::result_type + _Gresult_type; typedef typename std::make_unsigned::type __utype; - typedef typename std::conditional<(sizeof(__urngtype) - > sizeof(__utype)), - __urngtype, __utype>::type __uctype; + typedef typename std::common_type<_Gresult_type, __utype>::type + __uctype; const __uctype __urngmin = __urng.min(); const __uctype __urngmax = __urng.max(); @@ -2765,7 +2789,7 @@ : (__n - 1) / 2; const size_t __p = (__n - __t) / 2; const size_t __q = __p + __t; - const size_t __m = std::max(__s + 1, __n); + const size_t __m = std::max(size_t(__s + 1), __n); for (size_t __k = 0; __k < __m; ++__k) { Index: libstdc++-v3/include/bits/stl_function.h =================================================================== --- libstdc++-v3/include/bits/stl_function.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/bits/stl_function.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,6 +1,7 @@ // Functor implementations -*- C++ -*- -// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, +// 2011, 2012 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -471,7 +472,12 @@ /** @} */ template - struct _Identity : public unary_function<_Tp,_Tp> + struct _Identity +#ifndef __GXX_EXPERIMENTAL_CXX0X__ + // unary_function itself is deprecated in C++11 and deriving from + // it can even be a nuisance (see PR 52942). + : public unary_function<_Tp,_Tp> +#endif { _Tp& operator()(_Tp& __x) const @@ -483,8 +489,10 @@ }; template - struct _Select1st : public unary_function<_Pair, - typename _Pair::first_type> + struct _Select1st +#ifndef __GXX_EXPERIMENTAL_CXX0X__ + : public unary_function<_Pair, typename _Pair::first_type> +#endif { typename _Pair::first_type& operator()(_Pair& __x) const @@ -508,8 +516,10 @@ }; template - struct _Select2nd : public unary_function<_Pair, - typename _Pair::second_type> + struct _Select2nd +#ifndef __GXX_EXPERIMENTAL_CXX0X__ + : public unary_function<_Pair, typename _Pair::second_type> +#endif { typename _Pair::second_type& operator()(_Pair& __x) const Index: libstdc++-v3/include/Makefile.am =================================================================== --- libstdc++-v3/include/Makefile.am (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/include/Makefile.am (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,7 +1,7 @@ ## Makefile for the include subdirectory of the GNU C++ Standard library. ## ## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -## 2011 +## 2011, 2012 ## Free Software Foundation, Inc. ## ## This file is part of the libstdc++ version 3 distribution. @@ -1105,7 +1105,7 @@ sed -e "s,define __GLIBCXX__,define __GLIBCXX__ $$date," \ -e "s,define _GLIBCXX_INLINE_VERSION, define _GLIBCXX_INLINE_VERSION $$ns_version," \ -e "s,define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY, define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY $$visibility," \ - -e "s,define _GLIBCXX_EXTERN_TEMPLATE, define _GLIBCXX_EXTERN_TEMPLATE $$externtemplate," \ + -e "s,define _GLIBCXX_EXTERN_TEMPLATE$$, define _GLIBCXX_EXTERN_TEMPLATE $$externtemplate," \ -e "$$ldbl_compat" \ < ${glibcxx_srcdir}/include/bits/c++config > $@ ;\ sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \ Index: libstdc++-v3/ChangeLog =================================================================== --- libstdc++-v3/ChangeLog (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/ChangeLog (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,3 +1,279 @@ +2012-05-10 DJ Delorie + + * include/bits/random.tcc (seed_seq::generate): Cast max() + operands to size_t to ensure a template match. + * include/std/bitset (_M_copy_from_ptr): Cast min() operands to + size_t to ensure a template match. + +2012-05-02 Paolo Carlini + + PR libstdc++/53193 + * testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust + dg-error line number. + +2012-05-01 François Dumont + + PR libstdc++/53115 + * include/bits/hashtable.h + (_Hashtable<>::_M_rehash_aux(size_type, false_type)): Fix buckets + after insertion of several equivalent elements. + * testsuite/23_containers/unordered_multiset/insert/53115.cc: New. + * testsuite/23_containers/unordered_multimap/insert/53115.cc: New. + +2012-04-30 Andreas Tobler + + Backport from mainline + 2012-03-21 Andreas Tobler + + * testsuite/23_containers/vector/bool/modifiers/insert/31370.cc: + Skip this test on powerpc64-*-freebsd*. + +2012-04-25 Jonathan Wakely + + * include/std/scoped_allocator (scoped_allocator::__outermost): Do + not pass non-POD to varargs function. + * testsuite/20_util/scoped_allocator/1.cc: Fix test. + +2012-04-23 Chris Jefferson + + PR testsuite/53046 + * testsuite/25_algorithms/stable_partition/mem_check.cc: Fix size + of array A. + * testsuite/25_algorithms/stable_sort/mem_check.cc: Likewise. + +2012-04-22 Paolo Carlini + + PR libstdc++/53067 + * include/bits/hashtable_policy.h: Change inheritances to public. + * testsuite/23_containers/unordered_map/requirements/53067.cc: New. + * testsuite/23_containers/unordered_set/requirements/53067.cc: Likewise. + +2012-04-22 Jonathan Wakely + + PR libstdc++/53027 + * include/bits/ptr_traits.h (pointer_traits::rebind): Make public. + * testsuite/20_util/pointer_traits/requirements/typedefs.cc: Check + rebind works. + +2012-04-21 Alan Modra + + PR libstdc++/52839 + * acinclude.m4 (_GLIBCXX_ATOMIC_BUILTINS): Do not depend on + glibcxx_cv_atomic_long_long. + * configure: Regenerate. + +2012-04-16 Bernhard Reutner-Fischer + + PR bootstrap/52840 + * src/Makefile.am (build-debug): Do not adjust vpath dir, remove + Makefile.tmp + * src/Makefile.in: Adjust as per above. + +2012-04-16 Benjamin Kosnik + + PR libstdc++/52689 + * libsupc++/Makefile.am (LTCXXCOMPILE, CXXLINK): Tweak. + * libsupc++/Makefile.in: Regenerated. + * src/Makefile.am (LTCXXCOMPILE, CXXLINK): Tweak. + (libstdc___la_SOURCES): Add in compatiblity files, with content + that varies with -DPIC. + * src/Makefile.in: Regenerated. + * src/c++11/Makefile.am (LTCXXCOMPILE, CXXLINK): Tweak. + * src/c++11/Makefile.in: Regenerated. + * src/c++11/compatibility-atomic-c++0x.cc: Guard with PIC. + * src/c++11/compatibility-c++0x.cc: Same. + * src/c++11/future.cc: Consolidate compatibility bits into.. + * src/c++11/mutex.cc: Consolidate compatibility bits into.. + * src/c++11/compatibility-thread-cxx0x.cc: ...here. New. + * src/c++98/Makefile.am (LTCXXCOMPILE, CXXLINK): Tweak. + * src/c++98/Makefile.in: Regenerated. + * src/c++98/compatibility-list-2.cc: Guard with PIC. + * src/c++98/compatibility.cc: Tweak comments. + +2012-04-16 Benjamin Kosnik + + * include/ext/pb_ds/detail/pat_trie_/ + constructors_destructor_fn_imps.hpp: Increment after recursion. + * include/ext/pb_ds/detail/pat_trie_/pat_trie_base.hpp: Convert + node_type markup from brief. + +2012-04-14 Paolo Carlini + + PR libstdc++/52699 + * include/bits/random.tcc (independent_bits_engine<>::operator()()) + Avoid various overflows; use common_type on result_type and + _RandomNumberEngine::result_type; avoid floating point computations; + other smaller tweaks. + + * include/bits/random.tcc (uniform_int_distribution<>::operator()) + Use common_type; assume _UniformRandomNumberGenerator::result_type + unsigned; tidy. + + * include/bits/stl_algobase.h (__lg(unsigned), __lg(unsigned long), + __lg(unsigned long long)): Add. + +2012-04-13 Paolo Carlini + + * include/debug/safe_iterator.h (_BeforeBeginHelper<>:: + _S_Is_Beginnest): Add. + * include/debug/forward_list (_BeforeBeginHelper<>:: + _S_Is_Beginnest): Likewise. + (_Safe_iterator<>::_M_is_beginnest): Add. + * include/debug/safe_iterator.tcc (_Safe_iterator<>::_M_valid_range): + Use the latter. + * testsuite/23_containers/forward_list/debug/splice_after.cc: + Add test. + +2012-04-12 Paolo Carlini + + * include/bits/forward_list.h (splice_after(const_iterator, + forward_list&), splice_after(const_iterator, forward_list&, + consst_iterator), splice_after(const_iterator, forward_list&, + const_iterator, const_iterator), merge(forward_list&), + merge(forward_list&, _Comp)): Add per C++11 as published (and + LWG 1310). + * include/debug/forward_list: Adjust. + + * include/bits/forward_list.h (splice_after(const_iterator, + forward_list&&, const_iterator)): Only declare. + (_M_transfer_after): Remove. + (_M_splice_after(const_iterator, forward_list&&)): Change signature. + (splice_after(const_iterator, forward_list&&, const_iterator, + const_iterator)): Use the latter. + * include/bits/forward_list.tcc (splice_after(const_iterator, + forward_list&&, const_iterator)): Define here. + (_M_splice_after): Define, use throughout. + + * include/bits/forward_list.h (insert_after(const_iterator, + std::initializer_list<_Tp>)): Forward to insert_after(const_iterator, + _InputIterator, _InputIterator). + * include/bits/forward_list.tcc: Remove definition. + + * testsuite/23_containers/forward_list/modifiers/6.cc: New. + * testsuite/23_containers/forward_list/operations/1.cc: Adjust. + + * testsuite/23_containers/forward_list/requirements/dr438/ + assign_neg.cc: Adjust dg-error line number. + * testsuite/23_containers/forward_list/requirements/dr438/ + insert_neg.cc: Likewise. + * testsuite/23_containers/forward_list/requirements/dr438/ + constructor_1_neg.cc: Likewise. + * testsuite/23_containers/forward_list/requirements/dr438/ + constructor_2_neg.cc: Likewise. + +2012-04-12 Jeffrey Yasskin + + PR libstdc++/52822 + * include/bits/stl_algo.h (__find_if_not): Expose in C++98 mode. + (__find_if_not_n): Like __find_if_not, but works on and updates a + counted range instead of a bounded range. + (stable_partition): Guarantee !__pred(*__first) in call to + __stable_partition_adaptive() or __inplace_stable_partition(). + (__stable_partition_adaptive): Use new precondition to avoid + moving/copying objects onto themselves. Guarantee new + precondition to recursive calls. + (__inplace_stable_partition): Use new precondition to simplify + base case, remove __last parameter. Guarantee new precondition to + recursive calls. + * testsuite/25_algorithms/stable_partition/moveable.cc (test02): + Test a sequence that starts with a value matching the predicate. + * testsuite/25_algorithms/stable_partition/pr52822.cc: Test + vectors, which have a destructive self-move-assignment. + +2012-04-12 Paolo Carlini + + PR libstdc++/52942 + * include/bits/stl_function.h (_Identity, _Select1st, _Select2nd): + In C++11 mode do not derive from std::unary_function. + * include/ext/functional (identity, select1st, select2nd): Adjust. + * testsuite/23_containers/unordered_map/requirements/52942.cc: New. + * testsuite/23_containers/unordered_set/requirements/52942.cc: Likewise. + +2012-04-11 Jonathan Wakely + + PR libstdc++/52924 + * include/bits/shared_ptr_base.h (_Sp_counted_deleter): Add + user-defined destructor. + (_Sp_counted_inplace): Likewise. + * testsuite/20_util/shared_ptr/cons/52924.cc: New. + * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust dg-error + line numbers. + +2012-04-11 Jonathan Wakely + + * testsuite/performance/30_threads/future/polling.cc: Adjust. + +2012-04-11 Jonathan Wakely + + PR libstdc++/52591 + * include/bits/stl_vector.h (vector::operator=(vector&&)): Dispatch + to _M_move_assign depending on whether allocator is moved. + (vector::_M_move_assign): Add overloaded functions. + * testsuite/23_containers/vector/52591.cc: New. + * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: + Adjust dg-error line number. + * testsuite/23_containers/vector/requirements/dr438/ + constructor_1_neg.cc: + Likewise. + * testsuite/23_containers/vector/requirements/dr438/ + constructor_2_neg.cc: + Likewise. + * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: + Likewise. + +2012-04-09 François Dumont + + PR libstdc++/52476 + * include/bits/hashtable.h (_Hashtable<>::_M_rehash_aux): Add. + (_Hashtable<>::_M_rehash): Use the latter. + * testsuite/23_containers/unordered_multimap/insert/52476.cc: New. + * testsuite/23_containers/unordered_multiset/insert/52476.cc: New. + +2012-04-09 Terry Guo + + Backport from mainline + 2012-03-28 Terry Guo + + * testsuite/Makefile.am (TEST_GCC_EXEC_PREFIX): New. + * testsuite/Makefile.in: Regenerated. + +2012-03-30 Jeffrey Yasskin + Paolo Carlini + + PR libstdc++/52799 + * include/bits/deque.tcc (emplace): Fix thinko, replace push_front + -> emplace_front, and likewise for *_back. + * testsuite/23_containers/deque/modifiers/emplace/52799.cc: New. + * testsuite/23_containers/list/modifiers/emplace/52799.cc: Likewise. + * testsuite/23_containers/vector/modifiers/emplace/52799.cc: Likewise. + +2012-03-23 David S. Miller + + * config/abi/post/sparc-linux-gnu/baseline_symbols.txt: Update. + +2012-03-23 Paolo Carlini + + * include/bits/forward_list.h: Fix comments. + +2012-03-23 Paweł Sikora + + PR libstdc++/52540 + * include/Makefile.am (c++config.h): Fix sed rule to not break + the _GLIBCXX_EXTERN_TEMPLATE redefinition. + * include/Makefile.in: Regenerate. + +2012-03-22 Jonathan Wakely + + PR libstdc++/52433 + * include/debug/safe_iterator.h (_Safe_iterator): Add move + constructor and move assignment operator. + * testsuite/23_containers/vector/debug/52433.cc: New. + +2012-03-22 Paolo Carlini + + * include/std/array (array<>::at(size_type) const): Fix version + for undefined __EXCEPTIONS. + 2012-03-22 Release Manager * GCC 4.7.0 released. Index: libstdc++-v3/libsupc++/Makefile.in =================================================================== --- libstdc++-v3/libsupc++/Makefile.in (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/libsupc++/Makefile.in (.../branches/gcc-4_7-branch) (wersja 187906) @@ -344,15 +344,15 @@ # 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a noinst_LTLIBRARIES = libsupc++convenience.la std_HEADERS = \ - cxxabi.h exception initializer_list new typeinfo + cxxabi.h exception initializer_list new typeinfo bits_HEADERS = \ atomic_lockfree_defines.h cxxabi_forced.h \ - exception_defines.h exception_ptr.h hash_bytes.h nested_exception.h + exception_defines.h exception_ptr.h hash_bytes.h nested_exception.h headers = $(std_HEADERS) $(bits_HEADERS) @GLIBCXX_HOSTED_TRUE@c_sources = \ -@GLIBCXX_HOSTED_TRUE@ cp-demangle.c +@GLIBCXX_HOSTED_TRUE@ cp-demangle.c sources = \ array_type_info.cc \ @@ -404,7 +404,7 @@ vmi_class_type_info.cc \ vterminate.cc -libsupc___la_SOURCES = $(sources) $(c_sources) +libsupc___la_SOURCES = $(sources) $(c_sources) libsupc__convenience_la_SOURCES = $(sources) $(c_sources) # AM_CXXFLAGS needs to be in each subdirectory so that it can be @@ -415,9 +415,7 @@ AM_CXXFLAGS = \ $(PIC_CXXFLAGS) \ $(XTEMPLATE_FLAGS) \ - $(WARN_CXXFLAGS) \ - $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) + $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) AM_MAKEFLAGS = \ "gxx_include_dir=$(gxx_include_dir)" @@ -435,7 +433,7 @@ # LTCOMPILE is copied from LTCXXCOMPILE below. LTCOMPILE = $(LIBTOOL) --tag CC --tag disable-shared $(LIBTOOLFLAGS) --mode=compile \ $(CC) $(DEFS) $(C_INCLUDES) $(PIC_CXXFLAGS) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) # Libtool notes @@ -459,9 +457,11 @@ # # We have to put --tag disable-shared after --tag CXX lest things # CXX undo the affect of disable-shared. -LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \ - --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) @@ -471,9 +471,11 @@ # course is problematic at this point. So, we get the top-level # directory to configure libstdc++-v3 to use gcc as the C++ # compilation driver. -CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \ - --mode=link $(CXX) \ - $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ +CXXLINK = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ # Install notes Index: libstdc++-v3/libsupc++/Makefile.am =================================================================== --- libstdc++-v3/libsupc++/Makefile.am (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/libsupc++/Makefile.am (.../branches/gcc-4_7-branch) (wersja 187906) @@ -32,17 +32,17 @@ noinst_LTLIBRARIES = libsupc++convenience.la std_HEADERS = \ - cxxabi.h exception initializer_list new typeinfo + cxxabi.h exception initializer_list new typeinfo bits_HEADERS = \ atomic_lockfree_defines.h cxxabi_forced.h \ - exception_defines.h exception_ptr.h hash_bytes.h nested_exception.h + exception_defines.h exception_ptr.h hash_bytes.h nested_exception.h headers = $(std_HEADERS) $(bits_HEADERS) if GLIBCXX_HOSTED c_sources = \ - cp-demangle.c + cp-demangle.c endif sources = \ @@ -95,7 +95,7 @@ vmi_class_type_info.cc \ vterminate.cc -libsupc___la_SOURCES = $(sources) $(c_sources) +libsupc___la_SOURCES = $(sources) $(c_sources) libsupc__convenience_la_SOURCES = $(sources) $(c_sources) # AM_CXXFLAGS needs to be in each subdirectory so that it can be @@ -106,9 +106,7 @@ AM_CXXFLAGS = \ $(PIC_CXXFLAGS) \ $(XTEMPLATE_FLAGS) \ - $(WARN_CXXFLAGS) \ - $(OPTIMIZE_CXXFLAGS) \ - $(CONFIG_CXXFLAGS) + $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) AM_MAKEFLAGS = \ "gxx_include_dir=$(gxx_include_dir)" @@ -125,7 +123,7 @@ # LTCOMPILE is copied from LTCXXCOMPILE below. LTCOMPILE = $(LIBTOOL) --tag CC --tag disable-shared $(LIBTOOLFLAGS) --mode=compile \ $(CC) $(DEFS) $(C_INCLUDES) $(PIC_CXXFLAGS) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) cp-demangle.c: rm -f $@ @@ -178,9 +176,11 @@ # # We have to put --tag disable-shared after --tag CXX lest things # CXX undo the affect of disable-shared. -LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \ - --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(TOPLEVEL_INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) @@ -190,11 +190,12 @@ # course is problematic at this point. So, we get the top-level # directory to configure libstdc++-v3 to use gcc as the C++ # compilation driver. -CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared $(LIBTOOLFLAGS) \ - --mode=link $(CXX) \ - $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ +CXXLINK = \ + $(LIBTOOL) --tag CXX --tag disable-shared \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXX) \ + $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@ - # Install notes # We have to have rules modified from the default to counteract SUN make # prepending each of $(*_HEADERS) with VPATH below. Index: libstdc++-v3/testsuite/25_algorithms/stable_partition/mem_check.cc =================================================================== --- libstdc++-v3/testsuite/25_algorithms/stable_partition/mem_check.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/25_algorithms/stable_partition/mem_check.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,4 +1,4 @@ -// Copyright (C) 2009 Free Software Foundation, Inc. +// Copyright (C) 2009, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -31,7 +31,7 @@ typedef test_container Container; const int A[] = {10, 20, 1, 11, 2, 21, 28, 29, 12, 35, 15, 27, 6, 16, 7, - 25, 17, 8, 23, 18, 9, 19, 24, 30, 13, 4, 14, 22, 26}; + 25, 17, 8, 23, 18, 9, 19, 24, 30, 13, 4, 14, 22, 26, 0}; bool even(const copy_tracker& ct) { return ct.id() < 19; } Index: libstdc++-v3/testsuite/25_algorithms/stable_partition/pr52822.cc =================================================================== --- libstdc++-v3/testsuite/25_algorithms/stable_partition/pr52822.cc (.../tags/gcc_4_7_0_release) (wersja 0) +++ libstdc++-v3/testsuite/25_algorithms/stable_partition/pr52822.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,43 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without Pred 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 +// . + +// 25.2.12 [lib.alg.partitions] Partitions. + +#include +#include +#include + +bool true_vector_pred(const std::vector&) { return true; } + +void +test01() +{ + std::vector > v(1); + v[0].push_back(7); + VERIFY( v[0].size() == 1 ); + std::stable_partition(v.begin(), v.end(), &true_vector_pred); + VERIFY( v[0].size() == 1 ); +} + +int +main() +{ + test01(); + return 0; +} Index: libstdc++-v3/testsuite/25_algorithms/stable_partition/moveable.cc =================================================================== --- libstdc++-v3/testsuite/25_algorithms/stable_partition/moveable.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/25_algorithms/stable_partition/moveable.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -35,6 +35,11 @@ const int B[] = {2, 4, 6, 8, 10, 12, 14, 16, 1, 3, 5, 7, 9, 11, 13, 15, 17}; const int N = sizeof(A) / sizeof(int); +// Check that starting with a true predicate works too. (PR52822) +const int A2[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17}; +const int B2[] = {2, 4, 6, 8, 10, 12, 14, 16, 3, 5, 7, 9, 11, 13, 15, 17}; +const int N2 = sizeof(A2) / sizeof(int); + struct Pred { bool @@ -42,7 +47,7 @@ { return (x.val % 2) == 0; } }; -// 25.2.12 stable_partition() +// 25.2.12 stable_partition(), starting with a false predicate. void test01() { @@ -56,9 +61,24 @@ VERIFY( std::equal(s1, s1 + N, B) ); } +// 25.2.12 stable_partition(), starting with a true predicate. +void +test02() +{ + bool test __attribute__((unused)) = true; + + rvalstruct s1[N2]; + std::copy(A2, A2 + N2, s1); + Container con(s1, s1 + N2); + + std::stable_partition(con.begin(), con.end(), Pred()); + VERIFY( std::equal(s1, s1 + N2, B2) ); +} + int main() { test01(); + test02(); return 0; } Index: libstdc++-v3/testsuite/25_algorithms/stable_sort/mem_check.cc =================================================================== --- libstdc++-v3/testsuite/25_algorithms/stable_sort/mem_check.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/25_algorithms/stable_sort/mem_check.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,4 +1,4 @@ -// Copyright (C) 2009 Free Software Foundation, Inc. +// Copyright (C) 2009, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -31,7 +31,7 @@ typedef test_container Container; const int A[] = {10, 20, 1, 11, 2, 21, 28, 29, 12, 35, 15, 27, 6, 16, 7, - 25, 17, 8, 23, 18, 9, 19, 24, 30, 13, 4, 14, 22, 26}; + 25, 17, 8, 23, 18, 9, 19, 24, 30, 13, 4, 14, 22, 26, 0}; void test_mem1(int throw_count) Index: libstdc++-v3/testsuite/Makefile.in =================================================================== --- libstdc++-v3/testsuite/Makefile.in (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/Makefile.in (.../branches/gcc-4_7-branch) (wersja 187906) @@ -505,6 +505,7 @@ @echo 'set libiconv "$(LIBICONV)"' >>site.tmp @echo 'set baseline_dir "$(baseline_dir)"' >> site.tmp @echo 'set baseline_subdir_switch "$(baseline_subdir_switch)"' >> site.tmp + @echo 'set TEST_GCC_EXEC_PREFIX "$(libdir)/gcc/"' >> site.tmp @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp @test ! -f site.exp || \ sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp Index: libstdc++-v3/testsuite/performance/30_threads/future/polling.cc =================================================================== --- libstdc++-v3/testsuite/performance/30_threads/future/polling.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/performance/30_threads/future/polling.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,4 +1,4 @@ -// Copyright (C) 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2009, 2010, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -22,7 +22,7 @@ inline bool is_ready(std::shared_future& f) { - return f.wait_for(std::chrono::microseconds(1)); + return f.wait_for(std::chrono::microseconds(1)) == std::future_status::ready; } void poll(std::shared_future f) Index: libstdc++-v3/testsuite/Makefile.am =================================================================== --- libstdc++-v3/testsuite/Makefile.am (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/Makefile.am (.../branches/gcc-4_7-branch) (wersja 187906) @@ -60,6 +60,7 @@ @echo 'set libiconv "$(LIBICONV)"' >>site.tmp @echo 'set baseline_dir "$(baseline_dir)"' >> site.tmp @echo 'set baseline_subdir_switch "$(baseline_subdir_switch)"' >> site.tmp + @echo 'set TEST_GCC_EXEC_PREFIX "$(libdir)/gcc/"' >> site.tmp @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp @test ! -f site.exp || \ sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp Index: libstdc++-v3/testsuite/23_containers/unordered_map/requirements/53067.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/unordered_map/requirements/53067.cc (.../tags/gcc_4_7_0_release) (wersja 0) +++ libstdc++-v3/testsuite/23_containers/unordered_map/requirements/53067.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,28 @@ +// { dg-do compile } +// { dg-options "-std=gnu++11" } + +// Copyright (C) 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without Pred 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 + +void f() +{ + std::unordered_map Foo; + ref(Foo); +} Index: libstdc++-v3/testsuite/23_containers/unordered_map/requirements/52942.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/unordered_map/requirements/52942.cc (.../tags/gcc_4_7_0_release) (wersja 0) +++ libstdc++-v3/testsuite/23_containers/unordered_map/requirements/52942.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,37 @@ +// { dg-do compile } +// { dg-options "-std=gnu++11" } + +// Copyright (C) 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without Pred 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 + +struct TFoo {}; + +struct TFoo_hash +{ + std::size_t operator()(const TFoo &) const { return 0; } +}; + +void f1(std::unordered_map &) {} + +void f2() +{ + std::unordered_map map1; + std::bind(f1, std::ref(map1)); +} Index: libstdc++-v3/testsuite/23_containers/forward_list/modifiers/6.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/forward_list/modifiers/6.cc (.../tags/gcc_4_7_0_release) (wersja 0) +++ libstdc++-v3/testsuite/23_containers/forward_list/modifiers/6.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,94 @@ +// { dg-options "-std=gnu++11" } + +// Copyright (C) 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without Pred 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 + +void test01() +{ + bool test __attribute__((unused)) = true; + + std::forward_list fl1(1, 5), fl2(1, 4), fl3(1, 3), + fl4(1, 2), fl5(1, 1), fl6(1, 0); + + fl1.splice_after(fl1.before_begin(), fl2); + + auto it = fl1.begin(); + + VERIFY( *it == 4 ); + + ++it; + + VERIFY( *it == 5 ); + + fl3.splice_after(fl3.before_begin(), fl4, fl4.before_begin()); + + it = fl3.begin(); + + VERIFY( *it == 2 ); + + ++it; + + VERIFY( *it == 3 ); + + fl5.splice_after(fl5.before_begin(), fl6, fl6.before_begin(), fl6.end()); + + it = fl5.begin(); + + VERIFY( *it == 0 ); + + ++it; + + VERIFY( *it == 1 ); + + fl1.merge(fl2); + + it = fl1.begin(); + + VERIFY( *it == 4 ); + + ++it; + + VERIFY( *it == 5 ); + + fl1.merge(fl3, std::less()); + + it = fl1.begin(); + + VERIFY( *it == 2 ); + + ++it; + + VERIFY( *it == 3 ); + + ++it; + + VERIFY( *it == 4 ); + + ++it; + + VERIFY( *it == 5 ); +} + +int main() +{ + test01(); + return 0; +} Index: libstdc++-v3/testsuite/23_containers/forward_list/operations/1.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/forward_list/operations/1.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/23_containers/forward_list/operations/1.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,6 +1,6 @@ // { dg-options "-std=gnu++0x" } -// Copyright (C) 2008, 2009 Free Software Foundation, Inc. +// Copyright (C) 2008, 2009, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -68,7 +68,7 @@ VERIFY(*befy == 10.0); ++befy; - VERIFY(*befy == 15.0); + VERIFY(*befy == 14.0); } // This test verifies the following: Index: libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,8 +1,8 @@ // { dg-do compile } // { dg-options "-std=gnu++0x" } -// { dg-error "no matching" "" { target *-*-* } 1213 } +// { dg-error "no matching" "" { target *-*-* } 1221 } -// Copyright (C) 2009, 2010, 2011 Free Software Foundation +// Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation // // 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 Index: libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,8 +1,8 @@ // { dg-do compile } // { dg-options "-std=gnu++0x" } -// { dg-error "no matching" "" { target *-*-* } 1213 } +// { dg-error "no matching" "" { target *-*-* } 1221 } -// Copyright (C) 2009, 2010, 2011 Free Software Foundation +// Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation // // 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 Index: libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,8 +1,8 @@ // { dg-do compile } // { dg-options "-std=gnu++0x" } -// { dg-error "no matching" "" { target *-*-* } 1213 } +// { dg-error "no matching" "" { target *-*-* } 1221 } -// Copyright (C) 2009, 2010, 2011 Free Software Foundation +// Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation // // 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 Index: libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,8 +1,8 @@ // { dg-do compile } // { dg-options "-std=gnu++0x" } -// { dg-error "no matching" "" { target *-*-* } 1213 } +// { dg-error "no matching" "" { target *-*-* } 1221 } -// Copyright (C) 2009, 2010, 2011 Free Software Foundation +// Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation // // 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 Index: libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/23_containers/forward_list/debug/splice_after.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,6 +1,6 @@ // { dg-options "-std=gnu++0x" } -// Copyright (C) 2010 Free Software Foundation, Inc. +// Copyright (C) 2010, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -34,6 +34,10 @@ VERIFY( before == fl1.before_begin() ); VERIFY( end == fl1.end() ); + + // no-op just to check that debug mode does not see any problem with it. + fl1.splice_after(fl1.before_begin(), std::move(fl2), + fl2.before_begin(), fl2.begin()); } int Index: libstdc++-v3/testsuite/23_containers/unordered_multimap/insert/53115.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/unordered_multimap/insert/53115.cc (.../tags/gcc_4_7_0_release) (wersja 0) +++ libstdc++-v3/testsuite/23_containers/unordered_multimap/insert/53115.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,101 @@ +// { dg-options "-std=gnu++11" } +// +// Copyright (C) 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +namespace +{ + std::size_t + get_nb_bucket_elems(const std::unordered_multimap& us) + { + std::size_t nb = 0; + for (std::size_t b = 0; b != us.bucket_count(); ++b) + nb += us.bucket_size(b); + return nb; + } +} + +void test01() +{ + using namespace std; + bool test __attribute__((unused)) = true; + + std::unordered_multimap umm; + umm.insert(make_pair(10, 1)); + VERIFY( umm.size() == 1 ); + VERIFY( std::distance(umm.begin(), umm.end()) == umm.size() ); + VERIFY( get_nb_bucket_elems(umm) == umm.size() ); + + umm.insert(make_pair(10, 2)); + VERIFY( umm.size() == 2 ); + VERIFY( std::distance(umm.begin(), umm.end()) == umm.size() ); + VERIFY( get_nb_bucket_elems(umm) == umm.size() ); + + umm.insert(make_pair(10, 3)); + VERIFY( umm.size() == 3 ); + VERIFY( std::distance(umm.begin(), umm.end()) == umm.size() ); + VERIFY( get_nb_bucket_elems(umm) == umm.size() ); + + umm.insert(make_pair(10, 4)); + VERIFY( umm.size() == 4 ); + VERIFY( std::distance(umm.begin(), umm.end()) == umm.size() ); + VERIFY( get_nb_bucket_elems(umm) == umm.size() ); + + umm.insert(make_pair(10, 5)); + VERIFY( umm.size() == 5 ); + VERIFY( std::distance(umm.begin(), umm.end()) == umm.size() ); + VERIFY( get_nb_bucket_elems(umm) == umm.size() ); + + umm.insert(make_pair(24, 6)); + VERIFY( umm.size() == 6 ); + VERIFY( std::distance(umm.begin(), umm.end()) == umm.size() ); + VERIFY( get_nb_bucket_elems(umm) == umm.size() ); + + umm.insert(make_pair(25, 7)); + VERIFY( umm.size() == 7 ); + VERIFY( std::distance(umm.begin(), umm.end()) == umm.size() ); + VERIFY( get_nb_bucket_elems(umm) == umm.size() ); + + umm.insert(make_pair(2, 8)); + VERIFY( umm.size() == 8 ); + VERIFY( std::distance(umm.begin(), umm.end()) == umm.size() ); + VERIFY( get_nb_bucket_elems(umm) == umm.size() ); + + umm.insert(make_pair(2, 9)); + VERIFY( umm.size() == 9 ); + VERIFY( std::distance(umm.begin(), umm.end()) == umm.size() ); + VERIFY( get_nb_bucket_elems(umm) == umm.size() ); + + umm.insert(make_pair(1, 10)); + VERIFY( umm.size() == 10 ); + VERIFY( std::distance(umm.begin(), umm.end()) == umm.size() ); + VERIFY( get_nb_bucket_elems(umm) == umm.size() ); + + umm.insert(make_pair(10, 11)); + VERIFY( umm.size() == 11 ); + VERIFY( std::distance(umm.begin(), umm.end()) == umm.size() ); + VERIFY( get_nb_bucket_elems(umm) == umm.size() ); +} + +int main() +{ + test01(); + return 0; +} Index: libstdc++-v3/testsuite/23_containers/unordered_multimap/insert/52476.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/unordered_multimap/insert/52476.cc (.../tags/gcc_4_7_0_release) (wersja 0) +++ libstdc++-v3/testsuite/23_containers/unordered_multimap/insert/52476.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,59 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include +#include +#include + +void test01() +{ + using namespace std; + bool test __attribute__((unused)) = true; + + unordered_multimap mmap; + vector values; + + size_t nb_bkts = mmap.bucket_count(); + int i = 0; + for (;; ++i) + { + mmap.insert(make_pair(0, i)); + if (mmap.bucket_count() != nb_bkts) + // Container got rehash + break; + values.clear(); + transform(mmap.begin(), mmap.end(), back_inserter(values), + [](const pair& p) { return p.second; }); + } + + vector rehash_values; + transform(mmap.begin(), mmap.end(), back_inserter(rehash_values), + [](const pair& p) { return p.second; }); + // Remove the value that result in a rehash + rehash_values.erase(remove(rehash_values.begin(), rehash_values.end(), i)); + + VERIFY( rehash_values == values ); +} + +int main() +{ + test01(); + return 0; +} Index: libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/52799.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/52799.cc (.../tags/gcc_4_7_0_release) (wersja 0) +++ libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/52799.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,28 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include + +// libstdc++/52799 +int main() +{ + std::vector v; + v.emplace(v.begin()); +} Index: libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -18,7 +18,7 @@ // . // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1225 } +// { dg-error "no matching" "" { target *-*-* } 1207 } #include Index: libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -18,7 +18,7 @@ // . // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1266 } +// { dg-error "no matching" "" { target *-*-* } 1248 } #include Index: libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -18,7 +18,7 @@ // . // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1155 } +// { dg-error "no matching" "" { target *-*-* } 1137 } #include Index: libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -18,7 +18,7 @@ // . // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1155 } +// { dg-error "no matching" "" { target *-*-* } 1137 } #include #include Index: libstdc++-v3/testsuite/23_containers/vector/debug/52433.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/vector/debug/52433.cc (.../tags/gcc_4_7_0_release) (wersja 0) +++ libstdc++-v3/testsuite/23_containers/vector/debug/52433.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,43 @@ +// Copyright (C) 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . +// +// { dg-require-debug-mode "" } +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// PR libstdc++/52433 + +#include + +struct X +{ + std::vector::iterator i; + + X() = default; + X(const X&) = default; + X(X&&) = default; + X& operator=(const X&) = default; + X& operator=(X&&) = default; +}; + +X test01() +{ + X x; + x = X(); + return x; +} + Index: libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/31370.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/31370.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/31370.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,4 +1,4 @@ -// Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2007, 2009, 2010, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -17,6 +17,7 @@ // 23.2.5 class vector [lib.vector.bool] +// { dg-skip-if "" { powerpc64-*-freebsd* } { "*" } { "" } } // { dg-do run { xfail *-*-darwin8.[0-4].* } } #include Index: libstdc++-v3/testsuite/23_containers/vector/52591.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/vector/52591.cc (.../tags/gcc_4_7_0_release) (wersja 0) +++ libstdc++-v3/testsuite/23_containers/vector/52591.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,38 @@ +// Copyright (C) 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// libstdc++/52591 + +#include + +// As an extension we allow move-assignment of std::vector when the element +// type is not MoveAssignable, as long as the allocator type propagates or +// is known to always compare equal. + +struct C +{ + C& operator=(C&&) = delete; +}; + +void test01() +{ + std::vector a; + a = std::vector(); +} Index: libstdc++-v3/testsuite/23_containers/unordered_set/instantiation_neg.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/unordered_set/instantiation_neg.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/23_containers/unordered_set/instantiation_neg.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -2,7 +2,7 @@ // { dg-options "-std=gnu++0x" } // { dg-require-normal-mode "" } -// Copyright (C) 2011 Free Software Foundation, Inc. +// Copyright (C) 2011, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -19,7 +19,7 @@ // with this library; see the file COPYING3. If not see // . -// { dg-error "static assertion failed" "" { target *-*-* } 185 } +// { dg-error "static assertion failed" "" { target *-*-* } 186 } #include Index: libstdc++-v3/testsuite/23_containers/unordered_set/requirements/53067.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/unordered_set/requirements/53067.cc (.../tags/gcc_4_7_0_release) (wersja 0) +++ libstdc++-v3/testsuite/23_containers/unordered_set/requirements/53067.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,28 @@ +// { dg-do compile } +// { dg-options "-std=gnu++11" } + +// Copyright (C) 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without Pred 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 + +void f() +{ + std::unordered_set Foo; + ref(Foo); +} Index: libstdc++-v3/testsuite/23_containers/unordered_set/requirements/52942.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/unordered_set/requirements/52942.cc (.../tags/gcc_4_7_0_release) (wersja 0) +++ libstdc++-v3/testsuite/23_containers/unordered_set/requirements/52942.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,37 @@ +// { dg-do compile } +// { dg-options "-std=gnu++11" } + +// Copyright (C) 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without Pred 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 + +struct TFoo {}; + +struct TFoo_hash +{ + std::size_t operator()(const TFoo &) const { return 0; } +}; + +void f1(std::unordered_set &) {} + +void f2() +{ + std::unordered_set set1; + std::bind(f1, std::ref(set1)); +} Index: libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/52799.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/52799.cc (.../tags/gcc_4_7_0_release) (wersja 0) +++ libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/52799.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,28 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include + +// libstdc++/52799 +int main() +{ + std::deque d; + d.emplace(d.begin()); +} Index: libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/52799.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/52799.cc (.../tags/gcc_4_7_0_release) (wersja 0) +++ libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/52799.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,28 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include + +// libstdc++/52799 +int main() +{ + std::list l; + l.emplace(l.begin()); +} Index: libstdc++-v3/testsuite/23_containers/unordered_multiset/insert/53115.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/unordered_multiset/insert/53115.cc (.../tags/gcc_4_7_0_release) (wersja 0) +++ libstdc++-v3/testsuite/23_containers/unordered_multiset/insert/53115.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,101 @@ +// { dg-options "-std=gnu++11" } +// +// Copyright (C) 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include + +namespace +{ + std::size_t + get_nb_bucket_elems(const std::unordered_multiset& us) + { + std::size_t nb = 0; + for (std::size_t b = 0; b != us.bucket_count(); ++b) + nb += us.bucket_size(b); + return nb; + } +} + +void test01() +{ + using namespace std; + bool test __attribute__((unused)) = true; + + std::unordered_multiset mms; + mms.insert(10); + VERIFY( mms.size() == 1 ); + VERIFY( std::distance(mms.begin(), mms.end()) == mms.size() ); + VERIFY( get_nb_bucket_elems(mms) == mms.size() ); + + mms.insert(10); + VERIFY( mms.size() == 2 ); + VERIFY( std::distance(mms.begin(), mms.end()) == mms.size() ); + VERIFY( get_nb_bucket_elems(mms) == mms.size() ); + + mms.insert(10); + VERIFY( mms.size() == 3 ); + VERIFY( std::distance(mms.begin(), mms.end()) == mms.size() ); + VERIFY( get_nb_bucket_elems(mms) == mms.size() ); + + mms.insert(10); + VERIFY( mms.size() == 4 ); + VERIFY( std::distance(mms.begin(), mms.end()) == mms.size() ); + VERIFY( get_nb_bucket_elems(mms) == mms.size() ); + + mms.insert(10); + VERIFY( mms.size() == 5 ); + VERIFY( std::distance(mms.begin(), mms.end()) == mms.size() ); + VERIFY( get_nb_bucket_elems(mms) == mms.size() ); + + mms.insert(24); + VERIFY( mms.size() == 6 ); + VERIFY( std::distance(mms.begin(), mms.end()) == mms.size() ); + VERIFY( get_nb_bucket_elems(mms) == mms.size() ); + + mms.insert(25); + VERIFY( mms.size() == 7 ); + VERIFY( std::distance(mms.begin(), mms.end()) == mms.size() ); + VERIFY( get_nb_bucket_elems(mms) == mms.size() ); + + mms.insert(2); + VERIFY( mms.size() == 8 ); + VERIFY( std::distance(mms.begin(), mms.end()) == mms.size() ); + VERIFY( get_nb_bucket_elems(mms) == mms.size() ); + + mms.insert(2); + VERIFY( mms.size() == 9 ); + VERIFY( std::distance(mms.begin(), mms.end()) == mms.size() ); + VERIFY( get_nb_bucket_elems(mms) == mms.size() ); + + mms.insert(1); + VERIFY( mms.size() == 10 ); + VERIFY( std::distance(mms.begin(), mms.end()) == mms.size() ); + VERIFY( get_nb_bucket_elems(mms) == mms.size() ); + + mms.insert(10); + VERIFY( mms.size() == 11 ); + VERIFY( std::distance(mms.begin(), mms.end()) == mms.size() ); + VERIFY( get_nb_bucket_elems(mms) == mms.size() ); +} + +int main() +{ + test01(); + return 0; +} Index: libstdc++-v3/testsuite/23_containers/unordered_multiset/insert/52476.cc =================================================================== --- libstdc++-v3/testsuite/23_containers/unordered_multiset/insert/52476.cc (.../tags/gcc_4_7_0_release) (wersja 0) +++ libstdc++-v3/testsuite/23_containers/unordered_multiset/insert/52476.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,77 @@ +// { dg-options "-std=gnu++0x" } +// +// Copyright (C) 2012 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include +#include +#include + +namespace +{ + struct pair_hash + { + std::size_t + operator()(const std::pair& p) const noexcept + { return std::hash()(p.first); } + }; + + struct pair_equal_to + { + bool + operator()(const std::pair& x, + const std::pair& y) const noexcept + { return x.first == y.first; } + }; +} + +void test01() +{ + using namespace std; + bool test __attribute__((unused)) = true; + + unordered_multiset, pair_hash, pair_equal_to> mset; + vector values; + + size_t nb_bkts = mset.bucket_count(); + int i = 0; + for (;; ++i) + { + mset.insert(make_pair(0, i)); + if (mset.bucket_count() != nb_bkts) + // Container got rehash + break; + values.clear(); + transform(mset.begin(), mset.end(), back_inserter(values), + [](const pair& p) { return p.second; }); + } + + vector rehash_values; + transform(mset.begin(), mset.end(), back_inserter(rehash_values), + [](const pair& p) { return p.second; }); + // Remove the value that result in a rehash + rehash_values.erase(remove(rehash_values.begin(), rehash_values.end(), i)); + + VERIFY( rehash_values == values ); +} + +int main() +{ + test01(); + return 0; +} Index: libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc =================================================================== --- libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/20_util/shared_ptr/cons/43820_neg.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -32,9 +32,9 @@ { X* px = 0; std::shared_ptr p1(px); // { dg-error "here" } - // { dg-error "incomplete" "" { target *-*-* } 771 } + // { dg-error "incomplete" "" { target *-*-* } 775 } std::shared_ptr p9(ap()); // { dg-error "here" } - // { dg-error "incomplete" "" { target *-*-* } 865 } + // { dg-error "incomplete" "" { target *-*-* } 869 } } Index: libstdc++-v3/testsuite/20_util/shared_ptr/cons/52924.cc =================================================================== --- libstdc++-v3/testsuite/20_util/shared_ptr/cons/52924.cc (.../tags/gcc_4_7_0_release) (wersja 0) +++ libstdc++-v3/testsuite/20_util/shared_ptr/cons/52924.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,44 @@ +// { dg-options "-std=gnu++0x" } +// { dg-do compile } + +// Copyright (C) 2012 Free Software Foundation +// +// 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 + +// libstdc++/52924 + +struct A { } a; + +struct D { + ~D() noexcept(false) { } + void operator()(A*) { } +} d; + +auto sp = std::shared_ptr(&a, d); + +template +struct Alloc : std::allocator +{ + Alloc() = default; + ~Alloc() noexcept(false) { } + template Alloc(const Alloc&) { } +}; + +Alloc al; + +auto as = std::allocate_shared(al); Index: libstdc++-v3/testsuite/20_util/scoped_allocator/1.cc =================================================================== --- libstdc++-v3/testsuite/20_util/scoped_allocator/1.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/20_util/scoped_allocator/1.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,6 +1,6 @@ // { dg-options "-std=gnu++0x" } -// Copyright (C) 2011 Free Software Foundation, Inc. +// Copyright (C) 2011, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -33,7 +33,7 @@ Element(const allocator_type& a = allocator_type()) : alloc(a) { } - Element(std::allocator_arg_t, const allocator_type& a, int i = 0) + Element(std::allocator_arg_t, const allocator_type& a, int = 0) : alloc(a) { } Element(std::allocator_arg_t, const allocator_type& a, const Element&) @@ -53,6 +53,7 @@ alloc1_type a1(1); Element e; EltVec ev1(1, e, a1); + VERIFY( ev1.get_allocator().get_personality() == 1 ); VERIFY( ev1[0].get_allocator().get_personality() == 1 ); } @@ -60,14 +61,16 @@ { bool test __attribute((unused)) = false; - typedef std::vector EltVec; + typedef std::scoped_allocator_adaptor inner_alloc_type; - typedef std::scoped_allocator_adaptor alloc_type; + typedef std::vector EltVec; + typedef std::scoped_allocator_adaptor alloc_type; + typedef std::vector EltVecVec; - alloc_type a(1, 2); + alloc_type a(1, Element::allocator_type(2)); // outer=1, inner=2 Element e; EltVec ev(1, e); EltVecVec evv(1, ev, a); @@ -76,7 +79,7 @@ VERIFY( evv[0].get_allocator().get_personality() == 2 ); VERIFY( evv[0][0].get_allocator().get_personality() == 2 ); - alloc_type a2(3, 4); + alloc_type a2(3, Element::allocator_type(4)); // outer=3, inner=4 EltVecVec evv2(evv, a2); // copy with a different allocator @@ -96,4 +99,5 @@ int main() { test01(); + test02(); } Index: libstdc++-v3/testsuite/20_util/pointer_traits/requirements/typedefs.cc =================================================================== --- libstdc++-v3/testsuite/20_util/pointer_traits/requirements/typedefs.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/testsuite/20_util/pointer_traits/requirements/typedefs.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -32,6 +32,7 @@ typedef typename test_type::pointer pointer; typedef typename test_type::element_type element_type; typedef typename test_type::difference_type difference_type; + typedef typename test_type::template rebind rebind_type; } int main() Index: libstdc++-v3/config/abi/post/sparc-linux-gnu/baseline_symbols.txt =================================================================== --- libstdc++-v3/config/abi/post/sparc-linux-gnu/baseline_symbols.txt (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/config/abi/post/sparc-linux-gnu/baseline_symbols.txt (.../branches/gcc-4_7-branch) (wersja 187906) @@ -43,6 +43,10 @@ FUNC:_ZN11__gnu_debug19_Safe_sequence_base18_M_detach_singularEv@@GLIBCXX_3.4 FUNC:_ZN11__gnu_debug19_Safe_sequence_base22_M_revalidate_singularEv@@GLIBCXX_3.4 FUNC:_ZN11__gnu_debug19_Safe_sequence_base7_M_swapERS0_@@GLIBCXX_3.4 +FUNC:_ZN11__gnu_debug25_Safe_local_iterator_base9_M_attachEPNS_19_Safe_sequence_baseEb@@GLIBCXX_3.4.17 +FUNC:_ZN11__gnu_debug25_Safe_local_iterator_base9_M_detachEv@@GLIBCXX_3.4.17 +FUNC:_ZN11__gnu_debug30_Safe_unordered_container_base13_M_detach_allEv@@GLIBCXX_3.4.17 +FUNC:_ZN11__gnu_debug30_Safe_unordered_container_base7_M_swapERS0_@@GLIBCXX_3.4.17 FUNC:_ZN14__gnu_parallel9_Settings3getEv@@GLIBCXX_3.4.10 FUNC:_ZN14__gnu_parallel9_Settings3setERS0_@@GLIBCXX_3.4.10 FUNC:_ZN9__gnu_cxx12__atomic_addEPVii@@GLIBCXX_3.4 @@ -877,6 +881,7 @@ FUNC:_ZNSaIwEC2Ev@@GLIBCXX_3.4 FUNC:_ZNSaIwED1Ev@@GLIBCXX_3.4 FUNC:_ZNSaIwED2Ev@@GLIBCXX_3.4 +FUNC:_ZNSbIwSt11char_traitsIwESaIwEE10_S_compareEjj@@GLIBCXX_3.4.16 FUNC:_ZNSbIwSt11char_traitsIwESaIwEE12_Alloc_hiderC1EPwRKS1_@@GLIBCXX_3.4 FUNC:_ZNSbIwSt11char_traitsIwESaIwEE12_Alloc_hiderC2EPwRKS1_@@GLIBCXX_3.4 FUNC:_ZNSbIwSt11char_traitsIwESaIwEE12_M_leak_hardEv@@GLIBCXX_3.4 @@ -961,6 +966,7 @@ FUNC:_ZNSbIwSt11char_traitsIwESaIwEE7replaceEjjRKS2_jj@@GLIBCXX_3.4 FUNC:_ZNSbIwSt11char_traitsIwESaIwEE7replaceEjjjw@@GLIBCXX_3.4 FUNC:_ZNSbIwSt11char_traitsIwESaIwEE7reserveEj@@GLIBCXX_3.4 +FUNC:_ZNSbIwSt11char_traitsIwESaIwEE8pop_backEv@@GLIBCXX_3.4.17 FUNC:_ZNSbIwSt11char_traitsIwESaIwEE9_M_assignEPwjw@@GLIBCXX_3.4.5 FUNC:_ZNSbIwSt11char_traitsIwESaIwEE9_M_assignEPwjw@GLIBCXX_3.4 FUNC:_ZNSbIwSt11char_traitsIwESaIwEE9_M_mutateEjjj@@GLIBCXX_3.4 @@ -1116,6 +1122,7 @@ FUNC:_ZNSolsEt@@GLIBCXX_3.4 FUNC:_ZNSolsEx@@GLIBCXX_3.4 FUNC:_ZNSolsEy@@GLIBCXX_3.4 +FUNC:_ZNSs10_S_compareEjj@@GLIBCXX_3.4.16 FUNC:_ZNSs12_Alloc_hiderC1EPcRKSaIcE@@GLIBCXX_3.4 FUNC:_ZNSs12_Alloc_hiderC2EPcRKSaIcE@@GLIBCXX_3.4 FUNC:_ZNSs12_M_leak_hardEv@@GLIBCXX_3.4 @@ -1200,6 +1207,7 @@ FUNC:_ZNSs7replaceEjjRKSsjj@@GLIBCXX_3.4 FUNC:_ZNSs7replaceEjjjc@@GLIBCXX_3.4 FUNC:_ZNSs7reserveEj@@GLIBCXX_3.4 +FUNC:_ZNSs8pop_backEv@@GLIBCXX_3.4.17 FUNC:_ZNSs9_M_assignEPcjc@@GLIBCXX_3.4.5 FUNC:_ZNSs9_M_assignEPcjc@GLIBCXX_3.4 FUNC:_ZNSs9_M_mutateEjjj@@GLIBCXX_3.4 @@ -1433,6 +1441,9 @@ FUNC:_ZNSt13__future_base12_Result_baseD0Ev@@GLIBCXX_3.4.15 FUNC:_ZNSt13__future_base12_Result_baseD1Ev@@GLIBCXX_3.4.15 FUNC:_ZNSt13__future_base12_Result_baseD2Ev@@GLIBCXX_3.4.15 +FUNC:_ZNSt13__future_base19_Async_state_commonD0Ev@@GLIBCXX_3.4.17 +FUNC:_ZNSt13__future_base19_Async_state_commonD1Ev@@GLIBCXX_3.4.17 +FUNC:_ZNSt13__future_base19_Async_state_commonD2Ev@@GLIBCXX_3.4.17 FUNC:_ZNSt13bad_exceptionD0Ev@@GLIBCXX_3.4 FUNC:_ZNSt13bad_exceptionD1Ev@@GLIBCXX_3.4 FUNC:_ZNSt13bad_exceptionD2Ev@@GLIBCXX_3.4 @@ -1741,6 +1752,8 @@ FUNC:_ZNSt15__exception_ptrneERKNS_13exception_ptrES2_@@CXXABI_1.3.3 FUNC:_ZNSt15basic_streambufIcSt11char_traitsIcEE10pubseekoffExSt12_Ios_SeekdirSt13_Ios_Openmode@@GLIBCXX_3.4 FUNC:_ZNSt15basic_streambufIcSt11char_traitsIcEE10pubseekposESt4fposI11__mbstate_tESt13_Ios_Openmode@@GLIBCXX_3.4 +FUNC:_ZNSt15basic_streambufIcSt11char_traitsIcEE12__safe_gbumpEi@@GLIBCXX_3.4.16 +FUNC:_ZNSt15basic_streambufIcSt11char_traitsIcEE12__safe_pbumpEi@@GLIBCXX_3.4.16 FUNC:_ZNSt15basic_streambufIcSt11char_traitsIcEE4setgEPcS3_S3_@@GLIBCXX_3.4 FUNC:_ZNSt15basic_streambufIcSt11char_traitsIcEE4setpEPcS3_@@GLIBCXX_3.4 FUNC:_ZNSt15basic_streambufIcSt11char_traitsIcEE4syncEv@@GLIBCXX_3.4 @@ -1780,6 +1793,8 @@ FUNC:_ZNSt15basic_streambufIcSt11char_traitsIcEEaSERKS2_@@GLIBCXX_3.4 FUNC:_ZNSt15basic_streambufIwSt11char_traitsIwEE10pubseekoffExSt12_Ios_SeekdirSt13_Ios_Openmode@@GLIBCXX_3.4 FUNC:_ZNSt15basic_streambufIwSt11char_traitsIwEE10pubseekposESt4fposI11__mbstate_tESt13_Ios_Openmode@@GLIBCXX_3.4 +FUNC:_ZNSt15basic_streambufIwSt11char_traitsIwEE12__safe_gbumpEi@@GLIBCXX_3.4.16 +FUNC:_ZNSt15basic_streambufIwSt11char_traitsIwEE12__safe_pbumpEi@@GLIBCXX_3.4.16 FUNC:_ZNSt15basic_streambufIwSt11char_traitsIwEE4setgEPwS3_S3_@@GLIBCXX_3.4 FUNC:_ZNSt15basic_streambufIwSt11char_traitsIwEE4setpEPwS3_@@GLIBCXX_3.4 FUNC:_ZNSt15basic_streambufIwSt11char_traitsIwEE4syncEv@@GLIBCXX_3.4 @@ -1824,6 +1839,7 @@ FUNC:_ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE7_M_syncEPcjj@@GLIBCXX_3.4 FUNC:_ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE7seekoffExSt12_Ios_SeekdirSt13_Ios_Openmode@@GLIBCXX_3.4 FUNC:_ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE7seekposESt4fposI11__mbstate_tESt13_Ios_Openmode@@GLIBCXX_3.4 +FUNC:_ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE8_M_pbumpEPcS4_x@@GLIBCXX_3.4.16 FUNC:_ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE8overflowEi@@GLIBCXX_3.4 FUNC:_ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE9pbackfailEi@@GLIBCXX_3.4 FUNC:_ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE9showmanycEv@@GLIBCXX_3.4.6 @@ -1841,6 +1857,7 @@ FUNC:_ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEE7_M_syncEPwjj@@GLIBCXX_3.4 FUNC:_ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEE7seekoffExSt12_Ios_SeekdirSt13_Ios_Openmode@@GLIBCXX_3.4 FUNC:_ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEE7seekposESt4fposI11__mbstate_tESt13_Ios_Openmode@@GLIBCXX_3.4 +FUNC:_ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEE8_M_pbumpEPwS4_x@@GLIBCXX_3.4.16 FUNC:_ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEE8overflowEj@@GLIBCXX_3.4 FUNC:_ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEE9pbackfailEj@@GLIBCXX_3.4 FUNC:_ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEE9showmanycEv@@GLIBCXX_3.4.6 @@ -2145,6 +2162,7 @@ FUNC:_ZNSt6localeD2Ev@@GLIBCXX_3.4 FUNC:_ZNSt6localeaSERKS_@@GLIBCXX_3.4 FUNC:_ZNSt6thread15_M_start_threadESt10shared_ptrINS_10_Impl_baseEE@@GLIBCXX_3.4.11 +FUNC:_ZNSt6thread20hardware_concurrencyEv@@GLIBCXX_3.4.17 FUNC:_ZNSt6thread4joinEv@@GLIBCXX_3.4.11 FUNC:_ZNSt6thread6detachEv@@GLIBCXX_3.4.11 FUNC:_ZNSt7codecvtIcc11__mbstate_tEC1EP15__locale_structj@@GLIBCXX_3.4 @@ -2640,14 +2658,17 @@ FUNC:_ZnwjRKSt9nothrow_t@@GLIBCXX_3.4 FUNC:__atomic_flag_for_address@@GLIBCXX_3.4.11 FUNC:__atomic_flag_wait_explicit@@GLIBCXX_3.4.11 +FUNC:__cxa_allocate_dependent_exception@@CXXABI_1.3.6 FUNC:__cxa_allocate_exception@@CXXABI_1.3 FUNC:__cxa_bad_cast@@CXXABI_1.3 FUNC:__cxa_bad_typeid@@CXXABI_1.3 FUNC:__cxa_begin_catch@@CXXABI_1.3 FUNC:__cxa_call_unexpected@@CXXABI_1.3 FUNC:__cxa_current_exception_type@@CXXABI_1.3 +FUNC:__cxa_deleted_virtual@@CXXABI_1.3.6 FUNC:__cxa_demangle@@CXXABI_1.3 FUNC:__cxa_end_catch@@CXXABI_1.3 +FUNC:__cxa_free_dependent_exception@@CXXABI_1.3.6 FUNC:__cxa_free_exception@@CXXABI_1.3 FUNC:__cxa_get_exception_ptr@@CXXABI_1.3.1 FUNC:__cxa_get_globals@@CXXABI_1.3 @@ -2658,6 +2679,7 @@ FUNC:__cxa_pure_virtual@@CXXABI_1.3 FUNC:__cxa_rethrow@@CXXABI_1.3 FUNC:__cxa_throw@@CXXABI_1.3 +FUNC:__cxa_tm_cleanup@@CXXABI_TM_1 FUNC:__cxa_vec_cctor@@CXXABI_1.3 FUNC:__cxa_vec_cleanup@@CXXABI_1.3 FUNC:__cxa_vec_ctor@@CXXABI_1.3 @@ -2701,7 +2723,9 @@ OBJECT:0:CXXABI_1.3.3 OBJECT:0:CXXABI_1.3.4 OBJECT:0:CXXABI_1.3.5 +OBJECT:0:CXXABI_1.3.6 OBJECT:0:CXXABI_LDBL_1.3 +OBJECT:0:CXXABI_TM_1 OBJECT:0:GLIBCXX_3.4 OBJECT:0:GLIBCXX_3.4.1 OBJECT:0:GLIBCXX_3.4.10 @@ -2710,6 +2734,8 @@ OBJECT:0:GLIBCXX_3.4.13 OBJECT:0:GLIBCXX_3.4.14 OBJECT:0:GLIBCXX_3.4.15 +OBJECT:0:GLIBCXX_3.4.16 +OBJECT:0:GLIBCXX_3.4.17 OBJECT:0:GLIBCXX_3.4.2 OBJECT:0:GLIBCXX_3.4.3 OBJECT:0:GLIBCXX_3.4.4 @@ -2737,6 +2763,7 @@ OBJECT:12:_ZTIN9__gnu_cxx13stdio_filebufIwSt11char_traitsIwEEE@@GLIBCXX_3.4 OBJECT:12:_ZTIN9__gnu_cxx18stdio_sync_filebufIcSt11char_traitsIcEEE@@GLIBCXX_3.4 OBJECT:12:_ZTIN9__gnu_cxx18stdio_sync_filebufIwSt11char_traitsIwEEE@@GLIBCXX_3.4 +OBJECT:12:_ZTINSt13__future_base19_Async_state_commonE@@GLIBCXX_3.4.17 OBJECT:12:_ZTINSt17__gnu_cxx_ldbl1287num_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEEE@@GLIBCXX_LDBL_3.4 OBJECT:12:_ZTINSt17__gnu_cxx_ldbl1287num_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEEE@@GLIBCXX_LDBL_3.4 OBJECT:12:_ZTINSt17__gnu_cxx_ldbl1287num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEEE@@GLIBCXX_LDBL_3.4 @@ -3245,6 +3272,7 @@ OBJECT:20:_ZTSSt15underflow_error@@GLIBCXX_3.4 OBJECT:20:_ZTVNSt13__future_base11_State_baseE@@GLIBCXX_3.4.15 OBJECT:20:_ZTVNSt13__future_base12_Result_baseE@@GLIBCXX_3.4.15 +OBJECT:20:_ZTVNSt13__future_base19_Async_state_commonE@@GLIBCXX_3.4.17 OBJECT:20:_ZTVNSt8ios_base7failureE@@GLIBCXX_3.4 OBJECT:20:_ZTVSt10bad_typeid@@GLIBCXX_3.4 OBJECT:20:_ZTVSt10lock_error@@GLIBCXX_3.4.11 @@ -3437,6 +3465,7 @@ OBJECT:40:_ZTVSt19basic_ostringstreamIwSt11char_traitsIwESaIwEE@@GLIBCXX_3.4 OBJECT:40:_ZTVSt8time_getIcSt19istreambuf_iteratorIcSt11char_traitsIcEEE@@GLIBCXX_3.4 OBJECT:40:_ZTVSt8time_getIwSt19istreambuf_iteratorIwSt11char_traitsIwEEE@@GLIBCXX_3.4 +OBJECT:41:_ZTSNSt13__future_base19_Async_state_commonE@@GLIBCXX_3.4.17 OBJECT:41:_ZTSSt15basic_streambufIcSt11char_traitsIcEE@@GLIBCXX_3.4 OBJECT:41:_ZTSSt15basic_streambufIwSt11char_traitsIwEE@@GLIBCXX_3.4 OBJECT:44:_ZTVN10__cxxabiv117__class_type_infoE@@CXXABI_1.3 Index: libstdc++-v3/acinclude.m4 =================================================================== --- libstdc++-v3/acinclude.m4 (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libstdc++-v3/acinclude.m4 (.../branches/gcc-4_7-branch) (wersja 187906) @@ -2955,11 +2955,10 @@ CXXFLAGS="$old_CXXFLAGS" AC_LANG_RESTORE - # Set atomicity_dir to builtins if all of above tests pass. + # Set atomicity_dir to builtins if all but the long long test above passes. if test $glibcxx_cv_atomic_bool = yes \ && test $glibcxx_cv_atomic_short = yes \ - && test $glibcxx_cv_atomic_int = yes \ - && test $glibcxx_cv_atomic_long_long = yes ; then + && test $glibcxx_cv_atomic_int = yes; then AC_DEFINE(_GLIBCXX_ATOMIC_BUILTINS, 1, [Define if the compiler supports C++11 atomics.]) atomicity_dir=cpu/generic/atomicity_builtins Index: libiberty/ChangeLog =================================================================== --- libiberty/ChangeLog (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libiberty/ChangeLog (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,3 +1,12 @@ +2012-03-24 H.J. Lu + + * testsuite/demangle-expected: Fix a typo. + +2012-03-22 Jason Merrill + + * cp-demangle.c (cplus_demangle_operators): Add li. + (d_unqualified_name): Handle it specially. + 2012-03-22 Release Manager * GCC 4.7.0 released. Index: libiberty/testsuite/demangle-expected =================================================================== --- libiberty/testsuite/demangle-expected (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libiberty/testsuite/demangle-expected (.../branches/gcc-4_7-branch) (wersja 187906) @@ -4073,6 +4073,9 @@ _Z2f1IiEDTnw_T_ilEES0_ decltype (new int{}) f1(int) --format=gnu-v3 +_Zli2_wPKc +operator"" _w(char const*) +--format=gnu-v3 _Z1fIiEDTnw_Dapifp_EET_ decltype (new auto({parm#1})) f(int) --format=gnu-v3 Index: libiberty/cp-demangle.c =================================================================== --- libiberty/cp-demangle.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libiberty/cp-demangle.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1419,7 +1419,12 @@ ret = d_operator_name (di); if (ret != NULL && ret->type == DEMANGLE_COMPONENT_OPERATOR) - di->expansion += sizeof "operator" + ret->u.s_operator.op->len - 2; + { + di->expansion += sizeof "operator" + ret->u.s_operator.op->len - 2; + if (!strcmp (ret->u.s_operator.op->code, "li")) + ret = d_make_comp (di, DEMANGLE_COMPONENT_UNARY, ret, + d_source_name (di)); + } return ret; } else if (peek == 'C' || peek == 'D') @@ -1596,6 +1601,7 @@ { "ix", NL ("[]"), 2 }, { "lS", NL ("<<="), 2 }, { "le", NL ("<="), 2 }, + { "li", NL ("operator\"\" "), 1 }, { "ls", NL ("<<"), 2 }, { "lt", NL ("<"), 2 }, { "mI", NL ("-="), 2 }, Index: ChangeLog =================================================================== --- ChangeLog (.../tags/gcc_4_7_0_release) (wersja 187906) +++ ChangeLog (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,3 +1,18 @@ +2012-05-16 Olivier Hainque + + * Makefile.tpl (gcc-no-fixedincludes): Rename into ... + (gcc-install-no-fixedincludes): Now forwarder to local target in gcc/ + (install-no-fixedincludes): Adjust accordingly. + * Makefile.in: Regenerate. + +2012-03-28 Georg-Johann Lay + + Backport from 2012-03-28 mainline r185907. + + PR target/52737 + * contrib/gcc_update (files_and_dependencies): + Remove gcc/config/avr/t-multilib from touch data. + 2012-03-22 Release Manager * GCC 4.7.0 released. Index: contrib/gcc_update =================================================================== --- contrib/gcc_update (.../tags/gcc_4_7_0_release) (wersja 187906) +++ contrib/gcc_update (.../branches/gcc-4_7-branch) (wersja 187906) @@ -83,7 +83,6 @@ gcc/config/arm/arm-tables.opt: gcc/config/arm/arm-arches.def gcc/config/arm/arm-cores.def gcc/config/arm/arm-fpus.def gcc/config/arm/genopt.sh gcc/config/avr/avr-tables.opt: gcc/config/avr/avr-mcus.def gcc/config/avr/genopt.sh gcc/config/avr/t-multilib: gcc/config/avr/avr-mcus.def gcc/config/avr/genmultilib.awk -gcc/config/avr/multilib.h: gcc/config/avr/avr-mcus.def gcc/config/avr/genmultilib.awk gcc/config/c6x/c6x-tables.opt: gcc/config/c6x/c6x-isas.def gcc/config/c6x/genopt.sh gcc/config/c6x/c6x-sched.md: gcc/config/c6x/c6x-sched.md.in gcc/config/c6x/gensched.sh gcc/config/c6x/c6x-mult.md: gcc/config/c6x/c6x-mult.md.in gcc/config/c6x/genmult.sh Index: libjava/configure.ac =================================================================== --- libjava/configure.ac (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libjava/configure.ac (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1825,7 +1825,7 @@ AS_HELP_STRING([--disable-symvers], [disable symbol versioning for libjava]), [case "$enableval" in - yes) libjava_cv_anon_version_script=yes ;; + yes|gnu*) libjava_cv_anon_version_script=yes ;; no) libjava_cv_anon_version_script=no ;; *) AC_MSG_ERROR([Unknown argument to enable/disable symvers]);; esac], Index: libjava/include/Makefile.in =================================================================== --- libjava/include/Makefile.in (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libjava/include/Makefile.in (.../branches/gcc-4_7-branch) (wersja 187906) @@ -136,7 +136,6 @@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCC_FOR_ECJX = @GCC_FOR_ECJX@ -GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@ GCDEPS = @GCDEPS@ GCINCS = @GCINCS@ GCJ = @GCJ@ @@ -184,6 +183,7 @@ LIBDIR = @LIBDIR@ LIBFFI = @LIBFFI@ LIBFFIINCS = @LIBFFIINCS@ +LIBGCC_UNWIND_INCLUDE = @LIBGCC_UNWIND_INCLUDE@ LIBGCJDEBUG = @LIBGCJDEBUG@ LIBGCJTESTSPEC = @LIBGCJTESTSPEC@ LIBGCJ_BC_SPEC = @LIBGCJ_BC_SPEC@ Index: libjava/ChangeLog =================================================================== --- libjava/ChangeLog (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libjava/ChangeLog (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,3 +1,15 @@ +2012-05-21 Benjamin Kosnik + + PR libstdc++/52700 + * configure.ac: Allow gnu, gnu-versioned-namespace for + --enable-symvers arguments. + * configure: Regenerate. + +2012-04-23 Andrew Haley + + * defineclass.cc (MAJOR_1_7, MINOR_1_7): New. + (parse): Allow MAJOR_1_7 classfile version. + 2012-03-22 Release Manager * GCC 4.7.0 released. Index: libjava/testsuite/Makefile.in =================================================================== --- libjava/testsuite/Makefile.in (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libjava/testsuite/Makefile.in (.../branches/gcc-4_7-branch) (wersja 187906) @@ -111,7 +111,6 @@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCC_FOR_ECJX = @GCC_FOR_ECJX@ -GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@ GCDEPS = @GCDEPS@ GCINCS = @GCINCS@ GCJ = @GCJ@ @@ -159,6 +158,7 @@ LIBDIR = @LIBDIR@ LIBFFI = @LIBFFI@ LIBFFIINCS = @LIBFFIINCS@ +LIBGCC_UNWIND_INCLUDE = @LIBGCC_UNWIND_INCLUDE@ LIBGCJDEBUG = @LIBGCJDEBUG@ LIBGCJTESTSPEC = @LIBGCJTESTSPEC@ LIBGCJ_BC_SPEC = @LIBGCJ_BC_SPEC@ Index: libjava/configure =================================================================== --- libjava/configure (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libjava/configure (.../branches/gcc-4_7-branch) (wersja 187906) @@ -24557,7 +24557,7 @@ # Check whether --enable-symvers was given. if test "${enable_symvers+set}" = set; then : enableval=$enable_symvers; case "$enableval" in - yes) libjava_cv_anon_version_script=yes ;; + yes|gnu*) libjava_cv_anon_version_script=yes ;; no) libjava_cv_anon_version_script=no ;; *) as_fn_error "Unknown argument to enable/disable symvers" "$LINENO" 5;; esac Index: libjava/gcj/Makefile.in =================================================================== --- libjava/gcj/Makefile.in (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libjava/gcj/Makefile.in (.../branches/gcc-4_7-branch) (wersja 187906) @@ -135,7 +135,6 @@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GCC_FOR_ECJX = @GCC_FOR_ECJX@ -GCC_UNWIND_INCLUDE = @GCC_UNWIND_INCLUDE@ GCDEPS = @GCDEPS@ GCINCS = @GCINCS@ GCJ = @GCJ@ @@ -183,6 +182,7 @@ LIBDIR = @LIBDIR@ LIBFFI = @LIBFFI@ LIBFFIINCS = @LIBFFIINCS@ +LIBGCC_UNWIND_INCLUDE = @LIBGCC_UNWIND_INCLUDE@ LIBGCJDEBUG = @LIBGCJDEBUG@ LIBGCJTESTSPEC = @LIBGCJTESTSPEC@ LIBGCJ_BC_SPEC = @LIBGCJ_BC_SPEC@ Index: libjava/defineclass.cc =================================================================== --- libjava/defineclass.cc (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libjava/defineclass.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -361,6 +361,8 @@ #define MINOR_1_5 0 #define MAJOR_1_6 50 #define MINOR_1_6 0 +#define MAJOR_1_7 51 +#define MINOR_1_7 0 void _Jv_ClassReader::parse () @@ -371,8 +373,8 @@ int minor_version = read2u (); int major_version = read2u (); - if (major_version < MAJOR_1_1 || major_version > MAJOR_1_6 - || (major_version == MAJOR_1_6 && minor_version > MINOR_1_6)) + if (major_version < MAJOR_1_1 || major_version > MAJOR_1_7 + || (major_version == MAJOR_1_7 && minor_version > MINOR_1_7)) throw_class_format_error ("unrecognized class file version"); is_15 = (major_version >= MAJOR_1_5); Index: libgcc/config.host =================================================================== --- libgcc/config.host (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libgcc/config.host (.../branches/gcc-4_7-branch) (wersja 187906) @@ -744,15 +744,13 @@ ;; mips*-*-netbsd*) # NetBSD/mips, either endian. ;; -mips64*-*-linux* | mipsisa64*-*-linux*) - extra_parts="$extra_parts crtfastmath.o" - tmake_file="${tmake_file} t-crtfm mips/t-mips16 mips/t-tpbit" - md_unwind_header=mips/linux-unwind.h - ;; mips*-*-linux*) # Linux MIPS, either endian. extra_parts="$extra_parts crtfastmath.o" tmake_file="${tmake_file} t-crtfm mips/t-mips16" md_unwind_header=mips/linux-unwind.h + if test "${ac_cv_sizeof_long_double}" = 16; then + tmake_file="${tmake_file} mips/t-tpbit" + fi ;; mips*-*-openbsd*) ;; @@ -848,9 +846,15 @@ tmake_file="$tmake_file rs6000/t-darwin64 rs6000/t-ibm-ldouble" extra_parts="$extra_parts crt2.o" ;; -powerpc-*-freebsd*) - tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-savresfgpr rs6000/t-crtstuff rs6000/t-freebsd t-softfp-sfdf t-softfp-excl t-softfp t-slibgcc-libgcc" +powerpc*-*-freebsd*) + tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-savresfgpr rs6000/t-crtstuff rs6000/t-freebsd t-softfp-sfdf t-softfp-excl t-softfp" extra_parts="$extra_parts crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o" + case ${host} in + powerpc64*) + tmake_file="${tmake_file} rs6000/t-freebsd64" + md_unwind_header=rs6000/freebsd-unwind.h + ;; + esac ;; powerpc-*-netbsd*) tmake_file="$tmake_file rs6000/t-netbsd rs6000/t-crtstuff" Index: libgcc/Makefile.in =================================================================== --- libgcc/Makefile.in (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libgcc/Makefile.in (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1002,14 +1002,26 @@ $(libunwind-objects) $(libunwind-s-objects) \ $(EXTRA_PARTS): libgcc_tm.h -install-unwind_h: +# Copy unwind.h to the place where gcc will look for it at build-time +install-unwind_h-forbuild: dest=$(gcc_objdir)/include/tmp$$$$-unwind.h; \ cp unwind.h $$dest; \ chmod a+r $$dest; \ sh $(srcdir)/../move-if-change $$dest $(gcc_objdir)/include/unwind.h -all: install-unwind_h +# Copy unwind.h to the place where gcc will look at run-time, once installed +# +# This is redundant with the internal copy above when using a regular toplevel +# "install" target, because gcc's install will copy to the destination as well. +# +# This is however useful for "install-no-fixincludes" case, when only the gcc +# internal headers are copied by gcc's install. +install-unwind_h: + $(mkinstalldirs) $(DESTDIR)$(libsubdir)/include + $(INSTALL_DATA) unwind.h $(DESTDIR)$(libsubdir)/include +all: install-unwind_h-forbuild + # Documentation targets (empty). .PHONY: info html dvi pdf install-info install-html install-pdf @@ -1067,12 +1079,13 @@ esac; \ done -install: install-leaf +install: install-leaf install-unwind_h @: $(MAKE) ; $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install install-strip: install .PHONY: install install-shared install-libunwind install-strip +.PHONY: install-unwind_h install-unwind_h-forbuild # Don't export variables to the environment, in order to not confuse # configure. Index: libgcc/configure.ac =================================================================== --- libgcc/configure.ac (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libgcc/configure.ac (.../branches/gcc-4_7-branch) (wersja 187906) @@ -14,6 +14,11 @@ AC_INIT([GNU C Runtime Library], 1.0,,[libgcc]) AC_CONFIG_SRCDIR([static-object.mk]) +# The libgcc should not depend on any header files +AC_DEFUN([_AC_INCLUDES_DEFAULT_REQUIREMENTS], + [m4_divert_text([DEFAULTS], + [ac_includes_default='/* none */'])]) + AC_ARG_WITH(target-subdir, [ --with-target-subdir=SUBDIR Configuring in a subdirectory for target]) AC_ARG_WITH(cross-host, Index: libgcc/ChangeLog =================================================================== --- libgcc/ChangeLog (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libgcc/ChangeLog (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,3 +1,127 @@ +2012-05-25 Ian Lance Taylor + + * config/i386/morestack.S (__morestack_non_split): Check whether + caller is varargs and needs %bp to hold the stack frame on return. + +2012-05-24 Olivier Hainque + + * Makefile.in: Move dependency on install-unwind_h from + "install-leaf" to "install". + +2012-05-21 Andrew Pinski + + PR bootstrap/53183 + * configure.ac: Define the default includes to being none. + * configure: Regenerate. + +2012-05-16 Olivier Hainque + + * Makefile.in (install-unwind_h): Rename into ... + (install-unwind_h-forbuild): New target. + (all): Use it instead of the former install-unwind_h. + (install-unwind_h): Reinstate, copy to user install destination + for include files, not to the internal gcc object directory one. + (install-leaf): Depend on it. + +2012-04-30 Andreas Tobler + + Backport from mainline + 2012-03-21 Andreas Tobler + + * config.host: Add bits to support powerpc64-*-freebsd*. + * config/rs6000/freebsd-unwind.h: New file. + * config/rs6000/t-freebsd64: New file. + +2012-04-28 Aurelien Jarno + + * config.host (mips64*-*-linux*, mipsisa64*-*-linux*): Remove. + (mips*-*-linux*): Include mips/t-tpbit when long double is + 16 bytes long. + +2012-04-20 Thomas Schwinge + + struct siginfo vs. siginfo_t + + Backport from trunk: + + 2012-04-20 Thomas Schwinge + + * config/alpha/linux-unwind.h (alpha_fallback_frame_state): Use + siginfo_t instead of struct siginfo. + * config/bfin/linux-unwind.h (bfin_fallback_frame_state): Likewise. + * config/i386/linux-unwind.h (x86_fallback_frame_state): Likewise. + * config/ia64/linux-unwind.h (ia64_fallback_frame_state) + (ia64_handle_unwabi): Likewise. + * config/mips/linux-unwind.h (mips_fallback_frame_state): Likewise. + * config/pa/linux-unwind.h (pa32_fallback_frame_state): Likewise. + * config/sh/linux-unwind.h (shmedia_fallback_frame_state) + (sh_fallback_frame_state): Likewise. + * config/tilepro/linux-unwind.h (tile_fallback_frame_state): Likewise. + * config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Likewise. + +2012-04-06 Walter Lee + + Backport from mainline + 2012-03-07 Walter Lee + + * config/tilepro/atomic.c: Rename "atomic_" prefix to + "arch_atomic_". + (atomic_xor): Rename and move definition to + config/tilepro/atomic.h. + (atomic_nand): Ditto. + * config/tilepro/atomic.h: Rename "atomic_" prefix to + "arch_atomic_". + (arch_atomic_xor): Move from config/tilepro/atomic.c. + (arch_atomic_nand): Ditto. + +2012-04-02 H.J. Lu + + Backported from mainline + 2012-04-02 H.J. Lu + + * config/i386/linux-unwind.h (RT_SIGRETURN_SYSCALL): Update x32 + system call number. + +2012-03-31 Eric Botcazou + + * config/ia64/unwind-ia64.c (uw_install_context): Manually save LC + if it hasn't been previously saved. + +2012-03-28 Georg-Johann Lay + + Backport from 2012-03-28 mainline r185907. + + PR target/52737 + * config/avr/lib1funcs.S: Use __AVR_HAVE_SPH__ for SP_H checks + instead of __AVR_HAVE_8BIT_SP__. + +2012-03-22 Georg-Johann Lay + + Backport from 2012-03-07 mainline r185033. + + PR target/52507 + * config/avr/lib1funcs.S (__movmemx_hi): Fix loop label in RAM-part. + + Backport from 2012-03-07 mainline r185031. + + PR target/52505 + * config/avr/lib1funcs.S (__xload_1): Don't read unintentionally + from RAM. + + Backport from 2012-03-07 mainline r185030. + + PR target/52461 + PR target/52508 + * config/avr/lib1funcs.S (__do_copy_data): Clear RAMPZ after usage + if RAMPZ affects reading from RAM. + (__tablejump_elpm__): Ditto. + (.xload): Ditto. + (__movmemx_hi): Ditto. + (__do_global_ctors): Right condition for RAMPZ usage is "have ELPM". + (__do_global_dtors): Ditto. + (__xload_1, __xload_2, __xload_3, __xload_4): Ditto. + (__movmemx_hi): Ditto. + 2012-03-22 Release Manager * GCC 4.7.0 released. Index: libgcc/config/alpha/linux-unwind.h =================================================================== --- libgcc/config/alpha/linux-unwind.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libgcc/config/alpha/linux-unwind.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,5 +1,5 @@ /* DWARF2 EH unwinding support for Alpha Linux. - Copyright (C) 2004, 2005, 2009, 2011 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2009, 2011, 2012 Free Software Foundation, Inc. This file is part of GCC. @@ -49,7 +49,7 @@ else if (pc[1] == 0x201f015f) /* lda $0,NR_rt_sigreturn */ { struct rt_sigframe { - struct siginfo info; + siginfo_t info; struct ucontext uc; } *rt_ = context->cfa; sc = &rt_->uc.uc_mcontext; Index: libgcc/config/ia64/unwind-ia64.c =================================================================== --- libgcc/config/ia64/unwind-ia64.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libgcc/config/ia64/unwind-ia64.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -2171,8 +2171,20 @@ struct _Unwind_Context *target) { unsigned long ireg_buf[4], ireg_nat = 0, ireg_pr = 0; + unsigned long saved_lc; long i; + /* ??? LC is a fixed register so the call to __builtin_unwind_init in + uw_init_context doesn't cause it to be saved. In case it isn't in + the user frames either, we need to manually do so here, lest it be + clobbered by the loop just below. */ + if (target->lc_loc == NULL) + { + register unsigned long lc asm ("ar.lc"); + saved_lc = lc; + target->lc_loc = &saved_lc; + } + /* Copy integer register data from the target context to a temporary buffer. Do this so that we can frob AR.UNAT to get the NaT bits for these registers set properly. */ Index: libgcc/config/ia64/linux-unwind.h =================================================================== --- libgcc/config/ia64/linux-unwind.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libgcc/config/ia64/linux-unwind.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,5 +1,5 @@ /* DWARF2 EH unwinding support for IA64 Linux. - Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2009, 2012 Free Software Foundation, Inc. This file is part of GCC. @@ -47,7 +47,7 @@ struct sigframe { char scratch[16]; unsigned long sig_number; - struct siginfo *info; + siginfo_t *info; struct sigcontext *sc; } *frame_ = (struct sigframe *)context->psp; struct sigcontext *sc = frame_->sc; @@ -137,7 +137,7 @@ struct sigframe { char scratch[16]; unsigned long sig_number; - struct siginfo *info; + siginfo_t *info; struct sigcontext *sc; } *frame = (struct sigframe *)context->psp; struct sigcontext *sc = frame->sc; Index: libgcc/config/i386/linux-unwind.h =================================================================== --- libgcc/config/i386/linux-unwind.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libgcc/config/i386/linux-unwind.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,5 +1,5 @@ /* DWARF2 EH unwinding support for AMD x86-64 and x86. - Copyright (C) 2004, 2005, 2006, 2009, 2010, 2011 + Copyright (C) 2004, 2005, 2006, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This file is part of GCC. @@ -48,7 +48,7 @@ #ifdef __LP64__ #define RT_SIGRETURN_SYSCALL 0x050f0000000fc0c7ULL #else -#define RT_SIGRETURN_SYSCALL 0x050f40002006c0c7ULL +#define RT_SIGRETURN_SYSCALL 0x050f40000201c0c7ULL #endif if (*(unsigned char *)(pc+0) == 0x48 && *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL) @@ -139,9 +139,9 @@ { struct rt_sigframe { int sig; - struct siginfo *pinfo; + siginfo_t *pinfo; void *puc; - struct siginfo info; + siginfo_t info; struct ucontext uc; } *rt_ = context->cfa; /* The void * cast is necessary to avoid an aliasing warning. Index: libgcc/config/i386/morestack.S =================================================================== --- libgcc/config/i386/morestack.S (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libgcc/config/i386/morestack.S (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,5 +1,5 @@ # x86/x86_64 support for -fsplit-stack. -# Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Contributed by Ian Lance Taylor . # This file is part of GCC. @@ -138,6 +138,24 @@ je 1f # see above. addl $2,%eax 1: inc %eax + + # If the instruction that we return to is + # leal 20(%ebp),{%eax,%ecx,%edx} + # then we have been called by a varargs function that expects + # %ebp to hold a real value. That can only work if we do the + # full stack split routine. FIXME: This is fragile. + cmpb $0x8d,(%eax) + jne 3f + cmpb $0x14,2(%eax) + jne 3f + cmpb $0x45,1(%eax) + je 2f + cmpb $0x4d,1(%eax) + je 2f + cmpb $0x55,1(%eax) + je 2f + +3: movl %eax,4(%esp) # Update return address. popl %eax # Restore %eax and stack. @@ -175,18 +193,32 @@ #else cmpl %fs:0x40,%eax #endif - popq %rax # Restore register. - .cfi_adjust_cfa_offset -8 # Adjust for popped register. - jb 2f # Get more space if we need it. # This breaks call/return prediction, as described above. - incq (%rsp) # Increment the return address. + incq 8(%rsp) # Increment the return address. + # If the instruction that we return to is + # leaq 24(%rbp), %r11n + # then we have been called by a varargs function that expects + # %ebp to hold a real value. That can only work if we do the + # full stack split routine. FIXME: This is fragile. + movq 8(%rsp),%rax + cmpl $0x185d8d4c,(%rax) + je 2f + + popq %rax # Restore register. + + .cfi_adjust_cfa_offset -8 # Adjust for popped register. + ret # Return to caller. 2: + popq %rax # Restore register. + + .cfi_adjust_cfa_offset -8 # Adjust for popped register. + addq $0x5000+BACKOFF,%r10 # Increment space we request. # Fall through into morestack. Index: libgcc/config/rs6000/t-freebsd64 =================================================================== --- libgcc/config/rs6000/t-freebsd64 (.../tags/gcc_4_7_0_release) (wersja 0) +++ libgcc/config/rs6000/t-freebsd64 (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,5 @@ +HOST_LIBGCC2_CFLAGS += -mno-minimal-toc +SHLIB_MAPFILES = libgcc-std.ver + +softfp_wrap_start := '\#ifndef __powerpc64__' +softfp_wrap_end := '\#endif' Index: libgcc/config/rs6000/freebsd-unwind.h =================================================================== --- libgcc/config/rs6000/freebsd-unwind.h (.../tags/gcc_4_7_0_release) (wersja 0) +++ libgcc/config/rs6000/freebsd-unwind.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,69 @@ +/* DWARF2 EH unwinding support for PowerPC64 FreeBSD. + Copyright (C) 2012 Free Software Foundation, Inc. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + +#define R_LR 65 + +#define MD_FROB_UPDATE_CONTEXT frob_update_context + +static void +frob_update_context (struct _Unwind_Context *context, + _Unwind_FrameState *fs ATTRIBUTE_UNUSED) +{ + const unsigned int *pc = (const unsigned int *) context->ra; + +#ifdef __powerpc64__ + if (fs->regs.reg[2].how == REG_UNSAVED) + { + /* If the current unwind info (FS) does not contain explicit info + saving R2, then we have to do a minor amount of code reading to + figure out if it was saved. The big problem here is that the + code that does the save/restore is generated by the linker, so + we have no good way to determine at compile time what to do. */ + if (pc[0] == 0xF8410028 + || ((pc[0] & 0xFFFF0000) == 0x3D820000 + && pc[1] == 0xF8410028)) + { + /* We are in a plt call stub or r2 adjusting long branch stub, + before r2 has been saved. Keep REG_UNSAVED. */ + } + else + { + unsigned int *insn + = (unsigned int *) _Unwind_GetGR (context, R_LR); + if (insn && *insn == 0xE8410028) + _Unwind_SetGRPtr (context, 2, context->cfa + 40); + else if (pc[0] == 0x4E800421 + && pc[1] == 0xE8410028) + { + /* We are at the bctrl instruction in a call via function + pointer. gcc always emits the load of the new R2 just + before the bctrl so this is the first and only place + we need to use the stored R2. */ + _Unwind_Word sp = _Unwind_GetGR (context, 1); + _Unwind_SetGRPtr (context, 2, (void *)(sp + 40)); + } + } + } +#endif +} Index: libgcc/config/sh/linux-unwind.h =================================================================== --- libgcc/config/sh/linux-unwind.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libgcc/config/sh/linux-unwind.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,5 +1,6 @@ /* DWARF2 EH unwinding support for SH Linux. - Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2006, 2007, 2009, 2012 Free Software Foundation, + Inc. This file is part of GCC. @@ -80,9 +81,9 @@ && (*(unsigned long *) (pc+11) == 0x6ff0fff0)) { struct rt_sigframe { - struct siginfo *pinfo; + siginfo_t *pinfo; void *puc; - struct siginfo info; + siginfo_t info; struct ucontext uc; } *rt_ = context->cfa; /* The void * cast is necessary to avoid an aliasing warning. @@ -179,7 +180,7 @@ && (*(unsigned short *) (pc+14) == 0x00ad)))) { struct rt_sigframe { - struct siginfo info; + siginfo_t info; struct ucontext uc; } *rt_ = context->cfa; /* The void * cast is necessary to avoid an aliasing warning. Index: libgcc/config/tilepro/atomic.h =================================================================== --- libgcc/config/tilepro/atomic.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libgcc/config/tilepro/atomic.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -104,8 +104,8 @@ /* 32-bit integer compare-and-exchange. */ static __inline __attribute__ ((always_inline)) - int atomic_val_compare_and_exchange_4 (volatile int *mem, - int oldval, int newval) + int arch_atomic_val_compare_and_exchange_4 (volatile int *mem, + int oldval, int newval) { #ifdef __tilegx__ __insn_mtspr (SPR_CMPEXCH_VALUE, oldval); @@ -123,9 +123,9 @@ /* 64-bit integer compare-and-exchange. */ static __inline __attribute__ ((always_inline)) - int64_t atomic_val_compare_and_exchange_8 (volatile int64_t * mem, - int64_t oldval, - int64_t newval) + int64_t arch_atomic_val_compare_and_exchange_8 (volatile int64_t * mem, + int64_t oldval, + int64_t newval) { #ifdef __tilegx__ __insn_mtspr (SPR_CMPEXCH_VALUE, oldval); @@ -146,41 +146,41 @@ /* This non-existent symbol is called for sizes other than "4" and "8", indicating a bug in the caller. */ -extern int __atomic_error_bad_argument_size (void) +extern int __arch_atomic_error_bad_argument_size (void) __attribute__ ((warning ("sizeof atomic argument not 4 or 8"))); -#define atomic_val_compare_and_exchange(mem, o, n) \ +#define arch_atomic_val_compare_and_exchange(mem, o, n) \ ({ \ (__typeof(*(mem)))(__typeof(*(mem)-*(mem))) \ ((sizeof(*(mem)) == 8) ? \ - atomic_val_compare_and_exchange_8( \ + arch_atomic_val_compare_and_exchange_8( \ (volatile int64_t*)(mem), (__typeof((o)-(o)))(o), \ (__typeof((n)-(n)))(n)) : \ (sizeof(*(mem)) == 4) ? \ - atomic_val_compare_and_exchange_4( \ + arch_atomic_val_compare_and_exchange_4( \ (volatile int*)(mem), (__typeof((o)-(o)))(o), \ (__typeof((n)-(n)))(n)) : \ - __atomic_error_bad_argument_size()); \ + __arch_atomic_error_bad_argument_size()); \ }) -#define atomic_bool_compare_and_exchange(mem, o, n) \ +#define arch_atomic_bool_compare_and_exchange(mem, o, n) \ ({ \ __typeof(o) __o = (o); \ __builtin_expect( \ - __o == atomic_val_compare_and_exchange((mem), __o, (n)), 1); \ + __o == arch_atomic_val_compare_and_exchange((mem), __o, (n)), 1); \ }) /* Loop with compare_and_exchange until we guess the correct value. Normally "expr" will be an expression using __old and __value. */ -#define __atomic_update_cmpxchg(mem, value, expr) \ +#define __arch_atomic_update_cmpxchg(mem, value, expr) \ ({ \ __typeof(value) __value = (value); \ __typeof(*(mem)) *__mem = (mem), __old = *__mem, __guess; \ do { \ __guess = __old; \ - __old = atomic_val_compare_and_exchange(__mem, __old, (expr)); \ + __old = arch_atomic_val_compare_and_exchange(__mem, __old, (expr)); \ } while (__builtin_expect(__old != __guess, 0)); \ __old; \ }) @@ -189,14 +189,14 @@ /* Generic atomic op with 8- or 4-byte variant. The _mask, _addend, and _expr arguments are ignored on tilegx. */ -#define __atomic_update(mem, value, op, _mask, _addend, _expr) \ +#define __arch_atomic_update(mem, value, op, _mask, _addend, _expr) \ ({ \ ((__typeof(*(mem))) \ ((sizeof(*(mem)) == 8) ? (__typeof(*(mem)-*(mem)))__insn_##op( \ (void *)(mem), (int64_t)(__typeof((value)-(value)))(value)) : \ (sizeof(*(mem)) == 4) ? (int)__insn_##op##4( \ (void *)(mem), (int32_t)(__typeof((value)-(value)))(value)) : \ - __atomic_error_bad_argument_size())); \ + __arch_atomic_error_bad_argument_size())); \ }) #else @@ -211,7 +211,7 @@ Only 32-bit support is provided. */ static __inline __attribute__ ((always_inline)) int - __atomic_update_4 (volatile int *mem, int mask, int addend) + __arch_atomic_update_4 (volatile int *mem, int mask, int addend) { int result; __asm__ __volatile__ ("swint1":"=R00" (result), @@ -224,48 +224,55 @@ /* Generic atomic op with 8- or 4-byte variant. The _op argument is ignored on tilepro. */ -#define __atomic_update(mem, value, _op, mask, addend, expr) \ +#define __arch_atomic_update(mem, value, _op, mask, addend, expr) \ ({ \ (__typeof(*(mem)))(__typeof(*(mem)-*(mem))) \ ((sizeof(*(mem)) == 8) ? \ - __atomic_update_cmpxchg((mem), (value), (expr)) : \ + __arch_atomic_update_cmpxchg((mem), (value), (expr)) : \ (sizeof(*(mem)) == 4) ? \ - __atomic_update_4((volatile int*)(mem), (__typeof((mask)-(mask)))(mask), \ - (__typeof((addend)-(addend)))(addend)) : \ - __atomic_error_bad_argument_size()); \ + __arch_atomic_update_4((volatile int*)(mem), \ + (__typeof((mask)-(mask)))(mask), \ + (__typeof((addend)-(addend)))(addend)) : \ + __arch_atomic_error_bad_argument_size()); \ }) #endif /* __tilegx__ */ -#define atomic_exchange(mem, newvalue) \ - __atomic_update(mem, newvalue, exch, 0, newvalue, __value) +#define arch_atomic_exchange(mem, newvalue) \ + __arch_atomic_update(mem, newvalue, exch, 0, newvalue, __value) -#define atomic_add(mem, value) \ - __atomic_update(mem, value, fetchadd, -1, value, __old + __value) +#define arch_atomic_add(mem, value) \ + __arch_atomic_update(mem, value, fetchadd, -1, value, __old + __value) -#define atomic_sub(mem, value) atomic_add((mem), -(value)) +#define arch_atomic_sub(mem, value) arch_atomic_add((mem), -(value)) -#define atomic_increment(mem) atomic_add((mem), 1) +#define arch_atomic_increment(mem) arch_atomic_add((mem), 1) -#define atomic_decrement(mem) atomic_add((mem), -1) +#define arch_atomic_decrement(mem) arch_atomic_add((mem), -1) -#define atomic_and(mem, mask) \ - __atomic_update(mem, mask, fetchand, mask, 0, __old & __value) +#define arch_atomic_and(mem, mask) \ + __arch_atomic_update(mem, mask, fetchand, mask, 0, __old & __value) -#define atomic_or(mem, mask) \ - __atomic_update(mem, mask, fetchor, ~mask, mask, __old | __value) +#define arch_atomic_or(mem, mask) \ + __arch_atomic_update(mem, mask, fetchor, ~mask, mask, __old | __value) -#define atomic_bit_set(mem, bit) \ +#define arch_atomic_xor(mem, mask) \ + __arch_atomic_update_cmpxchg(mem, mask, __old ^ __value) + +#define arch_atomic_nand(mem, mask) \ + __arch_atomic_update_cmpxchg(mem, mask, ~(__old & __value)) + +#define arch_atomic_bit_set(mem, bit) \ ({ \ __typeof(*(mem)) __mask = (__typeof(*(mem)))1 << (bit); \ - __mask & atomic_or((mem), __mask); \ + __mask & arch_atomic_or((mem), __mask); \ }) -#define atomic_bit_clear(mem, bit) \ +#define arch_atomic_bit_clear(mem, bit) \ ({ \ __typeof(*(mem)) __mask = (__typeof(*(mem)))1 << (bit); \ - __mask & atomic_and((mem), ~__mask); \ + __mask & arch_atomic_and((mem), ~__mask); \ }) #ifdef __tilegx__ @@ -275,9 +282,9 @@ This accessor is provided for compatibility with TILEPro, which required an explicit atomic operation for stores that needed to be atomic with respect to other atomic methods in this header. */ -#define atomic_write(mem, value) ((void) (*(mem) = (value))) +#define arch_atomic_write(mem, value) ((void) (*(mem) = (value))) #else -#define atomic_write(mem, value) \ +#define arch_atomic_write(mem, value) \ do { \ __typeof(mem) __aw_mem = (mem); \ __typeof(value) __aw_val = (value); \ @@ -285,26 +292,26 @@ __aw_intval = (__typeof((value) - (value)))__aw_val; \ switch (sizeof(*__aw_mem)) { \ case 8: \ - __atomic_update_cmpxchg(__aw_mem, __aw_val, __value); \ + __arch_atomic_update_cmpxchg(__aw_mem, __aw_val, __value); \ break; \ case 4: \ - __atomic_update_4((int *)__aw_mem, 0, __aw_intval); \ + __arch_atomic_update_4((int *)__aw_mem, 0, __aw_intval); \ break; \ case 2: \ __aw_off = 8 * ((long)__aw_mem & 0x2); \ __aw_mask = 0xffffU << __aw_off; \ __aw_mem32 = (unsigned int *)((long)__aw_mem & ~0x2); \ __aw_val32 = (__aw_intval << __aw_off) & __aw_mask; \ - __atomic_update_cmpxchg(__aw_mem32, __aw_val32, \ - (__old & ~__aw_mask) | __value); \ + __arch_atomic_update_cmpxchg(__aw_mem32, __aw_val32, \ + (__old & ~__aw_mask) | __value); \ break; \ case 1: \ __aw_off = 8 * ((long)__aw_mem & 0x3); \ __aw_mask = 0xffU << __aw_off; \ __aw_mem32 = (unsigned int *)((long)__aw_mem & ~0x3); \ __aw_val32 = (__aw_intval << __aw_off) & __aw_mask; \ - __atomic_update_cmpxchg(__aw_mem32, __aw_val32, \ - (__old & ~__aw_mask) | __value); \ + __arch_atomic_update_cmpxchg(__aw_mem32, __aw_val32, \ + (__old & ~__aw_mask) | __value); \ break; \ } \ } while (0) @@ -315,15 +322,15 @@ This macro prevents loads or stores from being moved by the compiler across the macro. Any loaded value that was loaded before this macro must then be reloaded by the compiler. */ -#define atomic_compiler_barrier() __asm__ __volatile__("" ::: "memory") +#define arch_atomic_compiler_barrier() __asm__ __volatile__("" ::: "memory") /* Full memory barrier. - This macro has the semantics of atomic_compiler_barrer(), but also + This macro has the semantics of arch_atomic_compiler_barrer(), but also ensures that previous stores are visible to other cores, and that all previous loaded values have been placed into their target register on this core. */ -#define atomic_full_barrier() __insn_mf() +#define arch_atomic_full_barrier() __insn_mf() /* Read memory barrier. @@ -335,9 +342,9 @@ On current TILE chips a read barrier is implemented as a full barrier, but this may not be true in later versions of the architecture. - See also atomic_acquire_barrier() for the appropriate idiom to use + See also arch_atomic_acquire_barrier() for the appropriate idiom to use to ensure no reads are lifted above an atomic lock instruction. */ -#define atomic_read_barrier() atomic_full_barrier() +#define arch_atomic_read_barrier() arch_atomic_full_barrier() /* Write memory barrier. @@ -349,9 +356,9 @@ On current TILE chips a write barrier is implemented as a full barrier, but this may not be true in later versions of the architecture. - See also atomic_release_barrier() for the appropriate idiom to use + See also arch_atomic_release_barrier() for the appropriate idiom to use to ensure all writes are complete prior to an atomic unlock instruction. */ -#define atomic_write_barrier() atomic_full_barrier() +#define arch_atomic_write_barrier() arch_atomic_full_barrier() /* Lock acquisition barrier. @@ -367,10 +374,10 @@ This should be done after the atomic operation that actually acquires the lock, and in conjunction with a "control dependency" that checks the atomic operation result to see if the lock was - in fact acquired. See the atomic_read_barrier() macro + in fact acquired. See the arch_atomic_read_barrier() macro for a heavier-weight barrier to use in certain unusual constructs, - or atomic_acquire_barrier_value() if no control dependency exists. */ -#define atomic_acquire_barrier() atomic_compiler_barrier() + or arch_atomic_acquire_barrier_value() if no control dependency exists. */ +#define arch_atomic_acquire_barrier() arch_atomic_compiler_barrier() /* Lock release barrier. @@ -383,7 +390,7 @@ for locking, that is, when leaving a critical section. This should be done before the operation (such as a store of zero) that actually releases the lock. */ -#define atomic_release_barrier() atomic_write_barrier() +#define arch_atomic_release_barrier() arch_atomic_write_barrier() /* Barrier until the read of a particular value is complete. @@ -400,7 +407,7 @@ atomic instruction, even if the value itself is not checked. This guarantees that if the atomic instruction succeeded in taking the lock, the lock was held before any reads in the critical section issued. */ -#define atomic_acquire_barrier_value(val) \ +#define arch_atomic_acquire_barrier_value(val) \ __asm__ __volatile__("move %0, %0" :: "r"(val)) /* Access the given variable in memory exactly once. @@ -421,8 +428,9 @@ Note that multiple uses of this macro are guaranteed to be ordered, i.e. the compiler will not reorder stores or loads that are wrapped - in atomic_access_once(). */ -#define atomic_access_once(x) (*(volatile __typeof(x) *)&(x)) + in arch_atomic_access_once(). */ +#define arch_atomic_access_once(x) (*(volatile __typeof(x) *)&(x)) + #endif /* !_ATOMIC_H_ */ Index: libgcc/config/tilepro/linux-unwind.h =================================================================== --- libgcc/config/tilepro/linux-unwind.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libgcc/config/tilepro/linux-unwind.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -61,7 +61,7 @@ struct rt_sigframe { unsigned char save_area[C_ABI_SAVE_AREA_SIZE]; - struct siginfo info; + siginfo_t info; struct ucontext uc; } *rt_; Index: libgcc/config/tilepro/atomic.c =================================================================== --- libgcc/config/tilepro/atomic.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libgcc/config/tilepro/atomic.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -63,18 +63,12 @@ #define __unused __attribute__((unused)) -/* Provide additional methods not implemented by atomic.h. */ -#define atomic_xor(mem, mask) \ - __atomic_update_cmpxchg(mem, mask, __old ^ __value) -#define atomic_nand(mem, mask) \ - __atomic_update_cmpxchg(mem, mask, ~(__old & __value)) - #define __atomic_fetch_and_do(type, size, opname) \ type \ __atomic_fetch_##opname##_##size(type* p, type i, int model) \ { \ pre_atomic_barrier(model); \ - type rv = atomic_##opname(p, i); \ + type rv = arch_atomic_##opname(p, i); \ post_atomic_barrier(model); \ return rv; \ } @@ -96,7 +90,7 @@ __atomic_##opname##_fetch_##size(type* p, type i, int model) \ { \ pre_atomic_barrier(model); \ - type rv = atomic_##opname(p, i) op i; \ + type rv = arch_atomic_##opname(p, i) op i; \ post_atomic_barrier(model); \ return rv; \ } @@ -120,7 +114,7 @@ { \ type oldval = *oldvalp; \ pre_atomic_barrier(models); \ - type retval = atomic_val_compare_and_exchange(ptr, oldval, newval); \ + type retval = arch_atomic_val_compare_and_exchange(ptr, oldval, newval); \ post_atomic_barrier(models); \ bool success = (retval == oldval); \ *oldvalp = retval; \ @@ -131,7 +125,7 @@ __atomic_exchange_##size(volatile type* ptr, type val, int model) \ { \ pre_atomic_barrier(model); \ - type retval = atomic_exchange(ptr, val); \ + type retval = arch_atomic_exchange(ptr, val); \ post_atomic_barrier(model); \ return retval; \ } @@ -159,7 +153,7 @@ type oldval = (oldword >> shift) & valmask; \ if (__builtin_expect((oldval == *guess), 1)) { \ unsigned int word = (oldword & bgmask) | ((val & valmask) << shift); \ - oldword = atomic_val_compare_and_exchange(p, oldword, word); \ + oldword = arch_atomic_val_compare_and_exchange(p, oldword, word); \ oldval = (oldword >> shift) & valmask; \ } \ post_atomic_barrier(models); \ @@ -187,7 +181,7 @@ oldval = (oldword >> shift) & valmask; \ val = expr; \ unsigned int word = (oldword & bgmask) | ((val & valmask) << shift); \ - xword = atomic_val_compare_and_exchange(p, oldword, word); \ + xword = arch_atomic_val_compare_and_exchange(p, oldword, word); \ } while (__builtin_expect(xword != oldword, 0)); \ bottom \ } Index: libgcc/config/avr/lib1funcs.S =================================================================== --- libgcc/config/avr/lib1funcs.S (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libgcc/config/avr/lib1funcs.S (.../branches/gcc-4_7-branch) (wersja 187906) @@ -25,7 +25,9 @@ #define __zero_reg__ r1 #define __tmp_reg__ r0 #define __SREG__ 0x3f +#if defined (__AVR_HAVE_SPH__) #define __SP_H__ 0x3e +#endif #define __SP_L__ 0x3d #define __RAMPZ__ 0x3B #define __EIND__ 0x3C @@ -1258,7 +1260,7 @@ #if defined (__AVR_HAVE_JMP_CALL__) # define SPEED_DIV 8 -#elif defined (__AVR_HAVE_MOVW__) && !defined (__AVR_HAVE_8BIT_SP__) +#elif defined (__AVR_HAVE_MOVW__) && defined (__AVR_HAVE_SPH__) # define SPEED_DIV 16 #else # define SPEED_DIV 0 @@ -1540,10 +1542,10 @@ 4: ;; Epilogue: Restore the Z = 12 Registers and return in r28, __SP_L__ -#if defined (__AVR_HAVE_8BIT_SP__) +#if defined (__AVR_HAVE_SPH__) + in r29, __SP_H__ +#else clr r29 -#else - in r29, __SP_H__ #endif /* #SP = 8/16 */ ldi r30, 12 XJMP __epilogue_restores__ + ((18 - 12) * 2) @@ -1691,7 +1693,7 @@ push r17 push r28 push r29 -#if defined (__AVR_HAVE_8BIT_SP__) +#if !defined (__AVR_HAVE_SPH__) in r28,__SP_L__ sub r28,r26 out __SP_L__,r28 @@ -1747,7 +1749,7 @@ ldd r16,Y+4 ldd r17,Y+3 ldd r26,Y+2 -#if defined (__AVR_HAVE_8BIT_SP__) +#if !defined (__AVR_HAVE_SPH__) ldd r29,Y+1 add r28,r30 out __SP_L__,r28 @@ -1893,6 +1895,10 @@ cpc r27, r17 brne .L__do_copy_data_loop #endif /* !defined(__AVR_HAVE_ELPMX__) && !defined(__AVR_HAVE_ELPM__) */ +#if defined (__AVR_HAVE_ELPM__) && defined (__AVR_HAVE_RAMPD__) + ;; Reset RAMPZ to 0 so that EBI devices don't read garbage from RAM + out __RAMPZ__, __zero_reg__ +#endif /* ELPM && RAMPD */ ENDF __do_copy_data #endif /* L_copy_data */ @@ -1920,7 +1926,7 @@ #ifdef L_ctors .section .init6,"ax",@progbits DEFUN __do_global_ctors -#if defined(__AVR_HAVE_RAMPZ__) +#if defined(__AVR_HAVE_ELPM__) ldi r17, hi8(__ctors_start) ldi r28, lo8(__ctors_end) ldi r29, hi8(__ctors_end) @@ -1953,14 +1959,14 @@ cpi r28, lo8(__ctors_start) cpc r29, r17 brne .L__do_global_ctors_loop -#endif /* defined(__AVR_HAVE_RAMPZ__) */ +#endif /* defined(__AVR_HAVE_ELPM__) */ ENDF __do_global_ctors #endif /* L_ctors */ #ifdef L_dtors .section .fini6,"ax",@progbits DEFUN __do_global_dtors -#if defined(__AVR_HAVE_RAMPZ__) +#if defined(__AVR_HAVE_ELPM__) ldi r17, hi8(__dtors_end) ldi r28, lo8(__dtors_start) ldi r29, hi8(__dtors_start) @@ -1993,7 +1999,7 @@ cpi r28, lo8(__dtors_end) cpc r29, r17 brne .L__do_global_dtors_loop -#endif /* defined(__AVR_HAVE_RAMPZ__) */ +#endif /* defined(__AVR_HAVE_ELPM__) */ ENDF __do_global_dtors #endif /* L_dtors */ @@ -2001,18 +2007,21 @@ #ifdef L_tablejump_elpm DEFUN __tablejump_elpm__ -#if defined (__AVR_HAVE_ELPM__) -#if defined (__AVR_HAVE_LPMX__) +#if defined (__AVR_HAVE_ELPMX__) elpm __tmp_reg__, Z+ elpm r31, Z mov r30, __tmp_reg__ +#if defined (__AVR_HAVE_RAMPD__) + ;; Reset RAMPZ to 0 so that EBI devices don't read garbage from RAM + out __RAMPZ__, __zero_reg__ +#endif /* RAMPD */ #if defined (__AVR_HAVE_EIJMP_EICALL__) eijmp #else ijmp #endif -#else +#elif defined (__AVR_HAVE_ELPM__) elpm adiw r30, 1 push r0 @@ -2024,7 +2033,6 @@ #endif ret #endif -#endif /* defined (__AVR_HAVE_ELPM__) */ ENDF __tablejump_elpm__ #endif /* defined (L_tablejump_elpm) */ @@ -2114,11 +2122,18 @@ adiw r30, 1 .endif #endif +#if defined (__AVR_HAVE_ELPM__) && defined (__AVR_HAVE_RAMPD__) +.if \dest == D0+\n-1 + ;; Reset RAMPZ to 0 so that EBI devices don't read garbage from RAM + out __RAMPZ__, __zero_reg__ +.endif +#endif .endm ; .xload #if defined (L_xload_1) DEFUN __xload_1 -#if defined (__AVR_HAVE_LPMX__) && !defined (__AVR_HAVE_RAMPZ__) +#if defined (__AVR_HAVE_LPMX__) && !defined (__AVR_HAVE_ELPM__) + sbrc HHI8, 7 ld D0, Z sbrs HHI8, 7 lpm D0, Z @@ -2126,14 +2141,14 @@ #else sbrc HHI8, 7 rjmp 1f -#if defined (__AVR_HAVE_RAMPZ__) +#if defined (__AVR_HAVE_ELPM__) out __RAMPZ__, HHI8 -#endif /* __AVR_HAVE_RAMPZ__ */ +#endif /* __AVR_HAVE_ELPM__ */ .xload D0, 1 ret 1: ld D0, Z ret -#endif /* LPMx && ! RAMPZ */ +#endif /* LPMx && ! ELPM */ ENDF __xload_1 #endif /* L_xload_1 */ @@ -2141,9 +2156,9 @@ DEFUN __xload_2 sbrc HHI8, 7 rjmp 1f -#if defined (__AVR_HAVE_RAMPZ__) +#if defined (__AVR_HAVE_ELPM__) out __RAMPZ__, HHI8 -#endif /* __AVR_HAVE_RAMPZ__ */ +#endif /* __AVR_HAVE_ELPM__ */ .xload D0, 2 .xload D1, 2 ret @@ -2157,9 +2172,9 @@ DEFUN __xload_3 sbrc HHI8, 7 rjmp 1f -#if defined (__AVR_HAVE_RAMPZ__) +#if defined (__AVR_HAVE_ELPM__) out __RAMPZ__, HHI8 -#endif /* __AVR_HAVE_RAMPZ__ */ +#endif /* __AVR_HAVE_ELPM__ */ .xload D0, 3 .xload D1, 3 .xload D2, 3 @@ -2175,9 +2190,9 @@ DEFUN __xload_4 sbrc HHI8, 7 rjmp 1f -#if defined (__AVR_HAVE_RAMPZ__) +#if defined (__AVR_HAVE_ELPM__) out __RAMPZ__, HHI8 -#endif /* __AVR_HAVE_RAMPZ__ */ +#endif /* __AVR_HAVE_ELPM__ */ .xload D0, 4 .xload D1, 4 .xload D2, 4 @@ -2219,7 +2234,7 @@ ;; Read from Flash -#if defined (__AVR_HAVE_RAMPZ__) +#if defined (__AVR_HAVE_ELPM__) out __RAMPZ__, HHI8 #endif @@ -2243,6 +2258,10 @@ st X+, r0 sbiw LOOP, 1 brne 0b +#if defined (__AVR_HAVE_ELPM__) && defined (__AVR_HAVE_RAMPD__) + ;; Reset RAMPZ to 0 so that EBI devices don't read garbage from RAM + out __RAMPZ__, __zero_reg__ +#endif /* ELPM && RAMPD */ ret ;; Read from RAM @@ -2252,7 +2271,7 @@ ;; and store that Byte to RAM Destination st X+, r0 sbiw LOOP, 1 - brne 0b + brne 1b ret ENDF __movmemx_hi Index: libgcc/config/pa/linux-unwind.h =================================================================== --- libgcc/config/pa/linux-unwind.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libgcc/config/pa/linux-unwind.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,5 +1,5 @@ /* DWARF2 EH unwinding support for PA Linux. - Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2009, 2012 Free Software Foundation, Inc. This file is part of GCC. @@ -63,7 +63,7 @@ int i; struct sigcontext *sc; struct rt_sigframe { - struct siginfo info; + siginfo_t info; struct ucontext uc; } *frame; Index: libgcc/config/xtensa/linux-unwind.h =================================================================== --- libgcc/config/xtensa/linux-unwind.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libgcc/config/xtensa/linux-unwind.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,5 +1,5 @@ /* DWARF2 EH unwinding support for Xtensa. - Copyright (C) 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2008, 2009, 2012 Free Software Foundation, Inc. This file is part of GCC. @@ -62,7 +62,7 @@ struct sigcontext *sc; struct rt_sigframe { - struct siginfo info; + siginfo_t info; struct ucontext uc; } *rt_; Index: libgcc/config/mips/linux-unwind.h =================================================================== --- libgcc/config/mips/linux-unwind.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libgcc/config/mips/linux-unwind.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,5 +1,6 @@ /* DWARF2 EH unwinding support for MIPS Linux. - Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2012 Free Software + Foundation, Inc. This file is part of GCC. @@ -75,7 +76,7 @@ struct rt_sigframe { u_int32_t ass[4]; /* Argument save space for o32. */ u_int32_t trampoline[2]; - struct siginfo info; + siginfo_t info; _sig_ucontext_t uc; } *rt_ = context->cfa; sc = &rt_->uc.uc_mcontext; Index: libgcc/config/bfin/linux-unwind.h =================================================================== --- libgcc/config/bfin/linux-unwind.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libgcc/config/bfin/linux-unwind.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,5 +1,5 @@ /* DWARF2 EH unwinding support for Blackfin. - Copyright (C) 2007, 2009 Free Software Foundation, Inc. + Copyright (C) 2007, 2009, 2012 Free Software Foundation, Inc. This file is part of GCC. @@ -48,10 +48,10 @@ { struct rt_sigframe { int sig; - struct siginfo *pinfo; + siginfo_t *pinfo; void *puc; char retcode[8]; - struct siginfo info; + siginfo_t info; struct ucontext uc; } *rt_ = context->cfa; Index: libgcc/configure =================================================================== --- libgcc/configure (.../tags/gcc_4_7_0_release) (wersja 187906) +++ libgcc/configure (.../branches/gcc-4_7-branch) (wersja 187906) @@ -552,42 +552,7 @@ PACKAGE_URL='http://www.gnu.org/software/libgcc/' ac_unique_file="static-object.mk" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - +ac_includes_default='/* none */' ac_subst_vars='LTLIBOBJS LIBOBJS asm_hidden_op @@ -605,8 +570,6 @@ decimal_float long_double_type_size double_type_size -EGREP -GREP CPP OBJEXT EXEEXT @@ -1732,35 +1695,6 @@ return $ac_retval } # ac_fn_c_compute_int - -# ac_fn_c_check_header_preproc LINENO HEADER VAR -# ---------------------------------------------- -# Tests whether HEADER is present, setting the cache variable VAR accordingly. -ac_fn_c_check_header_preproc () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f conftest.err conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_header_preproc cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -2117,7 +2051,10 @@ +# The libgcc should not depend on any header files + + # Check whether --with-target-subdir was given. if test "${with_target_subdir+set}" = set; then : withval=$with_target_subdir; @@ -4027,264 +3964,6 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_preproc "$LINENO" "$ac_header" "$as_ac_Header" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. Index: gcc/tree-vrp.c =================================================================== --- gcc/tree-vrp.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/tree-vrp.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -695,17 +695,22 @@ /* If VAR is a default definition of a parameter, the variable can take any value in VAR's type. */ sym = SSA_NAME_VAR (var); - if (SSA_NAME_IS_DEFAULT_DEF (var) - && TREE_CODE (sym) == PARM_DECL) + if (SSA_NAME_IS_DEFAULT_DEF (var)) { - /* Try to use the "nonnull" attribute to create ~[0, 0] - anti-ranges for pointers. Note that this is only valid with - default definitions of PARM_DECLs. */ - if (POINTER_TYPE_P (TREE_TYPE (sym)) - && nonnull_arg_p (sym)) + if (TREE_CODE (sym) == PARM_DECL) + { + /* Try to use the "nonnull" attribute to create ~[0, 0] + anti-ranges for pointers. Note that this is only valid with + default definitions of PARM_DECLs. */ + if (POINTER_TYPE_P (TREE_TYPE (sym)) + && nonnull_arg_p (sym)) + set_value_range_to_nonnull (vr, TREE_TYPE (sym)); + else + set_value_range_to_varying (vr); + } + else if (TREE_CODE (sym) == RESULT_DECL + && DECL_BY_REFERENCE (sym)) set_value_range_to_nonnull (vr, TREE_TYPE (sym)); - else - set_value_range_to_varying (vr); } return vr; @@ -3242,8 +3247,8 @@ set_value_range_to_varying (&vr1); /* The resulting value range is the union of the operand ranges */ - vrp_meet (&vr0, &vr1); copy_value_range (vr, &vr0); + vrp_meet (vr, &vr1); } @@ -6442,13 +6447,17 @@ { if (vr0->type == VR_UNDEFINED) { - copy_value_range (vr0, vr1); + /* Drop equivalences. See PR53465. */ + set_value_range (vr0, vr1->type, vr1->min, vr1->max, NULL); return; } if (vr1->type == VR_UNDEFINED) { - /* Nothing to do. VR0 already has the resulting range. */ + /* VR0 already has the resulting range, just drop equivalences. + See PR53465. */ + if (vr0->equiv) + bitmap_clear (vr0->equiv); return; } @@ -6590,6 +6599,7 @@ tree lhs = PHI_RESULT (phi); value_range_t *lhs_vr = get_value_range (lhs); value_range_t vr_result = { VR_UNDEFINED, NULL_TREE, NULL_TREE, NULL }; + bool first = true; int edges, old_edges; struct loop *l; @@ -6646,7 +6656,11 @@ fprintf (dump_file, "\n"); } - vrp_meet (&vr_result, &vr_arg); + if (first) + copy_value_range (&vr_result, &vr_arg); + else + vrp_meet (&vr_result, &vr_arg); + first = false; if (vr_result.type == VR_VARYING) break; Index: gcc/doc/extend.texi =================================================================== --- gcc/doc/extend.texi (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/doc/extend.texi (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1311,18 +1311,18 @@ #ifdef __FLASH const __flash int var = 1; -int read_i (void) +int read_var (void) @{ - return i; + return var; @} #else -#include /* From avr-libc */ +#include /* From AVR-LibC */ const int var PROGMEM = 1; -int read_i (void) +int read_var (void) @{ - return (int) pgm_read_word (&i); + return (int) pgm_read_word (&var); @} #endif /* __FLASH */ @end example @@ -1332,7 +1332,8 @@ accesses to these data will read from generic address space, i.e.@: from RAM, so that you need special accessors like @code{pgm_read_byte} -from @w{@uref{http://nongnu.org/avr-libc/user-manual,avr-libc}}. +from @w{@uref{http://nongnu.org/avr-libc/user-manual,AVR-LibC}} +together with attribute @code{progmem}. @b{Limitations and caveats} @@ -1345,7 +1346,7 @@ @code{__memx}. @item -If you use one if the @code{__flash@var{N}} address spaces +If you use one of the @code{__flash@var{N}} address spaces you will have to arrange your linker skript to locate the @code{.progmem@var{N}.data} sections according to your needs. @@ -2713,6 +2714,51 @@ This attribute is ignored for R8C target. +@item ifunc ("@var{resolver}") +@cindex @code{ifunc} attribute +The @code{ifunc} attribute is used to mark a function as an indirect +function using the STT_GNU_IFUNC symbol type extension to the ELF +standard. This allows the resolution of the symbol value to be +determined dynamically at load time, and an optimized version of the +routine can be selected for the particular processor or other system +characteristics determined then. To use this attribute, first define +the implementation functions available, and a resolver function that +returns a pointer to the selected implementation function. The +implementation functions' declarations must match the API of the +function being implemented, the resolver's declaration is be a +function returning pointer to void function returning void: + +@smallexample +void *my_memcpy (void *dst, const void *src, size_t len) +@{ + @dots{} +@} + +static void (*resolve_memcpy (void)) (void) +@{ + return my_memcpy; // we'll just always select this routine +@} +@end smallexample + +The exported header file declaring the function the user calls would +contain: + +@smallexample +extern void *memcpy (void *, const void *, size_t); +@end smallexample + +allowing the user to call this as a regular function, unaware of the +implementation. Finally, the indirect function needs to be defined in +the same translation unit as the resolver function: + +@smallexample +void *memcpy (void *, const void *, size_t) + __attribute__ ((ifunc ("resolve_memcpy"))); +@end smallexample + +Indirect functions cannot be weak, and require a recent binutils (at +least version 2.20.1), and GNU C library (at least version 2.11.1). + @item interrupt @cindex interrupt handler functions Use this attribute on the ARM, AVR, CR16, Epiphany, M32C, M32R/D, m68k, MeP, MIPS, @@ -2725,7 +2771,13 @@ Note, interrupt handlers for the Blackfin, H8/300, H8/300H, H8S, MicroBlaze, and SH processors can be specified via the @code{interrupt_handler} attribute. -Note, on the AVR, interrupts will be enabled inside the function. +Note, on the AVR, the hardware globally disables interrupts when an +interrupt is executed. The first instruction of an interrupt handler +declared with this attribute will be a @code{SEI} instruction to +re-enable interrupts. See also the @code{signal} function attribute +that does not insert a @code{SEI} instuction. If both @code{signal} and +@code{interrupt} are specified for the same function, @code{signal} +will be silently ignored. Note, for the ARM, you can specify the kind of interrupt to be handled by adding an optional parameter to the interrupt attribute like this: @@ -2821,51 +2873,6 @@ handlers intended to be used with the @code{BRK} opcode (i.e. those that must end with @code{RETB} instead of @code{RETI}). -@item ifunc ("@var{resolver}") -@cindex @code{ifunc} attribute -The @code{ifunc} attribute is used to mark a function as an indirect -function using the STT_GNU_IFUNC symbol type extension to the ELF -standard. This allows the resolution of the symbol value to be -determined dynamically at load time, and an optimized version of the -routine can be selected for the particular processor or other system -characteristics determined then. To use this attribute, first define -the implementation functions available, and a resolver function that -returns a pointer to the selected implementation function. The -implementation functions' declarations must match the API of the -function being implemented, the resolver's declaration is be a -function returning pointer to void function returning void: - -@smallexample -void *my_memcpy (void *dst, const void *src, size_t len) -@{ - @dots{} -@} - -static void (*resolve_memcpy (void)) (void) -@{ - return my_memcpy; // we'll just always select this routine -@} -@end smallexample - -The exported header file declaring the function the user calls would -contain: - -@smallexample -extern void *memcpy (void *, const void *, size_t); -@end smallexample - -allowing the user to call this as a regular function, unaware of the -implementation. Finally, the indirect function needs to be defined in -the same translation unit as the resolver function: - -@smallexample -void *memcpy (void *, const void *, size_t) - __attribute__ ((ifunc ("resolve_memcpy"))); -@end smallexample - -Indirect functions cannot be weak, and require a recent binutils (at -least version 2.20.1), and GNU C library (at least version 2.11.1). - @item interrupt_handler @cindex interrupt handler functions on the Blackfin, m68k, H8/300 and SH processors Use this attribute on the Blackfin, m68k, H8/300, H8/300H, H8S, and SH to @@ -3470,12 +3477,24 @@ See longcall/shortcall. @item signal -@cindex signal handler functions on the AVR processors +@cindex interrupt handler functions on the AVR processors Use this attribute on the AVR to indicate that the specified -function is a signal handler. The compiler will generate function -entry and exit sequences suitable for use in a signal handler when this -attribute is present. Interrupts will be disabled inside the function. +function is an interrupt handler. The compiler will generate function +entry and exit sequences suitable for use in an interrupt handler when this +attribute is present. +See also the @code{interrupt} function attribute. + +The AVR hardware globally disables interrupts when an interrupt is executed. +Interrupt handler functions defined with the @code{signal} attribute +do not re-enable interrupts. It is save to enable interrupts in a +@code{signal} handler. This ``save'' only applies to the code +generated by the compiler and not to the IRQ-layout of the +application which is responsibility of the application. + +If both @code{signal} and @code{interrupt} are specified for the same +function, @code{signal} will be silently ignored. + @item sp_switch Use this attribute on the SH to indicate an @code{interrupt_handler} function should switch to an alternate stack. It expects a string @@ -4782,7 +4801,7 @@ In order to read data located with the @code{progmem} attribute (inline) assembler must be used. @example -/* Use custom macros from @w{@uref{http://nongnu.org/avr-libc/user-manual,avr-libc}} */ +/* Use custom macros from @w{@uref{http://nongnu.org/avr-libc/user-manual,AVR-LibC}} */ #include /* Locate var in flash memory */ Index: gcc/doc/invoke.texi =================================================================== --- gcc/doc/invoke.texi (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/doc/invoke.texi (.../branches/gcc-4_7-branch) (wersja 187906) @@ -11085,8 +11085,7 @@ @item -mtiny-stack @opindex mtiny-stack -Only use the lower 8@tie{}bits of the stack pointer and assume that the high -byte of SP is always zero. +Only change the lower 8@tie{}bits of the stack pointer. @end table @subsubsection @code{EIND} and Devices with more than 128 Ki Bytes of Flash Index: gcc/doc/install.texi =================================================================== --- gcc/doc/install.texi (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/doc/install.texi (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1238,7 +1238,7 @@ @item --with-llsc On MIPS targets, make @option{-mllsc} the default when no -@option{-mno-lsc} option is passed. This is the default for +@option{-mno-llsc} option is passed. This is the default for Linux-based targets, as the kernel will emulate them if the ISA does not provide them. Index: gcc/godump.c =================================================================== --- gcc/godump.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/godump.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1024,12 +1024,25 @@ fprintf (go_dump_file, "type _%s ", IDENTIFIER_POINTER (DECL_NAME (decl))); go_output_type (container); + + if (RECORD_OR_UNION_TYPE_P (TREE_TYPE (decl))) + { + HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (decl)); + + if (size > 0) + fprintf (go_dump_file, + "\nconst _sizeof_%s = " HOST_WIDE_INT_PRINT_DEC, + IDENTIFIER_POINTER (DECL_NAME (decl)), + size); + } + pointer_set_insert (container->decls_seen, decl); } else if (RECORD_OR_UNION_TYPE_P (TREE_TYPE (decl))) { void **slot; const char *type; + HOST_WIDE_INT size; type = IDENTIFIER_POINTER (TYPE_NAME (TREE_TYPE ((decl)))); /* If type defined already, skip. */ @@ -1047,6 +1060,13 @@ fprintf (go_dump_file, "type _%s ", IDENTIFIER_POINTER (TYPE_NAME (TREE_TYPE (decl)))); go_output_type (container); + + size = int_size_in_bytes (TREE_TYPE (decl)); + if (size > 0) + fprintf (go_dump_file, + "\nconst _sizeof_%s = " HOST_WIDE_INT_PRINT_DEC, + IDENTIFIER_POINTER (TYPE_NAME (TREE_TYPE (decl))), + size); } else return; Index: gcc/lto-symtab.c =================================================================== --- gcc/lto-symtab.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/lto-symtab.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -215,8 +215,8 @@ { fprintf (cgraph_dump_file, "Replacing cgraph node %s/%i by %s/%i" " for symbol %s\n", - cgraph_node_name (node), node->uid, - cgraph_node_name (prevailing_node), + xstrdup (cgraph_node_name (node)), node->uid, + xstrdup (cgraph_node_name (prevailing_node)), prevailing_node->uid, IDENTIFIER_POINTER ((*targetm.asm_out.mangle_assembler_name) (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->decl))))); Index: gcc/tree-ssa-tail-merge.c =================================================================== --- gcc/tree-ssa-tail-merge.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/tree-ssa-tail-merge.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1123,18 +1123,31 @@ } } -/* Let GSI skip backwards over local defs. */ +/* Let GSI skip backwards over local defs. Return the earliest vuse in VUSE. + Return true in VUSE_ESCAPED if the vuse influenced a SSA_OP_DEF of one of the + processed statements. */ static void -gsi_advance_bw_nondebug_nonlocal (gimple_stmt_iterator *gsi) +gsi_advance_bw_nondebug_nonlocal (gimple_stmt_iterator *gsi, tree *vuse, + bool *vuse_escaped) { gimple stmt; + tree lvuse; while (true) { if (gsi_end_p (*gsi)) return; stmt = gsi_stmt (*gsi); + + lvuse = gimple_vuse (stmt); + if (lvuse != NULL_TREE) + { + *vuse = lvuse; + if (!ZERO_SSA_OPERANDS (stmt, SSA_OP_DEF)) + *vuse_escaped = true; + } + if (!(is_gimple_assign (stmt) && local_def (gimple_get_lhs (stmt)) && !gimple_has_side_effects (stmt))) return; @@ -1150,9 +1163,11 @@ { gimple_stmt_iterator gsi1 = gsi_last_nondebug_bb (bb1); gimple_stmt_iterator gsi2 = gsi_last_nondebug_bb (bb2); + tree vuse1 = NULL_TREE, vuse2 = NULL_TREE; + bool vuse_escaped = false; - gsi_advance_bw_nondebug_nonlocal (&gsi1); - gsi_advance_bw_nondebug_nonlocal (&gsi2); + gsi_advance_bw_nondebug_nonlocal (&gsi1, &vuse1, &vuse_escaped); + gsi_advance_bw_nondebug_nonlocal (&gsi2, &vuse2, &vuse_escaped); while (!gsi_end_p (gsi1) && !gsi_end_p (gsi2)) { @@ -1161,13 +1176,20 @@ gsi_prev_nondebug (&gsi1); gsi_prev_nondebug (&gsi2); - gsi_advance_bw_nondebug_nonlocal (&gsi1); - gsi_advance_bw_nondebug_nonlocal (&gsi2); + gsi_advance_bw_nondebug_nonlocal (&gsi1, &vuse1, &vuse_escaped); + gsi_advance_bw_nondebug_nonlocal (&gsi2, &vuse2, &vuse_escaped); } if (!(gsi_end_p (gsi1) && gsi_end_p (gsi2))) return; + /* If the incoming vuses are not the same, and the vuse escaped into an + SSA_OP_DEF, then merging the 2 blocks will change the value of the def, + which potentially means the semantics of one of the blocks will be changed. + TODO: make this check more precise. */ + if (vuse_escaped && vuse1 != vuse2) + return; + if (dump_file) fprintf (dump_file, "find_duplicates: duplicate of \n", bb1->index, bb2->index); Index: gcc/c-family/ChangeLog =================================================================== --- gcc/c-family/ChangeLog (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/c-family/ChangeLog (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,3 +1,8 @@ +2012-03-23 William Bader + + PR c/52682 + * c-lex.c (c_lex_with_flags): Avoid declarations after stmts. + 2012-03-22 Release Manager * GCC 4.7.0 released. Index: gcc/c-family/c-lex.c =================================================================== --- gcc/c-family/c-lex.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/c-family/c-lex.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -342,6 +342,8 @@ if (flags & CPP_N_USERDEF) { + char *str; + tree literal; tree suffix_id = get_identifier (suffix); int len = tok->val.str.len - strlen (suffix); /* If this is going to be used as a C string to pass to a @@ -350,9 +352,9 @@ (const char *) tok->val.str.text); TREE_TYPE (num_string) = char_array_type_node; num_string = fix_string_type (num_string); - char *str = CONST_CAST (char *, TREE_STRING_POINTER (num_string)); + str = CONST_CAST (char *, TREE_STRING_POINTER (num_string)); str[len] = '\0'; - tree literal = build_userdef_literal (suffix_id, *value, + literal = build_userdef_literal (suffix_id, *value, num_string); *value = literal; } Index: gcc/java/typeck.c =================================================================== --- gcc/java/typeck.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/java/typeck.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -189,6 +189,13 @@ return unsignedp ? unsigned_int_type_node : int_type_node; if (bits <= TYPE_PRECISION (long_type_node)) return unsignedp ? unsigned_long_type_node : long_type_node; + /* A 64-bit target with TImode requires 128-bit type definitions + for bitsizetype. This is fixed more properly elsewhere + beginning in 4.8. */ + if (int128_integer_type_node + && bits == TYPE_PRECISION (int128_integer_type_node)) + return (unsignedp ? int128_unsigned_type_node + : int128_integer_type_node); return 0; } Index: gcc/java/ChangeLog =================================================================== --- gcc/java/ChangeLog (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/java/ChangeLog (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,3 +1,7 @@ +2012-05-11 Bill Schmidt + + * typeck.c (java_type_for_size): Handle 128-bit sizes for bitsizetype. + 2012-03-22 Release Manager * GCC 4.7.0 released. Index: gcc/DATESTAMP =================================================================== --- gcc/DATESTAMP (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/DATESTAMP (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1 +1 @@ -20120322 +20120526 Index: gcc/tree.c =================================================================== --- gcc/tree.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/tree.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -8431,8 +8431,11 @@ a variable in FN. */ #define RETURN_TRUE_IF_VAR(T) \ do { tree _t = (T); \ - if (_t && _t != error_mark_node && TREE_CODE (_t) != INTEGER_CST \ - && (!fn || walk_tree (&_t, find_var_from_fn, fn, NULL))) \ + if (_t != NULL_TREE \ + && _t != error_mark_node \ + && TREE_CODE (_t) != INTEGER_CST \ + && TREE_CODE (_t) != PLACEHOLDER_EXPR \ + && (!fn || walk_tree (&_t, find_var_from_fn, fn, NULL))) \ return true; } while (0) if (type == error_mark_node) Index: gcc/ipa-cp.c =================================================================== --- gcc/ipa-cp.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/ipa-cp.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -2180,8 +2180,9 @@ if (dump_file) fprintf (dump_file, " - adding an extra caller %s/%i" " of %s/%i\n", - cgraph_node_name (cs->caller), cs->caller->uid, - cgraph_node_name (val->spec_node), + xstrdup (cgraph_node_name (cs->caller)), + cs->caller->uid, + xstrdup (cgraph_node_name (val->spec_node)), val->spec_node->uid); cgraph_redirect_edge_callee (cs, val->spec_node); Index: gcc/tree-scalar-evolution.c =================================================================== --- gcc/tree-scalar-evolution.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/tree-scalar-evolution.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -499,65 +499,6 @@ return chrec_dont_know; } -/* Determine whether the CHREC is always positive/negative. If the expression - cannot be statically analyzed, return false, otherwise set the answer into - VALUE. */ - -bool -chrec_is_positive (tree chrec, bool *value) -{ - bool value0, value1, value2; - tree end_value, nb_iter; - - switch (TREE_CODE (chrec)) - { - case POLYNOMIAL_CHREC: - if (!chrec_is_positive (CHREC_LEFT (chrec), &value0) - || !chrec_is_positive (CHREC_RIGHT (chrec), &value1)) - return false; - - /* FIXME -- overflows. */ - if (value0 == value1) - { - *value = value0; - return true; - } - - /* Otherwise the chrec is under the form: "{-197, +, 2}_1", - and the proof consists in showing that the sign never - changes during the execution of the loop, from 0 to - loop->nb_iterations. */ - if (!evolution_function_is_affine_p (chrec)) - return false; - - nb_iter = number_of_latch_executions (get_chrec_loop (chrec)); - if (chrec_contains_undetermined (nb_iter)) - return false; - -#if 0 - /* TODO -- If the test is after the exit, we may decrease the number of - iterations by one. */ - if (after_exit) - nb_iter = chrec_fold_minus (type, nb_iter, build_int_cst (type, 1)); -#endif - - end_value = chrec_apply (CHREC_VARIABLE (chrec), chrec, nb_iter); - - if (!chrec_is_positive (end_value, &value2)) - return false; - - *value = value0; - return value0 == value1; - - case INTEGER_CST: - *value = (tree_int_cst_sgn (chrec) == 1); - return true; - - default: - return false; - } -} - /* Associate CHREC to SCALAR. */ static void Index: gcc/configure =================================================================== --- gcc/configure (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/configure (.../branches/gcc-4_7-branch) (wersja 187906) @@ -3394,13 +3394,6 @@ fi -gnu_ld=`if test x"$gnu_ld_flag" = x"yes"; then echo 1; else echo 0; fi` - -cat >>confdefs.h <<_ACEOF -#define HAVE_GNU_LD $gnu_ld -_ACEOF - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a default linker was specified" >&5 $as_echo_n "checking whether a default linker was specified... " >&6; } if test x"${DEFAULT_LINKER+set}" = x"set"; then @@ -3459,13 +3452,6 @@ fi -gnu_as=`if test x"$gas_flag" = x"yes"; then echo 1; else echo 0; fi` - -cat >>confdefs.h <<_ACEOF -#define HAVE_GNU_AS $gnu_as -_ACEOF - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a default assembler was specified" >&5 $as_echo_n "checking whether a default assembler was specified... " >&6; } if test x"${DEFAULT_ASSEMBLER+set}" = x"set"; then @@ -11175,6 +11161,20 @@ fi +gnu_ld_bool=`if test x"$gnu_ld" = x"yes"; then echo 1; else echo 0; fi` + +cat >>confdefs.h <<_ACEOF +#define HAVE_GNU_LD $gnu_ld_bool +_ACEOF + + +gnu_as_bool=`if test x"$gas" = x"yes"; then echo 1; else echo 0; fi` + +cat >>confdefs.h <<_ACEOF +#define HAVE_GNU_AS $gnu_as_bool +_ACEOF + + count=a for f in $host_xm_file; do count=${count}x @@ -26474,7 +26474,15 @@ fi case "$target:$tm_file" in - powerpc64*-*-linux* | powerpc*-*-linux*rs6000/biarch64.h*) + powerpc64-*-freebsd* | powerpc64*-*-linux* | powerpc*-*-linux*rs6000/biarch64.h*) + case "$target" in + *-*-linux*) + emul_name="-melf64ppc" + ;; + *-*-freebsd*) + emul_name="-melf64ppc_fbsd" + ;; + esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker support for omitting dot symbols" >&5 $as_echo_n "checking linker support for omitting dot symbols... " >&6; } if test "${gcc_cv_ld_no_dot_syms+set}" = set; then : @@ -26504,7 +26512,7 @@ EOF if $gcc_cv_as -a64 -o conftest1.o conftest1.s > /dev/null 2>&1 \ && $gcc_cv_as -a64 -o conftest2.o conftest2.s > /dev/null 2>&1 \ - && $gcc_cv_ld -melf64ppc -o conftest conftest1.o conftest2.o > /dev/null 2>&1; then + && $gcc_cv_ld $emul_name -o conftest conftest1.o conftest2.o > /dev/null 2>&1; then gcc_cv_ld_no_dot_syms=yes fi rm -f conftest conftest1.o conftest2.o conftest1.s conftest2.s @@ -26541,7 +26549,7 @@ ld 9,ie0@got@tprel@l(9) EOF if $gcc_cv_as -a64 -o conftest.o conftest.s > /dev/null 2>&1 \ - && $gcc_cv_ld -melf64ppc --no-toc-sort -o conftest conftest.o > /dev/null 2>&1; then + && $gcc_cv_ld $emul_name --no-toc-sort -o conftest conftest.o > /dev/null 2>&1; then gcc_cv_ld_large_toc=yes fi rm -f conftest conftest.o conftest.s Index: gcc/fold-const.c =================================================================== --- gcc/fold-const.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/fold-const.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -6850,64 +6850,81 @@ s = integer_one_node; } - for (;; ref = TREE_OPERAND (ref, 0)) + /* Handle &x.array the same as we would handle &x.array[0]. */ + if (TREE_CODE (ref) == COMPONENT_REF + && TREE_CODE (TREE_TYPE (ref)) == ARRAY_TYPE) { - if (TREE_CODE (ref) == ARRAY_REF) + tree domain; + + /* Remember if this was a multi-dimensional array. */ + if (TREE_CODE (TREE_OPERAND (ref, 0)) == ARRAY_REF) + mdim = true; + + domain = TYPE_DOMAIN (TREE_TYPE (ref)); + if (! domain) + goto cont; + itype = TREE_TYPE (domain); + + step = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (ref))); + if (TREE_CODE (step) != INTEGER_CST) + goto cont; + + if (s) { - tree domain; + if (! tree_int_cst_equal (step, s)) + goto cont; + } + else + { + /* Try if delta is a multiple of step. */ + tree tmp = div_if_zero_remainder (EXACT_DIV_EXPR, op1, step); + if (! tmp) + goto cont; + delta = tmp; + } - /* Remember if this was a multi-dimensional array. */ - if (TREE_CODE (TREE_OPERAND (ref, 0)) == ARRAY_REF) - mdim = true; + /* Only fold here if we can verify we do not overflow one + dimension of a multi-dimensional array. */ + if (mdim) + { + tree tmp; - domain = TYPE_DOMAIN (TREE_TYPE (TREE_OPERAND (ref, 0))); - if (! domain) - continue; - itype = TREE_TYPE (domain); + if (!TYPE_MIN_VALUE (domain) + || !TYPE_MAX_VALUE (domain) + || TREE_CODE (TYPE_MAX_VALUE (domain)) != INTEGER_CST) + goto cont; - step = array_ref_element_size (ref); - if (TREE_CODE (step) != INTEGER_CST) - continue; + tmp = fold_binary_loc (loc, PLUS_EXPR, itype, + fold_convert_loc (loc, itype, + TYPE_MIN_VALUE (domain)), + fold_convert_loc (loc, itype, delta)); + if (TREE_CODE (tmp) != INTEGER_CST + || tree_int_cst_lt (TYPE_MAX_VALUE (domain), tmp)) + goto cont; + } - if (s) - { - if (! tree_int_cst_equal (step, s)) - continue; - } - else - { - /* Try if delta is a multiple of step. */ - tree tmp = div_if_zero_remainder (EXACT_DIV_EXPR, op1, step); - if (! tmp) - continue; - delta = tmp; - } + /* We found a suitable component reference. */ - /* Only fold here if we can verify we do not overflow one - dimension of a multi-dimensional array. */ - if (mdim) - { - tree tmp; + pref = TREE_OPERAND (addr, 0); + ret = copy_node (pref); + SET_EXPR_LOCATION (ret, loc); - if (TREE_CODE (TREE_OPERAND (ref, 1)) != INTEGER_CST - || !TYPE_MAX_VALUE (domain) - || TREE_CODE (TYPE_MAX_VALUE (domain)) != INTEGER_CST) - continue; + ret = build4_loc (loc, ARRAY_REF, TREE_TYPE (TREE_TYPE (ref)), ret, + fold_build2_loc + (loc, PLUS_EXPR, itype, + fold_convert_loc (loc, itype, + TYPE_MIN_VALUE + (TYPE_DOMAIN (TREE_TYPE (ref)))), + fold_convert_loc (loc, itype, delta)), + NULL_TREE, NULL_TREE); + return build_fold_addr_expr_loc (loc, ret); + } - tmp = fold_binary_loc (loc, PLUS_EXPR, itype, - fold_convert_loc (loc, itype, - TREE_OPERAND (ref, 1)), - fold_convert_loc (loc, itype, delta)); - if (!tmp - || TREE_CODE (tmp) != INTEGER_CST - || tree_int_cst_lt (TYPE_MAX_VALUE (domain), tmp)) - continue; - } +cont: - break; - } - else if (TREE_CODE (ref) == COMPONENT_REF - && TREE_CODE (TREE_TYPE (ref)) == ARRAY_TYPE) + for (;; ref = TREE_OPERAND (ref, 0)) + { + if (TREE_CODE (ref) == ARRAY_REF) { tree domain; @@ -6915,12 +6932,12 @@ if (TREE_CODE (TREE_OPERAND (ref, 0)) == ARRAY_REF) mdim = true; - domain = TYPE_DOMAIN (TREE_TYPE (ref)); + domain = TYPE_DOMAIN (TREE_TYPE (TREE_OPERAND (ref, 0))); if (! domain) continue; itype = TREE_TYPE (domain); - step = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (ref))); + step = array_ref_element_size (ref); if (TREE_CODE (step) != INTEGER_CST) continue; @@ -6944,16 +6961,17 @@ { tree tmp; - if (!TYPE_MIN_VALUE (domain) + if (TREE_CODE (TREE_OPERAND (ref, 1)) != INTEGER_CST || !TYPE_MAX_VALUE (domain) || TREE_CODE (TYPE_MAX_VALUE (domain)) != INTEGER_CST) continue; tmp = fold_binary_loc (loc, PLUS_EXPR, itype, fold_convert_loc (loc, itype, - TYPE_MIN_VALUE (domain)), + TREE_OPERAND (ref, 1)), fold_convert_loc (loc, itype, delta)); - if (TREE_CODE (tmp) != INTEGER_CST + if (!tmp + || TREE_CODE (tmp) != INTEGER_CST || tree_int_cst_lt (TYPE_MAX_VALUE (domain), tmp)) continue; } @@ -6982,29 +7000,11 @@ pos = TREE_OPERAND (pos, 0); } - if (TREE_CODE (ref) == ARRAY_REF) - { - TREE_OPERAND (pos, 1) - = fold_build2_loc (loc, PLUS_EXPR, itype, - fold_convert_loc (loc, itype, TREE_OPERAND (pos, 1)), - fold_convert_loc (loc, itype, delta)); - return fold_build1_loc (loc, ADDR_EXPR, TREE_TYPE (addr), ret); - } - else if (TREE_CODE (ref) == COMPONENT_REF) - { - gcc_assert (ret == pos); - ret = build4_loc (loc, ARRAY_REF, TREE_TYPE (TREE_TYPE (ref)), ret, - fold_build2_loc - (loc, PLUS_EXPR, itype, - fold_convert_loc (loc, itype, - TYPE_MIN_VALUE - (TYPE_DOMAIN (TREE_TYPE (ref)))), - fold_convert_loc (loc, itype, delta)), - NULL_TREE, NULL_TREE); - return build_fold_addr_expr_loc (loc, ret); - } - else - gcc_unreachable (); + TREE_OPERAND (pos, 1) + = fold_build2_loc (loc, PLUS_EXPR, itype, + fold_convert_loc (loc, itype, TREE_OPERAND (pos, 1)), + fold_convert_loc (loc, itype, delta)); + return fold_build1_loc (loc, ADDR_EXPR, TREE_TYPE (addr), ret); } @@ -12828,13 +12828,13 @@ if (TREE_CODE (arg0) == BIT_XOR_EXPR && operand_equal_p (TREE_OPERAND (arg0, 1), arg1, 0)) return fold_build2_loc (loc, code, type, TREE_OPERAND (arg0, 0), - build_int_cst (TREE_TYPE (arg0), 0)); + build_zero_cst (TREE_TYPE (arg0))); /* Likewise (X ^ Y) == X becomes Y == 0. X has no side-effects. */ if (TREE_CODE (arg0) == BIT_XOR_EXPR && operand_equal_p (TREE_OPERAND (arg0, 0), arg1, 0) && reorder_operands_p (TREE_OPERAND (arg0, 1), arg1)) return fold_build2_loc (loc, code, type, TREE_OPERAND (arg0, 1), - build_int_cst (TREE_TYPE (arg0), 0)); + build_zero_cst (TREE_TYPE (arg0))); /* (X ^ C1) op C2 can be rewritten as X op (C1 ^ C2). */ if (TREE_CODE (arg0) == BIT_XOR_EXPR @@ -12922,7 +12922,7 @@ BIT_XOR_EXPR, itype, arg00, arg10), arg01), - build_int_cst (itype, 0)); + build_zero_cst (itype)); if (operand_equal_p (arg01, arg10, 0)) return fold_build2_loc (loc, code, type, @@ -12931,7 +12931,7 @@ BIT_XOR_EXPR, itype, arg00, arg11), arg01), - build_int_cst (itype, 0)); + build_zero_cst (itype)); if (operand_equal_p (arg00, arg11, 0)) return fold_build2_loc (loc, code, type, @@ -12940,7 +12940,7 @@ BIT_XOR_EXPR, itype, arg01, arg10), arg00), - build_int_cst (itype, 0)); + build_zero_cst (itype)); if (operand_equal_p (arg00, arg10, 0)) return fold_build2_loc (loc, code, type, @@ -12949,7 +12949,7 @@ BIT_XOR_EXPR, itype, arg01, arg11), arg00), - build_int_cst (itype, 0)); + build_zero_cst (itype)); } if (TREE_CODE (arg0) == BIT_XOR_EXPR Index: gcc/omp-low.c =================================================================== --- gcc/omp-low.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/omp-low.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -851,6 +851,19 @@ return omp_copy_decl_2 (var, DECL_NAME (var), TREE_TYPE (var), ctx); } +/* Build COMPONENT_REF and set TREE_THIS_VOLATILE and TREE_READONLY on it + as appropriate. */ +static tree +omp_build_component_ref (tree obj, tree field) +{ + tree ret = build3 (COMPONENT_REF, TREE_TYPE (field), obj, field, NULL); + if (TREE_THIS_VOLATILE (field)) + TREE_THIS_VOLATILE (ret) |= 1; + if (TREE_READONLY (field)) + TREE_READONLY (ret) |= 1; + return ret; +} + /* Build tree nodes to access the field for VAR on the receiver side. */ static tree @@ -865,7 +878,7 @@ field = x; x = build_simple_mem_ref (ctx->receiver_decl); - x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL); + x = omp_build_component_ref (x, field); if (by_ref) x = build_simple_mem_ref (x); @@ -915,8 +928,7 @@ build_sender_ref (tree var, omp_context *ctx) { tree field = lookup_sfield (var, ctx); - return build3 (COMPONENT_REF, TREE_TYPE (field), - ctx->sender_decl, field, NULL); + return omp_build_component_ref (ctx->sender_decl, field); } /* Add a new field for VAR inside the structure CTX->SENDER_DECL. */ @@ -6534,7 +6546,7 @@ sf = (tree) n->value; sf = *(tree *) pointer_map_contains (tcctx.cb.decl_map, sf); src = build_simple_mem_ref_loc (loc, sarg); - src = build3 (COMPONENT_REF, TREE_TYPE (sf), src, sf, NULL); + src = omp_build_component_ref (src, sf); t = build2 (MODIFY_EXPR, TREE_TYPE (*p), *p, src); append_to_statement_list (t, &list); } @@ -6557,9 +6569,9 @@ if (tcctx.cb.decl_map) sf = *(tree *) pointer_map_contains (tcctx.cb.decl_map, sf); src = build_simple_mem_ref_loc (loc, sarg); - src = build3 (COMPONENT_REF, TREE_TYPE (sf), src, sf, NULL); + src = omp_build_component_ref (src, sf); dst = build_simple_mem_ref_loc (loc, arg); - dst = build3 (COMPONENT_REF, TREE_TYPE (f), dst, f, NULL); + dst = omp_build_component_ref (dst, f); t = build2 (MODIFY_EXPR, TREE_TYPE (dst), dst, src); append_to_statement_list (t, &list); break; @@ -6580,14 +6592,14 @@ if (tcctx.cb.decl_map) sf = *(tree *) pointer_map_contains (tcctx.cb.decl_map, sf); src = build_simple_mem_ref_loc (loc, sarg); - src = build3 (COMPONENT_REF, TREE_TYPE (sf), src, sf, NULL); + src = omp_build_component_ref (src, sf); if (use_pointer_for_field (decl, NULL) || is_reference (decl)) src = build_simple_mem_ref_loc (loc, src); } else src = decl; dst = build_simple_mem_ref_loc (loc, arg); - dst = build3 (COMPONENT_REF, TREE_TYPE (f), dst, f, NULL); + dst = omp_build_component_ref (dst, f); t = lang_hooks.decls.omp_clause_copy_ctor (c, dst, src); append_to_statement_list (t, &list); break; @@ -6606,14 +6618,14 @@ if (tcctx.cb.decl_map) sf = *(tree *) pointer_map_contains (tcctx.cb.decl_map, sf); src = build_simple_mem_ref_loc (loc, sarg); - src = build3 (COMPONENT_REF, TREE_TYPE (sf), src, sf, NULL); + src = omp_build_component_ref (src, sf); if (use_pointer_for_field (decl, NULL)) src = build_simple_mem_ref_loc (loc, src); } else src = decl; dst = build_simple_mem_ref_loc (loc, arg); - dst = build3 (COMPONENT_REF, TREE_TYPE (f), dst, f, NULL); + dst = omp_build_component_ref (dst, f); t = build2 (MODIFY_EXPR, TREE_TYPE (dst), dst, src); append_to_statement_list (t, &list); break; @@ -6645,10 +6657,10 @@ sf = (tree) n->value; sf = *(tree *) pointer_map_contains (tcctx.cb.decl_map, sf); src = build_simple_mem_ref_loc (loc, sarg); - src = build3 (COMPONENT_REF, TREE_TYPE (sf), src, sf, NULL); + src = omp_build_component_ref (src, sf); src = build_simple_mem_ref_loc (loc, src); dst = build_simple_mem_ref_loc (loc, arg); - dst = build3 (COMPONENT_REF, TREE_TYPE (f), dst, f, NULL); + dst = omp_build_component_ref (dst, f); t = lang_hooks.decls.omp_clause_copy_ctor (c, dst, src); append_to_statement_list (t, &list); n = splay_tree_lookup (ctx->field_map, @@ -6656,7 +6668,7 @@ df = (tree) n->value; df = *(tree *) pointer_map_contains (tcctx.cb.decl_map, df); ptr = build_simple_mem_ref_loc (loc, arg); - ptr = build3 (COMPONENT_REF, TREE_TYPE (df), ptr, df, NULL); + ptr = omp_build_component_ref (ptr, df); t = build2 (MODIFY_EXPR, TREE_TYPE (ptr), ptr, build_fold_addr_expr_loc (loc, dst)); append_to_statement_list (t, &list); Index: gcc/tree-chrec.h =================================================================== --- gcc/tree-chrec.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/tree-chrec.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -77,7 +77,6 @@ /* Observers. */ extern bool eq_evolutions_p (const_tree, const_tree); extern bool is_multivariate_chrec (const_tree); -extern bool chrec_is_positive (tree, bool *); extern bool chrec_contains_symbols (const_tree); extern bool chrec_contains_symbols_defined_in_loop (const_tree, unsigned); extern bool chrec_contains_undetermined (const_tree); Index: gcc/DEV-PHASE =================================================================== --- gcc/DEV-PHASE (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/DEV-PHASE (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1 @@ +prerelease Index: gcc/tree-ssa-sccvn.c =================================================================== --- gcc/tree-ssa-sccvn.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/tree-ssa-sccvn.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1348,18 +1348,19 @@ /* Lookup an existing or insert a new vn_reference entry into the value table for the VUSE, SET, TYPE, OPERANDS reference which - has the constant value CST. */ + has the value VALUE which is either a constant or an SSA name. */ static vn_reference_t -vn_reference_lookup_or_insert_constant_for_pieces (tree vuse, - alias_set_type set, - tree type, - VEC (vn_reference_op_s, - heap) *operands, - tree cst) +vn_reference_lookup_or_insert_for_pieces (tree vuse, + alias_set_type set, + tree type, + VEC (vn_reference_op_s, + heap) *operands, + tree value) { struct vn_reference_s vr1; vn_reference_t result; + unsigned value_id; vr1.vuse = vuse; vr1.operands = operands; vr1.type = type; @@ -1367,10 +1368,13 @@ vr1.hashcode = vn_reference_compute_hash (&vr1); if (vn_reference_lookup_1 (&vr1, &result)) return result; + if (TREE_CODE (value) == SSA_NAME) + value_id = VN_INFO (value)->value_id; + else + value_id = get_or_alloc_constant_value_id (value); return vn_reference_insert_pieces (vuse, set, type, VEC_copy (vn_reference_op_s, heap, - operands), cst, - get_or_alloc_constant_value_id (cst)); + operands), value, value_id); } /* Callback for walk_non_aliased_vuses. Tries to perform a lookup @@ -1452,7 +1456,7 @@ && offset2 + size2 >= offset + maxsize) { tree val = build_zero_cst (vr->type); - return vn_reference_lookup_or_insert_constant_for_pieces + return vn_reference_lookup_or_insert_for_pieces (vuse, vr->set, vr->type, vr->operands, val); } } @@ -1473,7 +1477,7 @@ && offset2 + size2 >= offset + maxsize) { tree val = build_zero_cst (vr->type); - return vn_reference_lookup_or_insert_constant_for_pieces + return vn_reference_lookup_or_insert_for_pieces (vuse, vr->set, vr->type, vr->operands, val); } } @@ -1514,7 +1518,7 @@ / BITS_PER_UNIT), ref->size / BITS_PER_UNIT); if (val) - return vn_reference_lookup_or_insert_constant_for_pieces + return vn_reference_lookup_or_insert_for_pieces (vuse, vr->set, vr->type, vr->operands, val); } } @@ -1568,7 +1572,7 @@ } } if (val) - return vn_reference_lookup_or_insert_constant_for_pieces + return vn_reference_lookup_or_insert_for_pieces (vuse, vr->set, vr->type, vr->operands, val); } } Index: gcc/cgraphunit.c =================================================================== --- gcc/cgraphunit.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/cgraphunit.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -2490,8 +2490,8 @@ if (cgraph_dump_file) { fprintf (cgraph_dump_file, "updating call of %s/%i -> %s/%i: ", - cgraph_node_name (e->caller), e->caller->uid, - cgraph_node_name (e->callee), e->callee->uid); + xstrdup (cgraph_node_name (e->caller)), e->caller->uid, + xstrdup (cgraph_node_name (e->callee)), e->callee->uid); print_gimple_stmt (cgraph_dump_file, e->call_stmt, 0, dump_flags); if (e->callee->clone.combined_args_to_skip) { @@ -2577,8 +2577,8 @@ if (cgraph_dump_file) { fprintf (cgraph_dump_file, "cloning %s to %s\n", - cgraph_node_name (node->clone_of), - cgraph_node_name (node)); + xstrdup (cgraph_node_name (node->clone_of)), + xstrdup (cgraph_node_name (node))); if (node->clone.tree_map) { unsigned int i; @@ -2591,9 +2591,11 @@ replace_info = VEC_index (ipa_replace_map_p, node->clone.tree_map, i); - print_generic_expr (cgraph_dump_file, replace_info->old_tree, 0); + print_generic_expr (cgraph_dump_file, + replace_info->old_tree, 0); fprintf (cgraph_dump_file, " -> "); - print_generic_expr (cgraph_dump_file, replace_info->new_tree, 0); + print_generic_expr (cgraph_dump_file, + replace_info->new_tree, 0); fprintf (cgraph_dump_file, "%s%s;", replace_info->replace_p ? "(replace)":"", replace_info->ref_p ? "(ref)":""); @@ -2603,12 +2605,15 @@ if (node->clone.args_to_skip) { fprintf (cgraph_dump_file, " args_to_skip: "); - dump_bitmap (cgraph_dump_file, node->clone.args_to_skip); + dump_bitmap (cgraph_dump_file, + node->clone.args_to_skip); } if (node->clone.args_to_skip) { - fprintf (cgraph_dump_file, " combined_args_to_skip:"); - dump_bitmap (cgraph_dump_file, node->clone.combined_args_to_skip); + fprintf (cgraph_dump_file, + " combined_args_to_skip:"); + dump_bitmap (cgraph_dump_file, + node->clone.combined_args_to_skip); } } cgraph_materialize_clone (node); Index: gcc/ChangeLog =================================================================== --- gcc/ChangeLog (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/ChangeLog (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,3 +1,1095 @@ +2012-05-25 Eric Botcazou + + PR lto/52178 + * tree-inline.c (remap_gimple_op_r): Fix handling of FIELD_DECL. + * tree.c (RETURN_TRUE_IF_VAR): Do not return true for PLACEHOLDER_EXPR. + +2012-05-25 Alexander Ivchenko + + PR target/53435 + * config/i386/i386.c (ix86_expand_vec_perm): Use correct op. + (ix86_expand_vec_perm): Use int mode instead of float. + +2012-05-25 Eric Botcazou + + PR ada/52362 + * config.gcc (i[34567]86-*-mingw* | x86_64-*-mingw*): Set gas and + gnu_ld variables to yes. + * configure.ac (HAVE_GNU_LD): Move to after config.gcc inclusion. + (HAVE_GNU_AS): Likewise. + * config.in: Regenerate. + * configure: Likewise. + +2012-05-25 Ramana Radhakrishnan + + Backport from mainline + 2012-03-12 Richard Guenther + * config/arm/arm.c (neon_dereference_pointer): Do not call + covert during RTL expansion. + +2012-05-24 Bill Schmidt + + Backport from mainline + 2012-05-18 Bill Schmidt + + PR target/53385 + * config/rs6000/rs6000.c (print_operand): Revise code that unsafely + relied on signed overflow behavior. + +2012-05-24 Richard Guenther + + PR middle-end/53460 + * tree-profile.c (tree_profiling): Cleanup the CFG if + execute_fixup_cfg requests it. + +2012-05-24 Jakub Jelinek + + PR tree-optimization/53465 + * tree-vrp.c (extract_range_from_cond_expr): First copy_value_range + vr0 into *vr, then vrp_meet that. + (vrp_meet): If one vr type is VR_UNDEFINED, ensure the result doesn't + have any equivalences. + (vrp_visit_phi_node): Call copy_value_range instead of vrp_meet the + first time. + +2012-05-23 Eric Botcazou + + * gimple.c (gimple_types_compatible_p_1) : Remove bogus + size handling. + (gimple_canonical_types_compatible_p) : Likewise. + (iterative_hash_gimple_type): Adjust comment. + (iterative_hash_canonical_type): Likewise. Hash the bounds of the + domain for an array type instead of the domain type itself. + +2012-05-23 Georg-Johann Lay + + Backport from 2012-05-23 mainline r187803 + + PR target/53448 + * config/avr/avr.h (ASM_OUTPUT_ALIGN): Don't inhibit .p2align 1. + * config/avr/elf.h (ASM_OUTPUT_BEFORE_CASE_LABEL): Use + ASM_OUTPUT_ALIGN. + +2012-05-23 Ganesh Gopalasubramanian + + Backport from 2012-05-03 mainline r187075 + + * config/i386/driver-i386.c (host_detect_local_cpu): Reset + has_fma4 for AMD processors with both fma3 and fma4 support. + +2012-05-22 Richard Guenther + + PR tree-optimization/53408 + * tree-vect-loop.c (vectorizable_induction): Properly check + the restriction that we cannot handle induction results from + the inner loop outside of the outer loop. + +2012-05-21 Jakub Jelinek + + PR tree-optimization/53436 + * omp-low.c (omp_build_component_ref): New function. + (build_receiver_ref, build_sender_ref, create_task_copyfn): Use it. + + PR tree-optimization/53366 + * tree-vect-slp.c (vect_supported_load_permutation_p): Don't shortcut + tests if complex_numbers == 2, but there are non-complex number loads + too. + + PR tree-optimization/53409 + * tree-vect-loop.c (vect_analyze_loop_operations): Don't check + vinfo_for_stmt (op_def_stmt) if op_def_stmt isn't inside loop. + + PR tree-optimization/53410 + * fold-const.c (fold_binary_loc): Use build_zero_cst (type) + instead of build_int_cst (type, 0) where vector types might be + involved. + +2012-05-21 Joseph Myers + + PR c/53418 + * c-typeck.c (build_conditional_expr): Remove C_MAYBE_CONST_EXPR + from folded operands before wrapping another around the + conditional expression. + +2012-05-21 Dave Boutcher + Patrick Marlier + + * trans-mem.c (ipa_tm_transform_clone): Transform functions with + indirect calls. + +2012-05-21 H.J. Lu + + Backport from mainline + 2012-05-21 H.J. Lu + + PR target/53416 + * config/i386/i386.md (UNSPEC_RDRAND): Renamed to ... + (UNSPECV_RDRAND): This. + (rdrand_1): Updated. + +2012-05-20 H.J. Lu + + Backport from mainline + 2012-05-20 H.J. Lu + + * config/i386/driver-i386.c (host_detect_local_cpu): Support + RDRND, F16C and FSGSBASE. + +2012-05-19 Eric Botcazou + + Backport from mainline + 2012-05-14 Eric Botcazou + + * tree-ssa-pre.c (can_value_number_call): Delete. + (compute_avail): Skip all statements with side effects. + : Skip calls to internal functions. + +2012-05-18 David S. Miller + + Backport r185385 from mainline + 2012-03-14 Richard Guenther + + PR middle-end/52584 + * tree-vect-generic.c (type_for_widest_vector_mode): Take + element type instead of mode, use build_vector_type_for_mode + instead of the langhook, build a vector of proper signedness. + (expand_vector_operations_1): Adjust. + +2012-05-18 Olivier Hainque + + * Makefile.in (FLAGS_TO_PASS): Pass $(libexecsubdir) instead of + $(libsubdir) as libexecsubdir. + +2012-05-16 Andrew Pinski + + * gimple-fold.c (get_maxval_strlen): Move COND_EXPR handling under + GIMPLE_ASSIGN. + +2012-05-16 David S. Miller + + * jump.c (delete_related_insns): If we remove a CALL, make sure + we delete it's NOTE_INSN_CALL_ARG_LOCATION note too. + +2012-05-16 Richard Henderson + + PR debug/52727 + * combine-stack-adj.c (prev_active_insn_bb): New. + (next_active_insn_bb): New. + (force_move_args_size_note): New. + (combine_stack_adjustments_for_block): Use it. + +2012-05-16 Olivier Hainque + + * Makefile.in (install-no-fixedincludes): New target, former toplevel + gcc-no-fixedincludes. Stash "include-fixed" in addition to "include". + Add comments and improve stamp preservation across the whole sequence. + (stmp-int-hdrs): Use move-if-change + cp -p to setup fix_dir/limits.h. + +2012-05-16 Richard Guenther + + PR tree-optimization/53364 + * tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Properly + detect a view-conversion of the decl. + +2012-05-15 Jakub Jelinek + + PR target/53358 + * config/i386/i386.md (*addqi_2 peephole with QImode addition): Check + that operands[2] is either immediate, or q_regs_operand. + +2012-05-15 Bin Cheng + + Backport r187139 from mainline. + 2012-05-04 Bin Cheng + + PR rtl-optimization/52804 + * reload1.c (reload_reg_reaches_end_p): Check whether successor + reload with type RELOAD_FOR_INPUT_ADDRESS kills reload register + of current one with type RELOAD_FOR_INPADDR_ADDRESS. + Same stands for reloads with type RELOAD_FOR_OUTPUT_ADDRESS and + RELOAD_FOR_OUTADDR_ADDRESS. + +2012-05-14 Uros Bizjak + + PR target/46098 + * config/i386/i386.c (ix86_expand_special_args_builtin): Always + generate target register for "load" class builtins. + + Revert: + 2010-10-22 Uros Bizjak + + PR target/46098 + * config/i386/sse.md (*avx_movu): + Rename from avx_movu. + (avx_movu): New expander. + (*_movu): Rename from _movu. + (_movu): New expander. + (*avx_movdqu): Rename from avx_movdqu. + (avx_movdqu): New expander. + (*sse2_movdqu): Rename from sse2_movdqu. + (sse2_movdqu): New expander. + +2012-05-14 Jakub Jelinek + + * dwarf2out.c (dwarf2out_define, dwarf2out_undef): Treat + lineno 1 the same as lineno 0 before first start file directive. + (optimize_macinfo_range): Likewise. + + * dwarf2out.c (have_macinfo): Define. + (dwarf2out_finish): Don't emit DW_AT_GNU_macros or DW_AT_macro_info + attribute, don't force empty compilation unit and don't emit any + .debug_macinfo/.debug_macro section if macinfo_table is empty. + +2012-05-13 Uros Bizjak + + Backport from mainline + 2012-05-12 Uros Bizjak + + * config/alpha/alpha.c (alpha_emit_conditional_branch): Handle + ORDERED and UNORDERED conditions. + +2012-05-12 Eric Botcazou + + * function.c (requires_stack_frame_p): If the function can throw + non-call exceptions, return true if the insn can throw internally. + +2012-05-10 Eric Botcazou + + * gimplify.c (gimplify_decl_expr): For a TYPE_DECL, also gimplify the + DECL_ORIGINAL_TYPE if it is present. + +2012-05-09 Georg-Johann Lay + + Backport from 2012-05-12 mainline r187342. + + PR target/53256 + * config/avr/elf.h (ASM_DECLARE_FUNCTION_NAME): Remove. + * config/avr/avr-protos.h (avr_asm_declare_function_name): Remove. + * config/avr/avr.h (struct machine_function): Add attributes_checked_p. + * config/avr/avr.c (avr_asm_declare_function_name): Remove. + (expand_prologue): Move initialization of cfun->machine->is_naked, + is_interrupt, is_signal, is_OS_task, is_OS_main from here to... + (avr_set_current_function): ...this new static function. + (TARGET_SET_CURRENT_FUNCTION): New define. + (avr_function_ok_for_sibcall): Use cfun->machine->is_* instead of + checking attributes of current_function_decl. + (avr_regs_to_save): Ditto. + (signal_function_p): Rename to avr_signal_function_p. + (interrupt_function_p): Rename to avr_interrupt_function_p. + + * doc/extend.texi (Function Attributes): Better explanation of + 'interrupt' and 'signal' for AVR. Move 'ifunc' down to establish + alphabetical order. + +2012-05-09 Matthias Klose + + * gcc-ar.c (main): Don't check for execute bits for the plugin. + +2012-05-08 Hans-Peter Nilsson + + PR target/53272 + * config/cris/cris.c (cris_normal_notice_update_cc): For TARGET_V32, + when a constant source operand matches an "I" constraint, the "no + CC0 change" applies to a register-destination only, not a + strict_low_part-destination. + +2012-05-07 Ramana Radhakrishnan + + Backport from mainline: + 2012-04-19 Ramana Radhakrishnan + + * config/arm/sync.md (sync_optab): Change ior attribute to "or". + +2012-05-07 Jakub Jelinek + + PR tree-optimization/53239 + * tree-vrp.c (get_value_range): Set VR of + SSA_NAME_IS_DEFAULT_DEF of DECL_BY_REFERENCE RESULT_DECL + to nonnull. + +2012-05-07 Richard Guenther + + PR tree-optimization/53195 + * tree-inline.c (setup_one_parameter): Properly add referenced + vars from the parameters new known value. + +2012-05-06 John David Anglin + + Backport from mainline: + 2012-04-27 John David Anglin + + PR target/52999 + * config/pa/pa.c (pa_legitimate_constant_p): Don't put function labels + in constant pool. + +2012-05-04 Ian Lance Taylor + + * tree-vect-patterns.c (vect_single_imm_use): Correct return + values from false to NULL. + +2012-05-04 Uros Bizjak + + Backport from mainline + 2012-05-04 Uros Bizjak + + PR target/53228 + * config/i386/i386.h (X86_ARCH_CMOV): Rename from X86_ARCH_CMOVE. + (TARGET_CMOV): Rename from TARGET_CMOVE. + (TARGET_CMOVE): New define. + * config/i386/i386.c (ix86_option_override_internal): Use TARGET_CMOV. + Do not set TARGET_CMOVE here. + +2012-05-04 Ulrich Weigand + + Backport from mainline: + + 2012-05-04 Ulrich Weigand + + PR tree-optimization/52633 + * tree-vect-patterns.c (vect_vect_recog_func_ptrs): Swap order of + vect_recog_widen_shift_pattern and vect_recog_over_widening_pattern. + (vect_recog_over_widening_pattern): Remove handling of code that was + already detected as over-widening pattern. Remove special handling + of "unsigned" cases. Instead, support general case of conversion + of the shift result to another type. + + 2012-05-04 Ulrich Weigand + + * tree-vect-patterns.c (vect_single_imm_use): New function. + (vect_recog_widen_mult_pattern): Use it instead of open-coding loop. + (vect_recog_over_widening_pattern): Likewise. + (vect_recog_widen_shift_pattern): Likewise. + + 2012-04-10 Ulrich Weigand + + PR tree-optimization/52870 + * tree-vect-patterns.c (vect_recog_widen_mult_pattern): Verify that + presumed pattern statement is within the same loop or basic block. + +2012-05-04 Richard Guenther + + * common.opt (flto-report): Do not mark as Optimization. + +2012-05-04 Eric Botcazou + + PR target/48496 + * recog.c (constrain_operands): If extra constraints are present, also + accept pseudo-registers with equivalent memory locations during reload. + +2012-05-03 Michael Meissner + + Backport from the mainline + 2012-05-03 Michael Meissner + + PR target/53199 + * config/rs6000/rs6000.md (bswapdi splitters): If + -mavoid-indexed-addresses (or -mcpu=power6 which sets it by + default) is used, generate an alternate sequence that does not + depend on using indexed addressing. + +2012-05-03 David S. Miller + + PR target/52684 + * config/sparc/sparc.c (emit_soft_tfmode_libcall): If we pass a + MEM directly into a libcall, mark it's MEM_EXPR as addressable. + (sparc_emit_float_lib_cmp): Likewise. + +2012-05-04 Martin Jambor + + Backport from mainline + 2012-05-02 Martin Jambor + + PR lto/52605 + * dwarf2out.c (dwarf2out_decl): Only lookup die representing context + of a variable when the contect is a function. + +2012-05-03 Jakub Jelinek + + PR plugins/53126 + * gcc-ar.c (main): If GCC_EXEC_PREFIX is set in env, + append program name to it and pass that as first argument + to make_relative_prefix. Always pass standard_libexec_prefix + as last argument to make_relative_prefix. If + make_relative_prefix returns NULL, fall back to + standard_libexec_prefix. + + PR debug/53174 + * tree-predcom.c (remove_stmt): Call reset_debug_uses on stmts being + removed. + + PR target/53187 + * config/arm/arm.c (arm_select_cc_mode): If x has MODE_CC class + mode, return that mode. + +2012-05-03 Richard Guenther + + PR tree-optimization/53144 + * tree-ssa-sccvn.c (vn_reference_lookup_or_insert_constant_for_pieces): + Rename to ... + (vn_reference_lookup_or_insert_for_pieces): ... this. Properly deal + with SSA name values. + (vn_reference_lookup_3): Adjust callers. + +2012-05-02 Jakub Jelinek + + PR tree-optimization/53163 + * tree-ssa-phiopt.c (cond_if_else_store_replacement): Don't ignore + return value from compute_all_dependences. + + PR rtl-optimization/53160 + * ree.c (combine_reaching_defs): Handle the case where cand->insn + has been modified by ree pass already. + +2012-05-01 Uros Bizjak + + Backport from mainline + 2012-04-30 Uros Bizjak + + PR middle-end/53136 + * ipa-prop.c (ipa_print_node_jump_functions): Wrap multiple + calls to cgraph_node_name in xstrdup. + (ipa_make_edge_direct_to_target): Ditto. + * tree-sra.c (convert_callers_for_node): Ditto. + * lto-symtab.c (lto_cgraph_replace_node): Ditto. + * ipa-cp.c (perhaps_add_new_callers): Ditto. + * cgraphunit.c (cgraph_redirect_edge_call_stmt_to_callee): Ditto. + (cgraph_materialize_all_clones): Ditto. + * ipa-inline.c (report_inline_failed_reason): Ditto. + (want_early_inline_function_p): Ditto. + (edge_badness): Ditto. + (update_edge_key): Ditto. + (flatten_function): Ditto. + (ipa_inline): Ditto. + (inline_always_inline_functions): Ditto. + (early_inline_small_functions): Ditto. + +2012-04-30 Andreas Tobler + + Backport from mainline + 2012-03-21 Andreas Tobler + + * configure.ac (HAVE_LD_NO_DOT_SYMBOLS): Add powerpc64-*-freebsd*. + Introduce emul_name to select the right linker emulation for + powerpc64-*-freebsd*. + * configure: Regenerate. + * config.gcc: Add bits to support powerpc64-*-freebsd*. + * config/rs6000/freebsd.h (POWERPC_FREEBSD): Define. + * config/rs6000/freebsd64.h: New file. + * config/rs6000/rs6000.c (rs6000_option_override_internal): Use + POWERPC_FREEBSD. + (rs6000_savres_strategy): Likewise. + (rs6000_savres_routine_name): Likewise. + (rs6000_elf_file_end): Likewise. + * config/rs6000/t-freebsd64: New file. + * config/rs6000/sysv4.h (SUBTARGET_OVERRIDE_OPTIONS): Set the + rs6000_current_abi for 64-bit FreeBSD to ABI_AIX. + +2012-04-30 Uros Bizjak + + Backport from mainline + 2012-04-27 Paolo Bonzini + + PR target/53138 + * config/i386/i386.md (x86_movcc_0_m1_neg): Add clobber. + +2012-04-30 Eric Botcazou + + * config/i386/i386.c (ix86_handle_struct_attribute): Use the proper + predicate to discriminate types. + +2012-04-27 Richard Guenther + + PR c/51527 + * convert.c (convert_to_integer): Avoid infinite recursion for + target-defined built-in types. + +2012-04-26 Hans-Peter Nilsson + + PR target/53120 + * config/cris/cris.md ("*andhi_lowpart_v32") + ("*andqi_lowpart_v32"): Change first input-only operand from + a (match_operand ...) to (match_dup 0). Drop alternatives with + const_int-matching constraints for redundancy. + ("*andhi_lowpart_non_v32", "*andqi_lowpart_non_v32"): Ditto. Drop + three-operand alternative. + +2012-04-26 Uros Bizjak + + Backport from mainline + 2012-04-23 Uros Bizjak + + * config/i386/i386.md (*add_2): Add r/r/0 alternative. + (*addsi_2_zext): Ditto. + (*add_3): Ditto. + (*addsi_3_zext): Ditto. + (*add_5): Ditto. + +2012-04-25 Jakub Jelinek + + PR c/52880 + * c-typeck.c (set_nonincremental_init, + set_nonincremental_init_from_string): Pass true instead of false + as IMPLICIT to add_pending_init. + +2012-04-24 Georg-Johann Lay + + Backport from 2012-04-24 mainline r186768. + + PR target/53065 + * config/avr/avr.h (HARD_REGNO_CALL_PART_CLOBBERED): New hook define. + +2012-04-24 Richard Guenther + + PR tree-optimization/53085 + * tree-ssa-pre.c (eliminate): Do not eliminate volatile redundant + stores. + +2012-04-24 Jakub Jelinek + + PR middle-end/53084 + * varasm.c (compute_reloc_for_constant): Handle ADDR_EXPR + of MEM_REF. + (output_addressed_constants): Likewise. + + PR middle-end/52999 + * varasm.c (get_section): Don't ICE for section conflicts with + built-in section kinds. + +2012-04-23 David Edelsohn + + * config/rs6000/sync.md (fetchop_name): Change ior attribute to "or". + +2012-04-23 Georg-Johann Lay + + * doc/extend.texi (AVR Named Address Spaces): Fix typos. + +2012-04-23 Richard Guenther + + PR c/53060 + * c-typeck.c (build_binary_op): Fix typo. + +2012-04-23 Jakub Jelinek + + PR tree-optimizations/52891 + * tree-vect-patterns.c (adjust_bool_pattern): Use + build_nonstandard_type even if rhs1 has unsigned INTEGER_TYPE, + but with non-standard precision. + +2012-04-22 Ian Lance Taylor + + * godump.c (go_output_typedef): Dump size of structs. + +2012-04-20 Ulrich Weigand + + Backport from mainline: + + * config/arm/arm.c (arm_print_operand): Fix invalid alignment + hints for 'A' operand types. + +2012-04-19 Georg-Johann Lay + + Backport from 2012-04-19 mainline r186588. + + PR target/53033 + * config/avr/avr.c (avr_out_load_psi): Fix assembler template for + the case *(X+const). + +2012-04-18 Uros Bizjak + + * config/alpha/sync.md (fetchop_name): Change ior attribute to "or". + +2012-04-17 Uros Bizjak + + PR target/53020 + * config/i386/sync.md (atomic_): Rename to + atomic_. + +2012-04-16 Uros Bizjak + + Backport from mainline + 2012-04-12 Uros Bizjak + + PR target/52932 + * config/i386/avx2intrin.h (_mm256_permutevar8x32_ps): Change second + argument type to __m256i. Update call to __builtin_ia32_permvarsf256. + * config/i386/sse.md (avx2_permvarv8sf): Change operand 1 to V8SI. + (avx2_permvarv8sf, avx2_permvarv8si): Switch operands 1 and 2. + * config/i386/i386.c (bdesc_args) <__builtin_ia32_permvarsf256>: + Update builtin type to V8SF_FTYPE_V8SF_V8SI. + (ix86_expand_vec_perm): Update calls to gen_avx2_permvarv8si and + gen_avx2_permvarv8sf. + +2012-04-16 Martin Jambor + + Backported from mainline + + 2012-04-13 Martin Jambor + PR middle-end/52939 + + * gimple-fold.c (gimple_get_virt_method_for_binfo): Bail out if + fold_ctor_reference returns a zero constant. + +2012-04-13 H.J. Lu + + Backported from mainline + 2012-04-13 H.J. Lu + + * config/i386/i386-c.c (ix86_target_macros): Define _ILP32 + and __ILP32__ for x32. + +2012-04-13 Tom de Vries + + Backport from mainline r186418. + + 2012-04-13 Tom de Vries + + * tree-ssa-tail-merge.c (gsi_advance_bw_nondebug_nonlocal): Add + parameters vuse and vuse_escaped. + (find_duplicate): Init vuse1, vuse2 and vuse_escaped. Pass to + gsi_advance_bw_nondebug_nonlocal. Return if vuse_escaped and + vuse1 != vuse2. + +2012-04-13 Richard Guenther + + PR tree-optimization/52969 + * tree-if-conv.c (predicate_mem_writes): Properly gimplify + the condition for the COND_EXPR and handle predicate negation + by swapping the COND_EXPR arms. + +2012-04-13 Richard Guenther + + PR c/52862 + * convert.c (convert_to_pointer): Remove special-casing of + zero. + +2012-04-12 Michael Meissner + + Backport from mainline + 2012-04-12 Michael Meissner + + PR target/52775 + * config/rs6000/rs6000.h (TARGET_FCFID): Add TARGET_PPC_GPOPT to + the list of options to enable the FCFID instruction. + (TARGET_EXTRA_BUILTINS): Adjust comment. + +2012-04-12 Richard Guenther + + PR tree-optimization/52943 + * tree-chrec.h (chrec_is_positive): Remove. + * tree-scalar-evolution.c (chrec_is_positive): Move ... + * tree-data-ref.c (chrec_is_positive): ... here. Make static. + Return false for a constant zero instead of negative. + (analyze_siv_subscript_cst_affine): Handle zero difference + in the initial condition explicitely. + +2012-04-10 John David Anglin + + PR middle-end/52894 + * varasm.c (process_pending_assemble_externals): Set + pending_assemble_externals_processed true. + (assemble_external): Call assemble_external_real if the pending + assemble externals have been processed. + +2012-04-09 Eric Botcazou + + PR target/52717 + * config/sparc/sparc.c (sparc_file_end): Set TREE_PUBLIC explicitly on + the DECL generated for the special GOT helper. + +2012-04-06 Walter Lee + + Backport from mainline + 2012-03-07 Walter Lee + + * config/tilegx/tilegx.c (tilegx_expand_prologue): Don't generate + REG_CFA_* notes for the stack pointer. + (tilegx_expand_epilogue): Restore stack pointer by adjusting it by + EH_RETURN_STACKADJ_RTX. + * config/tilepro/tilepro.c (tilepro_expand_prologue): Don't + generate REG_CFA_* notes for the stack pointer. + (tilepro_expand_epilogue): Restore stack pointer by adjusting it + by EH_RETURN_STACKADJ_RTX. + +2012-04-06 Matt Turner + + * doc/install.texi: Correct typo "-mno-lsc" -> "-mno-llsc". + +2012-04-06 Eric Botcazou + + * config/ia64/ia64.c (ia64_load_pair_ok): Return 0 if the second member + of the destination isn't also a FP_REGS register. + +2012-04-03 Richard Guenther + + Backport from mainline + 2012-03-02 Richard Guenther + + PR tree-optimization/52406 + * tree-data-ref.h: Update documentation about DR_BASE_OBJECT. + (struct indices): Add unconstrained_base member. + (struct dr_alias): Remove unused vops member. + (DR_UNCONSTRAINED_BASE): New define. + * tree-data-ref.c (dr_analyze_indices): For COMPONENT_REFs + add indices to allow their disambiguation. Make DR_BASE_OBJECT + be an artificial access that covers the whole indexed object, + or mark it with DR_UNCONSTRAINED_BASE if we cannot do so. Canonicalize + plain decl base-objects to their MEM_REF variant. + (dr_may_alias_p): When the base-object of either data reference + has unknown size use only points-to information. + (compute_affine_dependence): Make dumps easier to read and + more verbose. + * tree-vect-data-ref.c (vector_alignment_reachable_p): Use + DR_REF when looking for packed references. + (vect_supportable_dr_alignment): Likewise. + +2012-04-03 Richard Guenther + + Backport from mainline + 2012-03-15 Richard Guenther + + PR middle-end/52580 + * tree-data-ref.c (subscript_dependence_tester_1): Check + all dimensions for non-conflicting access functions. + +2012-04-03 Richard Guenther + + Backport from mainline + 2012-03-06 Richard Guenther + + PR middle-end/52493 + * tree-ssa-alias.c (ptr_derefs_may_alias_p): Robustify. + + 2012-03-23 Richard Guenther + + PR tree-optimization/52678 + * tree-vectorizer.h (struct _stmt_vec_info): Add + loop_phi_evolution_part member. + (STMT_VINFO_LOOP_PHI_EVOLUTION_PART): New define. + * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Initialize + STMT_VINFO_LOOP_PHI_EVOLUTION_PART. + * tree-vect-loop-manip.c (vect_update_ivs_after_vectorizer): + Use the cached evolution part and the PHI nodes value from + the loop preheader edge instead of re-analyzing the evolution. + + 2012-03-26 Richard Guenther + + PR tree-optimization/52701 + * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Always + compute and set the evolution part of PHI nodes. + + 2012-03-30 Richard Guenther + + PR tree-optimization/52754 + * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Only + propagate arbitrary addresses into really plain dereferences. + +2012-04-03 Jakub Jelinek + + PR tree-optimization/52835 + * tree-data-ref.c (build_rdg): Return NULL if + compute_data_dependences_for_loop failed. + +2012-03-31 Eric Botcazou + + * tree-cfg.c (call_can_make_abnormal_goto): New predicate. + (stmt_can_make_abnormal_goto): Use it. + (is_ctrl_altering_stmt): Likewise. + +2012-03-31 Martin Jambor + + Backported from mainline + 2012-03-30 Martin Jambor + + * tree-ssa-ccp.c (insert_clobbers_for_var): Do not assert that there + is a builtin_stack_save in a dominating BB. + +2012-03-29 Uros Bizjak + + * config/i386/sse.md (avx_hv4df3): Fix results + crossing 128bit lane boundary. + +2012-03-29 Uros Bizjak + + Backported from mainline + 2012-03-27 Uros Bizjak + + PR target/52698 + * config/i386/i386-protos.h (ix86_legitimize_reload_address): + New prototype. + * config/i386/i386.h (LEGITIMIZE_RELOAD_ADDRESS): New define. + * config/i386/i386.c: Include reload.h. + (ix86_legitimize_reload_address): New function. + +2012-03-28 Martin Jambor + + Backported from mainline + 2012-03-27 Martin Jambor + + PR middle-end/52693 + * tree-sra.c (sra_modify_assign): Do not call + load_assign_lhs_subreplacements when working with an unscalarizable + region. + +2012-03-28 Jakub Jelinek + + PR middle-end/52691 + * tree-ssa-ccp.c (optimize_stdarg_builtin): Optimize + __builtin_va_start to __builtin_next_arg if the latter is + builtin_decl_explicit_p rather than when it is not. + + PR middle-end/52750 + * tree-vect-generic.c (vector_element): Perform multiplication + for pos in bitsizetype type instead of idx type. + +2012-03-28 Georg-Johann Lay + + Backport from 2012-03-28 mainline r185910. + + PR target/52692 + * config/avr/avr.c (TARGET_BUILTIN_DECL): New define. + (avr_builtin_decl): New static function. + (struct avr_builtin_description, avr_bdesc): Move up. + Add GTY marker. Add field fndecl. Remove redundant field id. + (avr_init_builtins): Initialize avr_bdesc[ID].fndecl. + (avr_expand_builtin): Code cleanup because .id is removed. + +2012-03-28 Aurelien Buhrig + + PR middle-end/51893 + * expmed.c (store_bit_field_1): Fix wordnum value for big-endian + targets. + +2012-03-28 Georg-Johann Lay + + Backport from 2012-03-28 mainline r185907. + + PR target/52737 + * config.gcc (tm_file): Remove avr/multilib.h. + + * doc/invoke.texi (AVR Options): Adjust + documentation of -mtiny-stack. + + * config/avr/genmultilib.awk: Remove code to generate multilib.h. + (BEGIN): Use -msp8 as multilib option instead of -mtiny-stack. + * config/avr/t-avr: Remove generation of multilib.h. + * config/avr/t-multilib: Regenerate. + * config/avr/multilib.h: Remove. + * config/avr/avr.opt (-msp8): New option. + (avr_sp8): New variable. + * config/avr/driver-avr.c (avr_device_to_sp8): New function. + * config/avr/avr.h (AVR_HAVE_SPH): New define. + (AVR_HAVE_8BIT_SP): Also set by avr_sp8 i.e. -msp8. + (avr_device_to_sp8): New prototype. + (EXTRA_SPEC_FUNCTIONS): Add { "device_to_sp8", avr_device_to_sp8 } + (DRIVER_SELF_SPECS): New define. + * config/avr/avr-c.c (avr_cpu_cpp_builtins): New built-in defines: + __AVR_SP8__, __AVR_HAVE_SPH__. + * config/avr/avr.c (output_movhi): Use AVR_HAVE_SPH instead of + AVR_HAVE_8BIT_SP to decide if SP_H is present. + (avr_file_start): Ditto. + +2012-03-28 Jakub Jelinek + + PR target/52736 + * config/i386/sse.md (sse2_loadlpd splitter): Use offset 0 + instead of 8 in adjust_address. + +2012-03-27 Eric Botcazou + + * expmed.c (store_bit_field): Assert that BITREGION_START is a multiple + of a unit before computing the offset in units. + +2012-03-27 Richard Guenther + + PR middle-end/52720 + * fold-const.c (try_move_mult_to_index): Handle &x.array more + explicitely. + +2012-03-24 Eric Botcazou + + PR target/52610 + * config/sparc/sparc.h (ASM_CPU_SPEC): Pass -Av8 if -mcpu=leon. + +2012-03-24 Steven Bosscher + + PR middle-end/52640 + * varasm.c: Include pointer-set.h. + (pending_assemble_externals_set): New pointer set. + (process_pending_assemble_externals): Destroy the pointer set. + (assemble_external): See if decl is in pending_assemble_externals_set, + and add it to pending_assemble_externals if necessary. + (init_varasm_once): Allocate pending_assemble_externals_set. + +2012-03-23 Michael Meissner + + Backported from mainline + 2012-03-06 Michael Meissner + + PR target/50310 + * config/rs6000/vector.md (vector_uneq): Add support for + UNEQ, LTGT, ORDERED, and UNORDERED IEEE vector comparisons. + (vector_ltgt): Likewise. + (vector_ordered): Likewise. + (vector_unordered): Likewise. + * config/rs6000/rs6000.c (rs6000_emit_vector_compare_inner): Likewise. + +2012-03-23 Joern Rennecke + + * config/epiphany/epiphany.c (epiphany_function_value_regno_p): + Make static. + +2012-03-22 Kaz Kojima + + Backported from mainline + 2012-03-02 Kaz Kojima + + PR target/48596 + PR target/48806 + * config/sh/sh.c (sh_register_move_cost): Increase cost between + GENERAL_REGS and FP_REGS for SImode. + +2012-03-22 Jakub Jelinek + + PR middle-end/52547 + * tree-nested.c (convert_tramp_reference_stmt): Call declare_vars + on any new_local_var_chain vars declared during recursing on + GIMPLE_OMP_PARALLEL or GIMPLE_OMP_TASK body. + +2012-03-22 Georg-Johann Lay + + Backport from 2012-03-22 mainline r185692. + + PR target/52496 + * config/avr/avr.md (unspec): Remove UNSPEC_MEMORY_BARRIER. + (unspecv): Add UNSPECV_MEMORY_BARRIER. + (cli_sei): Use unspec_volatile instead of unspec for memory barrier. + (delay_cycles_1, delay_cycles_2): Ditto. + (delay_cycles_3, delay_cycles_4): Ditto. + (nopv, *nopv): Ditto. + (sleep, *sleep): Ditto. + (wdr, *wdr): Ditto. + + Backport from 2012-03-21 mainline r185605. + + PR rtl-optimization/52543 + PR target/52461 + * config/avr/avr-protos.h (avr_load_lpm): New prototype. + * config/avr/avr.c (avr_mode_dependent_address_p): New function. + (TARGET_MODE_DEPENDENT_ADDRESS_P): New define. + (avr_load_libgcc_p): Restrict to __flash loads. + (avr_out_lpm): Only handle 1-byte loads from __flash. + (avr_load_lpm): New function. + (avr_find_unused_d_reg): Remove. + (avr_out_lpm_no_lpmx): Remove. + (adjust_insn_length): Handle ADJUST_LEN_LOAD_LPM. + * config/avr/avr.md (unspec): Add UNSPEC_LPM. + (load__libgcc): Use UNSPEC_LPM instead of MEM. + (load_, load__clobber): New insns. + (mov): For multi-byte move from non-generic + 16-bit address spaces: Expand to load_ resp. + load__clobber. + (load_libgcc): Remove expander. + (split-lpmx): Remove split. + + Backport from 2012-03-13 mainline r185329. + + PR target/52488 + * config/avr/avr.c (avr_prologue_setup_frame): Cut down stack + offset (size) to a value the insns can deal with. + (expand_epilogue): Ditto. + + Backport from 2012-03-12 mainline r185256. + + PR target/52499 + * config/avr/avr.c (avr_mode_code_base_reg_class): Change return + type from reg_class_t to enum reg_class. + * config/avr/avr-protos.h (avr_mode_code_base_reg_class): Ditto. + + Backport from 2012-03-12 mainline r185253. + + PR target/52148 + * config/avr/avr.c (avr_out_movmem): Fix typo in output template + for the case ADDR_SPACE_FLASH and AVR_HAVE_LPMX introduced in + r184615 from 2012-02-28. + + Backport from 2012-03-08 mainline r185105. + + * config/avr/avr.md (*addhi3, addhi3_clobber): Add "w" alternative + for constants in [-63,63]. + + Backport from 2012-03-08 mainline r185100. + + PR target/52496 + * config/avr/avr.c (avr_mem_clobber): New static function. + (avr_expand_delay_cycles): Add memory clobber operand to + delay_cycles_1, delay_cycles_2, delay_cycles_3, delay_cycles_4. + * config/avr/avr.md (unspec): Add UNSPEC_MEMORY_BARRIER. + (enable_interrupt, disable_interrupt): New expander. + (nopv, sleep, wdr): New expanders. + (delay_cycles_1): Add memory clobber. + (delay_cycles_2): Add memory clobber. + (delay_cycles_3): Add memory clobber. + (delay_cycles_4): Add memory clobber. + (cli_sei): New insn from former "enable_interrupt", + "disable_interrupt" with memory clobber. + (*wdt): New insn from former "wdt" with memory clobber. + (*nopv): Similar, but for "nopv". + (*sleep): Similar, but for "sleep". + + Backport from 2012-03-07 mainline r185043. + + PR target/52484 + * config/avr/avr.md (xload_A): Add R22... to register footprint. + + Backport from 2012-03-07 mainline r185032. + + PR target/52506 + * gcc/config/avr/avr.c (expand_epilogue): Fix order of restoration + to: RAMPZ, RAMPY, RAMPX, RAMPD. + (expand_prologue): Only clear RAMPZ if it has effect on RAM-read. + + Backport from 2012-03-07 mainline r185031. + + PR target/52505 + * config/avr/avr.c (avr_out_xload): Don't read unintentionally + from RAM. + * config/avr/avr.md (xload_8): Adjust insn length. + + Backport from 2012-03-07 mainline r185030. + + PR target/52461 + * gcc/config/avr/avr.c (avr_out_lpm): Clear RAMPZ after usage + if RAMPZ affects reading from RAM. + + Backport from 2012-03-05 mainline r184919. + + * config/avr/avr.md (*umaddqihi4.2): New insn-and-split. + +2012-03-22 Georg-Johann Lay + + Backport from mainline r185259. + + PR other/52545 + * output.h (SECTION_EXCLUDE, SECTION_MACH_DEP): Don't use + SECTION_MACH_DEP reserved bits for SECTION_EXCLUDE. + +2012-03-22 Jakub Jelinek + + Backported from mainline + 2012-03-13 Jakub Jelinek + + PR c/52577 + * c-parser.c (c_parser_postfix_expression) + : Call mark_exp_read on argument values. + + * config/i386/smmintrin.h: Avoid /* within a comment. + * config/i386/nmmintrin.h: Likewise. + +2012-03-22 Richard Guenther + + * BASE-VER: Set to 4.7.1. + * DEV-PHASE: Set to prerelease. + 2012-03-22 Release Manager * GCC 4.7.0 released. @@ -74,8 +1166,8 @@ 2012-03-07 Ralf Corsépius PR target/51417 - * Makefile.in: Let install-gcc-ar depend on installdirs, gcc-ar$(exeext), - gcc-nm$(exeext), gcc-ranlib$(exeext). + * Makefile.in: Let install-gcc-ar depend on installdirs, + gcc-ar$(exeext), gcc-nm$(exeext), gcc-ranlib$(exeext). Don't double canonicalize if cross-compiling. 2012-03-06 Aldy Hernandez @@ -234,7 +1326,7 @@ 2012-03-01 Georg-Johann Lay * config/avr/avr-c.c (avr_cpu_cpp_builtins): Restore built-in - defines for __UINT24_MAX__, __INT24_MAX__, __INT24_MIN__ + defines for __UINT24_MAX__, __INT24_MAX__, __INT24_MIN__ unintentionally removed in r184616. 2012-03-01 Venkataramanan Kumar @@ -390,7 +1482,7 @@ * config/avr/avr-devices.c (avr_mcu_type): Adjust NULL part of initializer to changes from r184614. - + 2012-02-28 Richard Guenther PR tree-optimization/52395 Index: gcc/tree-vect-loop-manip.c =================================================================== --- gcc/tree-vect-loop-manip.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/tree-vect-loop-manip.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1797,13 +1797,12 @@ !gsi_end_p (gsi) && !gsi_end_p (gsi1); gsi_next (&gsi), gsi_next (&gsi1)) { - tree access_fn = NULL; - tree evolution_part; tree init_expr; tree step_expr, off; tree type; tree var, ni, ni_name; gimple_stmt_iterator last_gsi; + stmt_vec_info stmt_info; phi = gsi_stmt (gsi); phi1 = gsi_stmt (gsi1); @@ -1822,45 +1821,34 @@ } /* Skip reduction phis. */ - if (STMT_VINFO_DEF_TYPE (vinfo_for_stmt (phi)) == vect_reduction_def) + stmt_info = vinfo_for_stmt (phi); + if (STMT_VINFO_DEF_TYPE (stmt_info) == vect_reduction_def) { if (vect_print_dump_info (REPORT_DETAILS)) fprintf (vect_dump, "reduc phi. skip."); continue; } - access_fn = analyze_scalar_evolution (loop, PHI_RESULT (phi)); - gcc_assert (access_fn); - /* We can end up with an access_fn like - (short int) {(short unsigned int) i_49, +, 1}_1 - for further analysis we need to strip the outer cast but we - need to preserve the original type. */ - type = TREE_TYPE (access_fn); - STRIP_NOPS (access_fn); - evolution_part = - unshare_expr (evolution_part_in_loop_num (access_fn, loop->num)); - gcc_assert (evolution_part != NULL_TREE); + type = TREE_TYPE (gimple_phi_result (phi)); + step_expr = STMT_VINFO_LOOP_PHI_EVOLUTION_PART (stmt_info); + step_expr = unshare_expr (step_expr); /* FORNOW: We do not support IVs whose evolution function is a polynomial of degree >= 2 or exponential. */ - gcc_assert (!tree_is_chrec (evolution_part)); + gcc_assert (!tree_is_chrec (step_expr)); - step_expr = evolution_part; - init_expr = unshare_expr (initial_condition_in_loop_num (access_fn, - loop->num)); - init_expr = fold_convert (type, init_expr); + init_expr = PHI_ARG_DEF_FROM_EDGE (phi, loop_preheader_edge (loop)); off = fold_build2 (MULT_EXPR, TREE_TYPE (step_expr), fold_convert (TREE_TYPE (step_expr), niters), step_expr); - if (POINTER_TYPE_P (TREE_TYPE (init_expr))) + if (POINTER_TYPE_P (type)) ni = fold_build_pointer_plus (init_expr, off); else - ni = fold_build2 (PLUS_EXPR, TREE_TYPE (init_expr), - init_expr, - fold_convert (TREE_TYPE (init_expr), off)); + ni = fold_build2 (PLUS_EXPR, type, + init_expr, fold_convert (type, off)); - var = create_tmp_var (TREE_TYPE (init_expr), "tmp"); + var = create_tmp_var (type, "tmp"); add_referenced_var (var); last_gsi = gsi_last_bb (exit_bb); Index: gcc/testsuite/gcc.target/arm/pr52633.c =================================================================== --- gcc/testsuite/gcc.target/arm/pr52633.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/arm/pr52633.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,13 @@ +/* PR tree-optimization/52633 */ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_neon_ok } */ +/* { dg-options "-march=armv7-a -mfloat-abi=softfp -mfpu=neon -O -ftree-vectorize" } */ + +void +test (unsigned short *x, signed char *y) +{ + int i; + for (i = 0; i < 32; i++) + x[i] = (short) (y[i] << 5); +} + Index: gcc/testsuite/gcc.target/arm/pr53187.c =================================================================== --- gcc/testsuite/gcc.target/arm/pr53187.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/arm/pr53187.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,13 @@ +/* PR target/53187 */ +/* { dg-do compile } */ +/* { dg-options "-march=armv7-a -mfloat-abi=hard -O2" } */ + +void bar (int); + +void +foo (int x, double y, double z) +{ + _Bool t = z >= y; + if (!t || x) + bar (t ? 1 : 16); +} Index: gcc/testsuite/gcc.target/powerpc/pr52775.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/pr52775.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/powerpc/pr52775.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,16 @@ +/* { dg-do compile { target { powerpc*-*-* && ilp32 } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-options "-O1 -mcpu=power4" } */ +/* { dg-final { scan-assembler-times "fcfid" 2 } } */ + +double +int_to_double (int *p) +{ + return (double)*p; +} + +double +long_long_to_double (long long *p) +{ + return (double)*p; +} Index: gcc/testsuite/gcc.target/powerpc/pr53199.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/pr53199.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/powerpc/pr53199.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,50 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-options "-O2 -mcpu=power6 -mavoid-indexed-addresses" } */ +/* { dg-final { scan-assembler-times "lwbrx" 6 } } */ +/* { dg-final { scan-assembler-times "stwbrx" 6 } } */ + +/* PR 51399: bswap gets an error if -mavoid-indexed-addresses was used in + creating the two lwbrx instructions. */ + +long long +load64_reverse_1 (long long *p) +{ + return __builtin_bswap64 (*p); +} + +long long +load64_reverse_2 (long long *p) +{ + return __builtin_bswap64 (p[1]); +} + +long long +load64_reverse_3 (long long *p, int i) +{ + return __builtin_bswap64 (p[i]); +} + +void +store64_reverse_1 (long long *p, long long x) +{ + *p = __builtin_bswap64 (x); +} + +void +store64_reverse_2 (long long *p, long long x) +{ + p[1] = __builtin_bswap64 (x); +} + +void +store64_reverse_3 (long long *p, long long x, int i) +{ + p[i] = __builtin_bswap64 (x); +} + +long long +reg_reverse (long long x) +{ + return __builtin_bswap64 (x); +} Index: gcc/testsuite/gcc.target/avr/torture/addr-space-1-0.c =================================================================== --- gcc/testsuite/gcc.target/avr/torture/addr-space-1-0.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/avr/torture/addr-space-1-0.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,6 @@ +/* { dg-options "-std=gnu99" } */ +/* { dg-do run } */ + +#define __as __flash + +#include "addr-space-1.h" Index: gcc/testsuite/gcc.target/avr/torture/addr-space-1-1.c =================================================================== --- gcc/testsuite/gcc.target/avr/torture/addr-space-1-1.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/avr/torture/addr-space-1-1.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,6 @@ +/* { dg-options "-std=gnu99 -Tavr51-flash1.x" } */ +/* { dg-do run } */ + +#define __as __flash1 + +#include "addr-space-1.h" Index: gcc/testsuite/gcc.target/avr/torture/addr-space-2-0.c =================================================================== --- gcc/testsuite/gcc.target/avr/torture/addr-space-2-0.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/avr/torture/addr-space-2-0.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,6 @@ +/* { dg-options "-std=gnu99" } */ +/* { dg-do run } */ + +#define __as __flash + +#include "addr-space-2.h" Index: gcc/testsuite/gcc.target/avr/torture/addr-space-2-1.c =================================================================== --- gcc/testsuite/gcc.target/avr/torture/addr-space-2-1.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/avr/torture/addr-space-2-1.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,6 @@ +/* { dg-options "-std=gnu99 -Tavr51-flash1.x" } */ +/* { dg-do run } */ + +#define __as __flash1 + +#include "addr-space-2.h" Index: gcc/testsuite/gcc.target/avr/torture/avr-torture.exp =================================================================== --- gcc/testsuite/gcc.target/avr/torture/avr-torture.exp (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/gcc.target/avr/torture/avr-torture.exp (.../branches/gcc-4_7-branch) (wersja 187906) @@ -38,6 +38,7 @@ { -O0 } \ { -O1 } \ { -O2 } \ + { -Os -flto } \ { -O2 -mcall-prologues } \ { -O2 -fdata-sections } \ { -O2 -fmerge-all-constants } \ Index: gcc/testsuite/gcc.target/avr/torture/addr-space-1-x.c =================================================================== --- gcc/testsuite/gcc.target/avr/torture/addr-space-1-x.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/avr/torture/addr-space-1-x.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,6 @@ +/* { dg-options "-std=gnu99" } */ +/* { dg-do run } */ + +#define __as __memx + +#include "addr-space-1.h" Index: gcc/testsuite/gcc.target/avr/torture/addr-space-1.h =================================================================== --- gcc/testsuite/gcc.target/avr/torture/addr-space-1.h (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/avr/torture/addr-space-1.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,83 @@ +#include +#include + +typedef struct +{ + char i1; + short i2; + long i4; + long long i8; + char str[2][10]; +} a_t; + +const __as a_t A = + { + 12, 345, 678910, 1234567891011ll, + { + "xxx..xxx", + "yyy..yyy" + } + }; + +const __as volatile a_t V = + { + 12+1, 345+1, 678910+1, 1234567891011ll+1, + { + "XXX..XXX", + "YYY..YYY" + } + }; + +a_t A2; +volatile a_t V2; + +int main (void) +{ + if (A.i1 != 12 + || A.i1 != V.i1 -1) + abort(); + + if (A.i2 != 345 + || A.i2 != V.i2 -1) + abort(); + + if (A.i4 != 678910 + || A.i4 != V.i4 -1) + abort(); + + if (A.i8 != 1234567891011ll + || A.i8 != V.i8 -1) + abort(); + + A2 = A; + V2 = V; + + if (A2.i1 != 12 + || A2.i1 != V2.i1 -1) + abort(); + + if (A2.i2 != 345 + || A2.i2 != V2.i2 -1) + abort(); + + if (A2.i4 != 678910 + || A2.i4 != V2.i4 -1) + abort(); + + if (A2.i8 != 1234567891011ll + || A2.i8 != V2.i8 -1) + abort(); + + if (strcmp (A2.str[0], "xxx..xxx")) + abort(); + if (strcmp (A2.str[1], "yyy..yyy")) + abort(); + + if (strcmp ((const char*) V2.str[0], "XXX..XXX")) + abort(); + if (strcmp ((const char*) V2.str[1], "YYY..YYY")) + abort(); + + exit (0); + return 0; +} Index: gcc/testsuite/gcc.target/avr/torture/addr-space-2-x.c =================================================================== --- gcc/testsuite/gcc.target/avr/torture/addr-space-2-x.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/avr/torture/addr-space-2-x.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,9 @@ +/* { dg-options "-std=gnu99 -Wa,--no-warn" } */ +/* { dg-do run } */ + +/* --no-warn because: "assembling 24-bit address needs binutils extension" + see binutils PR13503. */ + +#define __as __memx + +#include "addr-space-2.h" Index: gcc/testsuite/gcc.target/avr/torture/addr-space-2.h =================================================================== --- gcc/testsuite/gcc.target/avr/torture/addr-space-2.h (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/avr/torture/addr-space-2.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,106 @@ +extern void exit (int); +extern void abort (void); + +typedef struct T +{ + char val; + const __as struct T *l, *r; +} tree; + +/* + abcd + / \ + ab cd + / \ / \ + a b c d +*/ + +const __as tree a = { 'a', 0, 0 }; +const __as tree b = { 'b', 0, 0 }; +const __as tree c = { 'c', 0, 0 }; +const __as tree d = { 'd', 0, 0 }; + +const __as tree ab = { 'A', &a, &b }; +const __as tree cd = { 'C', &c, &d }; + +const __as tree abcd = { '*', &ab, &cd }; + +static void +test1 (void) +{ + if (abcd.val != '*') + abort(); + + if (abcd.l->val != 'A') + abort(); + if (abcd.r->val != 'C') + abort(); + + if (abcd.l->l->val != 'a') + abort(); + if (abcd.l->r->val != 'b') + abort(); + if (abcd.r->l->val != 'c') + abort(); + if (abcd.r->r->val != 'd') + abort(); +} + +static void +test2 (const __as tree *t) +{ + if (t->val != '*') + abort(); + + if (t->l->val != 'A') + abort(); + if (t->r->val != 'C') + abort(); + + if (t->l->l->val != 'a') + abort(); + if (t->l->r->val != 'b') + abort(); + if (t->r->l->val != 'c') + abort(); + if (t->r->r->val != 'd') + abort(); +} + +static void +test3 (const __as tree *pt) +{ + tree t = *pt; + + if (t.val != '*') + abort(); + + if (t.l->val != 'A') + abort(); + if (t.r->val != 'C') + abort(); + + if (t.l->l->val != 'a') + abort(); + if (t.l->r->val != 'b') + abort(); + if (t.r->l->val != 'c') + abort(); + if (t.r->r->val != 'd') + abort(); +} + +int main (void) +{ + const __as tree *t = &abcd; + test1(); + test2 (&abcd); + test3 (&abcd); + + __asm ("" : "+r" (t)); + test2 (t); + test3 (t); + + exit (0); + return 0; +} Index: gcc/testsuite/gcc.target/avr/torture/addr-space-1-g.c =================================================================== --- gcc/testsuite/gcc.target/avr/torture/addr-space-1-g.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/avr/torture/addr-space-1-g.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,6 @@ +/* { dg-options "-std=gnu99" } */ +/* { dg-do run } */ + +#define __as + +#include "addr-space-1.h" Index: gcc/testsuite/gcc.target/avr/torture/addr-space-2-g.c =================================================================== --- gcc/testsuite/gcc.target/avr/torture/addr-space-2-g.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/avr/torture/addr-space-2-g.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,6 @@ +/* { dg-options "-std=gnu99" } */ +/* { dg-do run } */ + +#define __as + +#include "addr-space-2.h" Index: gcc/testsuite/gcc.target/avr/torture/builtins-2.c =================================================================== --- gcc/testsuite/gcc.target/avr/torture/builtins-2.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/avr/torture/builtins-2.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,46 @@ +/* { dg-options "-std=gnu99 -Tavr51-flash1.x" } */ +/* { dg-do run } */ + +#include +#include "../progmem.h" + +int volatile a; + +void f1 (void) +{ + __builtin_avr_sei (); + __builtin_avr_cli (); + __builtin_avr_wdr (); + __builtin_avr_sleep (); + __builtin_avr_nop (); + a = __builtin_avr_swap (a); + a = __builtin_avr_fmul (1,a); + a = __builtin_avr_fmuls (1,a); + a = __builtin_avr_fmulsu (1,a); + a = __builtin_avr_insert_bits (0x1f2f5364, a, a); +} + +const __flash char c0 = 1; +const __flash1 char c1 = 1; + +int main (void) +{ + const __memx void *p; + + f1(); + __builtin_avr_delay_cycles (1000); + + p = &c0; + if (__builtin_avr_flash_segment (p) != 0) + abort(); + + p = &c1; + if (__builtin_avr_flash_segment (p) != 1) + abort(); + + if (__builtin_avr_flash_segment ("p") != -1) + abort(); + + exit (0); + return 0; +} Index: gcc/testsuite/gcc.target/avr/progmem.h =================================================================== --- gcc/testsuite/gcc.target/avr/progmem.h (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/gcc.target/avr/progmem.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -5,6 +5,7 @@ static const char __c[] PROGMEM = (s); \ &__c[0];})) +#ifdef __AVR_HAVE_LPMX__ #define pgm_read_char(addr) \ (__extension__({ \ unsigned int __addr16 = (unsigned int)(addr); \ @@ -12,3 +13,13 @@ __asm__ ("lpm %0, %a1" \ : "=r" (__result) : "z" (__addr16)); \ __result; })) +#else +#define pgm_read_char(addr) \ + (__extension__({ \ + unsigned int __addr16 = (unsigned int)(addr); \ + char __result; \ + __asm__ ("lpm" "\n\t" \ + "mov %0, r0" \ + : "=r" (__result) : "z" (__addr16)); \ + __result; })) +#endif Index: gcc/testsuite/gcc.target/i386/avx2-vpermps-1.c =================================================================== --- gcc/testsuite/gcc.target/i386/avx2-vpermps-1.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/gcc.target/i386/avx2-vpermps-1.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -5,9 +5,10 @@ #include __m256 x; +__m256i y; void extern avx2_test (void) { - x = _mm256_permutevar8x32_ps (x, x); + x = _mm256_permutevar8x32_ps (x, y); } Index: gcc/testsuite/gcc.target/i386/avx256-unaligned-load-1.c =================================================================== --- gcc/testsuite/gcc.target/i386/avx256-unaligned-load-1.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/gcc.target/i386/avx256-unaligned-load-1.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -14,6 +14,6 @@ c[i] = a[i] * b[i+3]; } -/* { dg-final { scan-assembler-not "\\*avx_movups256/1" } } */ -/* { dg-final { scan-assembler "\\*sse_movups/1" } } */ +/* { dg-final { scan-assembler-not "avx_movups256/1" } } */ +/* { dg-final { scan-assembler "sse_movups/1" } } */ /* { dg-final { scan-assembler "vinsertf128" } } */ Index: gcc/testsuite/gcc.target/i386/avx256-unaligned-store-3.c =================================================================== --- gcc/testsuite/gcc.target/i386/avx256-unaligned-store-3.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/gcc.target/i386/avx256-unaligned-store-3.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -17,6 +17,6 @@ d[i] = c[i] * 20.0; } -/* { dg-final { scan-assembler-not "\\*avx_movupd256/2" } } */ +/* { dg-final { scan-assembler-not "avx_movupd256/2" } } */ /* { dg-final { scan-assembler "vmovupd.*\\*movv2df_internal/3" } } */ /* { dg-final { scan-assembler "vextractf128" } } */ Index: gcc/testsuite/gcc.target/i386/avx2-vpermps-2.c =================================================================== --- gcc/testsuite/gcc.target/i386/avx2-vpermps-2.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/gcc.target/i386/avx2-vpermps-2.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -8,7 +8,7 @@ #define NUM 10 static void -init_permps (float *src1, float *src2, int seed) +init_permps (float *src1, int *src2, int seed) { int i, sign = 1; @@ -21,24 +21,24 @@ } static void -calc_permps (float *src1, float *src2, float *dst) +calc_permps (float *src1, int *src2, float *dst) { int i; unsigned temp; - unsigned *idx = (int *) src1; memcpy (dst, src1, 32); for (i = 0; i < 8; i++) { - temp = idx[i]; - dst[i] = src2[temp & 7]; + temp = src2[i]; + dst[i] = src1[temp & 7]; } } static void avx2_test (void) { - union256 src1, src2, dst; + union256 src1, dst; + union256i_d src2; float dst_ref[8]; int i; Index: gcc/testsuite/gcc.target/i386/avx256-unaligned-load-2.c =================================================================== --- gcc/testsuite/gcc.target/i386/avx256-unaligned-load-2.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/gcc.target/i386/avx256-unaligned-load-2.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -24,6 +24,6 @@ } } -/* { dg-final { scan-assembler-not "\\*avx_movdqu256/1" } } */ -/* { dg-final { scan-assembler "\\*sse2_movdqu/1" } } */ +/* { dg-final { scan-assembler-not "avx_movdqu256/1" } } */ +/* { dg-final { scan-assembler "sse2_movdqu/1" } } */ /* { dg-final { scan-assembler "vinsert.128" } } */ Index: gcc/testsuite/gcc.target/i386/pr53366-1.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr53366-1.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/i386/pr53366-1.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,5 @@ +/* PR tree-optimization/53366 */ +/* { dg-do run { target avx_runtime } } */ +/* { dg-options "-O3 -mavx" } */ + +#include "../../gcc.dg/torture/pr53366-1.c" Index: gcc/testsuite/gcc.target/i386/avx256-unaligned-store-4.c =================================================================== --- gcc/testsuite/gcc.target/i386/avx256-unaligned-store-4.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/gcc.target/i386/avx256-unaligned-store-4.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -14,7 +14,7 @@ b[i+3] = a[i] * c[i]; } -/* { dg-final { scan-assembler "\\*avx_movups256/2" } } */ -/* { dg-final { scan-assembler-not "\\*avx_movups/2" } } */ +/* { dg-final { scan-assembler "avx_movups256/2" } } */ +/* { dg-final { scan-assembler-not "avx_movups/2" } } */ /* { dg-final { scan-assembler-not "\\*avx_movv4sf_internal/3" } } */ /* { dg-final { scan-assembler-not "vextractf128" } } */ Index: gcc/testsuite/gcc.target/i386/pr52736.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr52736.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/i386/pr52736.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,29 @@ +/* PR target/52736 */ +/* { dg-do run } */ +/* { dg-options "-O1 -msse2" } */ +/* { dg-require-effective-target sse2_runtime } */ + +#include + +typedef double D __attribute__((may_alias)); +__attribute__((aligned(16))) static const double r[4] = { 1., 5., 1., 3. }; + +__attribute__((noinline, noclone)) +void +foo (int x) +{ + asm volatile ("" : "+g" (x) : : "memory"); + if (x != 3) + __builtin_abort (); +} + +int +main () +{ + __m128d t = _mm_set1_pd (5.); + ((D *)(&t))[0] = 1.; + foo (_mm_movemask_pd (_mm_cmpeq_pd (t, _mm_load_pd (&r[0])))); + ((D *)(&t))[1] = 3.; + foo (_mm_movemask_pd (_mm_cmpeq_pd (t, _mm_load_pd (&r[2])))); + return 0; +} Index: gcc/testsuite/gcc.target/i386/pr52754.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr52754.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/i386/pr52754.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -fpredictive-commoning -msse2 -std=c99" } */ +/* { dg-require-effective-target sse2 } */ + +#include + +#include "isa-check.h" +#include "sse-os-support.h" + +int main() +{ + const float mem[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; + + unsigned int indexes[8]; + for (unsigned int i = 0; i < 8; ++i) indexes[i] = i; + + check_isa (); + + if (!sse_os_support ()) + exit (0); + + __m128 x = _mm_setr_ps(0, 1, 2, 3); + for (unsigned int i = 0; i + 4 < 6; ++i) { + const unsigned int *ii = &indexes[i]; + const __m128 tmp = _mm_setr_ps(mem[ii[0]], mem[ii[1]], mem[ii[2]], mem[ii[3]]); + if (0xf != _mm_movemask_ps(_mm_cmpeq_ps(tmp, x))) { + __builtin_abort(); + } + x = _mm_add_ps(x, _mm_set1_ps(1)); + } + + return 0; +} Index: gcc/testsuite/gcc.target/i386/avx256-unaligned-load-3.c =================================================================== --- gcc/testsuite/gcc.target/i386/avx256-unaligned-load-3.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/gcc.target/i386/avx256-unaligned-load-3.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -14,6 +14,6 @@ c[i] = a[i] * b[i+3]; } -/* { dg-final { scan-assembler-not "\\*avx_movupd256/1" } } */ -/* { dg-final { scan-assembler "\\*sse2_movupd/1" } } */ +/* { dg-final { scan-assembler-not "avx_movupd256/1" } } */ +/* { dg-final { scan-assembler "sse2_movupd/1" } } */ /* { dg-final { scan-assembler "vinsertf128" } } */ Index: gcc/testsuite/gcc.target/i386/avx256-unaligned-store-1.c =================================================================== --- gcc/testsuite/gcc.target/i386/avx256-unaligned-store-1.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/gcc.target/i386/avx256-unaligned-store-1.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -17,6 +17,6 @@ d[i] = c[i] * 20.0; } -/* { dg-final { scan-assembler-not "\\*avx_movups256/2" } } */ +/* { dg-final { scan-assembler-not "avx_movups256/2" } } */ /* { dg-final { scan-assembler "vmovups.*\\*movv4sf_internal/3" } } */ /* { dg-final { scan-assembler "vextractf128" } } */ Index: gcc/testsuite/gcc.target/i386/pr53366-2.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr53366-2.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/i386/pr53366-2.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,5 @@ +/* PR tree-optimization/53366 */ +/* { dg-do run { target avx_runtime } } */ +/* { dg-options "-O3 -mavx" } */ + +#include "../../gcc.dg/torture/pr53366-2.c" Index: gcc/testsuite/gcc.target/i386/avx2-vpermd-2.c =================================================================== --- gcc/testsuite/gcc.target/i386/avx2-vpermd-2.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/gcc.target/i386/avx2-vpermd-2.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -29,8 +29,8 @@ memcpy (dst, src1, 32); for (i = 0; i < 8; i++) { - temp = src1[i]; - dst[i] = src2[temp & 7]; + temp = src2[i]; + dst[i] = src1[temp & 7]; } } Index: gcc/testsuite/gcc.target/i386/pr53416.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr53416.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/i386/pr53416.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,17 @@ +/* PR target/53416 */ +/* { dg-options "-O2 -mrdrnd" } */ + +int test (void) +{ + unsigned int number = 0; + int result0, result1, result2, result3; + + result0 = __builtin_ia32_rdrand32_step (&number); + result1 = __builtin_ia32_rdrand32_step (&number); + result2 = __builtin_ia32_rdrand32_step (&number); + result3 = __builtin_ia32_rdrand32_step (&number); + + return result0 + result1 +result2 + result3; +} + +/* { dg-final { scan-assembler-times "rdrand" 4 } } */ Index: gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c =================================================================== --- gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/gcc.target/i386/avx256-unaligned-load-4.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -14,6 +14,6 @@ b[i] = a[i+3] * 2; } -/* { dg-final { scan-assembler "\\*avx_movups256/1" } } */ -/* { dg-final { scan-assembler-not "\\*avx_movups/1" } } */ +/* { dg-final { scan-assembler "avx_movups256/1" } } */ +/* { dg-final { scan-assembler-not "avx_movups/1" } } */ /* { dg-final { scan-assembler-not "vinsertf128" } } */ Index: gcc/testsuite/gcc.target/i386/avx256-unaligned-store-2.c =================================================================== --- gcc/testsuite/gcc.target/i386/avx256-unaligned-store-2.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/gcc.target/i386/avx256-unaligned-store-2.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -24,6 +24,6 @@ } } -/* { dg-final { scan-assembler-not "\\*avx_movdqu256/2" } } */ +/* { dg-final { scan-assembler-not "avx_movdqu256/2" } } */ /* { dg-final { scan-assembler "vmovdqu.*\\*movv16qi_internal/3" } } */ /* { dg-final { scan-assembler "vextract.128" } } */ Index: gcc/testsuite/gcc.target/ia64/pr52657.c =================================================================== --- gcc/testsuite/gcc.target/ia64/pr52657.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/ia64/pr52657.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,44 @@ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +typedef unsigned long int mp_limb_t; + +typedef struct +{ + int _mp_alloc; + int _mp_size; + mp_limb_t *_mp_d; +} __mpz_struct; + +typedef __mpz_struct mpz_t[1]; +typedef mp_limb_t * mp_ptr; +typedef const mp_limb_t * mp_srcptr; +typedef long int mp_size_t; + +extern mp_limb_t __gmpn_addmul_2 (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr); + +void +__gmpn_redc_2 (mp_ptr rp, mp_ptr up, mp_srcptr mp, mp_size_t n, mp_srcptr mip) +{ + mp_limb_t q[2]; + mp_size_t j; + mp_limb_t upn; + + for (j = n - 2; j >= 0; j -= 2) + { + mp_limb_t _ph, _pl; + __asm__ ("xma.hu %0 = %3, %5, f0\n\t" + "xma.l %1 = %3, %5, f0\n\t" + ";;\n\t" + "xma.l %0 = %3, %4, %0\n\t" + ";;\n\t" + "xma.l %0 = %2, %5, %0" + : "=&f" (q[1]), "=&f" (q[0]) + : "f" (mip[1]), "f" (mip[0]), "f" (up[1]), "f" (up[0])); + upn = up[n]; + up[1] = __gmpn_addmul_2 (up, mp, n, q); + up[0] = up[n]; + up[n] = upn; + up += 2; + } +} Index: gcc/testsuite/gcc.target/ia64/pr48496.c =================================================================== --- gcc/testsuite/gcc.target/ia64/pr48496.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.target/ia64/pr48496.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,24 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +typedef unsigned int UINT64 __attribute__((__mode__(__DI__))); + +typedef struct +{ + UINT64 x[2] __attribute__((aligned(16))); +} fpreg; + +struct ia64_args +{ + fpreg fp_regs[8]; + UINT64 gp_regs[8]; +}; + +ffi_call(long i, long gpcount, long fpcount, void **avalue) +{ + struct ia64_args *stack; + stack = __builtin_alloca (64); + asm ("stf.spill %0 = %1%P0" : "=m" (*&stack->fp_regs[fpcount++]) + : "f"(*(double *)avalue[i])); + stack->gp_regs[gpcount++] = *(UINT64 *)avalue[i]; +} Index: gcc/testsuite/go.test/go-test.exp =================================================================== --- gcc/testsuite/go.test/go-test.exp (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/go.test/go-test.exp (.../branches/gcc-4_7-branch) (wersja 187906) @@ -217,6 +217,13 @@ return "" } } + "powerpc*-*-*" { + if [check_effective_target_ilp32] { + set goarch "ppc" + } else { + set goarch "ppc64" + } + } "sparc*-*-*" { if [check_effective_target_ilp32] { set goarch "sparc" @@ -302,7 +309,7 @@ } # Handle certain tests in a target-dependant way. - if { [istarget "alpha*-*-*"] || [istarget "sparc*-*-solaris*"] } { + if { [istarget "alpha*-*-*"] || [istarget "sparc*-*-solaris*"] || [istarget "powerpc*-*-*"] } { if { [string match "*go.test/test/nilptr.go" $test] } { untested $test continue Index: gcc/testsuite/lib/target-supports.exp =================================================================== --- gcc/testsuite/lib/target-supports.exp (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/lib/target-supports.exp (.../branches/gcc-4_7-branch) (wersja 187906) @@ -2576,8 +2576,23 @@ } "-mcpu=niagara3"] } -# Return 1 if this is a Sparc target with VIS enabled. +# Return 1 if this is a SPARC-V9 target. +proc check_effective_target_sparc_v9 { } { + if { [istarget sparc*-*-*] } { + return [check_no_compiler_messages sparc_v9 object { + int main (void) { + asm volatile ("return %i7+8"); + return 0; + } + }] + } else { + return 0 + } +} + +# Return 1 if this is a SPARC target with VIS enabled. + proc check_effective_target_sparc_vis { } { if { [istarget sparc*-*-*] } { return [check_no_compiler_messages sparc_vis object { @@ -3755,7 +3770,8 @@ if { [istarget x86_64-*-*] || [istarget i?86-*-*]) || [istarget arm*-*-*] - || [istarget alpha*-*-*] } { + || [istarget alpha*-*-*] + || ([istarget sparc*-*-*] && [check_effective_target_lp64]) } { return 1 } else { return 0 @@ -3800,6 +3816,10 @@ } "" ] } elseif { [istarget alpha*-*-*] } { return 1 + } elseif { ([istarget sparc*-*-*] + && [check_effective_target_lp64] + && [check_effective_target_ultrasparc_hw]) } { + return 1 } else { return 0 } @@ -3825,8 +3845,7 @@ || [istarget hppa*-*linux*] || [istarget s390*-*-*] || [istarget powerpc*-*-*] - || [istarget sparc64-*-*] - || [istarget sparcv9-*-*] + || ([istarget sparc*-*-*] && [check_effective_target_sparc_v9]) || [check_effective_target_mips_llsc] } { set et_sync_int_long_saved 1 } @@ -3855,8 +3874,7 @@ || [istarget hppa*-*linux*] || [istarget s390*-*-*] || [istarget powerpc*-*-*] - || [istarget sparc64-*-*] - || [istarget sparcv9-*-*] + || ([istarget sparc*-*-*] && [check_effective_target_sparc_v9]) || [check_effective_target_mips_llsc] } { set et_sync_char_short_saved 1 } Index: gcc/testsuite/gfortran.dg/function_optimize_11.f90 =================================================================== --- gcc/testsuite/gfortran.dg/function_optimize_11.f90 (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gfortran.dg/function_optimize_11.f90 (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,17 @@ +! { dg-do run } +! { dg-options "-ffrontend-optimize" } +! Do not move common functions out of implicit DO loop constructors. +program test + integer, parameter :: N = 4 + integer, parameter :: dp=kind(1.d0) + real(kind=dp), parameter :: pi=4*atan(1._dp) + real(kind=dp), parameter :: eps = 1.e-14_dp + real(kind=dp) :: h1(0:N-1), h2(0:N-1) + integer i + + i = 1 + h1 = [(cos(2*pi*mod(i*k,N)/N),k=0,N/2), & + & (sin(2*pi*mod(i*k,N)/N),k=1,N/2-1)] + h2 = (/ 1._dp, 0._dp, -1._dp, 1._dp /) + if (any(abs(h1 - h2) > eps)) call abort +end program test Index: gcc/testsuite/gfortran.dg/constructor_7.f90 =================================================================== --- gcc/testsuite/gfortran.dg/constructor_7.f90 (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gfortran.dg/constructor_7.f90 (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,48 @@ +! { dg-do compile } +! { dg-options "-std=f95" } +! +! PR fortran/53111 +! + +! ------------ INVALID ONE ------------------------ + +module m +type t + integer :: i +end type t +end + +module m2 + interface t + module procedure sub + end interface t +contains + integer function sub() + sub = 4 + end function sub +end module m2 + +! Note: The following is formally valid as long as "t" is not used. +! For simplicity, -std=f95 will give an error. +! It is unlikely that a real-world program is rejected with -std=f95 +! because of that. + +use m ! { dg-error "Fortran 2003: Generic name 't' of function 'sub' at .1. being the same name as derived type at" } +use m2 ! { dg-error "Fortran 2003: Generic name 't' of function 'sub' at .1. being the same name as derived type at" } +! i = sub() ! << Truly invalid in F95, valid in F2003 +end + +! ------------ INVALID TWO ------------------------ + +module m3 +type t2 ! { dg-error "Fortran 2003: Generic name 't2' of function 'sub2' at .1. being the same name as derived type at" } + integer :: i +end type t2 + interface t2 + module procedure sub2 + end interface t2 +contains + integer function sub2() ! { dg-error "Fortran 2003: Generic name 't2' of function 'sub2' at .1. being the same name as derived type at" } + sub2 = 4 + end function sub2 +end module m3 Index: gcc/testsuite/gfortran.dg/intrinsic_8.f90 =================================================================== --- gcc/testsuite/gfortran.dg/intrinsic_8.f90 (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gfortran.dg/intrinsic_8.f90 (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,23 @@ +! { dg-do compile } +! +! PR fortran/52452 +! +! Contributed by Roger Ferrer Ibanez +! +PROGRAM test_etime + IMPLICIT NONE + INTRINSIC :: etime + REAL(4) :: tarray(1:2) + REAL(4) :: result + + CALL etime(tarray, result) +END PROGRAM test_etime + +subroutine test_etime2 + IMPLICIT NONE + INTRINSIC :: etime + REAL(4) :: tarray(1:2) + REAL(4) :: result + + result = etime(tarray) +END subroutine test_etime2 Index: gcc/testsuite/gfortran.dg/pr52701.f90 =================================================================== --- gcc/testsuite/gfortran.dg/pr52701.f90 (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gfortran.dg/pr52701.f90 (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,20 @@ +! { dg-do compile } +! { dg-options "-O3" } +function pr52701 (x, z, e, f, g, l) + integer a, b, c, d, e, f, g, i, j, l, pr52701 + double precision x(e), z(e*e) + do i = l, f + do j = l, i + d = 0 + do a = 1, g + c = a - g + do b = 1, g + d = d + 1 + c = c + g + z(d) = z(d) / (x(i) + x(j) - x(f + a) - x(f + b)) + end do + end do + end do + end do + pr52701 = c +end Index: gcc/testsuite/gfortran.dg/typebound_operator_15.f90 =================================================================== --- gcc/testsuite/gfortran.dg/typebound_operator_15.f90 (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gfortran.dg/typebound_operator_15.f90 (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,78 @@ +! { dg-do run } +! +! PR fortran/53255 +! +! Contributed by Reinhold Bader. +! +! Before TYPE(ext)'s .tr. wrongly called the base type's trace +! instead of ext's trace_ext. +! +module mod_base + implicit none + private + integer, public :: base_cnt = 0 + type, public :: base + private + real :: r(2,2) = reshape( (/ 1.0, 2.0, 3.0, 4.0 /), (/ 2, 2 /)) + contains + procedure, private :: trace + generic :: operator(.tr.) => trace + end type base +contains + complex function trace(this) + class(base), intent(in) :: this + base_cnt = base_cnt + 1 +! write(*,*) 'executing base' + trace = this%r(1,1) + this%r(2,2) + end function trace +end module mod_base + +module mod_ext + use mod_base + implicit none + private + integer, public :: ext_cnt = 0 + public :: base, base_cnt + type, public, extends(base) :: ext + private + real :: i(2,2) = reshape( (/ 1.0, 1.0, 1.0, 1.5 /), (/ 2, 2 /)) + contains + procedure, private :: trace => trace_ext + end type ext +contains + complex function trace_ext(this) + class(ext), intent(in) :: this + +! the following should be executed through invoking .tr. p below +! write(*,*) 'executing override' + ext_cnt = ext_cnt + 1 + trace_ext = .tr. this%base + (0.0, 1.0) * ( this%i(1,1) + this%i(2,2) ) + end function trace_ext + +end module mod_ext +program test_override + use mod_ext + implicit none + type(base) :: o + type(ext) :: p + real :: r + + ! Note: ext's ".tr." (trace_ext) calls also base's "trace" + +! write(*,*) .tr. o +! write(*,*) .tr. p + if (base_cnt /= 0 .or. ext_cnt /= 0) call abort () + r = .tr. o + if (base_cnt /= 1 .or. ext_cnt /= 0) call abort () + r = .tr. p + if (base_cnt /= 2 .or. ext_cnt /= 1) call abort () + + if (abs(.tr. o - 5.0 ) < 1.0e-6 .and. abs( .tr. p - (5.0,2.5)) < 1.0e-6) & + then + if (base_cnt /= 4 .or. ext_cnt /= 2) call abort () +! write(*,*) 'OK' + else + call abort() +! write(*,*) 'FAIL' + end if +end program test_override Index: gcc/testsuite/gfortran.dg/pr52678.f =================================================================== --- gcc/testsuite/gfortran.dg/pr52678.f (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gfortran.dg/pr52678.f (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,18 @@ +! { dg-do compile } +! { dg-options "-O -ftree-vectorize" } + SUBROUTINE OpenAD_set_ref_state(DRF, RHOFACF, RHOFACC) + real(8) DRF(1 : 15) + real(8) RHOFACF(1 : 16) + real(8) RHOFACC(1 : 15) + integer, dimension(:), allocatable :: oad_it + integer :: oad_it_ptr + INTEGER(8) OpenAD_Symbol_188 + INTEGER(4) K + OpenAD_Symbol_188 = 0 + DO K = 2, 15, 1 + RHOFACF(INT(K)) = ((RHOFACC(K) * DRF(K + (-1)) + RHOFACC(K + + + (-1)) * DRF(K)) /(DRF(K) + DRF(K + (-1)))) + OpenAD_Symbol_188 = (INT(OpenAD_Symbol_188) + INT(1)) + END DO + oad_it(oad_it_ptr) = OpenAD_Symbol_188 + end subroutine OpenAD_set_ref_state Index: gcc/testsuite/gfortran.dg/use_only_6.f90 =================================================================== --- gcc/testsuite/gfortran.dg/use_only_6.f90 (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gfortran.dg/use_only_6.f90 (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,14 @@ +! { dg-do compile } +! PR 52668 - there used to be a bogus warning about not using b. +! Original test case by Arnaud Desitter. +module mm + integer :: a, b + common /mm1/ a, b +end module mm + +subroutine aa() + use mm, only: a + implicit none + a = 1 +end subroutine aa +! { dg-final { cleanup-modules "mm" } } Index: gcc/testsuite/gfortran.dg/function_optimize_12.f90 =================================================================== --- gcc/testsuite/gfortran.dg/function_optimize_12.f90 (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gfortran.dg/function_optimize_12.f90 (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,12 @@ +! { dg-do run } +! { dg-options "-ffrontend-optimize" } +! PR 53148 - this used to cause wrong code because the label was +! placed after the statement assigning the new variables. +program main + integer :: n + double precision x + n = 3 + goto 100 +100 x = dble(n) + dble(n) + if (x /= 6.d0) call abort +end program main Index: gcc/testsuite/gfortran.dg/constructor_8.f90 =================================================================== --- gcc/testsuite/gfortran.dg/constructor_8.f90 (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gfortran.dg/constructor_8.f90 (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,22 @@ +! { dg-do compile } +! { dg-options "-std=f95" } +! +! PR fortran/53111 +! +! Contributed by Jacob Middag, reduced by Janus Weil. +! + +module a + type :: my + real :: x + end type +end module + +module b + use a +end module + +program test + use a + use b +end program Index: gcc/testsuite/gfortran.dg/pointer_intent_6.f90 =================================================================== --- gcc/testsuite/gfortran.dg/pointer_intent_6.f90 (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gfortran.dg/pointer_intent_6.f90 (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,19 @@ +! { dg-do compile } +! +! PR fortran/52864 +! +! Assigning to an intent(in) pointer (which is valid). +! + program test + type PoisFFT_Solver3D + complex, dimension(:,:,:), & + pointer :: work => null() + end type PoisFFT_Solver3D + contains + subroutine PoisFFT_Solver3D_FullPeriodic(D, p) + type(PoisFFT_Solver3D), intent(in) :: D + real, intent(in), pointer :: p(:) + D%work(i,j,k) = 0.0 + p = 0.0 + end subroutine + end Index: gcc/testsuite/gfortran.dg/pr52835.f90 =================================================================== --- gcc/testsuite/gfortran.dg/pr52835.f90 (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gfortran.dg/pr52835.f90 (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,16 @@ +! PR tree-optimization/52835 +! { dg-do compile } +! { dg-options "-O3 -fdump-tree-optimized" } + +subroutine foo (x, y, z, n) + integer :: n, i + real :: x(n), y(n), z(n) + do i = 1, n + z(i) = 0.0 + y(i) = 0.0 + call bar (y(i), z(i), x(i)) + end do +end subroutine + +! { dg-final { scan-tree-dump "bar " "optimized" } } +! { dg-final { cleanup-tree-dump "optimized" } } Index: gcc/testsuite/gfortran.dg/realloc_on_assign_15.f90 =================================================================== --- gcc/testsuite/gfortran.dg/realloc_on_assign_15.f90 (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gfortran.dg/realloc_on_assign_15.f90 (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,40 @@ +! { dg-do run } +! +! PR fortran/53389 +! +! The program was leaking memory before due to +! realloc on assignment and nested functions. +! +module foo + implicit none + contains + + function filler(array, val) + real, dimension(:), intent(in):: array + real, dimension(size(array)):: filler + real, intent(in):: val + + filler=val + + end function filler +end module + +program test + use foo + implicit none + + real, dimension(:), allocatable:: x, y + integer, parameter:: N=1000 !*1000 + integer:: i + +! allocate( x(N) ) + allocate( y(N) ) + y=0.0 + + do i=1, N +! print *,i + x=filler(filler(y, real(2*i)), real(i)) + y=y+x + end do + +end program test Index: gcc/testsuite/gfortran.dg/bessel_7.f90 =================================================================== --- gcc/testsuite/gfortran.dg/bessel_7.f90 (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/gfortran.dg/bessel_7.f90 (.../branches/gcc-4_7-branch) (wersja 187906) @@ -16,7 +16,7 @@ implicit none real,parameter :: values(*) = [0.0, 0.5, 1.0, 0.9, 1.8,2.0,3.0,4.0,4.25,8.0,34.53, 475.78] real,parameter :: myeps(size(values)) = epsilon(0.0) & - * [2, 3, 4, 5, 8, 2, 12, 6, 7, 6, 31, 168 ] + * [2, 3, 4, 5, 8, 2, 12, 6, 7, 6, 36, 168 ] ! The following is sufficient for me - the values above are a bit ! more tolerant ! * [0, 0, 0, 3, 3, 0, 9, 0, 2, 1, 22, 130 ] Index: gcc/testsuite/gfortran.dg/vect/pr52580.f =================================================================== --- gcc/testsuite/gfortran.dg/vect/pr52580.f (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gfortran.dg/vect/pr52580.f (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,33 @@ +! { dg-do compile } +! { dg-require-effective-target vect_double } + SUBROUTINE CALC2 + IMPLICIT REAL*8 (A-H, O-Z) + PARAMETER (N1=1335, N2=1335) + + COMMON U(N1,N2), V(N1,N2), P(N1,N2), + * UNEW(N1,N2), VNEW(N1,N2), + 1 PNEW(N1,N2), UOLD(N1,N2), + * VOLD(N1,N2), POLD(N1,N2), + 2 CU(N1,N2), CV(N1,N2), + * Z(N1,N2), H(N1,N2), PSI(N1,N2) + COMMON /CONS/ DT,TDT,DX,DY,A,ALPHA,ITMAX,MPRINT,M,N,MP1, + 1 NP1,EL,PI,TPI,DI,DJ,PCF + TDTS8 = TDT/8.D0 + TDTSDX = TDT/DX + TDTSDY = TDT/DY + + DO 200 J=1,N + DO 200 I=1,M + UNEW(I+1,J) = UOLD(I+1,J)+ + 1 TDTS8*(Z(I+1,J+1)+Z(I+1,J))*(CV(I+1,J+1)+CV(I,J+1)+CV(I,J) + 2 +CV(I+1,J))-TDTSDX*(H(I+1,J)-H(I,J)) + VNEW(I,J+1) = VOLD(I,J+1)-TDTS8*(Z(I+1,J+1)+Z(I,J+1)) + 1 *(CU(I+1,J+1)+CU(I,J+1)+CU(I,J)+CU(I+1,J)) + 2 -TDTSDY*(H(I,J+1)-H(I,J)) + PNEW(I,J) = POLD(I,J)-TDTSDX*(CU(I+1,J)-CU(I,J)) + 1 -TDTSDY*(CV(I,J+1)-CV(I,J)) + 200 CONTINUE + RETURN + END +! { dg-final { scan-tree-dump-times "LOOP VECTORIZED" 1 "vect" } } +! { dg-final { cleanup-tree-dump "vect" } } Index: gcc/testsuite/gcc.c-torture/execute/pr53160.c =================================================================== --- gcc/testsuite/gcc.c-torture/execute/pr53160.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.c-torture/execute/pr53160.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,35 @@ +/* PR rtl-optimization/53160 */ + +extern void abort (void); + +int a, c = 1, d, e, g; +volatile int b; +volatile char f; +long h; +short i; + +void +foo (void) +{ + for (e = 0; e; ++e) + ; +} + +int +main () +{ + if (g) + (void) b; + foo (); + for (d = 0; d >= 0; d--) + { + short j = f; + int k = 0; + i = j ? j : j << k; + } + h = c == 0 ? 0 : i; + a = h; + if (a != 0) + abort (); + return 0; +} Index: gcc/testsuite/gcc.c-torture/execute/pr53084.c =================================================================== --- gcc/testsuite/gcc.c-torture/execute/pr53084.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.c-torture/execute/pr53084.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,18 @@ +/* PR middle-end/53084 */ + +extern void abort (void); + +__attribute__((noinline, noclone)) void +bar (const char *p) +{ + if (p[0] != 'o' || p[1] != 'o' || p[2]) + abort (); +} + +int +main () +{ + static const char *const foo[] = {"foo" + 1}; + bar (foo[0]); + return 0; +} Index: gcc/testsuite/gcc.c-torture/execute/20120427-1.c =================================================================== --- gcc/testsuite/gcc.c-torture/execute/20120427-1.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.c-torture/execute/20120427-1.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,36 @@ +typedef struct sreal +{ + unsigned sig; /* Significant. */ + int exp; /* Exponent. */ +} sreal; + +sreal_compare (sreal *a, sreal *b) +{ + if (a->exp > b->exp) + return 1; + if (a->exp < b->exp) + return -1; + if (a->sig > b->sig) + return 1; + return -(a->sig < b->sig); +} + +sreal a[] = { + { 0, 0 }, + { 1, 0 }, + { 0, 1 }, + { 1, 1 } +}; + +int main() +{ + int i, j; + for (i = 0; i <= 3; i++) { + for (j = 0; j < 3; j++) { + if (i < j && sreal_compare(&a[i], &a[j]) != -1) abort(); + if (i == j && sreal_compare(&a[i], &a[j]) != 0) abort(); + if (i > j && sreal_compare(&a[i], &a[j]) != 1) abort(); + } + } + return 0; +} Index: gcc/testsuite/gcc.c-torture/execute/pr53465.c =================================================================== --- gcc/testsuite/gcc.c-torture/execute/pr53465.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.c-torture/execute/pr53465.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,30 @@ +/* PR tree-optimization/53465 */ + +extern void abort (); + +static const int a[] = { 1, 2 }; + +void +foo (const int *x, int y) +{ + int i; + int b = 0; + int c; + for (i = 0; i < y; i++) + { + int d = x[i]; + if (d == 0) + break; + if (b && d <= c) + abort (); + c = d; + b = 1; + } +} + +int +main () +{ + foo (a, 2); + return 0; +} Index: gcc/testsuite/gcc.c-torture/compile/pr52891-1.c =================================================================== --- gcc/testsuite/gcc.c-torture/compile/pr52891-1.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.c-torture/compile/pr52891-1.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,20 @@ +/* PR tree-optimizations/52891 */ + +struct S +{ + int a; + struct T { unsigned c : 10; } b; +} s; + +void +bar (short x, short y, int **p) +{ + if ((x && y) + **p) + while (1); +} + +void +foo (int **p) +{ + bar (s.a, s.b.c, p); +} Index: gcc/testsuite/gcc.c-torture/compile/pr53418-1.c =================================================================== --- gcc/testsuite/gcc.c-torture/compile/pr53418-1.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.c-torture/compile/pr53418-1.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,5 @@ +void +f (void) +{ + int i = (0 ? 1 : 0U / 0); +} Index: gcc/testsuite/gcc.c-torture/compile/pr53410-2.c =================================================================== --- gcc/testsuite/gcc.c-torture/compile/pr53410-2.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.c-torture/compile/pr53410-2.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,64 @@ +/* PR tree-optimization/53410 */ + +typedef int V __attribute__((vector_size (4 * sizeof (int)))); +typedef unsigned int W __attribute__((vector_size (4 * sizeof (int)))); + +void +f1 (V *p) +{ + *p = (*p & ((V) { 1, 1, 1, 1 })) ^ ((V) { 1, 1, 1, 1}); +} + +void +f2 (V *p) +{ + *p = (*p ^ ((V) { 1, 1, 1, 1 })) & ((V) { 1, 1, 1, 1}); +} + +void +f3 (V *p) +{ + *p = (~*p) & ((V) { 1, 1, 1, 1 }); +} + +void +f4 (V *p, V *q) +{ + *p = (*p ^ *q) == *q; +} + +void +f5 (V *p, V *q) +{ + *p = (*p ^ *q) == *p; +} + +void +f6 (V *p, V *q, V *r) +{ + *p = (*p & *r) == (*q & *r); +} + +void +f7 (V *p, V *q, V *r) +{ + *p = (*p & *r) == (*r & *q); +} + +void +f8 (V *p, V *q, V *r) +{ + *p = (*r & *p) == (*q & *r); +} + +void +f9 (V *p, V *q, V *r) +{ + *p = (*r & *p) == (*r & *q); +} + +void +f10 (W *p, W *q) +{ + *p = *p < (((const W) { 1U, 1U, 1U, 1U }) << *q); +} Index: gcc/testsuite/gcc.c-torture/compile/limits-externdecl.c =================================================================== --- gcc/testsuite/gcc.c-torture/compile/limits-externdecl.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.c-torture/compile/limits-externdecl.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,56 @@ +/* Inspired by the test case for PR middle-end/52640. */ + +typedef struct +{ + char *value; +} REFERENCE; + +/* Add a few "extern int Xxxxxx ();" declarations. */ +#undef DEF +#undef LIM1 +#undef LIM2 +#undef LIM3 +#undef LIM4 +#undef LIM5 +#undef LIM6 +#define DEF(x) extern int x () +#define LIM1(x) DEF(x##0); DEF(x##1); DEF(x##2); DEF(x##3); DEF(x##4); \ + DEF(x##5); DEF(x##6); DEF(x##7); DEF(x##8); DEF(x##9); +#define LIM2(x) LIM1(x##0) LIM1(x##1) LIM1(x##2) LIM1(x##3) LIM1(x##4) \ + LIM1(x##5) LIM1(x##6) LIM1(x##7) LIM1(x##8) LIM1(x##9) +#define LIM3(x) LIM2(x##0) LIM2(x##1) LIM2(x##2) LIM2(x##3) LIM2(x##4) \ + LIM2(x##5) LIM2(x##6) LIM2(x##7) LIM2(x##8) LIM2(x##9) +#define LIM4(x) LIM3(x##0) LIM3(x##1) LIM3(x##2) LIM3(x##3) LIM3(x##4) \ + LIM3(x##5) LIM3(x##6) LIM3(x##7) LIM3(x##8) LIM3(x##9) +#define LIM5(x) LIM4(x##0) LIM4(x##1) LIM4(x##2) LIM4(x##3) LIM4(x##4) \ + LIM4(x##5) LIM4(x##6) LIM4(x##7) LIM4(x##8) LIM4(x##9) +#define LIM6(x) LIM5(x##0) LIM5(x##1) LIM5(x##2) LIM5(x##3) LIM5(x##4) \ + LIM5(x##5) LIM5(x##6) LIM5(x##7) LIM5(x##8) LIM5(x##9) +LIM5 (X); + +/* Add references to them, or GCC will simply ignore the extern decls. */ +#undef DEF +#undef LIM1 +#undef LIM2 +#undef LIM3 +#undef LIM4 +#undef LIM5 +#undef LIM6 +#define DEF(x) (char *) x +#define LIM1(x) DEF(x##0), DEF(x##1), DEF(x##2), DEF(x##3), DEF(x##4), \ + DEF(x##5), DEF(x##6), DEF(x##7), DEF(x##8), DEF(x##9), +#define LIM2(x) LIM1(x##0) LIM1(x##1) LIM1(x##2) LIM1(x##3) LIM1(x##4) \ + LIM1(x##5) LIM1(x##6) LIM1(x##7) LIM1(x##8) LIM1(x##9) +#define LIM3(x) LIM2(x##0) LIM2(x##1) LIM2(x##2) LIM2(x##3) LIM2(x##4) \ + LIM2(x##5) LIM2(x##6) LIM2(x##7) LIM2(x##8) LIM2(x##9) +#define LIM4(x) LIM3(x##0) LIM3(x##1) LIM3(x##2) LIM3(x##3) LIM3(x##4) \ + LIM3(x##5) LIM3(x##6) LIM3(x##7) LIM3(x##8) LIM3(x##9) +#define LIM5(x) LIM4(x##0) LIM4(x##1) LIM4(x##2) LIM4(x##3) LIM4(x##4) \ + LIM4(x##5) LIM4(x##6) LIM4(x##7) LIM4(x##8) LIM4(x##9) +#define LIM6(x) LIM5(x##0) LIM5(x##1) LIM5(x##2) LIM5(x##3) LIM5(x##4) \ + LIM5(x##5) LIM5(x##6) LIM5(x##7) LIM5(x##8) LIM5(x##9) +REFERENCE references[] = { + LIM5 (X) + 0 +}; + Index: gcc/testsuite/gcc.c-torture/compile/pr53163.c =================================================================== --- gcc/testsuite/gcc.c-torture/compile/pr53163.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.c-torture/compile/pr53163.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,34 @@ +/* PR tree-optimization/53163 */ + +struct S { int s; } b, f; +int a, c; + +void +foo (void) +{ + int d, e; + for (d = 4; d < 19; ++d) + for (e = 2; e >= 0; e--) + { + a = 0; + a = 1; + } +} + +void +bar (void) +{ + int g, h, i; + for (i = 1; i >= 0; i--) + { + b = f; + for (g = 0; g <= 1; g++) + { + if (c) + break; + for (h = 0; h <= 1; h++) + foo (); + foo (); + } + } +} Index: gcc/testsuite/gcc.c-torture/compile/pr52891-2.c =================================================================== --- gcc/testsuite/gcc.c-torture/compile/pr52891-2.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.c-torture/compile/pr52891-2.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,16 @@ +/* PR tree-optimizations/52891 */ + +#if __SIZEOF_INT__ > 2 +struct __attribute__((packed)) S { unsigned s : 22; }; +#else +struct __attribute__((packed)) S { unsigned s : 12; }; +#endif +struct __attribute__((packed)) T { struct S t; } c; +int a, b, d; + +void +foo (void) +{ + if (1 ? (!c.t.s & (d < 0)) < a : 0) + b = 0; +} Index: gcc/testsuite/gcc.c-torture/compile/pr53410-1.c =================================================================== --- gcc/testsuite/gcc.c-torture/compile/pr53410-1.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.c-torture/compile/pr53410-1.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,10 @@ +/* PR tree-optimization/53410 */ + +int *a, b, c, d; + +void +foo (void) +{ + for (; d <= 0; d++) + b &= ((a || d) ^ c) == 1; +} Index: gcc/testsuite/gcc.c-torture/compile/pr53418-2.c =================================================================== --- gcc/testsuite/gcc.c-torture/compile/pr53418-2.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.c-torture/compile/pr53418-2.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,5 @@ +void +f (void) +{ + int i = (1 ? 0U / 0 : 1); +} Index: gcc/testsuite/gcc.c-torture/compile/pr53409.c =================================================================== --- gcc/testsuite/gcc.c-torture/compile/pr53409.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.c-torture/compile/pr53409.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,19 @@ +/* PR tree-optimization/53409 */ + +int a, c, d, e, f; +int b[0]; + +int +main () +{ + if (f) + e = 0; + int g = d; + for (c = 0; c <= 1; c++) + { + for (a = 0; a <= 1; a = (char) a + 1) + b[c] = g; + a = 0; + } + return 0; +} Index: gcc/testsuite/gcc.c-torture/compile/pr52750.c =================================================================== --- gcc/testsuite/gcc.c-torture/compile/pr52750.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.c-torture/compile/pr52750.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,11 @@ +/* PR middle-end/52750 */ + +typedef signed char V __attribute__((vector_size (32))); + +void +foo (V *x) +{ + V m = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}; + *x = __builtin_shuffle (*x, m); +} Index: gcc/testsuite/gcc.c-torture/compile/pr53187.c =================================================================== --- gcc/testsuite/gcc.c-torture/compile/pr53187.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.c-torture/compile/pr53187.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,11 @@ +/* PR target/53187 */ + +void bar (int); + +void +foo (int x, double y, double z) +{ + _Bool t = z >= y; + if (!t || x) + bar (t ? 1 : 16); +} Index: gcc/testsuite/gnat.dg/null_pointer_deref3.adb =================================================================== --- gcc/testsuite/gnat.dg/null_pointer_deref3.adb (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gnat.dg/null_pointer_deref3.adb (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,24 @@ +-- { dg-do run } +-- { dg-options "-O -gnatp" } + +-- This test requires architecture- and OS-specific support code for unwinding +-- through signal frames (typically located in *-unwind.h) to pass. Feel free +-- to disable it if this code hasn't been implemented yet. + +procedure Null_Pointer_Deref3 is + + procedure Leaf is + type Int_Ptr is access all Integer; + function n return Int_Ptr is + begin return null; end; + + Data : Int_Ptr := n; + begin + Data.all := 0; + end; + +begin + Leaf; +exception + when others => null; +end; Index: gcc/testsuite/gnat.dg/lto11.adb =================================================================== --- gcc/testsuite/gnat.dg/lto11.adb (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gnat.dg/lto11.adb (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,20 @@ +-- { dg-do compile } +-- { dg-options "-flto" { target lto } } + +with Ada.Streams; use Ada.Streams; + +package body Lto11 is + + procedure Write + (S : not null access Root_Stream_Type'Class; + V : Vector) + is + subtype M_SEA is Stream_Element_Array (1 .. V'Size / Stream_Element'Size); + Bytes : M_SEA; + for Bytes'Address use V'Address; + pragma Import (Ada, Bytes); + begin + Ada.Streams.Write (S.all, Bytes); + end; + +end Lto11; Index: gcc/testsuite/gnat.dg/lto11.ads =================================================================== --- gcc/testsuite/gnat.dg/lto11.ads (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gnat.dg/lto11.ads (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,9 @@ +with Ada.Streams; use Ada.Streams; + +package Lto11 is + + type Vector is array (Positive range <>) of Float; + + procedure Write (S : not null access Root_Stream_Type'Class; V : Vector); + +end Lto11; Index: gcc/testsuite/gnat.dg/controlled6.adb =================================================================== --- gcc/testsuite/gnat.dg/controlled6.adb (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gnat.dg/controlled6.adb (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,24 @@ +-- { dg-do compile } +-- { dg-options "-O -gnatn" } + +with Ada.Text_IO; use Ada.Text_IO; +with Controlled6_Pkg; +with Controlled6_Pkg.Iterators; + +procedure Controlled6 is + + type String_Access is access String; + + package My_Q is new Controlled6_Pkg (String_Access); + package My_Iterators is new My_Q.Iterators (0); + use My_Iterators; + + Iterator : Iterator_Type := Find; + +begin + loop + exit when Is_Null (Iterator); + Put (Current (Iterator).all & ' '); + Find_Next (Iterator); + end loop; +end; Index: gcc/testsuite/gnat.dg/concat2.adb =================================================================== --- gcc/testsuite/gnat.dg/concat2.adb (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gnat.dg/concat2.adb (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,18 @@ +with Text_IO; use Text_IO; + +package body Concat2 is + + function Get_Param return String is + begin + return ""; + end; + + procedure Browse is + Mode : constant String := Get_Param; + Mode_Param : constant String := "MODE=" & Mode; + begin + Put_Line (Mode_Param); + end; + +end Concat2; + Index: gcc/testsuite/gnat.dg/controlled6_pkg-iterators.adb =================================================================== --- gcc/testsuite/gnat.dg/controlled6_pkg-iterators.adb (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gnat.dg/controlled6_pkg-iterators.adb (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,21 @@ +package body Controlled6_Pkg.Iterators is + + function Find return Iterator_Type is + Iterator : Iterator_Type; + begin + return Iterator; + end Find; + + function Current (Iterator : in Iterator_Type) return T is begin + return Iterator.Current.Item; + end Current; + + procedure Find_Next (Iterator : in out Iterator_Type) is begin + Iterator.Current := null; + end Find_Next; + + function Is_Null (Iterator : in Iterator_Type) return Boolean is begin + return Iterator.Current = null; + end Is_Null; + +end Controlled6_Pkg.Iterators; Index: gcc/testsuite/gnat.dg/concat2.ads =================================================================== --- gcc/testsuite/gnat.dg/concat2.ads (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gnat.dg/concat2.ads (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,8 @@ +-- { dg-do compile } +-- { dg-options "-O" } + +package Concat2 is + + procedure Browse; + +end Concat2; Index: gcc/testsuite/gnat.dg/controlled6_pkg-iterators.ads =================================================================== --- gcc/testsuite/gnat.dg/controlled6_pkg-iterators.ads (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gnat.dg/controlled6_pkg-iterators.ads (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,22 @@ +with Ada.Finalization; + +generic + + I : Integer; + +package Controlled6_Pkg.Iterators is + + type Iterator_Type is new Ada.Finalization.Controlled with record + Current : Node_Access_Type; + end record; + + function Find return Iterator_Type; + + function Current (Iterator : in Iterator_Type) return T; + pragma Inline (Current); + + procedure Find_Next (Iterator : in out Iterator_Type); + + function Is_Null (Iterator : in Iterator_Type) return Boolean; + +end Controlled6_Pkg.Iterators; Index: gcc/testsuite/gnat.dg/lto13.adb =================================================================== --- gcc/testsuite/gnat.dg/lto13.adb (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gnat.dg/lto13.adb (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,9 @@ +-- { dg-do link } +-- { dg-options "-g -flto" { target lto } } + +with Lto13_Pkg; use Lto13_Pkg; + +procedure Lto13 is +begin + Proc; +end; Index: gcc/testsuite/gnat.dg/controlled6_pkg.ads =================================================================== --- gcc/testsuite/gnat.dg/controlled6_pkg.ads (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gnat.dg/controlled6_pkg.ads (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,15 @@ +with Ada.Finalization; + +generic + + type T is private; + +package Controlled6_Pkg is + + type Node_Type is record + Item : T; + end record; + + type Node_Access_Type is access Node_Type; + +end Controlled6_Pkg; Index: gcc/testsuite/gnat.dg/lto14.adb =================================================================== --- gcc/testsuite/gnat.dg/lto14.adb (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gnat.dg/lto14.adb (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,7 @@ +-- { dg-do link } +-- { dg-options "-largs -f -margs -flto" { target lto } } + +procedure Lto14 is +begin + null; +end; Index: gcc/testsuite/gnat.dg/lto13_pkg.adb =================================================================== --- gcc/testsuite/gnat.dg/lto13_pkg.adb (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gnat.dg/lto13_pkg.adb (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,10 @@ +package body Lto13_Pkg is + + procedure Proc is + begin + raise Constraint_Error; + end; + + type T is null record; + +end Lto13_Pkg; Index: gcc/testsuite/gnat.dg/lto13_pkg.ads =================================================================== --- gcc/testsuite/gnat.dg/lto13_pkg.ads (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gnat.dg/lto13_pkg.ads (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,9 @@ +package Lto13_Pkg is + + procedure Proc; + +private + + type T; + +end Lto13_Pkg; Index: gcc/testsuite/gnat.dg/specs/lto12_pkg.ads =================================================================== --- gcc/testsuite/gnat.dg/specs/lto12_pkg.ads (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gnat.dg/specs/lto12_pkg.ads (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,14 @@ +-- { dg-excess-errors "cannot generate code" } + +package Lto12_Pkg is + + type R (Kind : Boolean := False) is record + case Kind is + when True => I : Integer; + when others => null; + end case; + end record; + + function F return R; + +end Lto12_Pkg; Index: gcc/testsuite/gnat.dg/specs/lto12.ads =================================================================== --- gcc/testsuite/gnat.dg/specs/lto12.ads (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gnat.dg/specs/lto12.ads (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,10 @@ +-- { dg-do compile } +-- { dg-options "-flto" { target lto } } + +with Lto12_Pkg; use Lto12_Pkg; + +package Lto12 is + + C : constant R := F; + +end Lto12; Index: gcc/testsuite/gcc.dg/pr49994-3.c =================================================================== --- gcc/testsuite/gcc.dg/pr49994-3.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/gcc.dg/pr49994-3.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,8 +1,7 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fsched2-use-superblocks -g" } */ +/* { dg-options "-O2 -fsched2-use-superblocks -g -w" } */ /* { dg-options "-O2 -fsched2-use-superblocks -g -mbackchain" { target s390*-*-* } } */ /* { dg-require-effective-target scheduling } */ -/* { dg-skip-if "PR testsuite/50722" { ia64-*-*-* hppa*-*-* *-*-hpux* } } */ void * foo (int offset) Index: gcc/testsuite/gcc.dg/pr52691.c =================================================================== --- gcc/testsuite/gcc.dg/pr52691.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/pr52691.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,24 @@ +/* PR middle-end/52691 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +#include + +int +foo (int a, ...) +{ + int b = 0, c = 0; + va_list ap; + va_start (ap, a); + if (a > 1) + b = va_arg (ap, double); + if (a > 2) + c = va_arg (ap, long long); + va_end (ap); + return a + b + c; +} + +/* { dg-final { scan-tree-dump "__builtin_next_arg" "optimized" { target { { i?86-*-* x86_64-*-* } && ia32 } } } } */ +/* { dg-final { scan-tree-dump "__builtin_next_arg" "optimized" { target { powerpc*-*-darwin* powerpc*-*-aix* } } } } */ +/* { dg-final { scan-tree-dump "__builtin_next_arg" "optimized" { target { powerpc*-*-linux* && lp64 } } } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ Index: gcc/testsuite/gcc.dg/pr52862.c =================================================================== --- gcc/testsuite/gcc.dg/pr52862.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/pr52862.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-options "-O" } */ + +void ASMAtomicWritePtrVoid(const void *pv); +void rtThreadDestroy(void) +{ + void * const pvTypeChecked = ((void *)0); + ASMAtomicWritePtrVoid((void *)(pvTypeChecked)); +} Index: gcc/testsuite/gcc.dg/pr52880.c =================================================================== --- gcc/testsuite/gcc.dg/pr52880.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/pr52880.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,10 @@ +/* PR c/52880 */ +/* { dg-do compile } */ +/* { dg-options "-Woverride-init" } */ + +struct A { int a; int b; }; +struct B { struct A c; int d, e; }; +struct B f = { .c.a = 0, .e = 1, .d = 2, .c.b = 3 }; +struct C { int g; int h; }; +struct D { int i; struct C j; int k; }; +struct D l = { .j.g = 0, .k = 1, .i = 2, .j.h = 3 }; Index: gcc/testsuite/gcc.dg/split-6.c =================================================================== --- gcc/testsuite/gcc.dg/split-6.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/split-6.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,53 @@ +/* { dg-do run } */ +/* { dg-require-effective-target split_stack } */ +/* { dg-options "-fsplit-stack" } */ + +/* This test is like split-3.c, but tests with a smaller stack frame, + since that uses a different prologue. */ + +#include +#include + +/* Use a noinline function to ensure that the buffer is not removed + from the stack. */ +static void use_buffer (char *buf) __attribute__ ((noinline)); +static void +use_buffer (char *buf) +{ + buf[0] = '\0'; +} + +/* When using gold, the call to abort will force a stack split. */ + +static void +down (int i, ...) +{ + char buf[1]; + va_list ap; + + va_start (ap, i); + if (va_arg (ap, int) != 1 + || va_arg (ap, int) != 2 + || va_arg (ap, int) != 3 + || va_arg (ap, int) != 4 + || va_arg (ap, int) != 5 + || va_arg (ap, int) != 6 + || va_arg (ap, int) != 7 + || va_arg (ap, int) != 8 + || va_arg (ap, int) != 9 + || va_arg (ap, int) != 10) + abort (); + + if (i > 0) + { + use_buffer (buf); + down (i - 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + } +} + +int +main (void) +{ + down (1000, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + return 0; +} Index: gcc/testsuite/gcc.dg/pr53174.c =================================================================== --- gcc/testsuite/gcc.dg/pr53174.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/pr53174.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,67 @@ +/* PR debug/53174 */ +/* { dg-do compile } */ +/* { dg-options "-Ofast -g" } */ + +int w, h; + +void +bar (float (*x)[4], int y, int z) +{ + int a, b, c, d, e, f, g; + + a = 2; + b = 2; + c = 274; + d = 274; + if (!z) + a = 12; + if (!y) + b = 12; + if (z + 266 >= h - 2) + c = 8 + h - z; + if (y + 266 >= w - 2) + d = 8 + w - y; + for (e = a; e < c; e++) + for (f = b, g = e * 276 + f; f < d; f++, g++) + { + float (*h)[4] = x + (g - 277); + float k = (*h)[0]; + float l = (*h)[1]; + float m = (*h)[2]; + h++; + k += (*h)[0]; + l += (*h)[1]; + m += (*h)[2]; + h++; + k += (*h)[0]; + l += (*h)[1]; + m += (*h)[2]; + h += 274; + k += (*h)[0]; + l += (*h)[1]; + m += (*h)[2]; + h += 2; + k += (*h)[0]; + l += (*h)[1]; + m += (*h)[2]; + h += 274; + k += (*h)[0]; + l += (*h)[1]; + m += (*h)[2]; + h++; + k += (*h)[0]; + l += (*h)[1]; + m += (*h)[2]; + h++; + k += (*h)[0]; + l += (*h)[1]; + m += (*h)[2]; + k *= 0.125f; + l *= 0.125f; + m *= 0.125f; + k = k + (x[g][1] - l); + m = m + (x[g][1] - l); + x[g][0] = k; + x[g][2] = m; + } +} Index: gcc/testsuite/gcc.dg/dll-8.c =================================================================== --- gcc/testsuite/gcc.dg/dll-8.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/gcc.dg/dll-8.c (.../branches/gcc-4_7-branch) (wersja 187906) Zmiany atrybutów dla: gcc/testsuite/gcc.dg/dll-8.c ___________________________________________________________________ Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Index: gcc/testsuite/gcc.dg/lto/pr53214_0.c =================================================================== --- gcc/testsuite/gcc.dg/lto/pr53214_0.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/lto/pr53214_0.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,8 @@ +/* { dg-lto-do run } */ + +double a(double) __attribute__ ((optimize(1), used)); +double a(double r) +{ + return r; +} +int main () { return 0; } Index: gcc/testsuite/gcc.dg/torture/pr52969.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr52969.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/torture/pr52969.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-ftree-loop-if-convert-stores" } */ + +int a, b; +float xsum[100]; +void foo (float *cluster) +{ + int j; + for (; a ; ++j) { + xsum[j] = cluster[j]; + if (xsum[j] > 0) + xsum[j] = 0; + } + if (xsum[0]) + b = 0; +} Index: gcc/testsuite/gcc.dg/torture/pr52693.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr52693.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/torture/pr52693.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,33 @@ +/* { dg-do run } */ + +struct pair +{ + int x; + int y; +}; + +struct array +{ + struct pair elems[ 2 ]; + unsigned index; +}; + +extern void abort (); + +void __attribute__ ((noinline,noclone)) +test_results (int x1, int y1, int x2, int y2) +{ + if (x1 != x2 || y1 != y2) + abort (); +} + +int +main (void) +{ + struct array arr = {{{1,2}, {3,4}}, 1}; + struct pair last = arr.elems[arr.index]; + + test_results ( last.x, last.y, arr.elems[1].x, arr.elems[1].y); + + return 0; +} Index: gcc/testsuite/gcc.dg/torture/pr52406.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr52406.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/torture/pr52406.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,29 @@ +/* { dg-do run } */ + +extern void abort (void); +struct { int f1; } a[2]; + +int *b, *const k = &a[1].f1; +static int **c = &b; + +int e, f, d; + +int +main () +{ + int **l = &b; + *l = k; + for (; d <= 0; d++) + { + int *j = &e; + **c = 1; + *l = k; + *k ^= 0; + f = **l; + *j = f; + } + if (e != 1) + abort (); + return 0; +} + Index: gcc/testsuite/gcc.dg/torture/pr53272-1.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr53272-1.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/torture/pr53272-1.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,39 @@ +/* { dg-do run } */ +/* { dg-additional-sources "pr53272-2.c" } */ +struct rtc_class_ops { + int (*f)(void *, unsigned int enabled); +}; + +struct rtc_device +{ + void *owner; + const struct rtc_class_ops *ops; + int ops_lock; +}; + +__attribute__ ((__noinline__, __noclone__)) +extern int foo(void *); +__attribute__ ((__noinline__, __noclone__)) +extern void foobar(void *); + +__attribute__ ((__noinline__, __noclone__)) +int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled) +{ + int err; + asm volatile (""); + + err = foo(&rtc->ops_lock); + + if (err) + return err; + + if (!rtc->ops) + err = -19; + else if (!rtc->ops->f) + err = -22; + else + err = rtc->ops->f(rtc->owner, enabled); + + foobar(&rtc->ops_lock); + return err; +} Index: gcc/testsuite/gcc.dg/torture/pr53144.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr53144.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/torture/pr53144.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,21 @@ +/* { dg-do compile } */ + +typedef unsigned char __attribute__((vector_size(4))) uvec; + +int main (int argc, char *argv[]) { + int i; + int x = 0; + uvec uc0 = (uvec) {argc, 1, 2, 10}; + unsigned char uc1[4] = {0, 3, 2, 200}; + signed char ucg[4] = {1, 0, 0, 0 }; + signed char ucl[4] = {0, 1, 0, 1 }; + +#define uc0_ ((unsigned char *)&uc0) + + for (i = 0; i < 4; i ++) { + x |= ucg[i] != (uc0_[i] > uc1[i]); + x |= ucl[i] != (uc0_[i] < uc1[i]); + } + return x; +} + Index: gcc/testsuite/gcc.dg/torture/pr53366-1.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr53366-1.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/torture/pr53366-1.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,70 @@ +/* PR tree-optimization/53366 */ +/* { dg-do run } */ + +extern void abort (void); + +struct S { double v[3]; }; +struct T { struct S r, i; }; +struct U { struct T j[5]; }; + +void +foo (struct U *__restrict p1, struct U *__restrict p2, + struct S l1, struct S l2, struct S l3, struct S l4, + const double _Complex * __restrict x, int y, int z) +{ + int i, j; + while (y < z - 2) + { + for (j = 0; j < 5; ++j) + { + double a = __real__ x[5 * y + j]; + double b = __imag__ x[5 * y + j]; + double c = __real__ x[5 * (y + 2) + j]; + double d = __imag__ x[5 * (y + 2) + j]; + double e = __real__ x[5 * (y + 1) + j]; + double f = __imag__ x[5 * (y + 1) + j]; + double g = __real__ x[5 * (y + 3) + j]; + double h = __imag__ x[5 * (y + 3) + j]; + for (i = 0; i < 3; ++i) + { + p1->j[j].r.v[i] += l2.v[i] * a; + p1->j[j].r.v[i] += l4.v[i] * c; + p1->j[j].i.v[i] += l2.v[i] * b; + p1->j[j].i.v[i] += l4.v[i] * d; + p2->j[j].r.v[i] += l3.v[i] * e; + p2->j[j].r.v[i] += l1.v[i] * g; + p2->j[j].i.v[i] += l3.v[i] * f; + p2->j[j].i.v[i] += l1.v[i] * h; + } + } + y += 4; + } +} + +_Complex double x[5005]; +struct U p1, p2; + +int +main () +{ + int i, j; + struct S l1, l2, l3, l4; + for (i = 0; i < 5005; ++i) + x[i] = i + 1.0iF * (2 * i); + for (i = 0; i < 3; ++i) + { + l1.v[i] = 1; + l2.v[i] = 2; + l3.v[i] = 3; + l4.v[i] = 4; + } + foo (&p1, &p2, l1, l2, l3, l4, x, 5, 1000); + for (j = 0; j < 5; ++j) + for (i = 0; i < 3; ++i) + if (p1.j[j].r.v[i] != 3752430 + j * 1494.0 + || p1.j[j].i.v[i] != p1.j[j].r.v[i] * 2 + || p2.j[j].r.v[i] != 2502450 + j * 996.0 + || p2.j[j].i.v[i] != p2.j[j].r.v[i] * 2) + abort (); + return 0; +} Index: gcc/testsuite/gcc.dg/torture/pr53272-2.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr53272-2.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/torture/pr53272-2.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,39 @@ +__attribute__ ((__noinline__, __noclone__)) +int foo(void *x) +{ + asm (""); + return *(int *) x != 42; +} + +__attribute__ ((__noinline__, __noclone__)) +void foobar(void *x) +{ + asm (""); + if (foo(x)) + __builtin_abort(); +} + +struct rtc_class_ops { + int (*f)(void *, unsigned int enabled); +}; + +struct rtc_device +{ + void *owner; + struct rtc_class_ops *ops; + int ops_lock; +}; + +extern __attribute__ ((__noinline__, __noclone__)) +int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int); + +int main(void) +{ + struct rtc_class_ops ops = {(void *) 0}; + struct rtc_device dev1 = {0, &ops, 42}; + + if (rtc_update_irq_enable (&dev1, 1) != -22) + __builtin_abort (); + + __builtin_exit (0); +} Index: gcc/testsuite/gcc.dg/torture/pr53120.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr53120.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/torture/pr53120.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,110 @@ +/* { dg-do compile } */ +/* { dg-options "-fno-tree-sra" } */ +typedef struct { + unsigned int en : 1; + unsigned int bit_order : 1; + unsigned int scl_io : 1; + unsigned int scl_inv : 1; + unsigned int sda0_io : 1; + unsigned int sda0_idle : 1; + unsigned int sda1_io : 1; + unsigned int sda1_idle : 1; + unsigned int sda2_io : 1; + unsigned int sda2_idle : 1; + unsigned int sda3_io : 1; + unsigned int sda3_idle : 1; + unsigned int sda_sel : 2; + unsigned int sen_idle : 1; + unsigned int sen_inv : 1; + unsigned int sen_sel : 2; + unsigned int dummy1 : 14; +} reg_gio_rw_i2c1_cfg; + +typedef struct { + unsigned int data0 : 8; + unsigned int data1 : 8; + unsigned int data2 : 8; + unsigned int data3 : 8; +} reg_gio_rw_i2c1_data; + +typedef struct { + unsigned int trf_bits : 6; + unsigned int switch_dir : 6; + unsigned int extra_start : 3; + unsigned int early_end : 1; + unsigned int start_stop : 1; + unsigned int ack_dir0 : 1; + unsigned int ack_dir1 : 1; + unsigned int ack_dir2 : 1; + unsigned int ack_dir3 : 1; + unsigned int ack_dir4 : 1; + unsigned int ack_dir5 : 1; + unsigned int ack_bit : 1; + unsigned int start_bit : 1; + unsigned int freq : 2; + unsigned int dummy1 : 5; +} reg_gio_rw_i2c1_ctrl; + +extern reg_gio_rw_i2c1_cfg reg_gio; +extern reg_gio_rw_i2c1_data reg_data; +extern int reg_start; +extern reg_gio_rw_i2c1_ctrl reg_ctrl; + +extern void foobar(void); +extern void foo(int); +extern void frob(unsigned int); +extern void bar(int); +extern void baz(void); + +unsigned int f(int *devspec, unsigned int addr) +{ + reg_gio_rw_i2c1_ctrl ctrl = {0}; + reg_gio_rw_i2c1_data data = {0}; + + foobar(); + + static int first = 1; + + if (first) { + reg_gio_rw_i2c1_cfg cfg = {0}; + first = 0; + + foo(1); + cfg.sda0_idle = 1; + cfg.sda0_io = 0; + cfg.scl_inv = 0; + cfg.scl_io = 0; + cfg.bit_order = 1; + cfg.sda_sel = 0; + cfg.sen_sel = 0; + cfg.en = 1; + reg_gio = cfg; + } + + ctrl.freq = 1; + ctrl.start_bit = 0; + ctrl.ack_bit = 1; + ctrl.ack_dir0 = 0; + ctrl.ack_dir1 = 0; + ctrl.ack_dir2 = 0; + ctrl.ack_dir3 = 1; + ctrl.ack_dir4 = 0; + ctrl.ack_dir5 = 0; + ctrl.start_stop = 1; + ctrl.early_end = 0; + ctrl.extra_start = 2; + ctrl.switch_dir = 8*3; + ctrl.trf_bits = 8*4; + reg_ctrl = ctrl; + frob(0xac); + data.data0 = devspec[1] & 192; + data.data1 = addr; + data.data2 = devspec[1] | 0x01; + reg_data = data; + reg_start = 1; + bar(100); + data = reg_data; + baz(); + + return data.data3; +} Index: gcc/testsuite/gcc.dg/torture/pr53366-2.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr53366-2.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/torture/pr53366-2.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,43 @@ +/* PR tree-optimization/53366 */ +/* { dg-do run } */ + +extern void abort (void); + +struct T { float r[3], i[3]; }; +struct U { struct T j[2]; }; + +void __attribute__ ((noinline)) +foo (struct U *__restrict y, const float _Complex *__restrict x) +{ + int i, j; + for (j = 0; j < 2; ++j) + { + float a = __real__ x[j]; + float b = __imag__ x[j]; + float c = __real__ x[j + 2]; + float d = __imag__ x[j + 2]; + for (i = 0; i < 3; ++i) + { + y->j[j].r[i] = y->j[j].r[i] + a + c; + y->j[j].i[i] = y->j[j].i[i] + b + d; + } + } +} + +_Complex float x[4]; +struct U y; + +int +main () +{ + int i, j; + for (i = 0; i < 4; ++i) + x[i] = i + 1.0iF * (2 * i); + foo (&y, x); + for (j = 0; j < 2; ++j) + for (i = 0; i < 3; ++i) + if (y.j[j].r[i] != __real__ (x[j] + x[j + 2]) + || y.j[j].i[i] != __imag__ (x[j] + x[j + 2])) + __builtin_abort (); + return 0; +} Index: gcc/testsuite/gcc.dg/torture/pr51071-2.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr51071-2.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/torture/pr51071-2.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,38 @@ +/* { dg-do compile } */ +/* { dg-options "-fno-delete-null-pointer-checks" } */ + +extern struct module __this_module; +static inline void +trace_module_get (struct module *mod, unsigned long ip) { } +struct module; +static inline __attribute__((no_instrument_function)) +int try_module_get(struct module *module) +{ + int ret = 1; + if (module) + { + if (module_is_live(module)) + { + __label__ __here; + asm(""); + __here: + trace_module_get(module, (unsigned long)&&__here); + } + else + ret = 0; + } + return ret; +} +struct net_device; +struct net_device_ops { + int (*ndo_open)(struct net_device *dev); +}; +int t3e3_open(struct net_device *dev) +{ + int ret = hdlc_open(dev); + if (ret) + return ret; + try_module_get((&__this_module)); + return 0; +} +const struct net_device_ops t3e3_ops = { .ndo_open = t3e3_open }; Index: gcc/testsuite/gcc.dg/torture/pr52493.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr52493.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/torture/pr52493.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,38 @@ +/* { dg-do compile } */ + +struct Time { + long int sec; + long usec; +}; +struct Flow { + unsigned short iif; + struct Time mtime; +}; +struct NetFlow { + unsigned MaxFlows; + unsigned HeaderFields; + unsigned short *HeaderFormat; +}; +static struct NetFlow *netflow; +static struct Time start_time; +static unsigned char emit_packet[1500]; +inline long int cmpmtime(struct Time *t1, struct Time *t2) +{ + return (t1->sec - t2->sec) * 1000 + (t1->usec - t2->usec) / 1000; +} +static void fill(int fields, unsigned short *format, + struct Flow *flow, void *p) +{ + int i; + for (i = 0; i < fields; i++) + if (format[i] == 21) + { + unsigned int __v; + __v = cmpmtime(&flow->mtime, &start_time); + *((unsigned int *) p) = __v; + } +} +void emit_thread() +{ + fill(netflow->HeaderFields, netflow->HeaderFormat, 0, &emit_packet); +} Index: gcc/testsuite/gcc.dg/torture/pr52720.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr52720.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/torture/pr52720.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "-march=k8-sse3" { target x86_64-*-* } } */ + +struct alu_bank_swizzle { + int hw_gpr[3][4]; + int hw_cfile_addr[4]; +}; +static void init_bank_swizzle(struct alu_bank_swizzle *bs) +{ + int i, cycle, component; + for (cycle = 0; cycle < 3; cycle++) + for (component = 0; component < 4; component++) + bs->hw_gpr[cycle][component] = -1; + for (i = 0; i < 4; i++) + bs->hw_cfile_addr[i] = -1; +} +int check_and_set_bank_swizzle(int max_slots, int *slots) +{ + struct alu_bank_swizzle bs; + int i; + for (i = 0; i < max_slots; i++) + { + init_bank_swizzle(&bs); + if (slots[i]) + check_vector(&bs); + } +} + Index: gcc/testsuite/gcc.dg/torture/pr53408.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr53408.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/torture/pr53408.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,20 @@ +/* { dg-do compile } */ + +int a, b, c, d, e; +void +fn1 () +{ + int f, g; + char h = 0; + b = 0; + for (; b < 32; b++) + { + g = h > e ? h : h << 1; + f = g && a ? 0 : 1; + h = 1; + for (; h > 0; h = h + 1) + c = 0 < h | f; + } + if (h) + d = 0; +} Index: gcc/testsuite/gcc.dg/torture/pr52943.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr52943.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/torture/pr52943.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,20 @@ +/* { dg-do run } */ + +extern void abort (void); +int a[] = { 0, 0, 0, 6 }; + +int b; +int +main () +{ + for (;;) + { + b = 3; + for (; b; b -= 1) + a[b] = a[3] > 1; + break; + } + if (a[1] != 0) + abort (); + return 0; +} Index: gcc/testsuite/gcc.dg/pr52734.c =================================================================== --- gcc/testsuite/gcc.dg/pr52734.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/pr52734.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,35 @@ +/* { dg-do run } */ +/* { dg-options "-O2" } */ + +int bbb = 0; + +int __attribute__((noinline,noclone)) aaa(void) +{ + ++bbb; + return 0; +} + +int __attribute__((noinline,noclone)) ccc(void) +{ + int ddd; + /* bbb == 0 */ + if (aaa()) + return bbb; + + /* bbb == 1 */ + ddd = bbb; + /* bbb == ddd == 1 */ + if (aaa ()) + return 0; + /* bbb == 2, ddd == 1 */ + + return ddd; +} + +int main(void) +{ + if (ccc() != 1) + __builtin_abort(); + return 0; +} + Index: gcc/testsuite/gcc.dg/pr53358.c =================================================================== --- gcc/testsuite/gcc.dg/pr53358.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/pr53358.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,22 @@ +/* PR target/53358 */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ +/* { dg-additional-options "-fpic" { target fpic } } */ +/* { dg-additional-options "-mtune=pentium4" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ + +struct S { unsigned char s, t[17]; }; +int bar (void); + +void +foo (struct S *x) +{ + unsigned char i, z; + if (bar ()) + { + z = bar (); + bar (); + x->s += z; + for (i = 0; i < x->s; i++) + x->t[i] = bar (); + } +} Index: gcc/testsuite/gcc.dg/tm/indirect-2.c =================================================================== --- gcc/testsuite/gcc.dg/tm/indirect-2.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/tm/indirect-2.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-fgnu-tm" } */ + +void __attribute__((transaction_safe)) +foo(void); + +void __attribute__((transaction_safe)) +set_fn(void) +{ + void __attribute__((transaction_safe)) (*fn)(void); + fn = foo; + fn(); +} + +/* { dg-final { scan-assembler "_ITM_getTMCloneSafe" } } */ Index: gcc/testsuite/gcc.dg/vect/vect-over-widen-1.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-over-widen-1.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/gcc.dg/vect/vect-over-widen-1.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -58,7 +58,9 @@ return 0; } -/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 4 "vect" { target {! vect_sizes_32B_16B} } } } */ +/* { dg-final { scan-tree-dump-times "vect_recog_widen_shift_pattern: detected" 2 "vect" { target vect_widen_shift } } } */ +/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 2 "vect" { target vect_widen_shift } } } */ +/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 4 "vect" { target { { ! vect_sizes_32B_16B } && { ! vect_widen_shift } } } } } */ /* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 8 "vect" { target vect_sizes_32B_16B } } } */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: gcc/testsuite/gcc.dg/vect/vect-over-widen-1-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-over-widen-1-big-array.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/gcc.dg/vect/vect-over-widen-1-big-array.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -58,7 +58,9 @@ return 0; } -/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 4 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vect_recog_widen_shift_pattern: detected" 2 "vect" { target vect_widen_shift } } } */ +/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 2 "vect" { target vect_widen_shift } } } */ +/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 4 "vect" { target { ! vect_widen_shift } } } } */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: gcc/testsuite/gcc.dg/vect/vect-over-widen-4.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-over-widen-4.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/gcc.dg/vect/vect-over-widen-4.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -62,7 +62,9 @@ return 0; } -/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 4 "vect" { target {! vect_sizes_32B_16B } } } } */ +/* { dg-final { scan-tree-dump-times "vect_recog_widen_shift_pattern: detected" 2 "vect" { target vect_widen_shift } } } */ +/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 2 "vect" { target vect_widen_shift } } } */ +/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 4 "vect" { target { { ! vect_sizes_32B_16B } && { ! vect_widen_shift } } } } } */ /* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 8 "vect" { target vect_sizes_32B_16B } } } */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: gcc/testsuite/gcc.dg/vect/vect-over-widen-4-big-array.c =================================================================== --- gcc/testsuite/gcc.dg/vect/vect-over-widen-4-big-array.c (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/gcc.dg/vect/vect-over-widen-4-big-array.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -62,7 +62,9 @@ return 0; } -/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 4 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vect_recog_widen_shift_pattern: detected" 2 "vect" { target vect_widen_shift } } } */ +/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 2 "vect" { target vect_widen_shift } } } */ +/* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 4 "vect" { target { ! vect_widen_shift } } } } */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ Index: gcc/testsuite/gcc.dg/vect/pr52870.c =================================================================== --- gcc/testsuite/gcc.dg/vect/pr52870.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/vect/pr52870.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -ftree-vectorize" } */ + +long +test (int *x) +{ + unsigned long sx, xprec; + + sx = *x >= 0 ? *x : -*x; + + xprec = sx * 64; + + if (sx < 16384) + foo (sx); + + return xprec; +} Index: gcc/testsuite/gcc.dg/pr53060.c =================================================================== --- gcc/testsuite/gcc.dg/pr53060.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/pr53060.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,24 @@ +/* { dg-do run } */ + +extern void abort (void); + +int f(void) { return 2; } +unsigned int g(void) { return 5; } +unsigned int h = 1; + +typedef unsigned int vec __attribute__((vector_size(16))); + +vec i = { 1, 2, 3, 4}; + +vec fv1(void) { return i + (h ? f() : g()); } +vec fv2(void) { return (h ? f() : g()) + i; } + +int main() +{ + vec i, j; + j = fv1(); + if (j[0] != 3) abort(); + i = fv2(); + if (i[0] != 3) abort(); + return 0; +} Index: gcc/testsuite/gcc.dg/Wunused-var-3.c =================================================================== --- gcc/testsuite/gcc.dg/Wunused-var-3.c (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/gcc.dg/Wunused-var-3.c (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,34 @@ +/* PR c/52577 */ +/* { dg-do compile } */ +/* { dg-options "-Wunused" } */ + +typedef int V __attribute__((vector_size (sizeof (int) * 4))); + +void +f1 (V *p) +{ + V mask = { 1, 2, 3, 0 }; + *p = __builtin_shuffle (*p, mask); +} + +void +f2 (V *p, V *q) +{ + V mask = { 1, 2, 3, 0 }; + *p = __builtin_shuffle (*p, *q, mask); +} + +void +f3 (V *p, V *mask) +{ + V a = { 1, 2, 3, 0 }; + *p = __builtin_shuffle (a, *mask); +} + +void +f4 (V *p, V *mask) +{ + V a = { 1, 2, 3, 0 }; + V b = { 2, 3, 4, 1 }; + *p = __builtin_shuffle (a, b, *mask); +} Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/ChangeLog (.../branches/gcc-4_7-branch) (wersja 187906) @@ -1,3 +1,640 @@ +2012-05-25 Ian Lance Taylor + + * gcc.dg/split-6.c: New test. + +2012-05-25 Eric Botcazou + + * gnat.dg/lto14.adb: New test. + +2012-05-24 Richard Guenther + + PR middle-end/53460 + * g++.dg/tree-prof/pr53460.C: New testcase. + +2012-05-24 Jakub Jelinek + + PR tree-optimization/53465 + * gcc.c-torture/execute/pr53465.c: New test. + +2012-05-23 Tobias Burnus + + PR fortran/53389 + * gfortran.dg/realloc_on_assign_15.f90: New. + +2012-05-22 Richard Guenther + + PR tree-optimization/53408 + * gcc.dg/torture/pr53408.c: New testcase. + +2012-05-22 Richard Guenther + + PR middle-end/51071 + * gcc.dg/torture/pr51071-2.c: New testcase. + +2012-05-21 Jakub Jelinek + + PR tree-optimization/53366 + * gcc.dg/torture/pr53366-1.c: New test. + * gcc.dg/torture/pr53366-2.c: New test. + * gcc.target/i386/pr53366-1.c: New test. + * gcc.target/i386/pr53366-2.c: New test. + + PR tree-optimization/53409 + * gcc.c-torture/compile/pr53409.c: New test. + + PR tree-optimization/53410 + * gcc.c-torture/compile/pr53410-1.c: New test. + * gcc.c-torture/compile/pr53410-2.c: New test. + +2012-05-21 Joseph Myers + + PR c/53418 + * gcc.c-torture/compile/pr53418-1.c, + gcc.c-torture/compile/pr53418-2.c: New tests. + +2012-05-21 Patrick Marlier + + * gcc.dg/tm/indirect-2.c: New test. + +2012-05-21 H.J. Lu + + Backport from mainline + 2012-05-21 Uros Bizjak + H.J. Lu + + PR target/53416 + * gcc.target/i386/pr53416.c: New file. + +2012-05-20 Eric Botcazou + + * gnat.dg/lto13.adb: New test. + * gnat.dg/lto13_pkg.ad[sb]: New helper. + +2012-05-18 Eric Botcazou + + * gnat.dg/specs/lto12.ads: New test. + * gnat.dg/specs/lto12_pkg.ads: New helper. + +2012-05-17 David S. Miller + + * gfortran.dg/bessel_7.f90: Bump allowed precision to avoid + failure on sparc-*-linux-gnu. + +2012-05-16 Richard Henderson + + PR debug/52727 + * g++.dg/opt/pr52727.C: New testcase. + +2012-05-16 Richard Guenther + + PR tree-optimization/53364 + * g++.dg/torture/pr53364.C: New testcase. + +2012-05-15 Jakub Jelinek + + PR target/53358 + * gcc.dg/pr53358.c: New test. + +2012-05-14 Uros Bizjak + + * gcc.target/i386/avx256-unaligned-load-[1234].c: Update scan strings. + * gcc.target/i386/avx256-unaligned-store-[1234].c: Ditto. + +2012-05-12 Eric Botcazou + + * gnat.dg/null_pointer_deref3.adb: New test. + +2012-05-10 Paolo Carlini + + PR c++/53301 + * g++.dg/warn/Wzero-as-null-pointer-constant-6.C: New. + +2012-05-10 Eric Botcazou + + * gnat.dg/lto11.ad[sb]: New test. + +2012-05-08 Hans-Peter Nilsson + + PR target/53272 + * gcc.dg/torture/pr53272-1.c, gcc.dg/torture/pr53272-2.c: New test. + +2012-05-07 Jakub Jelinek + + PR tree-optimization/53239 + * g++.dg/opt/vrp3.C: New test. + * g++.dg/opt/vrp3-aux.cc: New file. + * g++.dg/opt/vrp3.h: New file. + +2012-05-07 Tobias Burnus + + Backport from mainline: + 2012-05-07 Tobias Burnus + + PR fortran/53255 + * gfortran.dg/typebound_operator_15.f90: New. + +2012-05-05 Tobias Burnus + + Backport from mainline: + 2012-05-04 Tobias Burnus + + PR fortran/53111 + * gfortran.dg/constructor_7.f90: New. + * gfortran.dg/constructor_8.f90: New. + +2012-05-04 Ulrich Weigand + + Backport from mainline: + + 2012-05-04 Ulrich Weigand + + PR tree-optimization/52633 + * gcc.dg/vect/vect-over-widen-1.c: Two patterns should now be + recognized as widening shifts instead of over-widening. + * gcc.dg/vect/vect-over-widen-1-big-array.c: Likewise. + * gcc.dg/vect/vect-over-widen-4.c: Likewise. + * gcc.dg/vect/vect-over-widen-4-big-array.c: Likewise. + * gcc.target/arm/pr52633.c: New test. + + 2012-04-10 Ulrich Weigand + + PR tree-optimization/52870 + * gcc.dg/vect/pr52870.c: New test. + +2012-05-04 Richard Guenther + + * gcc.dg/lto/pr53214_0.c: New testcase. + +2012-05-04 Eric Botcazou + + * gcc.target/ia64/pr48496.c: New test. + * gcc.target/ia64/pr52657.c: Likewise. + +2012-05-03 Michael Meissner + + Backport from mainline + 2012-05-03 Michael Meissner + + PR target/53199 + * gcc.target/powwerpc/pr53199.c: New file. + +2012-05-03 Martin Jambor + + Backport from mainline + 2012-05-02 Martin Jambor + + PR lto/52605 + * g++.dg/lto/pr52605_0.C: New test. + +2012-05-03 Paolo Carlini + + PR c++/53186 + * g++.dg/other/final2.C: New. + +2012-05-03 Jakub Jelinek + + PR debug/53174 + * gcc.dg/pr53174.c: New test. + + PR target/53187 + * gcc.target/arm/pr53187.c: New test. + * gcc.c-torture/compile/pr53187.c: New test. + +2012-05-03 Richard Guenther + + PR tree-optimization/53144 + * gcc.dg/torture/pr53144.c: New testcase. + +2012-05-02 Tobias Burnus + + Backport from mainline + 2012-04-16 Tobias Burnus + + PR fortran/52864 + * gfortran.dg/pointer_intent_6.f90: New. + +2012-05-02 Jakub Jelinek + + PR tree-optimization/53163 + * gcc.c-torture/compile/pr53163.c: New test. + + PR rtl-optimization/53160 + * gcc.c-torture/execute/pr53160.c: New test. + +2012-04-30 Thomas Koenig + + PR fortran/53148 + Backport from trunk + * gfortran.dg/function_optimize_12.f90: New test. + +2012-04-30 Uros Bizjak + + Backport from mainline + 2012-04-27 Paolo Bonzini + + PR target/53138 + * gcc.c-torture/execute/20120427-1.c: New testcase. + +2012-04-26 Hans-Peter Nilsson + + PR target/53120 + * gcc.dg/torture/pr53120.c: New test. + +2012-04-25 Jakub Jelinek + + PR c/52880 + * gcc.dg/pr52880.c: New test. + +2012-04-24 Georg-Johann Lay + + PR testsuite/52641 + PR tree-optimizations/52891 + + * gcc.c-torture/compile/pr52891-2.c: Fix test for 16-bit int. + +2012-04-24 Richard Guenther + + PR tree-optimization/53085 + * g++.dg/torture/pr53085.C: New testcase. + +2012-04-23 Richard Guenther + + PR c/53060 + * gcc.dg/pr53060.c: New testcase. + +2012-04-23 Jakub Jelinek + + PR tree-optimizations/52891 + * gcc.c-torture/compile/pr52891-1.c: New test. + * gcc.c-torture/compile/pr52891-2.c: New test. + +2012-04-20 Ian Lance Taylor + + * go.test/go-test.exp (go-set-goarch): Recognize powerpc*-*-*. + (go-gc-tests): Skip nilptr.go on powerpc*-*-*. + +2012-04-17 Paolo Carlini + + PR c++/53003 + * g++.dg/parse/crash59.C: New. + +2012-04-16 Jason Merrill + + PR c++/38543 + * g++.dg/cpp0x/variadic131.C: New. + +2012-04-16 Jason Merrill + + PR c++/50830 + * g++.dg/cpp0x/variadic129.C: New. + + PR c++/50303 + * g++.dg/cpp0x/variadic128.C: New. + +2012-04-16 Uros Bizjak + + Backport from mainline + 2012-04-12 Uros Bizjak + + PR target/52932 + * gcc.target/i386/avx2-vpermps-1.c (avx2_test): Use __m256i type for + second function argument. + * gcc.target/i386/avx2-vpermps-2.c (init_permps): Update declaration. + (calc_permps): Update declaration. Calculate result correctly. + (avx2_test): Change src2 type to union256i_d. + * gcc.target/i386/avx2-vpermd-2.c (calc_permd): Calculate result + correctly. + +2012-04-16 Martin Jambor + + Backported from mainline + + 2012-04-13 Martin Jambor + PR middle-end/52939 + + * g++.dg/ipa/pr52939.C: New test. + +2012-04-15 Jason Merrill + + PR c++/52380 + * g++.dg/cpp0x/variadic125.C: New. + + PR c++/52292 + * g++.dg/cpp0x/variadic124.C: New. + +2012-04-15 Fabien Chêne + + PR c++/52465 + * g++.dg/lookup/using52.C: New. + +2012-04-13 Jason Merrill + + PR c++/52824 + * g++.dg/cpp0x/variadic123.C: New. + * g++.dg/cpp0x/alias-decl-15.C: Remove dg-errors. + +2012-04-11 Jason Merrill + + PR c++/52906 + * g++.dg/ext/attrib45.C: New. + +2012-04-13 Tom de Vries + + Backport from mainline r186419. + + 2012-04-13 Tom de Vries + + * gcc.dg/pr52734.c: New test. + +2012-04-13 Richard Guenther + + PR tree-optimization/52969 + * gcc.dg/torture/pr52969.c: New testcase. + +2012-04-13 Richard Guenther + + PR c/52862 + * gcc.dg/pr52862.c: New testcase. + +2012-04-12 Michael Meissner + + Backport from mainline + 2012-04-12 Michael Meissner + + PR target/52775 + * gcc.target/powerpc/pr52775.c: New file. + +2012-04-12 Richard Guenther + + PR tree-optimization/52943 + * gcc.dg/torture/pr52943.c: New testcase. + +2012-04-09 Mike Stump + + * g++.dg/cpp0x/udlit-raw-op.C: Don't use CRLF endings. + * gcc.dg/tree-ssa/vrp59.c: Likewise. + * gcc.dg/tree-ssa/vrp60.c: Likewise. + * gnat.dg/aggr11.adb: Likewise. + * gnat.dg/aggr11_pkg.ads: Likewise. + * gnat.dg/aggr15.adb: Likewise. + * gnat.dg/aggr15.ads: Likewise. + * gnat.dg/aggr17.adb: Likewise. + * gnat.dg/aggr18.adb: Likewise. + * gnat.dg/array14.adb: Likewise. + * gnat.dg/array14.ads: Likewise. + * gnat.dg/array14_pkg.ads: Likewise. + * gnat.dg/array19.adb: Likewise. + * gnat.dg/array19.ads: Likewise. + * gnat.dg/discr27.adb: Likewise. + * gnat.dg/discr27.ads: Likewise. + * gnat.dg/discr35.adb: Likewise. + * gnat.dg/discr35.ads: Likewise. + * gnat.dg/discr6.adb: Likewise. + * gnat.dg/discr6_pkg.ads: Likewise. + * gnat.dg/import1.adb: Likewise. + * gnat.dg/import1.ads: Likewise. + * gnat.dg/loop_address2.adb: Likewise. + * gnat.dg/opt7.adb: Likewise. + * gnat.dg/opt7.ads: Likewise. + * gnat.dg/pointer_variable_bounds.adb: Likewise. + * gnat.dg/pointer_variable_bounds.ads: Likewise. + * gnat.dg/rep_clause2.adb: Likewise. + * gnat.dg/rep_clause2.ads: Likewise. + * gnat.dg/slice2.adb: Likewise. + * gnat.dg/slice2.ads: Likewise. + * gnat.dg/slice6.adb: Likewise. + * gnat.dg/slice6_pkg.ads: Likewise. + * gnat.dg/specs/unchecked_union2.ads: Likewise. + * gnat.dg/taft_type2.adb: Likewise. + * gnat.dg/taft_type2.ads: Likewise. + * gnat.dg/taft_type2_pkg.ads: Likewise. + * gnat.dg/volatile10.adb: Likewise. + * gnat.dg/volatile10_pkg.ads: Likewise. + + * gcc.dg/dll-8.c: Remove execute permissions. + * g++.dg/ext/dllexport5.C: Likewise. + +2012-04-09 Eric Botcazou + + * lib/target-supports.exp (check_effective_target_sparc_v9): New. + (check_effective_target_sync_long_long): Add SPARC case. + (check_effective_target_sync_long_long_runtime): Likewise. + (check_effective_target_sync_int_long): Adjust SPARC case. + (check_effective_target_sync_char_short): Likewise. + +2012-04-07 Thomas Koenig + + PR fortran/52893 + Backport from trunk + * gfortran.dg/function_optimize_11.f90: New test. + +2012-04-07 Thomas Koenig + + PR fortran/52668 + Backport from trunk + * gfortran.dg/use_only_6.f90: New test. + +2012-04-06 Mike Stump + + PR testsuite/50722 + * gcc.dg/pr49994-3.c: Use -w to squelch non-portable warnings. + +2012-04-05 Jason Merrill + + PR c++/52596 + * g++.dg/template/qualified-id5.C: New. + +2012-04-03 Jason Merrill + + PR c++/52796 + * g++.dg/cpp0x/variadic-value1.C: New. + +2012-04-03 Richard Guenther + + Backport from mainline + 2012-03-02 Richard Guenther + + PR tree-optimization/52406 + * gcc.dg/torture/pr52406.c: New testcase. + +2012-04-03 Richard Guenther + + Backport from mainline + 2012-03-15 Richard Guenther + + PR middle-end/52580 + * gfortran.dg/vect/pr52580.f: New testcase. + +2012-04-03 Richard Guenther + + Backport from mainline + 2012-03-06 Richard Guenther + + PR middle-end/52493 + * gcc.dg/torture/pr52493.c: New testcase. + + 2012-03-23 Richard Guenther + + PR tree-optimization/52678 + * gfortran.dg/pr52678.f: New testcase. + + 2012-03-26 Richard Guenther + + PR tree-optimization/52701 + * gfortran.dg/pr52701.f90: New testcase. + + 2012-03-30 Richard Guenther + + PR tree-optimization/52754 + * gcc.target/i386/pr52754.c: New testcase. + +2012-04-03 Jakub Jelinek + + PR tree-optimization/52835 + * gfortran.dg/pr52835.f90: New test. + +2012-03-31 Eric Botcazou + + * gnat.dg/controlled6.adb: New test. + * gnat.dg/controlled6_pkg.ads: New helper. + * gnat.dg/controlled6_pkg-iterators.ad[sb]: Likewise. + +2012-03-29 Meador Inge + + PR c++/52672 + * g++.dg/cpp0x/constexpr-52672.C: New testcase. + +2012-03-29 Paolo Carlini + + PR c++/52718 + * g++.dg/warn/Wzero-as-null-pointer-constant-5.C: New. + +2012-03-29 Jason Merrill + + PR c++/52685 + * g++.dg/template/inherit8.C: New. + +2012-03-29 Jakub Jelinek + + PR c++/52759 + * g++.dg/ext/weak4.C: New test. + +2012-03-29 Jason Merrill + + PR c++/52743 + * g++.dg/cpp0x/initlist-array3.C: New. + +2012-03-28 Jason Merrill + + PR c++/52746 + * g++.dg/overload/virtual2.C: New. + +2012-03-28 Martin Jambor + + Backported from mainline + 2012-03-27 Martin Jambor + + PR middle-end/52693 + * gcc.dg/torture/pr52693.c: New test. + +2012-03-28 Jakub Jelinek + + PR middle-end/52691 + * gcc.dg/pr52691.c: New test. + + PR middle-end/52750 + * gcc.c-torture/compile/pr52750.c: New test. + +2012-03-28 Georg-Johann Lay + + Backport from 2012-03-28 mainline r185910. + + PR target/52692 + * gcc.target/avr/torture/builtins-2.c: New test. + +2012-03-28 Jakub Jelinek + + PR target/52736 + * gcc.target/i386/pr52736.c: New test. + +2012-03-27 Richard Guenther + + PR middle-end/52720 + * gcc.dg/torture/pr52720.c: New testcase. + +2012-03-26 Georg-Johann Lay + + Backport from 2012-03-26 mainline r185793. + + * gcc.target/avr/torture/avr-torture.exp (AVR_TORTURE_OPTIONS): + Add "-Os -flto" to list. + +2012-03-25 Eric Botcazou + + * gnat.dg/concat2.ad[sb]: New test. + +2012-03-24 Steven Bosscher + + PR middle-end/52640 + * gcc.c-torture/compile/limits-externdecl.c: New test. + +2012-03-22 Paolo Carlini + + PR c++/52487 + * g++.dg/cpp0x/lambda/lambda-ice7.C: New. + +2012-03-22 Tobias Burnus + + PR fortran/52452 + * gfortran.dg/intrinsic_8.f90: New. + +2012-03-22 Jakub Jelinek + + PR c++/52671 + * g++.dg/ext/attrib44.C: New test. + +2012-03-22 Jason Merrill + + * g++.dg/torture/pr52582.C: New. + +2012-03-22 Georg-Johann Lay + + Backport from 2012-03-20 mainline r185583. + + * gcc.target/avr/progmem.h (pgm_read_char): Define depending on + __AVR_HAVE_LPMX__ + + Backport from 2012-03-20 mainline r185570. + + PR target/49868 + * gcc.target/avr/torture/addr-space-2.h: New file. + * gcc.target/avr/torture/addr-space-2-g.h: New test. + * gcc.target/avr/torture/addr-space-2-0.h: New test. + * gcc.target/avr/torture/addr-space-2-1.h: New test. + * gcc.target/avr/torture/addr-space-2-x.h: New test. + + Backport from 2012-03-12 mainline r185255. + + PR target/49868 + * gcc.target/avr/torture/addr-space-1.h: New file. + * gcc.target/avr/torture/addr-space-g.h: New test. + * gcc.target/avr/torture/addr-space-0.h: New test. + * gcc.target/avr/torture/addr-space-1.h: New test. + * gcc.target/avr/torture/addr-space-x.h: New test. + +2012-03-22 Jakub Jelinek + + Backported from mainline + 2012-03-14 Jakub Jelinek + + PR c++/52521 + * g++.dg/cpp0x/udlit-args2.C: New test. + + 2012-03-13 Jakub Jelinek + + PR c/52577 + * gcc.dg/Wunused-var-3.c: New test. + 2012-03-22 Release Manager * GCC 4.7.0 released. Index: gcc/testsuite/g++.dg/ext/weak4.C =================================================================== --- gcc/testsuite/g++.dg/ext/weak4.C (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/g++.dg/ext/weak4.C (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,9 @@ +// PR c++/52759 +// { dg-do compile } +// { dg-require-weak "" } +// { dg-options "" } +#pragma weak foo +template +struct A { }; +template +void bar (A &); Index: gcc/testsuite/g++.dg/ext/attrib44.C =================================================================== --- gcc/testsuite/g++.dg/ext/attrib44.C (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/g++.dg/ext/attrib44.C (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,4 @@ +// PR c++/52671 +// { dg-do compile } +__attribute__ ((deprecated)) enum E { E0 }; // { dg-warning "attribute ignored in declaration of" } +// { dg-message "must follow the" "" { target *-*-* } 3 } Index: gcc/testsuite/g++.dg/ext/attrib45.C =================================================================== --- gcc/testsuite/g++.dg/ext/attrib45.C (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/g++.dg/ext/attrib45.C (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,3 @@ +// PR c++/52906 + +__attribute__ ((__deprecated__)); // { dg-error "does not declare anything" } Index: gcc/testsuite/g++.dg/ext/dllexport5.C =================================================================== --- gcc/testsuite/g++.dg/ext/dllexport5.C (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/g++.dg/ext/dllexport5.C (.../branches/gcc-4_7-branch) (wersja 187906) Zmiany atrybutów dla: gcc/testsuite/g++.dg/ext/dllexport5.C ___________________________________________________________________ Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Index: gcc/testsuite/g++.dg/opt/vrp3-aux.cc =================================================================== --- gcc/testsuite/g++.dg/opt/vrp3-aux.cc (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/g++.dg/opt/vrp3-aux.cc (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,21 @@ +// { dg-do compile } +// { dg-options "" } + +#include "vrp3.h" + +R::R () +{ + r1 = r2 = 1; +} + +R::R (int n, int d) +{ + r1 = n; + r2 = d; +} + +int +R::compare (R const &r, R const &s) +{ + return (int) (r.r1 * s.r2 - s.r1 * r.r2); +} Index: gcc/testsuite/g++.dg/opt/pr52727.C =================================================================== --- gcc/testsuite/g++.dg/opt/pr52727.C (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/g++.dg/opt/pr52727.C (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,45 @@ +// { dg-do compile } +// { dg-options "-g -Os" } + +int grow (int); +void fn (int); +struct A { int a1, a2; }; +template +struct B +{ + A *b; + ~B () { b3 (b); } + void b1 (int); + void b2 (int); + void b3 (A *); +}; +struct C { int c1, c2, c3; bool c4; }; +int +bar (int x) +{ + int y = x / 6; + if (y > x / 2) + return y; + return 0; +} +void baz (double, double); +void +foo (const C *x, int y, int z) +{ + B p; + double r = y / 2; + int w = bar (int (r)); + double s = y / 2 + 0.5; + double t = z / 2 + 0.5; + int u = x->c3; + int v = (x->c2 + u - 1 - x->c1) / u; + p.b2 ((2 * v > p.b->a1 || (2 * v < p.b->a2 && 2 * v < (p.b->a1 >> 1))) + ? grow (0) : p.b->a1); + for (int i = 0; i <= v; ++i) + { + double l = x->c4 ? 4.5 - i * 6.2 / v : (3.1 - i * 31 / v) / 6; + baz (s + (r - w) * l, t - (r - w) * l); + } +} + + Index: gcc/testsuite/g++.dg/opt/vrp3.C =================================================================== --- gcc/testsuite/g++.dg/opt/vrp3.C (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/g++.dg/opt/vrp3.C (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,47 @@ +// PR tree-optimization/53239 +// { dg-do run } +// { dg-options "-O2" } +// { dg-additional-sources "vrp3-aux.cc" } + +#include "vrp3.h" + +struct M +{ + M (R m); + R val; + static int compare (M const &, M const &); +}; + +inline M const & +min (M const & t1, M const & t2) +{ + return R::compare (t1.val, t2.val) < 0 ? t1 : t2; +} + +M::M (R m) +{ + val = m; +} + +M +test (M *x) +{ + M n (R (0, 0)); + + for (int i = 0; i < 2; i++) + { + M p = x[i]; + n = min (n, p); + } + + if (n.val.r2 != 2 || n.val.r1 != 1) + __builtin_abort (); + return n; +} + +int +main () +{ + M x[2] = { M (R (1, 2)), M (R (1, 1)) }; + test (x); +} Index: gcc/testsuite/g++.dg/opt/vrp3.h =================================================================== --- gcc/testsuite/g++.dg/opt/vrp3.h (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/g++.dg/opt/vrp3.h (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,9 @@ +struct R +{ + long long r1, r2; + void copy (R const &r) { r1 = r.r1; r2 = r.r2; } + R (); + explicit R (int, int); + R (R const &r) { copy (r); } + static int compare (R const &, R const &); +}; Index: gcc/testsuite/g++.dg/tree-prof/pr53460.C =================================================================== --- gcc/testsuite/g++.dg/tree-prof/pr53460.C (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/g++.dg/tree-prof/pr53460.C (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,25 @@ +// { dg-options "-O" } + +template class OwnPtr { +public: + ~OwnPtr(); +}; +template class GlyphMetricsMap { +public: + GlyphMetricsMap() { } + OwnPtr m_pages; +}; +class SimpleFontData { +public: + void boundsForGlyph() const; +}; +inline __attribute__((__always_inline__)) +void SimpleFontData::boundsForGlyph() const +{ + new GlyphMetricsMap; +} +void offsetToMiddleOfGlyph(const SimpleFontData* fontData) +{ + fontData->boundsForGlyph(); +} +int main() {} Index: gcc/testsuite/g++.dg/lookup/using52.C =================================================================== --- gcc/testsuite/g++.dg/lookup/using52.C (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/g++.dg/lookup/using52.C (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,16 @@ +// { dg-do compile } +// PR c++/52645 + +class A +{ +protected: + struct B {}; +}; + +class C : A +{ +protected: + using A::B; + + struct D : public B {}; +}; Index: gcc/testsuite/g++.dg/other/final2.C =================================================================== --- gcc/testsuite/g++.dg/other/final2.C (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/g++.dg/other/final2.C (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,27 @@ +// PR c++/53186 +// { dg-options "-fdump-tree-original -std=c++11" } + +struct F1 +{ + virtual void operator()() final; + virtual operator int() final; + virtual int operator++() final; +}; + +struct F2 final +{ + virtual void operator()(); + virtual operator int(); + virtual int operator++(); +}; + +void fooF1(F1& a) { a(); int m = a; ++a; } +void fooF2(F2& a) { a(); int m = a; ++a; } + +// { dg-final { scan-tree-dump-times "F1::operator\\(\\)" 1 "original" } } +// { dg-final { scan-tree-dump-times "F1::operator int" 1 "original" } } +// { dg-final { scan-tree-dump-times "F1::operator\\+\\+" 1 "original" } } +// { dg-final { scan-tree-dump-times "F2::operator\\(\\)" 1 "original" } } +// { dg-final { scan-tree-dump-times "F2::operator int" 1 "original" } } +// { dg-final { scan-tree-dump-times "F2::operator\\+\\+" 1 "original" } } +// { dg-final { cleanup-tree-dump "original" } } Index: gcc/testsuite/g++.dg/lto/pr52605_0.C =================================================================== --- gcc/testsuite/g++.dg/lto/pr52605_0.C (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/g++.dg/lto/pr52605_0.C (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,39 @@ +// { dg-lto-do link } +// { dg-lto-options {{-flto -g}} } + +extern "C" void abort (void); + +class A +{ +public: + virtual int foo (int i); +}; + +int A::foo (int i) +{ + return i + 1; +} + +int __attribute__ ((noinline,noclone)) get_input(void) +{ + return 1; +} + +int main (int argc, char *argv[]) +{ + + class B : public A + { + public: + int bar (int i) + { + return foo (i) + 2; + } + }; + class B b; + + if (b.bar (get_input ()) != 4) + abort (); + return 0; +} + Index: gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-5.C =================================================================== --- gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-5.C (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-5.C (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,20 @@ +// PR c++/52718 +// { dg-options "-Wzero-as-null-pointer-constant" } + +struct foo +{ + foo(void* a = 0) {}; // { dg-warning "zero as null pointer" } +}; + +void* fun(void* a = 0) {}; // { dg-warning "zero as null pointer" } + +struct bar: foo +{ + bar() {}; +}; + +struct baz +{ + baz(const foo& f1 = foo(), + void* f2 = fun()) {}; +}; Index: gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-6.C =================================================================== --- gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-6.C (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/g++.dg/warn/Wzero-as-null-pointer-constant-6.C (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,6 @@ +// PR c++/53301 +// { dg-options "-Wzero-as-null-pointer-constant" } + +class x { public: x(int v) {} }; + +void foo(const x& = 0); Index: gcc/testsuite/g++.dg/parse/crash59.C =================================================================== --- gcc/testsuite/g++.dg/parse/crash59.C (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/g++.dg/parse/crash59.C (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,3 @@ +// PR c++/53003 + +struct A{ void a{} return b // { dg-error "function definition|expected" } Index: gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice7.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice7.C (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice7.C (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,9 @@ +// PR c++/52487 +// { dg-options "-std=c++0x" } + +struct A; // { dg-error "forward declaration" } + +void foo(A& a) +{ + [=](){a;}; // { dg-error "invalid use of incomplete type" } +} Index: gcc/testsuite/g++.dg/cpp0x/alias-decl-15.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/alias-decl-15.C (.../tags/gcc_4_7_0_release) (wersja 187906) +++ gcc/testsuite/g++.dg/cpp0x/alias-decl-15.C (.../branches/gcc-4_7-branch) (wersja 187906) @@ -2,7 +2,7 @@ // { dg-options "-std=c++0x" } template //#1 -struct foo {}; // { dg-error "provided for|foo" } +struct foo {}; template struct P {}; @@ -10,8 +10,8 @@ template class... TT> struct bar { template - using mem = P...>;//#2 { dg-error "wrong number of|arguments" } + using mem = P...>;//#2 }; -bar::mem b;//#3 { dg-error "invalid type" } +bar::mem b;//#3 Index: gcc/testsuite/g++.dg/cpp0x/variadic131.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/variadic131.C (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/g++.dg/cpp0x/variadic131.C (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,11 @@ +// PR c++/38543 +// { dg-do compile { target c++11 } } + +template< typename ... T > void foo( T ... args ); +template<> void foo( ){} +template<> void foo(int,double){} +int main() +{ + foo( 0, 0.0 ); + return 55; +} Index: gcc/testsuite/g++.dg/cpp0x/constexpr-52672.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/constexpr-52672.C (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/g++.dg/cpp0x/constexpr-52672.C (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,8 @@ +// PR c++/52672 +// { dg-do compile } +// { dg-options "-std=c++11" } + +typedef unsigned long * ul_ptr; +constexpr unsigned long a = *((ul_ptr)0x0); // { dg-error "" } +constexpr unsigned long b = *((ul_ptr)(*((ul_ptr)0x0))); // { dg-error "" } +constexpr unsigned long c = *((ul_ptr)*((ul_ptr)(*((ul_ptr)0x0)))); // { dg-error "" } Index: gcc/testsuite/g++.dg/cpp0x/variadic123.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/variadic123.C (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/g++.dg/cpp0x/variadic123.C (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,14 @@ +// PR c++/52824 +// { dg-do compile { target c++11 } } + +template +struct foo +{}; + +template +struct bar : foo +{}; + +int main() { + bar f; +} Index: gcc/testsuite/g++.dg/cpp0x/variadic124.C =================================================================== --- gcc/testsuite/g++.dg/cpp0x/variadic124.C (.../tags/gcc_4_7_0_release) (wersja 0) +++ gcc/testsuite/g++.dg/cpp0x/variadic124.C (.../branches/gcc-4_7-branch) (wersja 187906) @@ -0,0 +1,29 @@ +// PR c++/52292 +// { dg-options -std=c++11 } + +template