diff options
author | Martin Liska <mliska@suse.cz> | 2022-08-18 15:35:14 +0200 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2022-08-18 15:35:14 +0200 |
commit | c4cf402822be5b52516a727e6b2abc923d1a9d52 (patch) | |
tree | d97b4c3407d27282cc3bcfda5a0052d37a325580 | |
parent | 87e8197e4012801477e3743601d6d6ead64e851c (diff) | |
parent | 03119249b9cfedb48e910b8df6a832b206cced2b (diff) | |
download | gcc-c4cf402822be5b52516a727e6b2abc923d1a9d52.zip gcc-c4cf402822be5b52516a727e6b2abc923d1a9d52.tar.gz gcc-c4cf402822be5b52516a727e6b2abc923d1a9d52.tar.bz2 |
Merge branch 'master' into devel/sphinx
116 files changed, 3298 insertions, 1949 deletions
diff --git a/Makefile.def b/Makefile.def index 11e9f23..3291b12 100644 --- a/Makefile.def +++ b/Makefile.def @@ -70,9 +70,6 @@ host_modules= { module= isl; lib_path=.libs; bootstrap=true; extra_configure_flags='--disable-shared @extra_isl_gmp_configure_flags@'; extra_make_flags='V=1'; no_install= true; }; -host_modules= { module= libelf; lib_path=.libs; bootstrap=true; - extra_configure_flags='--disable-shared'; - no_install= true; }; host_modules= { module= gold; bootstrap=true; }; host_modules= { module= gprof; }; host_modules= { module= intl; bootstrap=true; }; @@ -353,7 +350,6 @@ dependencies = { module=configure-gcc; on=all-binutils; }; dependencies = { module=configure-gcc; on=all-gas; }; dependencies = { module=configure-gcc; on=all-ld; }; dependencies = { module=configure-gcc; on=all-gold; }; -dependencies = { module=configure-gcc; on=all-libelf; }; dependencies = { module=configure-gcc; on=all-libiconv; }; dependencies = { module=all-gcc; on=all-libiberty; hard=true; }; dependencies = { module=all-gcc; on=all-intl; }; diff --git a/Makefile.in b/Makefile.in index 13ee95a..1919dfe 100644 --- a/Makefile.in +++ b/Makefile.in @@ -236,8 +236,6 @@ HOST_EXPORTS = \ GMPINC="$(HOST_GMPINC)"; export GMPINC; \ ISLLIBS="$(HOST_ISLLIBS)"; export ISLLIBS; \ ISLINC="$(HOST_ISLINC)"; export ISLINC; \ - LIBELFLIBS="$(HOST_LIBELFLIBS)"; export LIBELFLIBS; \ - LIBELFINC="$(HOST_LIBELFINC)"; export LIBELFINC; \ XGCC_FLAGS_FOR_TARGET="$(XGCC_FLAGS_FOR_TARGET)"; export XGCC_FLAGS_FOR_TARGET; \ @if gcc-bootstrap $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ @@ -343,10 +341,6 @@ HOST_GMPINC = @gmpinc@ HOST_ISLLIBS = @isllibs@ HOST_ISLINC = @islinc@ -# Where to find libelf -HOST_LIBELFLIBS = @libelflibs@ -HOST_LIBELFINC = @libelfinc@ - # ---------------------------------------------- # Programs producing files for the BUILD machine # ---------------------------------------------- @@ -754,7 +748,7 @@ TARGET_LIB_PATH_libatomic = $$r/$(TARGET_SUBDIR)/libatomic/.libs: # This is the list of directories that may be needed in RPATH_ENVVAR # so that programs built for the host machine work. -HOST_LIB_PATH = $(HOST_LIB_PATH_gmp)$(HOST_LIB_PATH_mpfr)$(HOST_LIB_PATH_mpc)$(HOST_LIB_PATH_isl)$(HOST_LIB_PATH_libelf) +HOST_LIB_PATH = $(HOST_LIB_PATH_gmp)$(HOST_LIB_PATH_mpfr)$(HOST_LIB_PATH_mpc)$(HOST_LIB_PATH_isl) # Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch @if gcc @@ -782,11 +776,6 @@ HOST_LIB_PATH_isl = \ $$r/$(HOST_SUBDIR)/isl/.libs:$$r/$(HOST_SUBDIR)/prev-isl/.libs: @endif isl -@if libelf -HOST_LIB_PATH_libelf = \ - $$r/$(HOST_SUBDIR)/libelf/.libs:$$r/$(HOST_SUBDIR)/prev-libelf/.libs: -@endif libelf - CXX_FOR_TARGET_FLAG_TO_PASS = \ "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" @@ -1078,7 +1067,6 @@ configure-host: \ maybe-configure-mpfr \ maybe-configure-mpc \ maybe-configure-isl \ - maybe-configure-libelf \ maybe-configure-gold \ maybe-configure-gprof \ maybe-configure-intl \ @@ -1229,9 +1217,6 @@ all-host: maybe-all-mpc @if isl-no-bootstrap all-host: maybe-all-isl @endif isl-no-bootstrap -@if libelf-no-bootstrap -all-host: maybe-all-libelf -@endif libelf-no-bootstrap @if gold-no-bootstrap all-host: maybe-all-gold @endif gold-no-bootstrap @@ -1370,7 +1355,6 @@ info-host: maybe-info-gmp info-host: maybe-info-mpfr info-host: maybe-info-mpc info-host: maybe-info-isl -info-host: maybe-info-libelf info-host: maybe-info-gold info-host: maybe-info-gprof info-host: maybe-info-intl @@ -1460,7 +1444,6 @@ dvi-host: maybe-dvi-gmp dvi-host: maybe-dvi-mpfr dvi-host: maybe-dvi-mpc dvi-host: maybe-dvi-isl -dvi-host: maybe-dvi-libelf dvi-host: maybe-dvi-gold dvi-host: maybe-dvi-gprof dvi-host: maybe-dvi-intl @@ -1550,7 +1533,6 @@ pdf-host: maybe-pdf-gmp pdf-host: maybe-pdf-mpfr pdf-host: maybe-pdf-mpc pdf-host: maybe-pdf-isl -pdf-host: maybe-pdf-libelf pdf-host: maybe-pdf-gold pdf-host: maybe-pdf-gprof pdf-host: maybe-pdf-intl @@ -1640,7 +1622,6 @@ html-host: maybe-html-gmp html-host: maybe-html-mpfr html-host: maybe-html-mpc html-host: maybe-html-isl -html-host: maybe-html-libelf html-host: maybe-html-gold html-host: maybe-html-gprof html-host: maybe-html-intl @@ -1730,7 +1711,6 @@ TAGS-host: maybe-TAGS-gmp TAGS-host: maybe-TAGS-mpfr TAGS-host: maybe-TAGS-mpc TAGS-host: maybe-TAGS-isl -TAGS-host: maybe-TAGS-libelf TAGS-host: maybe-TAGS-gold TAGS-host: maybe-TAGS-gprof TAGS-host: maybe-TAGS-intl @@ -1820,7 +1800,6 @@ install-info-host: maybe-install-info-gmp install-info-host: maybe-install-info-mpfr install-info-host: maybe-install-info-mpc install-info-host: maybe-install-info-isl -install-info-host: maybe-install-info-libelf install-info-host: maybe-install-info-gold install-info-host: maybe-install-info-gprof install-info-host: maybe-install-info-intl @@ -1910,7 +1889,6 @@ install-dvi-host: maybe-install-dvi-gmp install-dvi-host: maybe-install-dvi-mpfr install-dvi-host: maybe-install-dvi-mpc install-dvi-host: maybe-install-dvi-isl -install-dvi-host: maybe-install-dvi-libelf install-dvi-host: maybe-install-dvi-gold install-dvi-host: maybe-install-dvi-gprof install-dvi-host: maybe-install-dvi-intl @@ -2000,7 +1978,6 @@ install-pdf-host: maybe-install-pdf-gmp install-pdf-host: maybe-install-pdf-mpfr install-pdf-host: maybe-install-pdf-mpc install-pdf-host: maybe-install-pdf-isl -install-pdf-host: maybe-install-pdf-libelf install-pdf-host: maybe-install-pdf-gold install-pdf-host: maybe-install-pdf-gprof install-pdf-host: maybe-install-pdf-intl @@ -2090,7 +2067,6 @@ install-html-host: maybe-install-html-gmp install-html-host: maybe-install-html-mpfr install-html-host: maybe-install-html-mpc install-html-host: maybe-install-html-isl -install-html-host: maybe-install-html-libelf install-html-host: maybe-install-html-gold install-html-host: maybe-install-html-gprof install-html-host: maybe-install-html-intl @@ -2180,7 +2156,6 @@ installcheck-host: maybe-installcheck-gmp installcheck-host: maybe-installcheck-mpfr installcheck-host: maybe-installcheck-mpc installcheck-host: maybe-installcheck-isl -installcheck-host: maybe-installcheck-libelf installcheck-host: maybe-installcheck-gold installcheck-host: maybe-installcheck-gprof installcheck-host: maybe-installcheck-intl @@ -2270,7 +2245,6 @@ mostlyclean-host: maybe-mostlyclean-gmp mostlyclean-host: maybe-mostlyclean-mpfr mostlyclean-host: maybe-mostlyclean-mpc mostlyclean-host: maybe-mostlyclean-isl -mostlyclean-host: maybe-mostlyclean-libelf mostlyclean-host: maybe-mostlyclean-gold mostlyclean-host: maybe-mostlyclean-gprof mostlyclean-host: maybe-mostlyclean-intl @@ -2360,7 +2334,6 @@ clean-host: maybe-clean-gmp clean-host: maybe-clean-mpfr clean-host: maybe-clean-mpc clean-host: maybe-clean-isl -clean-host: maybe-clean-libelf clean-host: maybe-clean-gold clean-host: maybe-clean-gprof clean-host: maybe-clean-intl @@ -2450,7 +2423,6 @@ distclean-host: maybe-distclean-gmp distclean-host: maybe-distclean-mpfr distclean-host: maybe-distclean-mpc distclean-host: maybe-distclean-isl -distclean-host: maybe-distclean-libelf distclean-host: maybe-distclean-gold distclean-host: maybe-distclean-gprof distclean-host: maybe-distclean-intl @@ -2540,7 +2512,6 @@ maintainer-clean-host: maybe-maintainer-clean-gmp maintainer-clean-host: maybe-maintainer-clean-mpfr maintainer-clean-host: maybe-maintainer-clean-mpc maintainer-clean-host: maybe-maintainer-clean-isl -maintainer-clean-host: maybe-maintainer-clean-libelf maintainer-clean-host: maybe-maintainer-clean-gold maintainer-clean-host: maybe-maintainer-clean-gprof maintainer-clean-host: maybe-maintainer-clean-intl @@ -2688,7 +2659,6 @@ check-host: \ maybe-check-mpfr \ maybe-check-mpc \ maybe-check-isl \ - maybe-check-libelf \ maybe-check-gold \ maybe-check-gprof \ maybe-check-intl \ @@ -2825,7 +2795,6 @@ install-host-nogcc: \ maybe-install-mpfr \ maybe-install-mpc \ maybe-install-isl \ - maybe-install-libelf \ maybe-install-gold \ maybe-install-gprof \ maybe-install-intl \ @@ -2880,7 +2849,6 @@ install-host: \ maybe-install-mpfr \ maybe-install-mpc \ maybe-install-isl \ - maybe-install-libelf \ maybe-install-gold \ maybe-install-gprof \ maybe-install-intl \ @@ -2990,7 +2958,6 @@ install-strip-host: \ maybe-install-strip-mpfr \ maybe-install-strip-mpc \ maybe-install-strip-isl \ - maybe-install-strip-libelf \ maybe-install-strip-gold \ maybe-install-strip-gprof \ maybe-install-strip-intl \ @@ -17675,1143 +17642,6 @@ maintainer-clean-isl: -.PHONY: configure-libelf maybe-configure-libelf -maybe-configure-libelf: -@if gcc-bootstrap -configure-libelf: stage_current -@endif gcc-bootstrap -@if libelf -maybe-configure-libelf: configure-libelf -configure-libelf: - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - test ! -f $(HOST_SUBDIR)/libelf/Makefile || exit 0; \ - $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf; \ - $(HOST_EXPORTS) \ - echo Configuring in $(HOST_SUBDIR)/libelf; \ - cd "$(HOST_SUBDIR)/libelf" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libelf/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - module_srcdir=libelf; \ - $(SHELL) \ - $$s/$$module_srcdir/configure \ - --srcdir=$${topdir}/$$module_srcdir \ - $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ - --target=${target_alias} --disable-shared \ - || exit 1 -@endif libelf - - - -.PHONY: configure-stage1-libelf maybe-configure-stage1-libelf -maybe-configure-stage1-libelf: -@if libelf-bootstrap -maybe-configure-stage1-libelf: configure-stage1-libelf -configure-stage1-libelf: - @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start - @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - TFLAGS="$(STAGE1_TFLAGS)"; \ - test ! -f $(HOST_SUBDIR)/libelf/Makefile || exit 0; \ - $(HOST_EXPORTS) \ - CFLAGS="$(STAGE1_CFLAGS)"; export CFLAGS; \ - CXXFLAGS="$(STAGE1_CXXFLAGS)"; export CXXFLAGS; \ - LIBCFLAGS="$(LIBCFLAGS)"; export LIBCFLAGS; \ - echo Configuring stage 1 in $(HOST_SUBDIR)/libelf; \ - $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf; \ - cd $(HOST_SUBDIR)/libelf || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libelf/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - module_srcdir=libelf; \ - $(SHELL) $$s/$$module_srcdir/configure \ - --srcdir=$${topdir}/$$module_srcdir \ - $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ - --target=${target_alias} \ - \ - $(STAGE1_CONFIGURE_FLAGS) \ - --disable-shared -@endif libelf-bootstrap - -.PHONY: configure-stage2-libelf maybe-configure-stage2-libelf -maybe-configure-stage2-libelf: -@if libelf-bootstrap -maybe-configure-stage2-libelf: configure-stage2-libelf -configure-stage2-libelf: - @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start - @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - TFLAGS="$(STAGE2_TFLAGS)"; \ - test ! -f $(HOST_SUBDIR)/libelf/Makefile || exit 0; \ - $(HOST_EXPORTS) \ - $(POSTSTAGE1_HOST_EXPORTS) \ - CFLAGS="$(STAGE2_CFLAGS)"; export CFLAGS; \ - CXXFLAGS="$(STAGE2_CXXFLAGS)"; export CXXFLAGS; \ - LIBCFLAGS="$(STAGE2_CFLAGS)"; export LIBCFLAGS; \ - echo Configuring stage 2 in $(HOST_SUBDIR)/libelf; \ - $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf; \ - cd $(HOST_SUBDIR)/libelf || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libelf/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - module_srcdir=libelf; \ - $(SHELL) $$s/$$module_srcdir/configure \ - --srcdir=$${topdir}/$$module_srcdir \ - $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ - --target=${target_alias} \ - --with-build-libsubdir=$(HOST_SUBDIR) \ - $(STAGE2_CONFIGURE_FLAGS) \ - --disable-shared -@endif libelf-bootstrap - -.PHONY: configure-stage3-libelf maybe-configure-stage3-libelf -maybe-configure-stage3-libelf: -@if libelf-bootstrap -maybe-configure-stage3-libelf: configure-stage3-libelf -configure-stage3-libelf: - @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start - @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - TFLAGS="$(STAGE3_TFLAGS)"; \ - test ! -f $(HOST_SUBDIR)/libelf/Makefile || exit 0; \ - $(HOST_EXPORTS) \ - $(POSTSTAGE1_HOST_EXPORTS) \ - CFLAGS="$(STAGE3_CFLAGS)"; export CFLAGS; \ - CXXFLAGS="$(STAGE3_CXXFLAGS)"; export CXXFLAGS; \ - LIBCFLAGS="$(STAGE3_CFLAGS)"; export LIBCFLAGS; \ - echo Configuring stage 3 in $(HOST_SUBDIR)/libelf; \ - $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf; \ - cd $(HOST_SUBDIR)/libelf || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libelf/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - module_srcdir=libelf; \ - $(SHELL) $$s/$$module_srcdir/configure \ - --srcdir=$${topdir}/$$module_srcdir \ - $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ - --target=${target_alias} \ - --with-build-libsubdir=$(HOST_SUBDIR) \ - $(STAGE3_CONFIGURE_FLAGS) \ - --disable-shared -@endif libelf-bootstrap - -.PHONY: configure-stage4-libelf maybe-configure-stage4-libelf -maybe-configure-stage4-libelf: -@if libelf-bootstrap -maybe-configure-stage4-libelf: configure-stage4-libelf -configure-stage4-libelf: - @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start - @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - TFLAGS="$(STAGE4_TFLAGS)"; \ - test ! -f $(HOST_SUBDIR)/libelf/Makefile || exit 0; \ - $(HOST_EXPORTS) \ - $(POSTSTAGE1_HOST_EXPORTS) \ - CFLAGS="$(STAGE4_CFLAGS)"; export CFLAGS; \ - CXXFLAGS="$(STAGE4_CXXFLAGS)"; export CXXFLAGS; \ - LIBCFLAGS="$(STAGE4_CFLAGS)"; export LIBCFLAGS; \ - echo Configuring stage 4 in $(HOST_SUBDIR)/libelf; \ - $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf; \ - cd $(HOST_SUBDIR)/libelf || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libelf/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - module_srcdir=libelf; \ - $(SHELL) $$s/$$module_srcdir/configure \ - --srcdir=$${topdir}/$$module_srcdir \ - $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ - --target=${target_alias} \ - --with-build-libsubdir=$(HOST_SUBDIR) \ - $(STAGE4_CONFIGURE_FLAGS) \ - --disable-shared -@endif libelf-bootstrap - -.PHONY: configure-stageprofile-libelf maybe-configure-stageprofile-libelf -maybe-configure-stageprofile-libelf: -@if libelf-bootstrap -maybe-configure-stageprofile-libelf: configure-stageprofile-libelf -configure-stageprofile-libelf: - @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start - @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - TFLAGS="$(STAGEprofile_TFLAGS)"; \ - test ! -f $(HOST_SUBDIR)/libelf/Makefile || exit 0; \ - $(HOST_EXPORTS) \ - $(POSTSTAGE1_HOST_EXPORTS) \ - CFLAGS="$(STAGEprofile_CFLAGS)"; export CFLAGS; \ - CXXFLAGS="$(STAGEprofile_CXXFLAGS)"; export CXXFLAGS; \ - LIBCFLAGS="$(STAGEprofile_CFLAGS)"; export LIBCFLAGS; \ - echo Configuring stage profile in $(HOST_SUBDIR)/libelf; \ - $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf; \ - cd $(HOST_SUBDIR)/libelf || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libelf/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - module_srcdir=libelf; \ - $(SHELL) $$s/$$module_srcdir/configure \ - --srcdir=$${topdir}/$$module_srcdir \ - $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ - --target=${target_alias} \ - --with-build-libsubdir=$(HOST_SUBDIR) \ - $(STAGEprofile_CONFIGURE_FLAGS) \ - --disable-shared -@endif libelf-bootstrap - -.PHONY: configure-stagetrain-libelf maybe-configure-stagetrain-libelf -maybe-configure-stagetrain-libelf: -@if libelf-bootstrap -maybe-configure-stagetrain-libelf: configure-stagetrain-libelf -configure-stagetrain-libelf: - @[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start - @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - TFLAGS="$(STAGEtrain_TFLAGS)"; \ - test ! -f $(HOST_SUBDIR)/libelf/Makefile || exit 0; \ - $(HOST_EXPORTS) \ - $(POSTSTAGE1_HOST_EXPORTS) \ - CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \ - CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \ - LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS; \ - echo Configuring stage train in $(HOST_SUBDIR)/libelf; \ - $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf; \ - cd $(HOST_SUBDIR)/libelf || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libelf/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - module_srcdir=libelf; \ - $(SHELL) $$s/$$module_srcdir/configure \ - --srcdir=$${topdir}/$$module_srcdir \ - $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ - --target=${target_alias} \ - --with-build-libsubdir=$(HOST_SUBDIR) \ - $(STAGEtrain_CONFIGURE_FLAGS) \ - --disable-shared -@endif libelf-bootstrap - -.PHONY: configure-stagefeedback-libelf maybe-configure-stagefeedback-libelf -maybe-configure-stagefeedback-libelf: -@if libelf-bootstrap -maybe-configure-stagefeedback-libelf: configure-stagefeedback-libelf -configure-stagefeedback-libelf: - @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start - @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - TFLAGS="$(STAGEfeedback_TFLAGS)"; \ - test ! -f $(HOST_SUBDIR)/libelf/Makefile || exit 0; \ - $(HOST_EXPORTS) \ - $(POSTSTAGE1_HOST_EXPORTS) \ - CFLAGS="$(STAGEfeedback_CFLAGS)"; export CFLAGS; \ - CXXFLAGS="$(STAGEfeedback_CXXFLAGS)"; export CXXFLAGS; \ - LIBCFLAGS="$(STAGEfeedback_CFLAGS)"; export LIBCFLAGS; \ - echo Configuring stage feedback in $(HOST_SUBDIR)/libelf; \ - $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf; \ - cd $(HOST_SUBDIR)/libelf || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libelf/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - module_srcdir=libelf; \ - $(SHELL) $$s/$$module_srcdir/configure \ - --srcdir=$${topdir}/$$module_srcdir \ - $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ - --target=${target_alias} \ - --with-build-libsubdir=$(HOST_SUBDIR) \ - $(STAGEfeedback_CONFIGURE_FLAGS) \ - --disable-shared -@endif libelf-bootstrap - -.PHONY: configure-stageautoprofile-libelf maybe-configure-stageautoprofile-libelf -maybe-configure-stageautoprofile-libelf: -@if libelf-bootstrap -maybe-configure-stageautoprofile-libelf: configure-stageautoprofile-libelf -configure-stageautoprofile-libelf: - @[ $(current_stage) = stageautoprofile ] || $(MAKE) stageautoprofile-start - @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - TFLAGS="$(STAGEautoprofile_TFLAGS)"; \ - test ! -f $(HOST_SUBDIR)/libelf/Makefile || exit 0; \ - $(HOST_EXPORTS) \ - $(POSTSTAGE1_HOST_EXPORTS) \ - CFLAGS="$(STAGEautoprofile_CFLAGS)"; export CFLAGS; \ - CXXFLAGS="$(STAGEautoprofile_CXXFLAGS)"; export CXXFLAGS; \ - LIBCFLAGS="$(STAGEautoprofile_CFLAGS)"; export LIBCFLAGS; \ - echo Configuring stage autoprofile in $(HOST_SUBDIR)/libelf; \ - $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf; \ - cd $(HOST_SUBDIR)/libelf || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libelf/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - module_srcdir=libelf; \ - $(SHELL) $$s/$$module_srcdir/configure \ - --srcdir=$${topdir}/$$module_srcdir \ - $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ - --target=${target_alias} \ - --with-build-libsubdir=$(HOST_SUBDIR) \ - $(STAGEautoprofile_CONFIGURE_FLAGS) \ - --disable-shared -@endif libelf-bootstrap - -.PHONY: configure-stageautofeedback-libelf maybe-configure-stageautofeedback-libelf -maybe-configure-stageautofeedback-libelf: -@if libelf-bootstrap -maybe-configure-stageautofeedback-libelf: configure-stageautofeedback-libelf -configure-stageautofeedback-libelf: - @[ $(current_stage) = stageautofeedback ] || $(MAKE) stageautofeedback-start - @$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - TFLAGS="$(STAGEautofeedback_TFLAGS)"; \ - test ! -f $(HOST_SUBDIR)/libelf/Makefile || exit 0; \ - $(HOST_EXPORTS) \ - $(POSTSTAGE1_HOST_EXPORTS) \ - CFLAGS="$(STAGEautofeedback_CFLAGS)"; export CFLAGS; \ - CXXFLAGS="$(STAGEautofeedback_CXXFLAGS)"; export CXXFLAGS; \ - LIBCFLAGS="$(STAGEautofeedback_CFLAGS)"; export LIBCFLAGS; \ - echo Configuring stage autofeedback in $(HOST_SUBDIR)/libelf; \ - $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf; \ - cd $(HOST_SUBDIR)/libelf || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libelf/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - module_srcdir=libelf; \ - $(SHELL) $$s/$$module_srcdir/configure \ - --srcdir=$${topdir}/$$module_srcdir \ - $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \ - --target=${target_alias} \ - --with-build-libsubdir=$(HOST_SUBDIR) \ - $(STAGEautofeedback_CONFIGURE_FLAGS) \ - --disable-shared -@endif libelf-bootstrap - - - - - -.PHONY: all-libelf maybe-all-libelf -maybe-all-libelf: -@if gcc-bootstrap -all-libelf: stage_current -@endif gcc-bootstrap -@if libelf -TARGET-libelf=all -maybe-all-libelf: all-libelf -all-libelf: configure-libelf - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - (cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(STAGE1_FLAGS_TO_PASS) \ - $(TARGET-libelf)) -@endif libelf - - - -.PHONY: all-stage1-libelf maybe-all-stage1-libelf -.PHONY: clean-stage1-libelf maybe-clean-stage1-libelf -maybe-all-stage1-libelf: -maybe-clean-stage1-libelf: -@if libelf-bootstrap -maybe-all-stage1-libelf: all-stage1-libelf -all-stage1: all-stage1-libelf -TARGET-stage1-libelf = $(TARGET-libelf) -all-stage1-libelf: configure-stage1-libelf - @[ $(current_stage) = stage1 ] || $(MAKE) stage1-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - TFLAGS="$(STAGE1_TFLAGS)"; \ - $(HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libelf && \ - \ - $(MAKE) $(BASE_FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" \ - GENERATOR_CFLAGS="$(STAGE1_GENERATOR_CFLAGS)" \ - CXXFLAGS="$(STAGE1_CXXFLAGS)" \ - LIBCFLAGS="$(LIBCFLAGS)" \ - CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ - CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ - LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ - $(EXTRA_HOST_FLAGS) \ - $(STAGE1_FLAGS_TO_PASS) \ - TFLAGS="$(STAGE1_TFLAGS)" \ - $(TARGET-stage1-libelf) - -maybe-clean-stage1-libelf: clean-stage1-libelf -clean-stage1: clean-stage1-libelf -clean-stage1-libelf: - @if [ $(current_stage) = stage1 ]; then \ - [ -f $(HOST_SUBDIR)/libelf/Makefile ] || exit 0; \ - else \ - [ -f $(HOST_SUBDIR)/stage1-libelf/Makefile ] || exit 0; \ - $(MAKE) stage1-start; \ - fi; \ - cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(EXTRA_HOST_FLAGS) \ - $(STAGE1_FLAGS_TO_PASS) clean -@endif libelf-bootstrap - - -.PHONY: all-stage2-libelf maybe-all-stage2-libelf -.PHONY: clean-stage2-libelf maybe-clean-stage2-libelf -maybe-all-stage2-libelf: -maybe-clean-stage2-libelf: -@if libelf-bootstrap -maybe-all-stage2-libelf: all-stage2-libelf -all-stage2: all-stage2-libelf -TARGET-stage2-libelf = $(TARGET-libelf) -all-stage2-libelf: configure-stage2-libelf - @[ $(current_stage) = stage2 ] || $(MAKE) stage2-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - TFLAGS="$(STAGE2_TFLAGS)"; \ - $(HOST_EXPORTS) \ - $(POSTSTAGE1_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libelf && \ - \ - $(MAKE) $(BASE_FLAGS_TO_PASS) \ - CFLAGS="$(STAGE2_CFLAGS)" \ - GENERATOR_CFLAGS="$(STAGE2_GENERATOR_CFLAGS)" \ - CXXFLAGS="$(STAGE2_CXXFLAGS)" \ - LIBCFLAGS="$(STAGE2_CFLAGS)" \ - CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ - CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ - LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ - $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ - TFLAGS="$(STAGE2_TFLAGS)" \ - $(TARGET-stage2-libelf) - -maybe-clean-stage2-libelf: clean-stage2-libelf -clean-stage2: clean-stage2-libelf -clean-stage2-libelf: - @if [ $(current_stage) = stage2 ]; then \ - [ -f $(HOST_SUBDIR)/libelf/Makefile ] || exit 0; \ - else \ - [ -f $(HOST_SUBDIR)/stage2-libelf/Makefile ] || exit 0; \ - $(MAKE) stage2-start; \ - fi; \ - cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) clean -@endif libelf-bootstrap - - -.PHONY: all-stage3-libelf maybe-all-stage3-libelf -.PHONY: clean-stage3-libelf maybe-clean-stage3-libelf -maybe-all-stage3-libelf: -maybe-clean-stage3-libelf: -@if libelf-bootstrap -maybe-all-stage3-libelf: all-stage3-libelf -all-stage3: all-stage3-libelf -TARGET-stage3-libelf = $(TARGET-libelf) -all-stage3-libelf: configure-stage3-libelf - @[ $(current_stage) = stage3 ] || $(MAKE) stage3-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - TFLAGS="$(STAGE3_TFLAGS)"; \ - $(HOST_EXPORTS) \ - $(POSTSTAGE1_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libelf && \ - \ - $(MAKE) $(BASE_FLAGS_TO_PASS) \ - CFLAGS="$(STAGE3_CFLAGS)" \ - GENERATOR_CFLAGS="$(STAGE3_GENERATOR_CFLAGS)" \ - CXXFLAGS="$(STAGE3_CXXFLAGS)" \ - LIBCFLAGS="$(STAGE3_CFLAGS)" \ - CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ - CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ - LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ - $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ - TFLAGS="$(STAGE3_TFLAGS)" \ - $(TARGET-stage3-libelf) - -maybe-clean-stage3-libelf: clean-stage3-libelf -clean-stage3: clean-stage3-libelf -clean-stage3-libelf: - @if [ $(current_stage) = stage3 ]; then \ - [ -f $(HOST_SUBDIR)/libelf/Makefile ] || exit 0; \ - else \ - [ -f $(HOST_SUBDIR)/stage3-libelf/Makefile ] || exit 0; \ - $(MAKE) stage3-start; \ - fi; \ - cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) clean -@endif libelf-bootstrap - - -.PHONY: all-stage4-libelf maybe-all-stage4-libelf -.PHONY: clean-stage4-libelf maybe-clean-stage4-libelf -maybe-all-stage4-libelf: -maybe-clean-stage4-libelf: -@if libelf-bootstrap -maybe-all-stage4-libelf: all-stage4-libelf -all-stage4: all-stage4-libelf -TARGET-stage4-libelf = $(TARGET-libelf) -all-stage4-libelf: configure-stage4-libelf - @[ $(current_stage) = stage4 ] || $(MAKE) stage4-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - TFLAGS="$(STAGE4_TFLAGS)"; \ - $(HOST_EXPORTS) \ - $(POSTSTAGE1_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libelf && \ - \ - $(MAKE) $(BASE_FLAGS_TO_PASS) \ - CFLAGS="$(STAGE4_CFLAGS)" \ - GENERATOR_CFLAGS="$(STAGE4_GENERATOR_CFLAGS)" \ - CXXFLAGS="$(STAGE4_CXXFLAGS)" \ - LIBCFLAGS="$(STAGE4_CFLAGS)" \ - CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ - CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ - LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ - $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ - TFLAGS="$(STAGE4_TFLAGS)" \ - $(TARGET-stage4-libelf) - -maybe-clean-stage4-libelf: clean-stage4-libelf -clean-stage4: clean-stage4-libelf -clean-stage4-libelf: - @if [ $(current_stage) = stage4 ]; then \ - [ -f $(HOST_SUBDIR)/libelf/Makefile ] || exit 0; \ - else \ - [ -f $(HOST_SUBDIR)/stage4-libelf/Makefile ] || exit 0; \ - $(MAKE) stage4-start; \ - fi; \ - cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) clean -@endif libelf-bootstrap - - -.PHONY: all-stageprofile-libelf maybe-all-stageprofile-libelf -.PHONY: clean-stageprofile-libelf maybe-clean-stageprofile-libelf -maybe-all-stageprofile-libelf: -maybe-clean-stageprofile-libelf: -@if libelf-bootstrap -maybe-all-stageprofile-libelf: all-stageprofile-libelf -all-stageprofile: all-stageprofile-libelf -TARGET-stageprofile-libelf = $(TARGET-libelf) -all-stageprofile-libelf: configure-stageprofile-libelf - @[ $(current_stage) = stageprofile ] || $(MAKE) stageprofile-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - TFLAGS="$(STAGEprofile_TFLAGS)"; \ - $(HOST_EXPORTS) \ - $(POSTSTAGE1_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libelf && \ - \ - $(MAKE) $(BASE_FLAGS_TO_PASS) \ - CFLAGS="$(STAGEprofile_CFLAGS)" \ - GENERATOR_CFLAGS="$(STAGEprofile_GENERATOR_CFLAGS)" \ - CXXFLAGS="$(STAGEprofile_CXXFLAGS)" \ - LIBCFLAGS="$(STAGEprofile_CFLAGS)" \ - CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ - CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ - LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ - $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ - TFLAGS="$(STAGEprofile_TFLAGS)" \ - $(TARGET-stageprofile-libelf) - -maybe-clean-stageprofile-libelf: clean-stageprofile-libelf -clean-stageprofile: clean-stageprofile-libelf -clean-stageprofile-libelf: - @if [ $(current_stage) = stageprofile ]; then \ - [ -f $(HOST_SUBDIR)/libelf/Makefile ] || exit 0; \ - else \ - [ -f $(HOST_SUBDIR)/stageprofile-libelf/Makefile ] || exit 0; \ - $(MAKE) stageprofile-start; \ - fi; \ - cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) clean -@endif libelf-bootstrap - - -.PHONY: all-stagetrain-libelf maybe-all-stagetrain-libelf -.PHONY: clean-stagetrain-libelf maybe-clean-stagetrain-libelf -maybe-all-stagetrain-libelf: -maybe-clean-stagetrain-libelf: -@if libelf-bootstrap -maybe-all-stagetrain-libelf: all-stagetrain-libelf -all-stagetrain: all-stagetrain-libelf -TARGET-stagetrain-libelf = $(TARGET-libelf) -all-stagetrain-libelf: configure-stagetrain-libelf - @[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - TFLAGS="$(STAGEtrain_TFLAGS)"; \ - $(HOST_EXPORTS) \ - $(POSTSTAGE1_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libelf && \ - \ - $(MAKE) $(BASE_FLAGS_TO_PASS) \ - CFLAGS="$(STAGEtrain_CFLAGS)" \ - GENERATOR_CFLAGS="$(STAGEtrain_GENERATOR_CFLAGS)" \ - CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \ - LIBCFLAGS="$(STAGEtrain_CFLAGS)" \ - CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ - CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ - LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ - $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ - TFLAGS="$(STAGEtrain_TFLAGS)" \ - $(TARGET-stagetrain-libelf) - -maybe-clean-stagetrain-libelf: clean-stagetrain-libelf -clean-stagetrain: clean-stagetrain-libelf -clean-stagetrain-libelf: - @if [ $(current_stage) = stagetrain ]; then \ - [ -f $(HOST_SUBDIR)/libelf/Makefile ] || exit 0; \ - else \ - [ -f $(HOST_SUBDIR)/stagetrain-libelf/Makefile ] || exit 0; \ - $(MAKE) stagetrain-start; \ - fi; \ - cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) clean -@endif libelf-bootstrap - - -.PHONY: all-stagefeedback-libelf maybe-all-stagefeedback-libelf -.PHONY: clean-stagefeedback-libelf maybe-clean-stagefeedback-libelf -maybe-all-stagefeedback-libelf: -maybe-clean-stagefeedback-libelf: -@if libelf-bootstrap -maybe-all-stagefeedback-libelf: all-stagefeedback-libelf -all-stagefeedback: all-stagefeedback-libelf -TARGET-stagefeedback-libelf = $(TARGET-libelf) -all-stagefeedback-libelf: configure-stagefeedback-libelf - @[ $(current_stage) = stagefeedback ] || $(MAKE) stagefeedback-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - TFLAGS="$(STAGEfeedback_TFLAGS)"; \ - $(HOST_EXPORTS) \ - $(POSTSTAGE1_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libelf && \ - \ - $(MAKE) $(BASE_FLAGS_TO_PASS) \ - CFLAGS="$(STAGEfeedback_CFLAGS)" \ - GENERATOR_CFLAGS="$(STAGEfeedback_GENERATOR_CFLAGS)" \ - CXXFLAGS="$(STAGEfeedback_CXXFLAGS)" \ - LIBCFLAGS="$(STAGEfeedback_CFLAGS)" \ - CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ - CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ - LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ - $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ - TFLAGS="$(STAGEfeedback_TFLAGS)" \ - $(TARGET-stagefeedback-libelf) - -maybe-clean-stagefeedback-libelf: clean-stagefeedback-libelf -clean-stagefeedback: clean-stagefeedback-libelf -clean-stagefeedback-libelf: - @if [ $(current_stage) = stagefeedback ]; then \ - [ -f $(HOST_SUBDIR)/libelf/Makefile ] || exit 0; \ - else \ - [ -f $(HOST_SUBDIR)/stagefeedback-libelf/Makefile ] || exit 0; \ - $(MAKE) stagefeedback-start; \ - fi; \ - cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) clean -@endif libelf-bootstrap - - -.PHONY: all-stageautoprofile-libelf maybe-all-stageautoprofile-libelf -.PHONY: clean-stageautoprofile-libelf maybe-clean-stageautoprofile-libelf -maybe-all-stageautoprofile-libelf: -maybe-clean-stageautoprofile-libelf: -@if libelf-bootstrap -maybe-all-stageautoprofile-libelf: all-stageautoprofile-libelf -all-stageautoprofile: all-stageautoprofile-libelf -TARGET-stageautoprofile-libelf = $(TARGET-libelf) -all-stageautoprofile-libelf: configure-stageautoprofile-libelf - @[ $(current_stage) = stageautoprofile ] || $(MAKE) stageautoprofile-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - TFLAGS="$(STAGEautoprofile_TFLAGS)"; \ - $(HOST_EXPORTS) \ - $(POSTSTAGE1_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libelf && \ - $$s/gcc/config/i386/$(AUTO_PROFILE) \ - $(MAKE) $(BASE_FLAGS_TO_PASS) \ - CFLAGS="$(STAGEautoprofile_CFLAGS)" \ - GENERATOR_CFLAGS="$(STAGEautoprofile_GENERATOR_CFLAGS)" \ - CXXFLAGS="$(STAGEautoprofile_CXXFLAGS)" \ - LIBCFLAGS="$(STAGEautoprofile_CFLAGS)" \ - CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ - CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ - LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ - $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ - TFLAGS="$(STAGEautoprofile_TFLAGS)" \ - $(TARGET-stageautoprofile-libelf) - -maybe-clean-stageautoprofile-libelf: clean-stageautoprofile-libelf -clean-stageautoprofile: clean-stageautoprofile-libelf -clean-stageautoprofile-libelf: - @if [ $(current_stage) = stageautoprofile ]; then \ - [ -f $(HOST_SUBDIR)/libelf/Makefile ] || exit 0; \ - else \ - [ -f $(HOST_SUBDIR)/stageautoprofile-libelf/Makefile ] || exit 0; \ - $(MAKE) stageautoprofile-start; \ - fi; \ - cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) clean -@endif libelf-bootstrap - - -.PHONY: all-stageautofeedback-libelf maybe-all-stageautofeedback-libelf -.PHONY: clean-stageautofeedback-libelf maybe-clean-stageautofeedback-libelf -maybe-all-stageautofeedback-libelf: -maybe-clean-stageautofeedback-libelf: -@if libelf-bootstrap -maybe-all-stageautofeedback-libelf: all-stageautofeedback-libelf -all-stageautofeedback: all-stageautofeedback-libelf -TARGET-stageautofeedback-libelf = $(TARGET-libelf) -all-stageautofeedback-libelf: configure-stageautofeedback-libelf - @[ $(current_stage) = stageautofeedback ] || $(MAKE) stageautofeedback-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - TFLAGS="$(STAGEautofeedback_TFLAGS)"; \ - $(HOST_EXPORTS) \ - $(POSTSTAGE1_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libelf && \ - \ - $(MAKE) $(BASE_FLAGS_TO_PASS) \ - CFLAGS="$(STAGEautofeedback_CFLAGS)" \ - GENERATOR_CFLAGS="$(STAGEautofeedback_GENERATOR_CFLAGS)" \ - CXXFLAGS="$(STAGEautofeedback_CXXFLAGS)" \ - LIBCFLAGS="$(STAGEautofeedback_CFLAGS)" \ - CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \ - CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \ - LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \ - $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) \ - TFLAGS="$(STAGEautofeedback_TFLAGS)" PERF_DATA=perf.data \ - $(TARGET-stageautofeedback-libelf) - -maybe-clean-stageautofeedback-libelf: clean-stageautofeedback-libelf -clean-stageautofeedback: clean-stageautofeedback-libelf -clean-stageautofeedback-libelf: - @if [ $(current_stage) = stageautofeedback ]; then \ - [ -f $(HOST_SUBDIR)/libelf/Makefile ] || exit 0; \ - else \ - [ -f $(HOST_SUBDIR)/stageautofeedback-libelf/Makefile ] || exit 0; \ - $(MAKE) stageautofeedback-start; \ - fi; \ - cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) clean -@endif libelf-bootstrap - - - - - -.PHONY: check-libelf maybe-check-libelf -maybe-check-libelf: -@if libelf -maybe-check-libelf: check-libelf - -check-libelf: - @: $(MAKE); $(unstage) - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) $(EXTRA_HOST_EXPORTS) \ - (cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(FLAGS_TO_PASS) $(EXTRA_BOOTSTRAP_FLAGS) check) - -@endif libelf - -.PHONY: install-libelf maybe-install-libelf -maybe-install-libelf: -@if libelf -maybe-install-libelf: install-libelf - -install-libelf: - -@endif libelf - -.PHONY: install-strip-libelf maybe-install-strip-libelf -maybe-install-strip-libelf: -@if libelf -maybe-install-strip-libelf: install-strip-libelf - -install-strip-libelf: - -@endif libelf - -# Other targets (info, dvi, pdf, etc.) - -.PHONY: maybe-info-libelf info-libelf -maybe-info-libelf: -@if libelf -maybe-info-libelf: info-libelf - -info-libelf: \ - configure-libelf - @[ -f ./libelf/Makefile ] || exit 0; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - for flag in $(EXTRA_HOST_FLAGS) ; do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - echo "Doing info in libelf"; \ - (cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ - info) \ - || exit 1 - -@endif libelf - -.PHONY: maybe-dvi-libelf dvi-libelf -maybe-dvi-libelf: -@if libelf -maybe-dvi-libelf: dvi-libelf - -dvi-libelf: \ - configure-libelf - @[ -f ./libelf/Makefile ] || exit 0; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - for flag in $(EXTRA_HOST_FLAGS) ; do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - echo "Doing dvi in libelf"; \ - (cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ - dvi) \ - || exit 1 - -@endif libelf - -.PHONY: maybe-pdf-libelf pdf-libelf -maybe-pdf-libelf: -@if libelf -maybe-pdf-libelf: pdf-libelf - -pdf-libelf: \ - configure-libelf - @[ -f ./libelf/Makefile ] || exit 0; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - for flag in $(EXTRA_HOST_FLAGS) ; do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - echo "Doing pdf in libelf"; \ - (cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ - pdf) \ - || exit 1 - -@endif libelf - -.PHONY: maybe-html-libelf html-libelf -maybe-html-libelf: -@if libelf -maybe-html-libelf: html-libelf - -html-libelf: \ - configure-libelf - @[ -f ./libelf/Makefile ] || exit 0; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - for flag in $(EXTRA_HOST_FLAGS) ; do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - echo "Doing html in libelf"; \ - (cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ - html) \ - || exit 1 - -@endif libelf - -.PHONY: maybe-TAGS-libelf TAGS-libelf -maybe-TAGS-libelf: -@if libelf -maybe-TAGS-libelf: TAGS-libelf - -TAGS-libelf: \ - configure-libelf - @[ -f ./libelf/Makefile ] || exit 0; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - for flag in $(EXTRA_HOST_FLAGS) ; do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - echo "Doing TAGS in libelf"; \ - (cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ - TAGS) \ - || exit 1 - -@endif libelf - -.PHONY: maybe-install-info-libelf install-info-libelf -maybe-install-info-libelf: -@if libelf -maybe-install-info-libelf: install-info-libelf - -install-info-libelf: \ - configure-libelf \ - info-libelf - @[ -f ./libelf/Makefile ] || exit 0; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - for flag in $(EXTRA_HOST_FLAGS) ; do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - echo "Doing install-info in libelf"; \ - (cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ - install-info) \ - || exit 1 - -@endif libelf - -.PHONY: maybe-install-dvi-libelf install-dvi-libelf -maybe-install-dvi-libelf: -@if libelf -maybe-install-dvi-libelf: install-dvi-libelf - -install-dvi-libelf: \ - configure-libelf \ - dvi-libelf - @[ -f ./libelf/Makefile ] || exit 0; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - for flag in $(EXTRA_HOST_FLAGS) ; do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - echo "Doing install-dvi in libelf"; \ - (cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ - install-dvi) \ - || exit 1 - -@endif libelf - -.PHONY: maybe-install-pdf-libelf install-pdf-libelf -maybe-install-pdf-libelf: -@if libelf -maybe-install-pdf-libelf: install-pdf-libelf - -install-pdf-libelf: \ - configure-libelf \ - pdf-libelf - @[ -f ./libelf/Makefile ] || exit 0; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - for flag in $(EXTRA_HOST_FLAGS) ; do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - echo "Doing install-pdf in libelf"; \ - (cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ - install-pdf) \ - || exit 1 - -@endif libelf - -.PHONY: maybe-install-html-libelf install-html-libelf -maybe-install-html-libelf: -@if libelf -maybe-install-html-libelf: install-html-libelf - -install-html-libelf: \ - configure-libelf \ - html-libelf - @[ -f ./libelf/Makefile ] || exit 0; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - for flag in $(EXTRA_HOST_FLAGS) ; do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - echo "Doing install-html in libelf"; \ - (cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ - install-html) \ - || exit 1 - -@endif libelf - -.PHONY: maybe-installcheck-libelf installcheck-libelf -maybe-installcheck-libelf: -@if libelf -maybe-installcheck-libelf: installcheck-libelf - -installcheck-libelf: \ - configure-libelf - @[ -f ./libelf/Makefile ] || exit 0; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - for flag in $(EXTRA_HOST_FLAGS) ; do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - echo "Doing installcheck in libelf"; \ - (cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ - installcheck) \ - || exit 1 - -@endif libelf - -.PHONY: maybe-mostlyclean-libelf mostlyclean-libelf -maybe-mostlyclean-libelf: -@if libelf -maybe-mostlyclean-libelf: mostlyclean-libelf - -mostlyclean-libelf: - @[ -f ./libelf/Makefile ] || exit 0; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - for flag in $(EXTRA_HOST_FLAGS) ; do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - echo "Doing mostlyclean in libelf"; \ - (cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ - mostlyclean) \ - || exit 1 - -@endif libelf - -.PHONY: maybe-clean-libelf clean-libelf -maybe-clean-libelf: -@if libelf -maybe-clean-libelf: clean-libelf - -clean-libelf: - @[ -f ./libelf/Makefile ] || exit 0; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - for flag in $(EXTRA_HOST_FLAGS) ; do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - echo "Doing clean in libelf"; \ - (cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ - clean) \ - || exit 1 - -@endif libelf - -.PHONY: maybe-distclean-libelf distclean-libelf -maybe-distclean-libelf: -@if libelf -maybe-distclean-libelf: distclean-libelf - -distclean-libelf: - @[ -f ./libelf/Makefile ] || exit 0; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - for flag in $(EXTRA_HOST_FLAGS) ; do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - echo "Doing distclean in libelf"; \ - (cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ - distclean) \ - || exit 1 - -@endif libelf - -.PHONY: maybe-maintainer-clean-libelf maintainer-clean-libelf -maybe-maintainer-clean-libelf: -@if libelf -maybe-maintainer-clean-libelf: maintainer-clean-libelf - -maintainer-clean-libelf: - @[ -f ./libelf/Makefile ] || exit 0; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - for flag in $(EXTRA_HOST_FLAGS) ; do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - echo "Doing maintainer-clean in libelf"; \ - (cd $(HOST_SUBDIR)/libelf && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \ - maintainer-clean) \ - || exit 1 - -@endif libelf - - - .PHONY: configure-gold maybe-configure-gold maybe-configure-gold: @if gcc-bootstrap @@ -61875,11 +60705,6 @@ stage1-start:: mkdir stage1-isl; \ mv stage1-isl isl @endif isl -@if libelf - @cd $(HOST_SUBDIR); [ -d stage1-libelf ] || \ - mkdir stage1-libelf; \ - mv stage1-libelf libelf -@endif libelf @if gold @cd $(HOST_SUBDIR); [ -d stage1-gold ] || \ mkdir stage1-gold; \ @@ -62000,11 +60825,6 @@ stage1-end:: cd $(HOST_SUBDIR); mv isl stage1-isl; \ fi @endif isl -@if libelf - @if test -d $(HOST_SUBDIR)/libelf; then \ - cd $(HOST_SUBDIR); mv libelf stage1-libelf; \ - fi -@endif libelf @if gold @if test -d $(HOST_SUBDIR)/gold; then \ cd $(HOST_SUBDIR); mv gold stage1-gold; \ @@ -62178,12 +60998,6 @@ stage2-start:: mv stage2-isl isl; \ mv stage1-isl prev-isl || test -f stage1-lean @endif isl -@if libelf - @cd $(HOST_SUBDIR); [ -d stage2-libelf ] || \ - mkdir stage2-libelf; \ - mv stage2-libelf libelf; \ - mv stage1-libelf prev-libelf || test -f stage1-lean -@endif libelf @if gold @cd $(HOST_SUBDIR); [ -d stage2-gold ] || \ mkdir stage2-gold; \ @@ -62328,12 +61142,6 @@ stage2-end:: mv prev-isl stage1-isl; : ; \ fi @endif isl -@if libelf - @if test -d $(HOST_SUBDIR)/libelf; then \ - cd $(HOST_SUBDIR); mv libelf stage2-libelf; \ - mv prev-libelf stage1-libelf; : ; \ - fi -@endif libelf @if gold @if test -d $(HOST_SUBDIR)/gold; then \ cd $(HOST_SUBDIR); mv gold stage2-gold; \ @@ -62544,12 +61352,6 @@ stage3-start:: mv stage3-isl isl; \ mv stage2-isl prev-isl || test -f stage2-lean @endif isl -@if libelf - @cd $(HOST_SUBDIR); [ -d stage3-libelf ] || \ - mkdir stage3-libelf; \ - mv stage3-libelf libelf; \ - mv stage2-libelf prev-libelf || test -f stage2-lean -@endif libelf @if gold @cd $(HOST_SUBDIR); [ -d stage3-gold ] || \ mkdir stage3-gold; \ @@ -62694,12 +61496,6 @@ stage3-end:: mv prev-isl stage2-isl; : ; \ fi @endif isl -@if libelf - @if test -d $(HOST_SUBDIR)/libelf; then \ - cd $(HOST_SUBDIR); mv libelf stage3-libelf; \ - mv prev-libelf stage2-libelf; : ; \ - fi -@endif libelf @if gold @if test -d $(HOST_SUBDIR)/gold; then \ cd $(HOST_SUBDIR); mv gold stage3-gold; \ @@ -62966,12 +61762,6 @@ stage4-start:: mv stage4-isl isl; \ mv stage3-isl prev-isl || test -f stage3-lean @endif isl -@if libelf - @cd $(HOST_SUBDIR); [ -d stage4-libelf ] || \ - mkdir stage4-libelf; \ - mv stage4-libelf libelf; \ - mv stage3-libelf prev-libelf || test -f stage3-lean -@endif libelf @if gold @cd $(HOST_SUBDIR); [ -d stage4-gold ] || \ mkdir stage4-gold; \ @@ -63116,12 +61906,6 @@ stage4-end:: mv prev-isl stage3-isl; : ; \ fi @endif isl -@if libelf - @if test -d $(HOST_SUBDIR)/libelf; then \ - cd $(HOST_SUBDIR); mv libelf stage4-libelf; \ - mv prev-libelf stage3-libelf; : ; \ - fi -@endif libelf @if gold @if test -d $(HOST_SUBDIR)/gold; then \ cd $(HOST_SUBDIR); mv gold stage4-gold; \ @@ -63376,12 +62160,6 @@ stageprofile-start:: mv stageprofile-isl isl; \ mv stage1-isl prev-isl || test -f stage1-lean @endif isl -@if libelf - @cd $(HOST_SUBDIR); [ -d stageprofile-libelf ] || \ - mkdir stageprofile-libelf; \ - mv stageprofile-libelf libelf; \ - mv stage1-libelf prev-libelf || test -f stage1-lean -@endif libelf @if gold @cd $(HOST_SUBDIR); [ -d stageprofile-gold ] || \ mkdir stageprofile-gold; \ @@ -63526,12 +62304,6 @@ stageprofile-end:: mv prev-isl stage1-isl; : ; \ fi @endif isl -@if libelf - @if test -d $(HOST_SUBDIR)/libelf; then \ - cd $(HOST_SUBDIR); mv libelf stageprofile-libelf; \ - mv prev-libelf stage1-libelf; : ; \ - fi -@endif libelf @if gold @if test -d $(HOST_SUBDIR)/gold; then \ cd $(HOST_SUBDIR); mv gold stageprofile-gold; \ @@ -63719,12 +62491,6 @@ stagetrain-start:: mv stagetrain-isl isl; \ mv stageprofile-isl prev-isl || test -f stageprofile-lean @endif isl -@if libelf - @cd $(HOST_SUBDIR); [ -d stagetrain-libelf ] || \ - mkdir stagetrain-libelf; \ - mv stagetrain-libelf libelf; \ - mv stageprofile-libelf prev-libelf || test -f stageprofile-lean -@endif libelf @if gold @cd $(HOST_SUBDIR); [ -d stagetrain-gold ] || \ mkdir stagetrain-gold; \ @@ -63869,12 +62635,6 @@ stagetrain-end:: mv prev-isl stageprofile-isl; : ; \ fi @endif isl -@if libelf - @if test -d $(HOST_SUBDIR)/libelf; then \ - cd $(HOST_SUBDIR); mv libelf stagetrain-libelf; \ - mv prev-libelf stageprofile-libelf; : ; \ - fi -@endif libelf @if gold @if test -d $(HOST_SUBDIR)/gold; then \ cd $(HOST_SUBDIR); mv gold stagetrain-gold; \ @@ -64062,12 +62822,6 @@ stagefeedback-start:: mv stagefeedback-isl isl; \ mv stagetrain-isl prev-isl || test -f stagetrain-lean @endif isl -@if libelf - @cd $(HOST_SUBDIR); [ -d stagefeedback-libelf ] || \ - mkdir stagefeedback-libelf; \ - mv stagefeedback-libelf libelf; \ - mv stagetrain-libelf prev-libelf || test -f stagetrain-lean -@endif libelf @if gold @cd $(HOST_SUBDIR); [ -d stagefeedback-gold ] || \ mkdir stagefeedback-gold; \ @@ -64212,12 +62966,6 @@ stagefeedback-end:: mv prev-isl stagetrain-isl; : ; \ fi @endif isl -@if libelf - @if test -d $(HOST_SUBDIR)/libelf; then \ - cd $(HOST_SUBDIR); mv libelf stagefeedback-libelf; \ - mv prev-libelf stagetrain-libelf; : ; \ - fi -@endif libelf @if gold @if test -d $(HOST_SUBDIR)/gold; then \ cd $(HOST_SUBDIR); mv gold stagefeedback-gold; \ @@ -64428,12 +63176,6 @@ stageautoprofile-start:: mv stageautoprofile-isl isl; \ mv stage1-isl prev-isl || test -f stage1-lean @endif isl -@if libelf - @cd $(HOST_SUBDIR); [ -d stageautoprofile-libelf ] || \ - mkdir stageautoprofile-libelf; \ - mv stageautoprofile-libelf libelf; \ - mv stage1-libelf prev-libelf || test -f stage1-lean -@endif libelf @if gold @cd $(HOST_SUBDIR); [ -d stageautoprofile-gold ] || \ mkdir stageautoprofile-gold; \ @@ -64578,12 +63320,6 @@ stageautoprofile-end:: mv prev-isl stage1-isl; : ; \ fi @endif isl -@if libelf - @if test -d $(HOST_SUBDIR)/libelf; then \ - cd $(HOST_SUBDIR); mv libelf stageautoprofile-libelf; \ - mv prev-libelf stage1-libelf; : ; \ - fi -@endif libelf @if gold @if test -d $(HOST_SUBDIR)/gold; then \ cd $(HOST_SUBDIR); mv gold stageautoprofile-gold; \ @@ -64771,12 +63507,6 @@ stageautofeedback-start:: mv stageautofeedback-isl isl; \ mv stageautoprofile-isl prev-isl || test -f stageautoprofile-lean @endif isl -@if libelf - @cd $(HOST_SUBDIR); [ -d stageautofeedback-libelf ] || \ - mkdir stageautofeedback-libelf; \ - mv stageautofeedback-libelf libelf; \ - mv stageautoprofile-libelf prev-libelf || test -f stageautoprofile-lean -@endif libelf @if gold @cd $(HOST_SUBDIR); [ -d stageautofeedback-gold ] || \ mkdir stageautofeedback-gold; \ @@ -64921,12 +63651,6 @@ stageautofeedback-end:: mv prev-isl stageautoprofile-isl; : ; \ fi @endif isl -@if libelf - @if test -d $(HOST_SUBDIR)/libelf; then \ - cd $(HOST_SUBDIR); mv libelf stageautofeedback-libelf; \ - mv prev-libelf stageautoprofile-libelf; : ; \ - fi -@endif libelf @if gold @if test -d $(HOST_SUBDIR)/gold; then \ cd $(HOST_SUBDIR); mv gold stageautofeedback-gold; \ @@ -65361,16 +64085,6 @@ configure-stagetrain-gcc: maybe-all-stagetrain-gold configure-stagefeedback-gcc: maybe-all-stagefeedback-gold configure-stageautoprofile-gcc: maybe-all-stageautoprofile-gold configure-stageautofeedback-gcc: maybe-all-stageautofeedback-gold -configure-gcc: maybe-all-libelf -configure-stage1-gcc: maybe-all-stage1-libelf -configure-stage2-gcc: maybe-all-stage2-libelf -configure-stage3-gcc: maybe-all-stage3-libelf -configure-stage4-gcc: maybe-all-stage4-libelf -configure-stageprofile-gcc: maybe-all-stageprofile-libelf -configure-stagetrain-gcc: maybe-all-stagetrain-libelf -configure-stagefeedback-gcc: maybe-all-stagefeedback-libelf -configure-stageautoprofile-gcc: maybe-all-stageautoprofile-libelf -configure-stageautofeedback-gcc: maybe-all-stageautofeedback-libelf configure-gcc: maybe-all-libiconv configure-stage1-gcc: maybe-all-stage1-libiconv configure-stage2-gcc: maybe-all-stage2-libiconv @@ -66523,6 +65237,7 @@ all-target-liboffloadmic: maybe-all-target-libgomp configure-target-newlib: maybe-all-binutils configure-target-newlib: maybe-all-ld configure-target-libgfortran: maybe-all-target-libbacktrace +configure-target-libgo: maybe-all-target-libbacktrace @endunless gcc-bootstrap # Dependencies for target modules on other target modules are diff --git a/Makefile.tpl b/Makefile.tpl index ba07271..c734455 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -239,8 +239,6 @@ HOST_EXPORTS = \ GMPINC="$(HOST_GMPINC)"; export GMPINC; \ ISLLIBS="$(HOST_ISLLIBS)"; export ISLLIBS; \ ISLINC="$(HOST_ISLINC)"; export ISLINC; \ - LIBELFLIBS="$(HOST_LIBELFLIBS)"; export LIBELFLIBS; \ - LIBELFINC="$(HOST_LIBELFINC)"; export LIBELFINC; \ XGCC_FLAGS_FOR_TARGET="$(XGCC_FLAGS_FOR_TARGET)"; export XGCC_FLAGS_FOR_TARGET; \ @if gcc-bootstrap $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ @@ -346,10 +344,6 @@ HOST_GMPINC = @gmpinc@ HOST_ISLLIBS = @isllibs@ HOST_ISLINC = @islinc@ -# Where to find libelf -HOST_LIBELFLIBS = @libelflibs@ -HOST_LIBELFINC = @libelfinc@ - # ---------------------------------------------- # Programs producing files for the BUILD machine # ---------------------------------------------- @@ -2807,7 +2807,7 @@ build_tools="build-texinfo build-flex build-bison build-m4 build-fixincludes" # these libraries are used by various programs built for the host environment #f -host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libcody libdecnumber gmp mpfr mpc isl libelf libiconv libctf" +host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libcody libdecnumber gmp mpfr mpc isl libiconv libctf" # these tools are built for the host environment # Note, the powerpc-eabi build depends on sim occurring before gdb in order to diff --git a/configure.ac b/configure.ac index 371def9..13f8c5f 100644 --- a/configure.ac +++ b/configure.ac @@ -132,7 +132,7 @@ build_tools="build-texinfo build-flex build-bison build-m4 build-fixincludes" # these libraries are used by various programs built for the host environment #f -host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libcody libdecnumber gmp mpfr mpc isl libelf libiconv libctf" +host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libcody libdecnumber gmp mpfr mpc isl libiconv libctf" # these tools are built for the host environment # Note, the powerpc-eabi build depends on sim occurring before gdb in order to diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9d4d2e0..e193ffa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,243 @@ +2022-08-17 Roger Sayle <roger@nextmovesoftware.com> + + PR target/106640 + * config/i386/i386-features.cc + (timde_scalar_chain::compute_convert_gain): Replace incorrect use + of XINT with INTVAL (XEXP (src, 1)). + +2022-08-17 Aldy Hernandez <aldyh@redhat.com> + + * gimple-range-path.cc + (path_range_query::compute_ranges_in_block): Remove + set_root_oracle call. + (path_range_query::compute_ranges): Pass ranger oracle to + reset_path. + * value-relation.cc (path_oracle::reset_path): Set root oracle. + * value-relation.h (path_oracle::reset_path): Add root oracle + argument. + +2022-08-17 Marek Polacek <polacek@redhat.com> + + PR c++/89780 + * diagnostic-spec.cc (nowarn_spec_t::nowarn_spec_t): Handle + OPT_Wpessimizing_move and OPT_Wredundant_move. + * diagnostic-spec.h (nowarn_spec_t): Add NW_REDUNDANT enumerator. + +2022-08-17 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + Jakub Jelinek <jakub@redhat.com> + + PR fortran/46539 + * common.opt (static-libquadmath): New option. + * gcc.cc (driver_handle_option): Always accept -static-libquadmath. + * config/darwin.h (LINK_SPEC): Handle -static-libquadmath. + +2022-08-17 Tobias Burnus <tobias@codesourcery.com> + + * lto-cgraph.cc (input_offload_tables): Improve requires diagnostic + when filenames come out identically. + +2022-08-17 Tobias Burnus <tobias@codesourcery.com> + + PR middle-end/106548 + * omp-low.cc (lower_rec_input_clauses): Use build_outer_var_ref + for 'simd' linear-step values that are variable. + +2022-08-17 Tobias Burnus <tobias@codesourcery.com> + Chung-Lin Tang <cltang@codesourcery.com> + + PR c++/104493 + * gimplify.cc (omp_notice_variable): Call omp_mappable_type + instead of removed langhook. + * omp-general.h (omp_mappable_type): New prototype. + * omp-general.cc (omp_mappable_type): New; moved from ... + * langhooks.cc (lhd_omp_mappable_type): ... here. + * langhooks-def.h (lhd_omp_mappable_type, + LANG_HOOKS_OMP_MAPPABLE_TYPE): Remove. + (LANG_HOOKS_FOR_TYPES_INITIALIZER): Remote the latter. + * langhooks.h (struct lang_hooks_for_types): Remove + omp_mappable_type. + +2022-08-17 Christophe Lyon <christophe.lyon@arm.com> + + * config.gcc (arm): Define with_float to hard if target name ends + with 'hf'. + +2022-08-17 Richard Biener <rguenther@suse.de> + + * tree-ssa-threadbackward.cc + (back_threader_profitability): Split profitable_path_p + into possibly_profitable_path_p and itself, keep state + as new members. + (back_threader::m_profit): Remove. + (back_threader::find_paths): Likewise. + (back_threader::maybe_register_path): Take profitability + instance as parameter. + (back_threader::find_paths_to_names): Likewise. Use + possibly_profitable_path_p and avoid the path range query + when the path is currently too large. + (back_threader::find_paths): Fold into ... + (back_threader::maybe_thread_block): ... this. + (get_gimple_control_stmt): Remove. + (back_threader_profitability::possibly_profitable_path_p): + Split out from profitable_path_p, do early profitability + checks. + (back_threader_profitability::profitable_path_p): Do final + profitability path after the taken edge has been determined. + +2022-08-17 Xi Ruoyao <xry111@xry111.site> + + * config/loongarch/loongarch.md (fmax<mode>3): New RTL pattern. + (fmin<mode>3): Likewise. + +2022-08-17 Andrew MacLeod <amacleod@redhat.com> + + * gimple-range-fold.cc (gimple_range_ssa_names): New. + * gimple-range-fold.h (gimple_range_ssa_names): New prototype. + * gimple-range-gori.cc (range_def_chain::get_def_chain): Move + code to new routine. + +2022-08-16 Martin Liska <mliska@suse.cz> + + PR target/106637 + * doc/install.texi: Remove link to www.bullfreeware.com + +2022-08-16 Kito Cheng <kito.cheng@sifive.com> + + * common/config/riscv/riscv-common.cc (riscv_implied_info): Add + zfh and zfhmin. + (riscv_ext_version_table): Ditto. + (riscv_ext_flag_table): Ditto. + * config/riscv/riscv-opts.h (MASK_ZFHMIN): New. + (MASK_ZFH): Ditto. + (TARGET_ZFHMIN): Ditto. + (TARGET_ZFH): Ditto. + * config/riscv/riscv.cc (riscv_output_move): Handle HFmode move + for zfh and zfhmin. + (riscv_emit_float_compare): Handle HFmode. + * config/riscv/riscv.md (ANYF): Add HF. + (SOFTF): Add HF. + (load): Ditto. + (store): Ditto. + (truncsfhf2): New. + (truncdfhf2): Ditto. + (extendhfsf2): Ditto. + (extendhfdf2): Ditto. + (*movhf_hardfloat): Ditto. + (*movhf_softfloat): Make sure not ZFHMIN. + * config/riscv/riscv.opt (riscv_zf_subext): New. + +2022-08-16 Kito Cheng <kito.cheng@sifive.com> + + * config/riscv/riscv-builtins.cc: include stringpool.h + (riscv_float16_type_node): New. + (riscv_init_builtin_types): Ditto. + (riscv_init_builtins): Call riscv_init_builtin_types. + * config/riscv/riscv-modes.def (HF): New. + * config/riscv/riscv.cc (riscv_output_move): Handle HFmode. + (riscv_mangle_type): New. + (riscv_scalar_mode_supported_p): Ditto. + (riscv_libgcc_floating_mode_supported_p): Ditto. + (riscv_excess_precision): Ditto. + (riscv_floatn_mode): Ditto. + (riscv_init_libfuncs): Ditto. + (TARGET_MANGLE_TYPE): Ditto. + (TARGET_SCALAR_MODE_SUPPORTED_P): Ditto. + (TARGET_LIBGCC_FLOATING_MODE_SUPPORTED_P): Ditto. + (TARGET_INIT_LIBFUNCS): Ditto. + (TARGET_C_EXCESS_PRECISION): Ditto. + (TARGET_FLOATN_MODE): Ditto. + * config/riscv/riscv.md (mode): Add HF. + (softload): Add HF. + (softstore): Ditto. + (fmt): Ditto. + (UNITMODE): Ditto. + (movhf): New. + (*movhf_softfloat): New. + +2022-08-16 Richard Biener <rguenther@suse.de> + + * tree-ssa-threadbackward.cc (back_threader::find_paths_to_names): + Do not walk further if we are leaving the current loop. + +2022-08-16 Sergei Trofimovich <siarheit@google.com> + + PR driver/106624 + * gcc.cc (driver::detect_jobserver): Allocate storage xputenv() + argument using xstrdup(). + +2022-08-16 Aldy Hernandez <aldyh@redhat.com> + + * gimple-range-path.cc (path_range_query::import_p): Rename to... + (path_range_query::exit_dependency_p): ...this. + (path_range_query::dump): Rename imports to exit dependencies. + (path_range_query::compute_ranges_in_phis): Same. + (path_range_query::compute_ranges_in_block): Same. + (path_range_query::adjust_for_non_null_uses): Same. + (path_range_query::compute_ranges): Same. + (path_range_query::compute_phi_relations): Same. + (path_range_query::add_to_imports): Rename to... + (path_range_query::add_to_exit_dependencies): ...this. + (path_range_query::compute_imports): Rename to... + (path_range_query::compute_exit_dependencies): ...this. + * gimple-range-path.h (class path_range_query): Rename imports to + exit dependencies. + +2022-08-16 Martin Liska <mliska@suse.cz> + + * value-range-storage.h (class obstack_vrange_allocator): Mark + the class as final. + (class ggc_vrange_allocator): Likewise. + +2022-08-16 Martin Liska <mliska@suse.cz> + + * value-range-equiv.h (class value_range_equiv): Add virtual + destructor. + * value-range.h: Likewise. + +2022-08-16 Richard Biener <rguenther@suse.de> + + PR middle-end/106630 + * match.pd ((T)(x * CST) -> (T)x * CST): Restrict to + narrowing conversions. + +2022-08-16 Martin Liska <mliska@suse.cz> + + * value-range-equiv.h (class value_range_equiv): + +2022-08-16 Martin Liska <mliska@suse.cz> + + * config/i386/i386-features.h (class general_scalar_chain): Add + final override for a method. + (class timode_scalar_chain): Likewise. + +2022-08-16 Richard Biener <rguenther@suse.de> + + * doc/invoke.texi (max-jump-thread-paths): Adjust. + +2022-08-16 Martin Liska <mliska@suse.cz> + + * opts-common.cc (jobserver_info::connect): Open fifo + in non-blocking mode. + +2022-08-16 Kewen.Lin <linkw@gcc.gnu.org> + + PR target/103353 + * config/rs6000/mma.md (define_expand movoo): Move TARGET_MMA condition + check to preparation statements and add handlings for !TARGET_MMA. + (define_expand movxo): Likewise. + +2022-08-16 Kewen Lin <linkw@linux.ibm.com> + + PR tree-optimization/106322 + * tree-vect-stmts.cc (vectorizable_call): Don't allow + vect_emulated_vector_p type for both vectype_in and vectype_out. + +2022-08-16 Takayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp> + + * common/config/xtensa/xtensa-common.cc + (xtensa_option_optimization_table): Add OPT_fsplit_wide_types_early + for OPT_LEVELS_ALL in order to restore pre-GCC10 behavior. + 2022-08-15 Andrew MacLeod <amacleod@redhat.com> PR tree-optimization/106621 diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 9e916fe..17147d2 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20220816 +20220818 diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog index d190956..482ab88 100644 --- a/gcc/analyzer/ChangeLog +++ b/gcc/analyzer/ChangeLog @@ -1,3 +1,9 @@ +2022-08-16 Martin Liska <mliska@suse.cz> + + * region-model.cc: Fix -Winconsistent-missing-override clang + warning. + * region.h: Likewise. + 2022-08-15 David Malcolm <dmalcolm@redhat.com> PR analyzer/106626 diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index fea41f4..c738e57 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,10 @@ +2022-08-16 Tom Honermann <tom@honermann.net> + + PR c++/106423 + * c-opts.cc (c_common_post_options): Disable -Wc++20-compat + diagnostics in C++20 and later. + * c.opt (Wc++20-compat): Enable hooks for the preprocessor. + 2022-08-11 Marek Polacek <polacek@redhat.com> PR middle-end/102633 diff --git a/gcc/c-family/c-opts.cc b/gcc/c-family/c-opts.cc index 9833e50..337a524 100644 --- a/gcc/c-family/c-opts.cc +++ b/gcc/c-family/c-opts.cc @@ -1046,6 +1046,13 @@ c_common_post_options (const char **pfilename) else if (warn_narrowing == -1) warn_narrowing = 0; + if (cxx_dialect >= cxx20) + { + /* Don't warn about C++20 compatibility changes in C++20 or later. */ + warn_cxx20_compat = 0; + cpp_opts->cpp_warn_cxx20_compat = 0; + } + /* C++17 has stricter evaluation order requirements; let's use some of them for earlier C++ as well, so chaining works as expected. */ if (c_dialect_cxx () diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 44e1a60..dfdebd5 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -455,7 +455,7 @@ Wc++2a-compat C++ ObjC++ Warning Alias(Wc++20-compat) Undocumented Wc++20-compat -C++ ObjC++ Var(warn_cxx20_compat) Warning LangEnabledBy(C++ ObjC++,Wall) +C++ ObjC++ Var(warn_cxx20_compat) Warning LangEnabledBy(C++ ObjC++,Wall) Init(0) CPP(cpp_warn_cxx20_compat) CppReason(CPP_W_CXX20_COMPAT) Warn about C++ constructs whose meaning differs between ISO C++ 2017 and ISO C++ 2020. Wc++11-extensions diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 985c96c..a57d62f 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,11 @@ +2022-08-17 Tobias Burnus <tobias@codesourcery.com> + Chung-Lin Tang <cltang@codesourcery.com> + + PR c++/104493 + * c-decl.cc (c_decl_attributes, finish_decl): Call omp_mappable_type + instead of removed langhook. + * c-typeck.cc (c_finish_omp_clauses): Likewise. + 2022-08-11 Marek Polacek <polacek@redhat.com> PR middle-end/102633 diff --git a/gcc/c/c-decl.cc b/gcc/c/c-decl.cc index ae8990c..9e590c6 100644 --- a/gcc/c/c-decl.cc +++ b/gcc/c/c-decl.cc @@ -5074,8 +5074,7 @@ c_decl_attributes (tree *node, tree attributes, int flags) && ((VAR_P (*node) && is_global_var (*node)) || TREE_CODE (*node) == FUNCTION_DECL)) { - if (VAR_P (*node) - && !lang_hooks.types.omp_mappable_type (TREE_TYPE (*node))) + if (VAR_P (*node) && !omp_mappable_type (TREE_TYPE (*node))) attributes = tree_cons (get_identifier ("omp declare target implicit"), NULL_TREE, attributes); else @@ -5701,7 +5700,7 @@ finish_decl (tree decl, location_t init_loc, tree init, DECL_ATTRIBUTES (decl) = remove_attribute ("omp declare target implicit", DECL_ATTRIBUTES (decl)); - if (!lang_hooks.types.omp_mappable_type (TREE_TYPE (decl))) + if (!omp_mappable_type (TREE_TYPE (decl))) error ("%q+D in declare target directive does not have mappable type", decl); else if (!lookup_attribute ("omp declare target", diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc index d37de2a..de8780a 100644 --- a/gcc/c/c-typeck.cc +++ b/gcc/c/c-typeck.cc @@ -14955,7 +14955,7 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort) else { t = OMP_CLAUSE_DECL (c); - if (!lang_hooks.types.omp_mappable_type (TREE_TYPE (t))) + if (!omp_mappable_type (TREE_TYPE (t))) { error_at (OMP_CLAUSE_LOCATION (c), "array section does not have mappable type " @@ -15092,7 +15092,7 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort) t, omp_clause_code_name[OMP_CLAUSE_CODE (c)]); remove = true; } - else if (!lang_hooks.types.omp_mappable_type (TREE_TYPE (t))) + else if (!omp_mappable_type (TREE_TYPE (t))) { error_at (OMP_CLAUSE_LOCATION (c), "%qE does not have a mappable type in %qs clause", @@ -15173,7 +15173,7 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort) || (OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_FORCE_DEVICEPTR))) && t == OMP_CLAUSE_DECL (c) - && !lang_hooks.types.omp_mappable_type (TREE_TYPE (t))) + && !omp_mappable_type (TREE_TYPE (t))) { error_at (OMP_CLAUSE_LOCATION (c), "%qD does not have a mappable type in %qs clause", t, @@ -15290,7 +15290,7 @@ c_finish_omp_clauses (tree clauses, enum c_omp_region_type ort) cname); remove = true; } - else if (!lang_hooks.types.omp_mappable_type (TREE_TYPE (t))) + else if (!omp_mappable_type (TREE_TYPE (t))) { error_at (OMP_CLAUSE_LOCATION (c), "%qD does not have a mappable type in %qs clause", t, diff --git a/gcc/common.opt b/gcc/common.opt index e7a51e8..fba90ff 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -3601,6 +3601,10 @@ static-libphobos Driver ; Documented for D, but always accepted by driver. +static-libquadmath +Driver +; Documented for Fortran, but always accepted by driver. + static-libstdc++ Driver diff --git a/gcc/config.gcc b/gcc/config.gcc index 4e3b15b..02f5897 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1314,6 +1314,13 @@ arm*-*-linux-* | arm*-*-uclinuxfdpiceabi) tm_file="$tm_file arm/uclinuxfdpiceabi.h" ;; esac + # Define with_float to "hard" if not already defined and + # target name ends with "hf" + case $target:$with_float in + arm*-*-*hf:) + with_float=hard + ;; + esac # Generation of floating-point instructions requires at least ARMv5te. if [ "$with_float" = "hard" -o "$with_float" = "softfp" ] ; then target_cpu_cname="arm10e" diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index f82ec62..c5e1ba8 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -443,6 +443,7 @@ extern GTY(()) int darwin_ms_struct; %:replace-outfile(-lobjc libobjc-gnu.a%s); \ :%:replace-outfile(-lobjc -lobjc-gnu )}}\ %{static|static-libgcc|static-libgfortran:%:replace-outfile(-lgfortran libgfortran.a%s)}\ + %{static|static-libgcc|static-libquadmath:%:replace-outfile(-lquadmath libquadmath.a%s)}\ %{static|static-libgcc|static-libphobos:%:replace-outfile(-lgphobos libgphobos.a%s)}\ %{static|static-libgcc|static-libstdc++|static-libgfortran:%:replace-outfile(-lgomp libgomp.a%s)}\ %{static|static-libgcc|static-libstdc++:%:replace-outfile(-lstdc++ libstdc++.a%s)}\ diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc index 66d8f28..4b21630 100644 --- a/gcc/config/i386/i386-expand.cc +++ b/gcc/config/i386/i386-expand.cc @@ -4064,6 +4064,7 @@ ix86_expand_sse_movcc (rtx dest, rtx cmp, rtx op_true, rtx op_false) case E_V16QImode: case E_V8HImode: case E_V8HFmode: + case E_V8BFmode: case E_V4SImode: case E_V2DImode: case E_V1TImode: @@ -4084,6 +4085,7 @@ ix86_expand_sse_movcc (rtx dest, rtx cmp, rtx op_true, rtx op_false) case E_V32QImode: case E_V16HImode: case E_V16HFmode: + case E_V16BFmode: case E_V8SImode: case E_V4DImode: if (TARGET_AVX2) @@ -4102,6 +4104,9 @@ ix86_expand_sse_movcc (rtx dest, rtx cmp, rtx op_true, rtx op_false) case E_V32HFmode: gen = gen_avx512bw_blendmv32hf; break; + case E_V32BFmode: + gen = gen_avx512bw_blendmv32bf; + break; case E_V16SImode: gen = gen_avx512f_blendmv16si; break; @@ -15008,6 +15013,7 @@ ix86_expand_vector_init_duplicate (bool mmx_ok, machine_mode mode, case E_V8HImode: case E_V8HFmode: + case E_V8BFmode: if (TARGET_AVX2) return ix86_vector_duplicate_value (mode, target, val); @@ -15092,6 +15098,7 @@ ix86_expand_vector_init_duplicate (bool mmx_ok, machine_mode mode, case E_V16HImode: case E_V16HFmode: + case E_V16BFmode: case E_V32QImode: if (TARGET_AVX2) return ix86_vector_duplicate_value (mode, target, val); @@ -15112,6 +15119,7 @@ ix86_expand_vector_init_duplicate (bool mmx_ok, machine_mode mode, case E_V32HImode: case E_V32HFmode: + case E_V32BFmode: case E_V64QImode: if (TARGET_AVX512BW) return ix86_vector_duplicate_value (mode, target, val); @@ -15119,6 +15127,7 @@ ix86_expand_vector_init_duplicate (bool mmx_ok, machine_mode mode, { machine_mode hvmode = (mode == V32HImode ? V16HImode : mode == V32HFmode ? V16HFmode + : mode == V32BFmode ? V16BFmode : V32QImode); rtx x = gen_reg_rtx (hvmode); @@ -15232,6 +15241,18 @@ ix86_expand_vector_init_one_nonzero (bool mmx_ok, machine_mode mode, use_vector_set = TARGET_AVX512FP16 && one_var == 0; gen_vec_set_0 = gen_vec_setv32hf_0; break; + case E_V8BFmode: + use_vector_set = TARGET_AVX512FP16 && one_var == 0; + gen_vec_set_0 = gen_vec_setv8bf_0; + break; + case E_V16BFmode: + use_vector_set = TARGET_AVX512FP16 && one_var == 0; + gen_vec_set_0 = gen_vec_setv16bf_0; + break; + case E_V32BFmode: + use_vector_set = TARGET_AVX512FP16 && one_var == 0; + gen_vec_set_0 = gen_vec_setv32bf_0; + break; case E_V32HImode: use_vector_set = TARGET_AVX512FP16 && one_var == 0; gen_vec_set_0 = gen_vec_setv32hi_0; @@ -15386,6 +15407,8 @@ ix86_expand_vector_init_one_var (bool mmx_ok, machine_mode mode, /* FALLTHRU */ case E_V8HFmode: case E_V16HFmode: + case E_V8BFmode: + case E_V16BFmode: case E_V4DFmode: case E_V8SFmode: case E_V8SImode: @@ -15469,6 +15492,9 @@ ix86_expand_vector_init_concat (machine_mode mode, case E_V32HFmode: half_mode = V16HFmode; break; + case E_V32BFmode: + half_mode = V16BFmode; + break; case E_V16SImode: half_mode = V8SImode; break; @@ -15484,6 +15510,9 @@ ix86_expand_vector_init_concat (machine_mode mode, case E_V16HFmode: half_mode = V8HFmode; break; + case E_V16BFmode: + half_mode = V8BFmode; + break; case E_V8SImode: half_mode = V4SImode; break; @@ -15642,6 +15671,15 @@ ix86_expand_vector_init_interleave (machine_mode mode, second_imode = V2DImode; third_imode = VOIDmode; break; + case E_V8BFmode: + gen_load_even = gen_vec_interleave_lowv8bf; + gen_interleave_first_low = gen_vec_interleave_lowv4si; + gen_interleave_second_low = gen_vec_interleave_lowv2di; + inner_mode = BFmode; + first_imode = V4SImode; + second_imode = V2DImode; + third_imode = VOIDmode; + break; case E_V8HImode: gen_load_even = gen_vec_setv8hi; gen_interleave_first_low = gen_vec_interleave_lowv4si; @@ -15667,15 +15705,18 @@ ix86_expand_vector_init_interleave (machine_mode mode, for (i = 0; i < n; i++) { op = ops [i + i]; - if (inner_mode == HFmode) + if (inner_mode == HFmode || inner_mode == BFmode) { rtx even, odd; - /* Use vpuncklwd to pack 2 HFmode. */ - op0 = gen_reg_rtx (V8HFmode); - even = lowpart_subreg (V8HFmode, force_reg (HFmode, op), HFmode); - odd = lowpart_subreg (V8HFmode, - force_reg (HFmode, ops[i + i + 1]), - HFmode); + /* Use vpuncklwd to pack 2 HFmode or BFmode. */ + machine_mode vec_mode = + (inner_mode == HFmode) ? V8HFmode : V8BFmode; + op0 = gen_reg_rtx (vec_mode); + even = lowpart_subreg (vec_mode, + force_reg (inner_mode, op), inner_mode); + odd = lowpart_subreg (vec_mode, + force_reg (inner_mode, ops[i + i + 1]), + inner_mode); emit_insn (gen_load_even (op0, even, odd)); } else @@ -15824,6 +15865,10 @@ ix86_expand_vector_init_general (bool mmx_ok, machine_mode mode, half_mode = V8HFmode; goto half; + case E_V16BFmode: + half_mode = V8BFmode; + goto half; + half: n = GET_MODE_NUNITS (mode); for (i = 0; i < n; i++) @@ -15852,6 +15897,11 @@ half: half_mode = V16HFmode; goto quarter; + case E_V32BFmode: + quarter_mode = V8BFmode; + half_mode = V16BFmode; + goto quarter; + quarter: n = GET_MODE_NUNITS (mode); for (i = 0; i < n; i++) @@ -15891,6 +15941,7 @@ quarter: /* FALLTHRU */ case E_V8HFmode: + case E_V8BFmode: n = GET_MODE_NUNITS (mode); for (i = 0; i < n; i++) @@ -15994,7 +16045,8 @@ ix86_expand_vector_init (bool mmx_ok, rtx target, rtx vals) if (inner_mode == QImode || inner_mode == HImode || inner_mode == TImode - || inner_mode == HFmode) + || inner_mode == HFmode + || inner_mode == BFmode) { unsigned int n_bits = n_elts * GET_MODE_SIZE (inner_mode); scalar_mode elt_mode = inner_mode == TImode ? DImode : SImode; @@ -16078,7 +16130,8 @@ ix86_expand_vector_set_var (rtx target, rtx val, rtx idx) /* 512-bits vector byte/word broadcast and comparison only available under TARGET_AVX512BW, break 512-bits vector into two 256-bits vector when without TARGET_AVX512BW. */ - if ((mode == V32HImode || mode == V32HFmode || mode == V64QImode) + if ((mode == V32HImode || mode == V32HFmode || mode == V32BFmode + || mode == V64QImode) && !TARGET_AVX512BW) { gcc_assert (TARGET_AVX512F); @@ -16099,6 +16152,12 @@ ix86_expand_vector_set_var (rtx target, rtx val, rtx idx) extract_hi = gen_vec_extract_hi_v32hf; extract_lo = gen_vec_extract_lo_v32hf; } + else if (mode == V32BFmode) + { + half_mode = V16BFmode; + extract_hi = gen_vec_extract_hi_v32bf; + extract_lo = gen_vec_extract_lo_v32bf; + } else { half_mode = V32QImode; @@ -16155,6 +16214,15 @@ ix86_expand_vector_set_var (rtx target, rtx val, rtx idx) case E_V32HFmode: cmp_mode = V32HImode; break; + case E_V8BFmode: + cmp_mode = V8HImode; + break; + case E_V16BFmode: + cmp_mode = V16HImode; + break; + case E_V32BFmode: + cmp_mode = V32HImode; + break; default: gcc_unreachable (); } @@ -16192,7 +16260,7 @@ ix86_expand_vector_set (bool mmx_ok, rtx target, rtx val, int elt) bool use_vec_merge = false; bool blendm_const = false; rtx tmp; - static rtx (*gen_extract[7][2]) (rtx, rtx) + static rtx (*gen_extract[8][2]) (rtx, rtx) = { { gen_vec_extract_lo_v32qi, gen_vec_extract_hi_v32qi }, { gen_vec_extract_lo_v16hi, gen_vec_extract_hi_v16hi }, @@ -16200,9 +16268,10 @@ ix86_expand_vector_set (bool mmx_ok, rtx target, rtx val, int elt) { gen_vec_extract_lo_v4di, gen_vec_extract_hi_v4di }, { gen_vec_extract_lo_v8sf, gen_vec_extract_hi_v8sf }, { gen_vec_extract_lo_v4df, gen_vec_extract_hi_v4df }, - { gen_vec_extract_lo_v16hf, gen_vec_extract_hi_v16hf } + { gen_vec_extract_lo_v16hf, gen_vec_extract_hi_v16hf }, + { gen_vec_extract_lo_v16bf, gen_vec_extract_hi_v16bf } }; - static rtx (*gen_insert[7][2]) (rtx, rtx, rtx) + static rtx (*gen_insert[8][2]) (rtx, rtx, rtx) = { { gen_vec_set_lo_v32qi, gen_vec_set_hi_v32qi }, { gen_vec_set_lo_v16hi, gen_vec_set_hi_v16hi }, @@ -16211,6 +16280,7 @@ ix86_expand_vector_set (bool mmx_ok, rtx target, rtx val, int elt) { gen_vec_set_lo_v8sf, gen_vec_set_hi_v8sf }, { gen_vec_set_lo_v4df, gen_vec_set_hi_v4df }, { gen_vec_set_lo_v16hf, gen_vec_set_hi_v16hf }, + { gen_vec_set_lo_v16bf, gen_vec_set_hi_v16bf }, }; int i, j, n; machine_mode mmode = VOIDmode; @@ -16379,6 +16449,7 @@ ix86_expand_vector_set (bool mmx_ok, rtx target, rtx val, int elt) case E_V8HImode: case E_V8HFmode: + case E_V8BFmode: case E_V2HImode: use_vec_merge = TARGET_SSE2; break; @@ -16402,18 +16473,20 @@ ix86_expand_vector_set (bool mmx_ok, rtx target, rtx val, int elt) goto half; case E_V16HFmode: + case E_V16BFmode: /* For ELT == 0, vec_setv8hf_0 can save 1 vpbroadcastw. */ if (TARGET_AVX2 && elt != 0) { mmode = SImode; - gen_blendm = gen_avx2_pblendph_1; + gen_blendm = ((mode == E_V16HFmode) ? gen_avx2_pblendph_1 + : gen_avx2_pblendbf_1); blendm_const = true; break; } else { - half_mode = V8HFmode; - j = 6; + half_mode = ((mode == E_V16HFmode) ? V8HFmode : V8BFmode); + j = ((mode == E_V16HFmode) ? 6 : 7); n = 8; goto half; } @@ -16505,6 +16578,13 @@ half: gen_blendm = gen_avx512bw_blendmv32hf; } break; + case E_V32BFmode: + if (TARGET_AVX512BW) + { + mmode = SImode; + gen_blendm = gen_avx512bw_blendmv32bf; + } + break; case E_V32HImode: if (TARGET_AVX512BW) { @@ -16712,6 +16792,7 @@ ix86_expand_vector_extract (bool mmx_ok, rtx target, rtx vec, int elt) case E_V8HImode: case E_V8HFmode: + case E_V8BFmode: case E_V2HImode: use_vec_extr = TARGET_SSE2; break; @@ -16878,26 +16959,32 @@ ix86_expand_vector_extract (bool mmx_ok, rtx target, rtx vec, int elt) return; case E_V32HFmode: + case E_V32BFmode: if (TARGET_AVX512BW) { - tmp = gen_reg_rtx (V16HFmode); + tmp = (mode == E_V32HFmode + ? gen_reg_rtx (V16HFmode) + : gen_reg_rtx (V16BFmode)); if (elt < 16) - emit_insn (gen_vec_extract_lo_v32hf (tmp, vec)); + emit_insn (maybe_gen_vec_extract_lo (mode, tmp, vec)); else - emit_insn (gen_vec_extract_hi_v32hf (tmp, vec)); + emit_insn (maybe_gen_vec_extract_hi (mode, tmp, vec)); ix86_expand_vector_extract (false, target, tmp, elt & 15); return; } break; case E_V16HFmode: + case E_V16BFmode: if (TARGET_AVX) { - tmp = gen_reg_rtx (V8HFmode); + tmp = (mode == E_V16HFmode + ? gen_reg_rtx (V8HFmode) + : gen_reg_rtx (V8BFmode)); if (elt < 8) - emit_insn (gen_vec_extract_lo_v16hf (tmp, vec)); + emit_insn (maybe_gen_vec_extract_lo (mode, tmp, vec)); else - emit_insn (gen_vec_extract_hi_v16hf (tmp, vec)); + emit_insn (maybe_gen_vec_extract_hi (mode, tmp, vec)); ix86_expand_vector_extract (false, target, tmp, elt & 7); return; } diff --git a/gcc/config/i386/i386-features.cc b/gcc/config/i386/i386-features.cc index 821d8c7..d6bb66c 100644 --- a/gcc/config/i386/i386-features.cc +++ b/gcc/config/i386/i386-features.cc @@ -1248,7 +1248,7 @@ timode_scalar_chain::compute_convert_gain () case ASHIFT: case LSHIFTRT: /* See ix86_expand_v1ti_shift. */ - op1val = XINT (src, 1); + op1val = INTVAL (XEXP (src, 1)); if (optimize_insn_for_size_p ()) { if (op1val == 64 || op1val == 65) @@ -1282,7 +1282,7 @@ timode_scalar_chain::compute_convert_gain () case ASHIFTRT: /* See ix86_expand_v1ti_ashiftrt. */ - op1val = XINT (src, 1); + op1val = INTVAL (XEXP (src, 1)); if (optimize_insn_for_size_p ()) { if (op1val == 64 || op1val == 127) @@ -1355,7 +1355,7 @@ timode_scalar_chain::compute_convert_gain () case ROTATE: case ROTATERT: /* See ix86_expand_v1ti_rotate. */ - op1val = XINT (src, 1); + op1val = INTVAL (XEXP (src, 1)); if (optimize_insn_for_size_p ()) { scost = COSTS_N_BYTES (13); diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc index fa3722a..e27c87f 100644 --- a/gcc/config/i386/i386.cc +++ b/gcc/config/i386/i386.cc @@ -2463,6 +2463,7 @@ classify_argument (machine_mode mode, const_tree type, case E_V8SImode: case E_V32QImode: case E_V16HFmode: + case E_V16BFmode: case E_V16HImode: case E_V4DFmode: case E_V4DImode: @@ -2474,6 +2475,7 @@ classify_argument (machine_mode mode, const_tree type, case E_V8DFmode: case E_V16SFmode: case E_V32HFmode: + case E_V32BFmode: case E_V8DImode: case E_V16SImode: case E_V32HImode: @@ -2492,6 +2494,7 @@ classify_argument (machine_mode mode, const_tree type, case E_V16QImode: case E_V8HImode: case E_V8HFmode: + case E_V8BFmode: case E_V2DFmode: case E_V2DImode: classes[0] = X86_64_SSE_CLASS; @@ -2947,6 +2950,7 @@ pass_in_reg: /* FALLTHRU */ case E_V16HFmode: + case E_V16BFmode: case E_V8SFmode: case E_V8SImode: case E_V64QImode: @@ -2954,6 +2958,7 @@ pass_in_reg: case E_V16SImode: case E_V8DImode: case E_V32HFmode: + case E_V32BFmode: case E_V16SFmode: case E_V8DFmode: case E_V32QImode: @@ -2966,6 +2971,7 @@ pass_in_reg: case E_V4SImode: case E_V2DImode: case E_V8HFmode: + case E_V8BFmode: case E_V4SFmode: case E_V2DFmode: if (!type || !AGGREGATE_TYPE_P (type)) @@ -3190,6 +3196,7 @@ pass_in_reg: case E_V4SImode: case E_V2DImode: case E_V8HFmode: + case E_V8BFmode: case E_V4SFmode: case E_V2DFmode: if (!type || !AGGREGATE_TYPE_P (type)) @@ -3210,9 +3217,11 @@ pass_in_reg: case E_V16SImode: case E_V8DImode: case E_V32HFmode: + case E_V32BFmode: case E_V16SFmode: case E_V8DFmode: case E_V16HFmode: + case E_V16BFmode: case E_V8SFmode: case E_V8SImode: case E_V32QImode: @@ -3273,6 +3282,7 @@ function_arg_64 (const CUMULATIVE_ARGS *cum, machine_mode mode, break; case E_V16HFmode: + case E_V16BFmode: case E_V8SFmode: case E_V8SImode: case E_V32QImode: @@ -3280,6 +3290,7 @@ function_arg_64 (const CUMULATIVE_ARGS *cum, machine_mode mode, case E_V4DFmode: case E_V4DImode: case E_V32HFmode: + case E_V32BFmode: case E_V16SFmode: case E_V16SImode: case E_V64QImode: @@ -4748,6 +4759,7 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, switch (nat_mode) { case E_V16HFmode: + case E_V16BFmode: case E_V8SFmode: case E_V8SImode: case E_V32QImode: @@ -4755,6 +4767,7 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, case E_V4DFmode: case E_V4DImode: case E_V32HFmode: + case E_V32BFmode: case E_V16SFmode: case E_V16SImode: case E_V64QImode: @@ -5430,7 +5443,7 @@ ix86_get_ssemov (rtx *operands, unsigned size, switch (type) { case opcode_int: - if (scalar_mode == E_HFmode) + if (scalar_mode == E_HFmode || scalar_mode == E_BFmode) opcode = (misaligned_p ? (TARGET_AVX512BW ? "vmovdqu16" : "vmovdqu64") : "vmovdqa64"); @@ -5450,6 +5463,7 @@ ix86_get_ssemov (rtx *operands, unsigned size, switch (scalar_mode) { case E_HFmode: + case E_BFmode: if (evex_reg_p) opcode = (misaligned_p ? (TARGET_AVX512BW diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 0da3dce..0de5c77 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -1011,7 +1011,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #define VALID_AVX256_REG_MODE(MODE) \ ((MODE) == V32QImode || (MODE) == V16HImode || (MODE) == V8SImode \ || (MODE) == V4DImode || (MODE) == V2TImode || (MODE) == V8SFmode \ - || (MODE) == V4DFmode || (MODE) == V16HFmode) + || (MODE) == V4DFmode || (MODE) == V16HFmode || (MODE) == V16BFmode) #define VALID_AVX256_REG_OR_OI_MODE(MODE) \ (VALID_AVX256_REG_MODE (MODE) || (MODE) == OImode) @@ -1026,7 +1026,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #define VALID_AVX512F_REG_MODE(MODE) \ ((MODE) == V8DImode || (MODE) == V8DFmode || (MODE) == V64QImode \ || (MODE) == V16SImode || (MODE) == V16SFmode || (MODE) == V32HImode \ - || (MODE) == V4TImode || (MODE) == V32HFmode) + || (MODE) == V4TImode || (MODE) == V32HFmode || (MODE) == V32BFmode) #define VALID_AVX512F_REG_OR_XI_MODE(MODE) \ (VALID_AVX512F_REG_MODE (MODE) || (MODE) == XImode) @@ -1035,7 +1035,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); ((MODE) == V2DImode || (MODE) == V2DFmode || (MODE) == V16QImode \ || (MODE) == V4SImode || (MODE) == V4SFmode || (MODE) == V8HImode \ || (MODE) == TFmode || (MODE) == V1TImode || (MODE) == V8HFmode \ - || (MODE) == TImode) + || (MODE) == V8BFmode || (MODE) == TImode) #define VALID_AVX512FP16_REG_MODE(MODE) \ ((MODE) == V8HFmode || (MODE) == V16HFmode || (MODE) == V32HFmode \ @@ -1044,6 +1044,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #define VALID_SSE2_REG_MODE(MODE) \ ((MODE) == V16QImode || (MODE) == V8HImode || (MODE) == V2DFmode \ || (MODE) == V8HFmode || (MODE) == V4HFmode || (MODE) == V2HFmode \ + || (MODE) == V8BFmode \ || (MODE) == V4QImode || (MODE) == V2HImode || (MODE) == V1SImode \ || (MODE) == V2DImode || (MODE) == V2QImode || (MODE) == DFmode \ || (MODE) == HFmode || (MODE) == BFmode) @@ -1095,8 +1096,9 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); || (MODE) == V4DImode || (MODE) == V8SFmode || (MODE) == V4DFmode \ || (MODE) == V2TImode || (MODE) == V8DImode || (MODE) == V64QImode \ || (MODE) == V16SImode || (MODE) == V32HImode || (MODE) == V8DFmode \ - || (MODE) == V16SFmode || (MODE) == V32HFmode || (MODE) == V16HFmode \ - || (MODE) == V8HFmode) + || (MODE) == V16SFmode \ + || (MODE) == V32HFmode || (MODE) == V16HFmode || (MODE) == V8HFmode \ + || (MODE) == V32BFmode || (MODE) == V16BFmode || (MODE) == V8BFmode) #define X87_FLOAT_MODE_P(MODE) \ (TARGET_80387 && ((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode)) diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 5f7e245..58fcc38 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -1114,7 +1114,8 @@ (V2DF "16") (V4DF "32") (V8DF "64") (V4SF "16") (V8SF "32") (V16SF "64") (V8HF "16") (V16HF "32") (V32HF "64") - (V4HF "8") (V2HF "4")]) + (V4HF "8") (V2HF "4") + (V8BF "16") (V16BF "32") (V32BF "64")]) ;; Double word integer modes as mode attribute. (define_mode_attr DWI [(QI "HI") (HI "SI") (SI "DI") (DI "TI") (TI "OI")]) @@ -1258,8 +1259,8 @@ (define_mode_attr ssemodesuffix [(HF "sh") (SF "ss") (DF "sd") (V32HF "ph") (V16SF "ps") (V8DF "pd") - (V16HF "ph") (V8SF "ps") (V4DF "pd") - (V8HF "ph") (V4SF "ps") (V2DF "pd") + (V16HF "ph") (V16BF "bf") (V8SF "ps") (V4DF "pd") + (V8HF "ph") (V8BF "bf") (V4SF "ps") (V2DF "pd") (V16QI "b") (V8HI "w") (V4SI "d") (V2DI "q") (V32QI "b") (V16HI "w") (V8SI "d") (V4DI "q") (V64QI "b") (V32HI "w") (V16SI "d") (V8DI "q")]) @@ -1269,7 +1270,7 @@ ;; SSE vector mode corresponding to a scalar mode (define_mode_attr ssevecmode - [(QI "V16QI") (HI "V8HI") (SI "V4SI") (DI "V2DI") (HF "V8HF") (SF "V4SF") (DF "V2DF")]) + [(QI "V16QI") (HI "V8HI") (SI "V4SI") (DI "V2DI") (HF "V8HF") (BF "V8BF") (SF "V4SF") (DF "V2DF")]) (define_mode_attr ssevecmodelower [(QI "v16qi") (HI "v8hi") (SI "v4si") (DI "v2di") (SF "v4sf") (DF "v2df")]) diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index b23f07e..9351548 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -232,6 +232,7 @@ (V8DI "TARGET_AVX512F") (V4DI "TARGET_AVX") V2DI (V4TI "TARGET_AVX512F") (V2TI "TARGET_AVX") V1TI (V32HF "TARGET_AVX512F") (V16HF "TARGET_AVX") V8HF + (V32BF "TARGET_AVX512F") (V16BF "TARGET_AVX") V8BF (V16SF "TARGET_AVX512F") (V8SF "TARGET_AVX") V4SF (V8DF "TARGET_AVX512F") (V4DF "TARGET_AVX") V2DF]) @@ -263,10 +264,11 @@ [V64QI (V16QI "TARGET_AVX512VL") (V32QI "TARGET_AVX512VL") V32HI (V16HI "TARGET_AVX512VL") (V8HI "TARGET_AVX512VL")]) -(define_mode_iterator VI12HF_AVX512VL +(define_mode_iterator VI12HFBF_AVX512VL [V64QI (V16QI "TARGET_AVX512VL") (V32QI "TARGET_AVX512VL") V32HI (V16HI "TARGET_AVX512VL") (V8HI "TARGET_AVX512VL") - V32HF (V16HF "TARGET_AVX512VL") (V8HF "TARGET_AVX512VL")]) + V32HF (V16HF "TARGET_AVX512VL") (V8HF "TARGET_AVX512VL") + V32BF (V16BF "TARGET_AVX512VL") (V8BF "TARGET_AVX512VL")]) ;; Same iterator, but without supposed TARGET_AVX512BW (define_mode_iterator VI12_AVX512VLBW @@ -309,10 +311,10 @@ ;; All 256bit and 512bit vector modes (define_mode_iterator V_256_512 - [V32QI V16HI V16HF V8SI V4DI V8SF V4DF + [V32QI V16HI V16HF V16BF V8SI V4DI V8SF V4DF (V64QI "TARGET_AVX512F") (V32HI "TARGET_AVX512F") (V32HF "TARGET_AVX512F") - (V16SI "TARGET_AVX512F") (V8DI "TARGET_AVX512F") (V16SF "TARGET_AVX512F") - (V8DF "TARGET_AVX512F")]) + (V32BF "TARGET_AVX512F") (V16SI "TARGET_AVX512F") (V8DI "TARGET_AVX512F") + (V16SF "TARGET_AVX512F") (V8DF "TARGET_AVX512F")]) ;; All vector float modes (define_mode_iterator VF @@ -435,6 +437,13 @@ (define_mode_iterator VF_AVX512FP16 [V32HF V16HF V8HF]) +(define_mode_iterator VF_AVX512HFBF16 + [(V32HF "TARGET_AVX512FP16") (V16HF "TARGET_AVX512FP16") + (V8HF "TARGET_AVX512FP16") V32BF V16BF V8BF]) + +(define_mode_iterator VF_AVX512BWHFBF16 + [V32HF V16HF V8HF V32BF V16BF V8BF]) + (define_mode_iterator VF_AVX512FP16VL [V32HF (V16HF "TARGET_AVX512VL") (V8HF "TARGET_AVX512VL")]) @@ -447,13 +456,14 @@ (V4DI "TARGET_AVX") V2DI]) ;; All vector integer and HF modes -(define_mode_iterator VIHF +(define_mode_iterator VIHFBF [(V16SI "TARGET_AVX512F") (V8DI "TARGET_AVX512F") (V64QI "TARGET_AVX512BW") (V32QI "TARGET_AVX") V16QI (V32HI "TARGET_AVX512BW") (V16HI "TARGET_AVX") V8HI (V8SI "TARGET_AVX") V4SI (V4DI "TARGET_AVX") V2DI - (V32HF "TARGET_AVX512BW") (V16HF "TARGET_AVX") V8HF]) + (V32HF "TARGET_AVX512BW") (V16HF "TARGET_AVX") V8HF + (V32BF "TARGET_AVX512BW") (V16BF "TARGET_AVX") V8BF]) (define_mode_iterator VI_AVX2 [(V64QI "TARGET_AVX512BW") (V32QI "TARGET_AVX2") V16QI @@ -676,6 +686,7 @@ (V4SI "avx512vl") (V8SI "avx512vl") (V16SI "avx512f") (V2DI "avx512vl") (V4DI "avx512vl") (V8DI "avx512f") (V8HF "avx512fp16") (V16HF "avx512vl") (V32HF "avx512bw") + (V8BF "avx512vl") (V16BF "avx512vl") (V32BF "avx512bw") (V4SF "avx512vl") (V8SF "avx512vl") (V16SF "avx512f") (V2DF "avx512vl") (V4DF "avx512vl") (V8DF "avx512f")]) @@ -786,7 +797,7 @@ ;; All 128 and 256bit vector integer modes (define_mode_iterator VI_128_256 [V16QI V8HI V4SI V2DI V32QI V16HI V8SI V4DI]) ;; All 256bit vector integer and HF modes -(define_mode_iterator VIHF_256 [V32QI V16HI V8SI V4DI V16HF]) +(define_mode_iterator VIHFBF_256 [V32QI V16HI V8SI V4DI V16HF V16BF]) ;; Various 128bit vector integer mode combinations (define_mode_iterator VI12_128 [V16QI V8HI]) @@ -813,12 +824,12 @@ (define_mode_iterator VI4_256_8_512 [V8SI V8DI]) (define_mode_iterator VI_AVX512BW [V16SI V8DI (V32HI "TARGET_AVX512BW") (V64QI "TARGET_AVX512BW")]) -(define_mode_iterator VIHF_AVX512BW +(define_mode_iterator VIHFBF_AVX512BW [V16SI V8DI (V32HI "TARGET_AVX512BW") (V64QI "TARGET_AVX512BW") - (V32HF "TARGET_AVX512BW")]) + (V32HF "TARGET_AVX512BW") (V32BF "TARGET_AVX512BW")]) ;; Int-float size matches -(define_mode_iterator VI2F_256_512 [V16HI V32HI V16HF V32HF]) +(define_mode_iterator VI2F_256_512 [V16HI V32HI V16HF V32HF V16BF V32BF]) (define_mode_iterator VI4F_128 [V4SI V4SF]) (define_mode_iterator VI8F_128 [V2DI V2DF]) (define_mode_iterator VI4F_256 [V8SI V8SF]) @@ -863,9 +874,9 @@ (V8SF "TARGET_AVX512VL") (V4DF "TARGET_AVX512VL") V16SF V8DF]) -(define_mode_iterator V8_128 [V8HI V8HF]) -(define_mode_iterator V16_256 [V16HI V16HF]) -(define_mode_iterator V32_512 [V32HI V32HF]) +(define_mode_iterator V8_128 [V8HI V8HF V8BF]) +(define_mode_iterator V16_256 [V16HI V16HF V16BF]) +(define_mode_iterator V32_512 [V32HI V32HF V32BF]) ;; Mapping from float mode to required SSE level (define_mode_attr sse @@ -910,6 +921,7 @@ (V8SF "V8SF") (V4DF "V4DF") (V4SF "V4SF") (V2DF "V2DF") (V8HF "TI") (V16HF "OI") (V32HF "XI") + (V8BF "TI") (V16BF "OI") (V32BF "XI") (TI "TI")]) (define_mode_attr sseintvecinsnmode @@ -926,16 +938,17 @@ [(V64QI "BC") (V32HI "BC") (V16SI "BC") (V8DI "BC") (V4TI "BC") (V32QI "BC") (V16HI "BC") (V8SI "BC") (V4DI "BC") (V2TI "BC") (V16QI "BC") (V8HI "BC") (V4SI "BC") (V2DI "BC") (V1TI "BC") - (V32HF "BF") (V16SF "BF") (V8DF "BF") - (V16HF "BF") (V8SF "BF") (V4DF "BF") - (V8HF "BF") (V4SF "BF") (V2DF "BF")]) + (V32HF "BF") (V32BF "BF") (V16SF "BF") (V8DF "BF") + (V16HF "BF") (V16BF "BF") (V8SF "BF") (V4DF "BF") + (V8HF "BF") (V8BF "BF") (V4SF "BF") (V2DF "BF")]) ;; SSE integer instruction suffix for various modes (define_mode_attr sseintmodesuffix [(V16QI "b") (V8HI "w") (V4SI "d") (V2DI "q") (V32QI "b") (V16HI "w") (V8SI "d") (V4DI "q") (V64QI "b") (V32HI "w") (V16SI "d") (V8DI "q") - (V8HF "w") (V16HF "w") (V32HF "w")]) + (V8HF "w") (V16HF "w") (V32HF "w") + (V8BF "w") (V16BF "w") (V32BF "w")]) ;; Mapping of vector modes to corresponding mask size (define_mode_attr avx512fmaskmode @@ -944,6 +957,7 @@ (V16SI "HI") (V8SI "QI") (V4SI "QI") (V8DI "QI") (V4DI "QI") (V2DI "QI") (V32HF "SI") (V16HF "HI") (V8HF "QI") + (V32BF "SI") (V16BF "HI") (V8BF "QI") (V16SF "HI") (V8SF "QI") (V4SF "QI") (V8DF "QI") (V4DF "QI") (V2DF "QI")]) @@ -958,6 +972,7 @@ (V16SI "hi") (V8SI "qi") (V4SI "qi") (V8DI "qi") (V4DI "qi") (V2DI "qi") (V32HF "si") (V16HF "hi") (V8HF "qi") + (V32BF "si") (V16BF "hi") (V8BF "qi") (V16SF "hi") (V8SF "qi") (V4SF "qi") (V8DF "qi") (V4DF "qi") (V2DF "qi")]) @@ -973,9 +988,9 @@ ;; Mapping of vector float modes to an integer mode of the same size (define_mode_attr sseintvecmode - [(V32HF "V32HI") (V16SF "V16SI") (V8DF "V8DI") - (V16HF "V16HI") (V8SF "V8SI") (V4DF "V4DI") - (V8HF "V8HI") (V4SF "V4SI") (V2DF "V2DI") + [(V32HF "V32HI") (V32BF "V32HI") (V16SF "V16SI") (V8DF "V8DI") + (V16HF "V16HI") (V16BF "V16HI") (V8SF "V8SI") (V4DF "V4DI") + (V8HF "V8HI") (V8BF "V8HI") (V4SF "V4SI") (V2DF "V2DI") (V16SI "V16SI") (V8DI "V8DI") (V8SI "V8SI") (V4DI "V4DI") (V4SI "V4SI") (V2DI "V2DI") @@ -998,9 +1013,9 @@ (V16HF "OI") (V8HF "TI")]) (define_mode_attr sseintvecmodelower - [(V32HF "v32hi") (V16SF "v16si") (V8DF "v8di") - (V16HF "v16hi") (V8SF "v8si") (V4DF "v4di") - (V8HF "v8hi") (V4SF "v4si") (V2DF "v2di") + [(V32HF "v32hi") (V32BF "v32hi") (V16SF "v16si") (V8DF "v8di") + (V16HF "v16hi") (V16BF "v16hi") (V8SF "v8si") (V4DF "v4di") + (V8HF "v8hi") (V8BF "v8hi") (V4SF "v4si") (V2DF "v2di") (V8SI "v8si") (V4DI "v4di") (V4SI "v4si") (V2DI "v2di") (V16HI "v16hi") (V8HI "v8hi") @@ -1014,7 +1029,8 @@ (V16SF "V32SF") (V8DF "V16DF") (V8SF "V16SF") (V4DF "V8DF") (V4SF "V8SF") (V2DF "V4DF") - (V32HF "V64HF") (V16HF "V32HF") (V8HF "V16HF")]) + (V32HF "V64HF") (V16HF "V32HF") (V8HF "V16HF") + (V32BF "V64BF") (V16BF "V32BF") (V8BF "V16BF")]) ;; Mapping of vector modes to a vector mode of half size ;; instead of V1DI/V1DF, DI/DF are used for V2DI/V2DF although they are scalar. @@ -1025,7 +1041,8 @@ (V16SF "V8SF") (V8DF "V4DF") (V8SF "V4SF") (V4DF "V2DF") (V4SF "V2SF") (V2DF "DF") - (V32HF "V16HF") (V16HF "V8HF") (V8HF "V4HF")]) + (V32HF "V16HF") (V16HF "V8HF") (V8HF "V4HF") + (V32BF "V16BF") (V16BF "V8BF") (V8BF "V4BF")]) (define_mode_attr ssehalfvecmodelower [(V64QI "v32qi") (V32HI "v16hi") (V16SI "v8si") (V8DI "v4di") (V4TI "v2ti") @@ -1034,7 +1051,8 @@ (V16SF "v8sf") (V8DF "v4df") (V8SF "v4sf") (V4DF "v2df") (V4SF "v2sf") - (V32HF "v16hf") (V16HF "v8hf") (V8HF "v4hf")]) + (V32HF "v16hf") (V16HF "v8hf") (V8HF "v4hf") + (V32BF "v16bf") (V16BF "v8bf") (V8BF "v4bf")]) ;; Mapping of vector modes to vector hf modes of conversion. (define_mode_attr ssePHmode @@ -1085,6 +1103,7 @@ (V16SI "SI") (V8SI "SI") (V4SI "SI") (V8DI "DI") (V4DI "DI") (V2DI "DI") (V32HF "HF") (V16HF "HF") (V8HF "HF") + (V32BF "BF") (V16BF "BF") (V8BF "BF") (V16SF "SF") (V8SF "SF") (V4SF "SF") (V8DF "DF") (V4DF "DF") (V2DF "DF") (V4TI "TI") (V2TI "TI")]) @@ -1096,6 +1115,7 @@ (V16SI "si") (V8SI "si") (V4SI "si") (V8DI "di") (V4DI "di") (V2DI "di") (V32HF "hf") (V16HF "hf") (V8HF "hf") + (V32BF "bf") (V16BF "bf") (V8BF "bf") (V16SF "sf") (V8SF "sf") (V4SF "sf") (V8DF "df") (V4DF "df") (V2DF "df") (V4TI "ti") (V2TI "ti")]) @@ -1107,6 +1127,7 @@ (V16SI "V4SI") (V8SI "V4SI") (V4SI "V4SI") (V8DI "V2DI") (V4DI "V2DI") (V2DI "V2DI") (V32HF "V8HF") (V16HF "V8HF") (V8HF "V8HF") + (V32BF "V8BF") (V16BF "V8BF") (V8BF "V8BF") (V16SF "V4SF") (V8SF "V4SF") (V4SF "V4SF") (V8DF "V2DF") (V4DF "V2DF") (V2DF "V2DF")]) @@ -1128,6 +1149,7 @@ (V16SF "d") (V8SF "d") (V4SF "d") (V32HI "d") (V16HI "d") (V8HI "d") (V32HF "d") (V16HF "d") (V8HF "d") + (V32BF "d") (V16BF "d") (V8BF "d") (V64QI "d") (V32QI "d") (V16QI "d")]) ;; Number of scalar elements in each vector type @@ -1153,6 +1175,7 @@ (V32HI "16") (V16HI "16") (V8HI "16") (V16SI "32") (V8SI "32") (V4SI "32") (V32HF "16") (V16HF "16") (V8HF "16") + (V32BF "16") (V16BF "16") (V8BF "16") (V16SF "32") (V8SF "32") (V4SF "32") (V8DF "64") (V4DF "64") (V2DF "64")]) @@ -1164,9 +1187,9 @@ (V4SI "p") (V4SF "") (V8SI "p") (V8SF "") (V16SI "p") (V16SF "") - (V16QI "p") (V8HI "p") (V8HF "p") - (V32QI "p") (V16HI "p") (V16HF "p") - (V64QI "p") (V32HI "p") (V32HF "p")]) + (V16QI "p") (V8HI "p") (V8HF "p") (V8BF "p") + (V32QI "p") (V16HI "p") (V16HF "p") (V16BF "p") + (V64QI "p") (V32HI "p") (V32HF "p") (V32BF "p")]) ;; SSE prefix for integer and HF vector comparison. (define_mode_attr ssecmpintprefix @@ -1219,7 +1242,8 @@ ;; i128 for integer vectors and TARGET_AVX2, f128 otherwise. ;; i64x4 or f64x4 for 512bit modes. (define_mode_attr i128 - [(V16HF "%~128") (V32HF "i64x4") (V16SF "f64x4") (V8SF "f128") + [(V16HF "%~128") (V32HF "i64x4") (V16BF "%~128") (V32BF "i64x4") + (V16SF "f64x4") (V8SF "f128") (V8DF "f64x4") (V4DF "f128") (V64QI "i64x4") (V32QI "%~128") (V32HI "i64x4") (V16HI "%~128") (V16SI "i64x4") (V8SI "%~128") (V8DI "i64x4") (V4DI "%~128")]) @@ -1245,17 +1269,18 @@ (V16SI "d") (V8SI "d") (V4SI "d") (V8DI "q") (V4DI "q") (V2DI "q") (V32HF "w") (V16HF "w") (V8HF "w") + (V32BF "w") (V16BF "w") (V8BF "w") (V16SF "ss") (V8SF "ss") (V4SF "ss") (V8DF "sd") (V4DF "sd") (V2DF "sd")]) ;; Tie mode of assembler operand to mode iterator (define_mode_attr xtg_mode [(V16QI "x") (V8HI "x") (V4SI "x") (V2DI "x") - (V8HF "x") (V4SF "x") (V2DF "x") + (V8HF "x") (V8BF "x") (V4SF "x") (V2DF "x") (V32QI "t") (V16HI "t") (V8SI "t") (V4DI "t") - (V16HF "t") (V8SF "t") (V4DF "t") + (V16HF "t") (V16BF "t") (V8SF "t") (V4DF "t") (V64QI "g") (V32HI "g") (V16SI "g") (V8DI "g") - (V32HF "g") (V16SF "g") (V8DF "g")]) + (V32HF "g") (V32BF "g") (V16SF "g") (V8DF "g")]) ;; Half mask mode for unpacks (define_mode_attr HALFMASKMODE @@ -1553,10 +1578,10 @@ (set_attr "mode" "<sseinsnmode>")]) (define_insn "<avx512>_blendm<mode>" - [(set (match_operand:VF_AVX512FP16 0 "register_operand" "=v,v") - (vec_merge:VF_AVX512FP16 - (match_operand:VF_AVX512FP16 2 "nonimmediate_operand" "vm,vm") - (match_operand:VF_AVX512FP16 1 "nonimm_or_0_operand" "0C,v") + [(set (match_operand:VF_AVX512BWHFBF16 0 "register_operand" "=v,v") + (vec_merge:VF_AVX512BWHFBF16 + (match_operand:VF_AVX512BWHFBF16 2 "nonimmediate_operand" "vm,vm") + (match_operand:VF_AVX512BWHFBF16 1 "nonimm_or_0_operand" "0C,v") (match_operand:<avx512fmaskmode> 3 "register_operand" "Yk,Yk")))] "TARGET_AVX512BW" "@ @@ -1595,9 +1620,9 @@ (set_attr "mode" "<sseinsnmode>")]) (define_insn "<avx512>_store<mode>_mask" - [(set (match_operand:VI12HF_AVX512VL 0 "memory_operand" "=m") - (vec_merge:VI12HF_AVX512VL - (match_operand:VI12HF_AVX512VL 1 "register_operand" "v") + [(set (match_operand:VI12HFBF_AVX512VL 0 "memory_operand" "=m") + (vec_merge:VI12HFBF_AVX512VL + (match_operand:VI12HFBF_AVX512VL 1 "register_operand" "v") (match_dup 0) (match_operand:<avx512fmaskmode> 2 "register_operand" "Yk")))] "TARGET_AVX512BW" @@ -4513,14 +4538,18 @@ DONE; }) +(define_mode_iterator VF_AVX512HFBFVL + [V32HF (V16HF "TARGET_AVX512VL") (V8HF "TARGET_AVX512VL") + V32BF (V16BF "TARGET_AVX512VL") (V8BF "TARGET_AVX512VL")]) + (define_expand "vcond<mode><sseintvecmodelower>" - [(set (match_operand:VF_AVX512FP16VL 0 "register_operand") - (if_then_else:VF_AVX512FP16VL + [(set (match_operand:VF_AVX512HFBFVL 0 "register_operand") + (if_then_else:VF_AVX512HFBFVL (match_operator 3 "" [(match_operand:<sseintvecmode> 4 "vector_operand") (match_operand:<sseintvecmode> 5 "vector_operand")]) - (match_operand:VF_AVX512FP16VL 1 "general_operand") - (match_operand:VF_AVX512FP16VL 2 "general_operand")))] + (match_operand:VF_AVX512HFBFVL 1 "general_operand") + (match_operand:VF_AVX512HFBFVL 2 "general_operand")))] "TARGET_AVX512FP16" { bool ok = ix86_expand_int_vcond (operands); @@ -4552,10 +4581,10 @@ "TARGET_AVX512F") (define_expand "vcond_mask_<mode><avx512fmaskmodelower>" - [(set (match_operand:VI12HF_AVX512VL 0 "register_operand") - (vec_merge:VI12HF_AVX512VL - (match_operand:VI12HF_AVX512VL 1 "nonimmediate_operand") - (match_operand:VI12HF_AVX512VL 2 "nonimm_or_0_operand") + [(set (match_operand:VI12HFBF_AVX512VL 0 "register_operand") + (vec_merge:VI12HFBF_AVX512VL + (match_operand:VI12HFBF_AVX512VL 1 "nonimmediate_operand") + (match_operand:VI12HFBF_AVX512VL 2 "nonimm_or_0_operand") (match_operand:<avx512fmaskmode> 3 "register_operand")))] "TARGET_AVX512BW") @@ -10747,7 +10776,7 @@ (const_string "HF") (const_string "TI"))) (set (attr "enabled") - (cond [(and (not (match_test "<MODE>mode == V8HFmode")) + (cond [(and (not (match_test "<MODE>mode == V8HFmode || <MODE>mode == V8BFmode")) (eq_attr "alternative" "2")) (symbol_ref "false") ] @@ -10809,11 +10838,13 @@ DONE; }) -(define_insn "avx512fp16_movsh" - [(set (match_operand:V8HF 0 "register_operand" "=v") - (vec_merge:V8HF - (match_operand:V8HF 2 "register_operand" "v") - (match_operand:V8HF 1 "register_operand" "v") +(define_mode_iterator V8BFH_128 [V8HF V8BF]) + +(define_insn "avx512fp16_mov<mode>" + [(set (match_operand:V8BFH_128 0 "register_operand" "=v") + (vec_merge:V8BFH_128 + (match_operand:V8BFH_128 2 "register_operand" "v") + (match_operand:V8BFH_128 1 "register_operand" "v") (const_int 1)))] "TARGET_AVX512FP16" "vmovsh\t{%2, %1, %0|%0, %1, %2}" @@ -10996,9 +11027,9 @@ DONE; }) -(define_expand "vec_setv8hf" - [(match_operand:V8HF 0 "register_operand") - (match_operand:HF 1 "register_operand") +(define_expand "vec_set<mode>" + [(match_operand:V8BFH_128 0 "register_operand") + (match_operand:<ssescalarmode> 1 "register_operand") (match_operand 2 "vec_setm_sse41_operand")] "TARGET_SSE" { @@ -11726,7 +11757,7 @@ (set_attr "length_immediate" "1") (set_attr "mode" "<sseinsnmode>")]) -(define_insn_and_split "vec_extract_lo_<mode>" +(define_insn_and_split "@vec_extract_lo_<mode>" [(set (match_operand:<ssehalfvecmode> 0 "nonimmediate_operand" "=v,v,m") (vec_select:<ssehalfvecmode> (match_operand:V32_512 1 "nonimmediate_operand" "v,m,v") @@ -11768,7 +11799,7 @@ (set_attr "prefix" "evex") (set_attr "mode" "XI")]) -(define_insn "vec_extract_hi_<mode>" +(define_insn "@vec_extract_hi_<mode>" [(set (match_operand:<ssehalfvecmode> 0 "nonimmediate_operand" "=vm") (vec_select:<ssehalfvecmode> (match_operand:V32_512 1 "register_operand" "v") @@ -11788,7 +11819,7 @@ (set_attr "prefix" "evex") (set_attr "mode" "XI")]) -(define_insn_and_split "vec_extract_lo_<mode>" +(define_insn_and_split "@vec_extract_lo_<mode>" [(set (match_operand:<ssehalfvecmode> 0 "nonimmediate_operand" "=v,m") (vec_select:<ssehalfvecmode> (match_operand:V16_256 1 "nonimmediate_operand" "vm,v") @@ -11802,7 +11833,7 @@ [(set (match_dup 0) (match_dup 1))] "operands[1] = gen_lowpart (<ssehalfvecmode>mode, operands[1]);") -(define_insn "vec_extract_hi_<mode>" +(define_insn "@vec_extract_hi_<mode>" [(set (match_operand:<ssehalfvecmode> 0 "nonimmediate_operand" "=xm,vm,vm") (vec_select:<ssehalfvecmode> (match_operand:V16_256 1 "register_operand" "x,v,v") @@ -11944,20 +11975,20 @@ ;; NB: *vec_extract<mode>_0 must be placed before *vec_extracthf. ;; Otherwise, it will be ignored. (define_insn_and_split "*vec_extract<mode>_0" - [(set (match_operand:HF 0 "nonimmediate_operand" "=v,m,r") - (vec_select:HF - (match_operand:VF_AVX512FP16 1 "nonimmediate_operand" "vm,v,m") + [(set (match_operand:<ssescalarmode> 0 "nonimmediate_operand" "=v,m,r") + (vec_select:<ssescalarmode> + (match_operand:VF_AVX512HFBF16 1 "nonimmediate_operand" "vm,v,m") (parallel [(const_int 0)])))] - "TARGET_AVX512FP16 && !(MEM_P (operands[0]) && MEM_P (operands[1]))" + "TARGET_AVX512F && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "#" "&& reload_completed" [(set (match_dup 0) (match_dup 1))] - "operands[1] = gen_lowpart (HFmode, operands[1]);") + "operands[1] = gen_lowpart (<ssescalarmode>mode, operands[1]);") -(define_insn "*vec_extracthf" - [(set (match_operand:HF 0 "register_sse4nonimm_operand" "=?r,m,x,v") - (vec_select:HF - (match_operand:V8HF 1 "register_operand" "v,v,0,v") +(define_insn "*vec_extract<mode>" + [(set (match_operand:HFBF 0 "register_sse4nonimm_operand" "=?r,m,x,v") + (vec_select:HFBF + (match_operand:<ssevecmode> 1 "register_operand" "v,v,0,v") (parallel [(match_operand:SI 2 "const_0_to_7_operand")])))] "TARGET_SSE2" @@ -11992,6 +12023,7 @@ (V16SI "TARGET_AVX512F") (V8SI "TARGET_AVX") V4SI (V8DI "TARGET_AVX512F") (V4DI "TARGET_AVX") V2DI (V32HF "TARGET_AVX512BW") (V16HF "TARGET_AVX") V8HF + (V32BF "TARGET_AVX512BW") (V16BF "TARGET_AVX") V8BF (V16SF "TARGET_AVX512F") (V8SF "TARGET_AVX") V4SF (V8DF "TARGET_AVX512F") (V4DF "TARGET_AVX") V2DF (V4TI "TARGET_AVX512F") (V2TI "TARGET_AVX")]) @@ -18097,17 +18129,17 @@ ;; Modes handled by pinsr patterns. (define_mode_iterator PINSR_MODE - [(V16QI "TARGET_SSE4_1") V8HI V8HF + [(V16QI "TARGET_SSE4_1") V8HI V8HF V8BF (V4SI "TARGET_SSE4_1") (V2DI "TARGET_SSE4_1 && TARGET_64BIT")]) (define_mode_attr sse2p4_1 [(V16QI "sse4_1") (V8HI "sse2") (V8HF "sse2") - (V4SI "sse4_1") (V2DI "sse4_1")]) + (V8BF "sse2") (V4SI "sse4_1") (V2DI "sse4_1")]) (define_mode_attr pinsr_evex_isa [(V16QI "avx512bw") (V8HI "avx512bw") (V8HF "avx512bw") - (V4SI "avx512dq") (V2DI "avx512dq")]) + (V8BF "avx512bw") (V4SI "avx512dq") (V2DI "avx512dq")]) ;; sse4_1_pinsrd must come before sse2_loadld since it is preferred. (define_insn "<sse2p4_1>_pinsr<ssemodesuffix>" @@ -25193,11 +25225,12 @@ (V32HI "avx512bw") (V16HI "avx512bw") (V8HI "avx512bw") (V16SI "avx512f") (V8SI "avx512f") (V4SI "avx512f") (V8DI "avx512f") (V4DI "avx512f") (V2DI "avx512f") - (V32HF "avx512bw") (V16HF "avx512bw") (V8HF "avx512bw")]) + (V32HF "avx512bw") (V16HF "avx512bw") (V8HF "avx512bw") + (V32BF "avx512bw") (V16BF "avx512bw") (V8BF "avx512bw")]) (define_insn "avx2_pbroadcast<mode>" - [(set (match_operand:VIHF 0 "register_operand" "=x,v") - (vec_duplicate:VIHF + [(set (match_operand:VIHFBF 0 "register_operand" "=x,v") + (vec_duplicate:VIHFBF (vec_select:<ssescalarmode> (match_operand:<ssexmmmode> 1 "nonimmediate_operand" "xm,vm") (parallel [(const_int 0)]))))] @@ -25210,10 +25243,10 @@ (set_attr "mode" "<sseinsnmode>")]) (define_insn "avx2_pbroadcast<mode>_1" - [(set (match_operand:VIHF_256 0 "register_operand" "=x,x,v,v") - (vec_duplicate:VIHF_256 + [(set (match_operand:VIHFBF_256 0 "register_operand" "=x,x,v,v") + (vec_duplicate:VIHFBF_256 (vec_select:<ssescalarmode> - (match_operand:VIHF_256 1 "nonimmediate_operand" "m,x,m,v") + (match_operand:VIHFBF_256 1 "nonimmediate_operand" "m,x,m,v") (parallel [(const_int 0)]))))] "TARGET_AVX2" "@ @@ -25589,10 +25622,10 @@ (set_attr "mode" "V4DF")]) (define_insn "<avx512>_vec_dup<mode>_1" - [(set (match_operand:VIHF_AVX512BW 0 "register_operand" "=v,v") - (vec_duplicate:VIHF_AVX512BW + [(set (match_operand:VIHFBF_AVX512BW 0 "register_operand" "=v,v") + (vec_duplicate:VIHFBF_AVX512BW (vec_select:<ssescalarmode> - (match_operand:VIHF_AVX512BW 1 "nonimmediate_operand" "v,m") + (match_operand:VIHFBF_AVX512BW 1 "nonimmediate_operand" "v,m") (parallel [(const_int 0)]))))] "TARGET_AVX512F" "@ @@ -25622,8 +25655,8 @@ (set_attr "mode" "<sseinsnmode>")]) (define_insn "<avx512>_vec_dup<mode><mask_name>" - [(set (match_operand:VI12HF_AVX512VL 0 "register_operand" "=v") - (vec_duplicate:VI12HF_AVX512VL + [(set (match_operand:VI12HFBF_AVX512VL 0 "register_operand" "=v") + (vec_duplicate:VI12HFBF_AVX512VL (vec_select:<ssescalarmode> (match_operand:<ssexmmmode> 1 "nonimmediate_operand" "vm") (parallel [(const_int 0)]))))] @@ -25658,8 +25691,8 @@ (set_attr "mode" "<sseinsnmode>")]) (define_insn "<mask_codefor><avx512>_vec_dup_gpr<mode><mask_name>" - [(set (match_operand:VI12HF_AVX512VL 0 "register_operand" "=v,v") - (vec_duplicate:VI12HF_AVX512VL + [(set (match_operand:VI12HFBF_AVX512VL 0 "register_operand" "=v,v") + (vec_duplicate:VI12HFBF_AVX512VL (match_operand:<ssescalarmode> 1 "nonimmediate_operand" "vm,r")))] "TARGET_AVX512BW" "@ @@ -25759,7 +25792,7 @@ [(V8SF "ss") (V4DF "sd") (V8SI "ss") (V4DI "sd")]) ;; Modes handled by AVX2 vec_dup patterns. (define_mode_iterator AVX2_VEC_DUP_MODE - [V32QI V16QI V16HI V8HI V8SI V4SI V16HF V8HF]) + [V32QI V16QI V16HI V8HI V8SI V4SI V16HF V8HF V16BF V8BF]) (define_insn "*vec_dup<mode>" [(set (match_operand:AVX2_VEC_DUP_MODE 0 "register_operand" "=x,x,v") @@ -26522,6 +26555,7 @@ (V16SI "TARGET_AVX512F") (V8SI "TARGET_AVX") V4SI (V8DI "TARGET_AVX512F") (V4DI "TARGET_AVX") V2DI (V32HF "TARGET_AVX512F") (V16HF "TARGET_AVX") V8HF + (V32BF "TARGET_AVX512F") (V16BF "TARGET_AVX") V8BF (V16SF "TARGET_AVX512F") (V8SF "TARGET_AVX") V4SF (V8DF "TARGET_AVX512F") (V4DF "TARGET_AVX") (V2DF "TARGET_SSE2") (V4TI "TARGET_AVX512F") (V2TI "TARGET_AVX")]) @@ -26534,6 +26568,7 @@ (V16SI "TARGET_AVX512F") (V8SI "TARGET_AVX") V4SI (V8DI "TARGET_AVX512F") (V4DI "TARGET_AVX") (V32HF "TARGET_AVX512F") (V16HF "TARGET_AVX") V8HF + (V32BF "TARGET_AVX512F") (V16BF "TARGET_AVX") V8BF (V16SF "TARGET_AVX512F") (V8SF "TARGET_AVX") V4SF (V8DF "TARGET_AVX512F") (V4DF "TARGET_AVX") (V4TI "TARGET_AVX512F")]) diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc index 7968734..2437814 100644 --- a/gcc/config/loongarch/loongarch.cc +++ b/gcc/config/loongarch/loongarch.cc @@ -2448,8 +2448,18 @@ loongarch_call_tls_get_addr (rtx sym, enum loongarch_symbol_type type, rtx v0) gcc_unreachable (); } - insn = emit_call_insn (gen_call_value_internal (v0, loongarch_tls_symbol, - const0_rtx)); + if (flag_plt) + insn = emit_call_insn (gen_call_value_internal (v0, loongarch_tls_symbol, + const0_rtx)); + else + { + rtx dest = gen_reg_rtx (Pmode); + rtx high = gen_reg_rtx (Pmode); + loongarch_emit_move (high, gen_rtx_HIGH (Pmode, loongarch_tls_symbol)); + emit_insn (gen_ld_from_got (Pmode, dest, high, loongarch_tls_symbol)); + insn = emit_call_insn (gen_call_value_internal (v0, dest, const0_rtx)); + } + RTL_CONST_CALL_P (insn) = 1; use_reg (&CALL_INSN_FUNCTION_USAGE (insn), a0); insn = get_insns (); diff --git a/gcc/config/loongarch/loongarch.md b/gcc/config/loongarch/loongarch.md index 6b6df22..8e8868d 100644 --- a/gcc/config/loongarch/loongarch.md +++ b/gcc/config/loongarch/loongarch.md @@ -1023,6 +1023,24 @@ [(set_attr "type" "fmove") (set_attr "mode" "<MODE>")]) +(define_insn "fmax<mode>3" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (smax:ANYF (match_operand:ANYF 1 "register_operand" "f") + (match_operand:ANYF 2 "register_operand" "f")))] + "" + "fmax.<fmt>\t%0,%1,%2" + [(set_attr "type" "fmove") + (set_attr "mode" "<MODE>")]) + +(define_insn "fmin<mode>3" + [(set (match_operand:ANYF 0 "register_operand" "=f") + (smin:ANYF (match_operand:ANYF 1 "register_operand" "f") + (match_operand:ANYF 2 "register_operand" "f")))] + "" + "fmin.<fmt>\t%0,%1,%2" + [(set_attr "type" "fmove") + (set_attr "mode" "<MODE>")]) + (define_insn "smaxa<mode>3" [(set (match_operand:ANYF 0 "register_operand" "=f") (if_then_else:ANYF diff --git a/gcc/config/riscv/predicates.md b/gcc/config/riscv/predicates.md index e98db2c..79e0c1d 100644 --- a/gcc/config/riscv/predicates.md +++ b/gcc/config/riscv/predicates.md @@ -71,7 +71,7 @@ { /* Don't handle multi-word moves this way; we don't want to introduce the individual word-mode moves until after reload. */ - if (GET_MODE_SIZE (mode) > UNITS_PER_WORD) + if (GET_MODE_SIZE (mode).to_constant () > UNITS_PER_WORD) return false; /* Check whether the constant can be loaded in a single diff --git a/gcc/config/riscv/riscv-modes.def b/gcc/config/riscv/riscv-modes.def index 5cf2fc8..6e30c1a 100644 --- a/gcc/config/riscv/riscv-modes.def +++ b/gcc/config/riscv/riscv-modes.def @@ -21,3 +21,16 @@ along with GCC; see the file COPYING3. If not see FLOAT_MODE (HF, 2, ieee_half_format); FLOAT_MODE (TF, 16, ieee_quad_format); + +/* TODO: According to RISC-V 'V' ISA spec, the maximun vector length can + be 65536 for a single vector register which means the vector mode in + GCC can be maximum = 65536 * 8 bits (LMUL=8). + However, 'GET_MODE_SIZE' is using poly_uint16/unsigned short which will + overflow if we specify vector-length = 65536. To support this feature, + we need to change the codes outside the RISC-V port. We will support it in + the future. */ +#define MAX_BITSIZE_MODE_ANY_MODE (4096 * 8) + +/* Coefficient 1 is multiplied by the number of 64-bit/32-bit chunks in a vector + minus one. */ +#define NUM_POLY_INT_COEFFS 2 diff --git a/gcc/config/riscv/riscv-protos.h b/gcc/config/riscv/riscv-protos.h index 20c2381..2bc0ef0 100644 --- a/gcc/config/riscv/riscv-protos.h +++ b/gcc/config/riscv/riscv-protos.h @@ -64,7 +64,7 @@ extern rtx riscv_legitimize_call_address (rtx); extern void riscv_set_return_address (rtx, rtx); extern bool riscv_expand_block_move (rtx, rtx, rtx); extern rtx riscv_return_addr (int, rtx); -extern HOST_WIDE_INT riscv_initial_elimination_offset (int, int); +extern poly_int64 riscv_initial_elimination_offset (int, int); extern void riscv_expand_prologue (void); extern void riscv_expand_epilogue (int); extern bool riscv_epilogue_uses (unsigned int); diff --git a/gcc/config/riscv/riscv-sr.cc b/gcc/config/riscv/riscv-sr.cc index 694f90c..7248f04 100644 --- a/gcc/config/riscv/riscv-sr.cc +++ b/gcc/config/riscv/riscv-sr.cc @@ -247,7 +247,7 @@ riscv_remove_unneeded_save_restore_calls (void) /* We'll adjust stack size after this optimization, that require update every sp use site, which could be unsafe, so we decide to turn off this optimization if there are any arguments put on stack. */ - if (crtl->args.size != 0) + if (known_ne (crtl->args.size, 0)) return; /* Will point to the first instruction of the function body, after the diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 9d70974..7c120ea 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -100,7 +100,7 @@ enum riscv_address_type { /* Information about a function's frame layout. */ struct GTY(()) riscv_frame_info { /* The size of the frame in bytes. */ - HOST_WIDE_INT total_size; + poly_int64 total_size; /* Bit X is set if the function saves or restores GPR X. */ unsigned int mask; @@ -112,17 +112,17 @@ struct GTY(()) riscv_frame_info { unsigned save_libcall_adjustment; /* Offsets of fixed-point and floating-point save areas from frame bottom */ - HOST_WIDE_INT gp_sp_offset; - HOST_WIDE_INT fp_sp_offset; + poly_int64 gp_sp_offset; + poly_int64 fp_sp_offset; /* Offset of virtual frame pointer from stack pointer/frame bottom */ - HOST_WIDE_INT frame_pointer_offset; + poly_int64 frame_pointer_offset; /* Offset of hard frame pointer from stack pointer/frame bottom */ - HOST_WIDE_INT hard_frame_pointer_offset; + poly_int64 hard_frame_pointer_offset; /* The offset of arg_pointer_rtx from the bottom of the frame. */ - HOST_WIDE_INT arg_pointer_offset; + poly_int64 arg_pointer_offset; }; enum riscv_privilege_levels { @@ -255,6 +255,12 @@ static const struct riscv_tune_param *tune_param; /* Which automaton to use for tuning. */ enum riscv_microarchitecture_type riscv_microarchitecture; +/* The number of chunks in a single vector register. */ +poly_uint16 riscv_vector_chunks; + +/* The number of bytes in a vector chunk. */ +unsigned riscv_bytes_per_vector_chunk; + /* Index R is the smallest register class that contains register R. */ const enum reg_class riscv_regno_to_class[FIRST_PSEUDO_REGISTER] = { GR_REGS, GR_REGS, GR_REGS, GR_REGS, @@ -807,8 +813,8 @@ riscv_valid_offset_p (rtx x, machine_mode mode) /* We may need to split multiword moves, so make sure that every word is accessible. */ - if (GET_MODE_SIZE (mode) > UNITS_PER_WORD - && !SMALL_OPERAND (INTVAL (x) + GET_MODE_SIZE (mode) - UNITS_PER_WORD)) + if (GET_MODE_SIZE (mode).to_constant () > UNITS_PER_WORD + && !SMALL_OPERAND (INTVAL (x) + GET_MODE_SIZE (mode).to_constant () - UNITS_PER_WORD)) return false; return true; @@ -872,7 +878,7 @@ riscv_valid_lo_sum_p (enum riscv_symbol_type sym_type, machine_mode mode, else { align = GET_MODE_ALIGNMENT (mode); - size = GET_MODE_BITSIZE (mode); + size = GET_MODE_BITSIZE (mode).to_constant (); } /* We may need to split multiword moves, so make sure that each word @@ -1013,7 +1019,7 @@ riscv_address_insns (rtx x, machine_mode mode, bool might_split_p) /* BLKmode is used for single unaligned loads and stores and should not count as a multiword mode. */ if (mode != BLKmode && might_split_p) - n += (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + n += (GET_MODE_SIZE (mode).to_constant () + UNITS_PER_WORD - 1) / UNITS_PER_WORD; if (addr.type == ADDRESS_LO_SUM) n += riscv_symbol_insns (addr.symbol_type) - 1; @@ -1106,9 +1112,9 @@ riscv_load_store_insns (rtx mem, rtx_insn *insn) /* Try to prove that INSN does not need to be split. */ might_split_p = true; - if (GET_MODE_BITSIZE (mode) <= 32) + if (GET_MODE_BITSIZE (mode).to_constant () <= 32) might_split_p = false; - else if (GET_MODE_BITSIZE (mode) == 64) + else if (GET_MODE_BITSIZE (mode).to_constant () == 64) { set = single_set (insn); if (set && !riscv_split_64bit_move_p (SET_DEST (set), SET_SRC (set))) @@ -1625,7 +1631,7 @@ riscv_legitimize_move (machine_mode mode, rtx dest, rtx src) (set (reg:QI target) (subreg:QI (reg:DI temp) 0)) with auto-sign/zero extend. */ if (GET_MODE_CLASS (mode) == MODE_INT - && GET_MODE_SIZE (mode) < UNITS_PER_WORD + && GET_MODE_SIZE (mode).to_constant () < UNITS_PER_WORD && can_create_pseudo_p () && MEM_P (src)) { @@ -1650,7 +1656,7 @@ riscv_legitimize_move (machine_mode mode, rtx dest, rtx src) improve cse. */ machine_mode promoted_mode = mode; if (GET_MODE_CLASS (mode) == MODE_INT - && GET_MODE_SIZE (mode) < UNITS_PER_WORD) + && GET_MODE_SIZE (mode).to_constant () < UNITS_PER_WORD) promoted_mode = word_mode; if (splittable_const_int_operand (src, mode)) @@ -1748,7 +1754,7 @@ riscv_immediate_operand_p (int code, HOST_WIDE_INT x) static int riscv_binary_cost (rtx x, int single_insns, int double_insns) { - if (GET_MODE_SIZE (GET_MODE (x)) == UNITS_PER_WORD * 2) + if (GET_MODE_SIZE (GET_MODE (x)).to_constant () == UNITS_PER_WORD * 2) return COSTS_N_INSNS (double_insns); return COSTS_N_INSNS (single_insns); } @@ -1881,7 +1887,7 @@ riscv_rtx_costs (rtx x, machine_mode mode, int outer_code, int opno ATTRIBUTE_UN return false; case NOT: - *total = COSTS_N_INSNS (GET_MODE_SIZE (mode) > UNITS_PER_WORD ? 2 : 1); + *total = COSTS_N_INSNS (GET_MODE_SIZE (mode).to_constant () > UNITS_PER_WORD ? 2 : 1); return false; case AND: @@ -2128,7 +2134,7 @@ riscv_rtx_costs (rtx x, machine_mode mode, int outer_code, int opno ATTRIBUTE_UN if (float_mode_p) *total = tune_param->fp_add[mode == DFmode]; else - *total = COSTS_N_INSNS (GET_MODE_SIZE (mode) > UNITS_PER_WORD ? 4 : 1); + *total = COSTS_N_INSNS (GET_MODE_SIZE (mode).to_constant () > UNITS_PER_WORD ? 4 : 1); return false; case MULT: @@ -2137,7 +2143,7 @@ riscv_rtx_costs (rtx x, machine_mode mode, int outer_code, int opno ATTRIBUTE_UN else if (!TARGET_MUL) /* Estimate the cost of a library call. */ *total = COSTS_N_INSNS (speed ? 32 : 6); - else if (GET_MODE_SIZE (mode) > UNITS_PER_WORD) + else if (GET_MODE_SIZE (mode).to_constant () > UNITS_PER_WORD) *total = 3 * tune_param->int_mul[0] + COSTS_N_INSNS (2); else if (!speed) *total = COSTS_N_INSNS (1); @@ -2301,8 +2307,8 @@ riscv_output_move (rtx dest, rtx src) dest_code = GET_CODE (dest); src_code = GET_CODE (src); mode = GET_MODE (dest); - dbl_p = (GET_MODE_SIZE (mode) == 8); - width = GET_MODE_SIZE (mode); + dbl_p = (GET_MODE_SIZE (mode).to_constant () == 8); + width = GET_MODE_SIZE (mode).to_constant (); if (dbl_p && riscv_split_64bit_move_p (dest, src)) return "#"; @@ -2578,7 +2584,7 @@ static void riscv_extend_comparands (rtx_code code, rtx *op0, rtx *op1) { /* Comparisons consider all XLEN bits, so extend sub-XLEN values. */ - if (GET_MODE_SIZE (word_mode) > GET_MODE_SIZE (GET_MODE (*op0))) + if (GET_MODE_SIZE (word_mode) > GET_MODE_SIZE (GET_MODE (*op0)).to_constant ()) { /* It is more profitable to zero-extend QImode values. But not if the first operand has already been sign-extended, and the second one is @@ -2941,7 +2947,7 @@ riscv_flatten_aggregate_field (const_tree type, if (n != 0) return -1; - HOST_WIDE_INT elt_size = GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (type))); + HOST_WIDE_INT elt_size = GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (type))).to_constant (); if (elt_size <= UNITS_PER_FP_ARG) { @@ -2959,9 +2965,9 @@ riscv_flatten_aggregate_field (const_tree type, default: if (n < 2 && ((SCALAR_FLOAT_TYPE_P (type) - && GET_MODE_SIZE (TYPE_MODE (type)) <= UNITS_PER_FP_ARG) + && GET_MODE_SIZE (TYPE_MODE (type)).to_constant () <= UNITS_PER_FP_ARG) || (INTEGRAL_TYPE_P (type) - && GET_MODE_SIZE (TYPE_MODE (type)) <= UNITS_PER_WORD))) + && GET_MODE_SIZE (TYPE_MODE (type)).to_constant () <= UNITS_PER_WORD))) { fields[n].type = type; fields[n].offset = offset; @@ -3197,7 +3203,7 @@ riscv_get_arg_info (struct riscv_arg_info *info, const CUMULATIVE_ARGS *cum, } /* Work out the size of the argument. */ - num_bytes = type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode); + num_bytes = type ? int_size_in_bytes (type) : GET_MODE_SIZE (mode).to_constant (); num_words = (num_bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; /* Doubleword-aligned varargs start on an even register boundary. */ @@ -3291,7 +3297,7 @@ riscv_function_value (const_tree type, const_tree func, machine_mode mode) static bool riscv_pass_by_reference (cumulative_args_t cum_v, const function_arg_info &arg) { - HOST_WIDE_INT size = arg.type_size_in_bytes (); + HOST_WIDE_INT size = arg.type_size_in_bytes ().to_constant ();; struct riscv_arg_info info; CUMULATIVE_ARGS *cum = get_cumulative_args (cum_v); @@ -3920,7 +3926,7 @@ riscv_elf_select_rtx_section (machine_mode mode, rtx x, { section *s = default_elf_select_rtx_section (mode, x, align); - if (riscv_size_ok_for_small_data_p (GET_MODE_SIZE (mode))) + if (riscv_size_ok_for_small_data_p (GET_MODE_SIZE (mode).to_constant ())) { if (startswith (s->named.name, ".rodata.cst")) { @@ -4072,11 +4078,24 @@ riscv_save_libcall_count (unsigned mask) static HOST_WIDE_INT riscv_first_stack_step (struct riscv_frame_info *frame); +/* Handle stack align for poly_int. */ +static poly_int64 +riscv_stack_align (poly_int64 value) +{ + return aligned_upper_bound (value, PREFERRED_STACK_BOUNDARY / 8); +} + +static HOST_WIDE_INT +riscv_stack_align (HOST_WIDE_INT value) +{ + return RISCV_STACK_ALIGN (value); +} + static void riscv_compute_frame_info (void) { struct riscv_frame_info *frame; - HOST_WIDE_INT offset; + poly_int64 offset; bool interrupt_save_prologue_temp = false; unsigned int regno, i, num_x_saved = 0, num_f_saved = 0; @@ -4087,7 +4106,7 @@ riscv_compute_frame_info (void) if (cfun->machine->interrupt_handler_p) { HOST_WIDE_INT step1 = riscv_first_stack_step (frame); - if (! SMALL_OPERAND (frame->total_size - step1)) + if (! POLY_SMALL_OPERAND_P ((frame->total_size - step1))) interrupt_save_prologue_temp = true; } @@ -4117,23 +4136,23 @@ riscv_compute_frame_info (void) } /* At the bottom of the frame are any outgoing stack arguments. */ - offset = RISCV_STACK_ALIGN (crtl->outgoing_args_size); + offset = riscv_stack_align (crtl->outgoing_args_size); /* Next are local stack variables. */ - offset += RISCV_STACK_ALIGN (get_frame_size ()); + offset += riscv_stack_align (get_frame_size ()); /* The virtual frame pointer points above the local variables. */ frame->frame_pointer_offset = offset; /* Next are the callee-saved FPRs. */ if (frame->fmask) - offset += RISCV_STACK_ALIGN (num_f_saved * UNITS_PER_FP_REG); + offset += riscv_stack_align (num_f_saved * UNITS_PER_FP_REG); frame->fp_sp_offset = offset - UNITS_PER_FP_REG; /* Next are the callee-saved GPRs. */ if (frame->mask) { - unsigned x_save_size = RISCV_STACK_ALIGN (num_x_saved * UNITS_PER_WORD); + unsigned x_save_size = riscv_stack_align (num_x_saved * UNITS_PER_WORD); unsigned num_save_restore = 1 + riscv_save_libcall_count (frame->mask); /* Only use save/restore routines if they don't alter the stack size. */ - if (RISCV_STACK_ALIGN (num_save_restore * UNITS_PER_WORD) == x_save_size) + if (riscv_stack_align (num_save_restore * UNITS_PER_WORD) == x_save_size) { /* Libcall saves/restores 3 registers at once, so we need to allocate 12 bytes for callee-saved register. */ @@ -4149,9 +4168,9 @@ riscv_compute_frame_info (void) /* The hard frame pointer points above the callee-saved GPRs. */ frame->hard_frame_pointer_offset = offset; /* Above the hard frame pointer is the callee-allocated varags save area. */ - offset += RISCV_STACK_ALIGN (cfun->machine->varargs_size); + offset += riscv_stack_align (cfun->machine->varargs_size); /* Next is the callee-allocated area for pretend stack arguments. */ - offset += RISCV_STACK_ALIGN (crtl->args.pretend_args_size); + offset += riscv_stack_align (crtl->args.pretend_args_size); /* Arg pointer must be below pretend args, but must be above alignment padding. */ frame->arg_pointer_offset = offset - crtl->args.pretend_args_size; @@ -4159,7 +4178,7 @@ riscv_compute_frame_info (void) /* Next points the incoming stack pointer and any incoming arguments. */ /* Only use save/restore routines when the GPRs are atop the frame. */ - if (frame->hard_frame_pointer_offset != frame->total_size) + if (known_ne (frame->hard_frame_pointer_offset, frame->total_size)) frame->save_libcall_adjustment = 0; } @@ -4176,10 +4195,10 @@ riscv_can_eliminate (const int from ATTRIBUTE_UNUSED, const int to) or argument pointer. TO is either the stack pointer or hard frame pointer. */ -HOST_WIDE_INT +poly_int64 riscv_initial_elimination_offset (int from, int to) { - HOST_WIDE_INT src, dest; + poly_int64 src, dest; riscv_compute_frame_info (); @@ -4223,7 +4242,7 @@ riscv_set_return_address (rtx address, rtx scratch) gcc_assert (BITSET_P (cfun->machine->frame.mask, RETURN_ADDR_REGNUM)); slot_address = riscv_add_offset (scratch, stack_pointer_rtx, - cfun->machine->frame.gp_sp_offset); + cfun->machine->frame.gp_sp_offset.to_constant()); riscv_emit_move (gen_frame_mem (GET_MODE (address), slot_address), address); } @@ -4250,13 +4269,13 @@ riscv_save_restore_reg (machine_mode mode, int regno, of the frame. */ static void -riscv_for_each_saved_reg (HOST_WIDE_INT sp_offset, riscv_save_restore_fn fn, +riscv_for_each_saved_reg (poly_int64 sp_offset, riscv_save_restore_fn fn, bool epilogue, bool maybe_eh_return) { HOST_WIDE_INT offset; /* Save the link register and s-registers. */ - offset = cfun->machine->frame.gp_sp_offset - sp_offset; + offset = (cfun->machine->frame.gp_sp_offset - sp_offset).to_constant (); for (unsigned int regno = GP_REG_FIRST; regno <= GP_REG_LAST; regno++) if (BITSET_P (cfun->machine->frame.mask, regno - GP_REG_FIRST)) { @@ -4287,14 +4306,14 @@ riscv_for_each_saved_reg (HOST_WIDE_INT sp_offset, riscv_save_restore_fn fn, /* This loop must iterate over the same space as its companion in riscv_compute_frame_info. */ - offset = cfun->machine->frame.fp_sp_offset - sp_offset; + offset = (cfun->machine->frame.fp_sp_offset - sp_offset).to_constant (); for (unsigned int regno = FP_REG_FIRST; regno <= FP_REG_LAST; regno++) if (BITSET_P (cfun->machine->frame.fmask, regno - FP_REG_FIRST)) { machine_mode mode = TARGET_DOUBLE_FLOAT ? DFmode : SFmode; riscv_save_restore_reg (mode, regno, offset, fn); - offset -= GET_MODE_SIZE (mode); + offset -= GET_MODE_SIZE (mode).to_constant (); } } @@ -4336,21 +4355,21 @@ riscv_restore_reg (rtx reg, rtx mem) static HOST_WIDE_INT riscv_first_stack_step (struct riscv_frame_info *frame) { - if (SMALL_OPERAND (frame->total_size)) - return frame->total_size; + if (SMALL_OPERAND (frame->total_size.to_constant())) + return frame->total_size.to_constant(); HOST_WIDE_INT min_first_step = - RISCV_STACK_ALIGN (frame->total_size - frame->fp_sp_offset); + RISCV_STACK_ALIGN ((frame->total_size - frame->fp_sp_offset).to_constant()); HOST_WIDE_INT max_first_step = IMM_REACH / 2 - PREFERRED_STACK_BOUNDARY / 8; - HOST_WIDE_INT min_second_step = frame->total_size - max_first_step; + HOST_WIDE_INT min_second_step = frame->total_size.to_constant() - max_first_step; gcc_assert (min_first_step <= max_first_step); /* As an optimization, use the least-significant bits of the total frame size, so that the second adjustment step is just LUI + ADD. */ if (!SMALL_OPERAND (min_second_step) - && frame->total_size % IMM_REACH < IMM_REACH / 2 - && frame->total_size % IMM_REACH >= min_first_step) - return frame->total_size % IMM_REACH; + && frame->total_size.to_constant() % IMM_REACH < IMM_REACH / 2 + && frame->total_size.to_constant() % IMM_REACH >= min_first_step) + return frame->total_size.to_constant() % IMM_REACH; if (TARGET_RVC) { @@ -4423,7 +4442,7 @@ void riscv_expand_prologue (void) { struct riscv_frame_info *frame = &cfun->machine->frame; - HOST_WIDE_INT size = frame->total_size; + HOST_WIDE_INT size = frame->total_size.to_constant (); unsigned mask = frame->mask; rtx insn; @@ -4466,7 +4485,7 @@ riscv_expand_prologue (void) if (frame_pointer_needed) { insn = gen_add3_insn (hard_frame_pointer_rtx, stack_pointer_rtx, - GEN_INT (frame->hard_frame_pointer_offset - size)); + GEN_INT ((frame->hard_frame_pointer_offset - size).to_constant ())); RTX_FRAME_RELATED_P (emit_insn (insn)) = 1; riscv_emit_stack_tie (); @@ -4532,7 +4551,7 @@ riscv_expand_epilogue (int style) Start off by assuming that no registers need to be restored. */ struct riscv_frame_info *frame = &cfun->machine->frame; unsigned mask = frame->mask; - HOST_WIDE_INT step1 = frame->total_size; + HOST_WIDE_INT step1 = frame->total_size.to_constant (); HOST_WIDE_INT step2 = 0; bool use_restore_libcall = ((style == NORMAL_RETURN) && riscv_use_save_libcall (frame)); @@ -4540,8 +4559,8 @@ riscv_expand_epilogue (int style) rtx insn; /* We need to add memory barrier to prevent read from deallocated stack. */ - bool need_barrier_p = (get_frame_size () - + cfun->machine->frame.arg_pointer_offset) != 0; + bool need_barrier_p + = known_ne (get_frame_size (), cfun->machine->frame.arg_pointer_offset); if (cfun->machine->naked_p) { @@ -4568,7 +4587,7 @@ riscv_expand_epilogue (int style) riscv_emit_stack_tie (); need_barrier_p = false; - rtx adjust = GEN_INT (-frame->hard_frame_pointer_offset); + rtx adjust = GEN_INT (-frame->hard_frame_pointer_offset.to_constant ()); if (!SMALL_OPERAND (INTVAL (adjust))) { riscv_emit_move (RISCV_PROLOGUE_TEMP (Pmode), adjust); @@ -4582,7 +4601,7 @@ riscv_expand_epilogue (int style) rtx dwarf = NULL_RTX; rtx cfa_adjust_value = gen_rtx_PLUS ( Pmode, hard_frame_pointer_rtx, - GEN_INT (-frame->hard_frame_pointer_offset)); + GEN_INT (-frame->hard_frame_pointer_offset.to_constant ())); rtx cfa_adjust_rtx = gen_rtx_SET (stack_pointer_rtx, cfa_adjust_value); dwarf = alloc_reg_note (REG_CFA_ADJUST_CFA, cfa_adjust_rtx, dwarf); RTX_FRAME_RELATED_P (insn) = 1; @@ -4599,7 +4618,7 @@ riscv_expand_epilogue (int style) } /* Set TARGET to BASE + STEP1. */ - if (step1 > 0) + if (known_gt (step1, 0)) { /* Emit a barrier to prevent loads from a deallocated stack. */ riscv_emit_stack_tie (); @@ -4725,7 +4744,7 @@ riscv_epilogue_uses (unsigned int regno) bool riscv_can_use_return_insn (void) { - return (reload_completed && cfun->machine->frame.total_size == 0 + return (reload_completed && known_eq (cfun->machine->frame.total_size, 0) && ! cfun->machine->interrupt_handler_p); } @@ -4825,7 +4844,7 @@ static bool riscv_secondary_memory_needed (machine_mode mode, reg_class_t class1, reg_class_t class2) { - return (GET_MODE_SIZE (mode) > UNITS_PER_WORD + return (GET_MODE_SIZE (mode).to_constant () > UNITS_PER_WORD && (class1 == FP_REGS) != (class2 == FP_REGS)); } @@ -4848,10 +4867,10 @@ static unsigned int riscv_hard_regno_nregs (unsigned int regno, machine_mode mode) { if (FP_REG_P (regno)) - return (GET_MODE_SIZE (mode) + UNITS_PER_FP_REG - 1) / UNITS_PER_FP_REG; + return (GET_MODE_SIZE (mode).to_constant () + UNITS_PER_FP_REG - 1) / UNITS_PER_FP_REG; /* All other registers are word-sized. */ - return (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + return (GET_MODE_SIZE (mode).to_constant () + UNITS_PER_WORD - 1) / UNITS_PER_WORD; } /* Implement TARGET_HARD_REGNO_MODE_OK. */ @@ -5058,6 +5077,37 @@ riscv_init_machine_status (void) return ggc_cleared_alloc<machine_function> (); } +/* Return the VLEN value associated with -march. + TODO: So far we only support length-agnostic value. */ +static poly_uint16 +riscv_convert_vector_bits (void) +{ + /* The runtime invariant is only meaningful when vector is enabled. */ + if (!TARGET_VECTOR) + return 0; + + if (TARGET_VECTOR_ELEN_64 || TARGET_VECTOR_ELEN_FP_64) + { + /* When targetting Zve64* (ELEN = 64) extensions, we should use 64-bit + chunk size. Runtime invariant: The single indeterminate represent the + number of 64-bit chunks in a vector beyond minimum length of 64 bits. + Thus the number of bytes in a vector is 8 + 8 * x1 which is + riscv_vector_chunks * 8 = poly_int (8, 8). */ + riscv_bytes_per_vector_chunk = 8; + } + else + { + /* When targetting Zve32* (ELEN = 32) extensions, we should use 32-bit + chunk size. Runtime invariant: The single indeterminate represent the + number of 32-bit chunks in a vector beyond minimum length of 32 bits. + Thus the number of bytes in a vector is 4 + 4 * x1 which is + riscv_vector_chunks * 4 = poly_int (4, 4). */ + riscv_bytes_per_vector_chunk = 4; + } + + return poly_uint16 (1, 1); +} + /* Implement TARGET_OPTION_OVERRIDE. */ static void @@ -5204,6 +5254,8 @@ riscv_option_override (void) riscv_stack_protector_guard_offset = offs; } + /* Convert -march to a chunks count. */ + riscv_vector_chunks = riscv_convert_vector_bits (); } /* Implement TARGET_CONDITIONAL_REGISTER_USAGE. */ @@ -5561,7 +5613,7 @@ riscv_promote_function_mode (const_tree type ATTRIBUTE_UNUSED, return promote_mode (type, mode, punsignedp); unsignedp = *punsignedp; - PROMOTE_MODE (mode, unsignedp, type); + PROMOTE_MODE (as_a <scalar_mode> (mode), unsignedp, type); *punsignedp = unsignedp; return mode; } diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h index 6f7f4d3..4b07c54 100644 --- a/gcc/config/riscv/riscv.h +++ b/gcc/config/riscv/riscv.h @@ -522,6 +522,10 @@ enum reg_class #define SMALL_OPERAND(VALUE) \ ((unsigned HOST_WIDE_INT) (VALUE) + IMM_REACH/2 < IMM_REACH) +#define POLY_SMALL_OPERAND_P(POLY_VALUE) \ + (POLY_VALUE.is_constant () ? \ + SMALL_OPERAND (POLY_VALUE.to_constant ()) : false) + /* True if VALUE can be loaded into a register using LUI. */ #define LUI_OPERAND(VALUE) \ @@ -952,6 +956,11 @@ while (0) extern const enum reg_class riscv_regno_to_class[]; extern bool riscv_slow_unaligned_access_p; extern unsigned riscv_stack_boundary; +extern unsigned riscv_bytes_per_vector_chunk; +extern poly_uint16 riscv_vector_chunks; +/* The number of bits and bytes in a RVV vector. */ +#define BITS_PER_RISCV_VECTOR (poly_uint16 (riscv_vector_chunks * riscv_bytes_per_vector_chunk * 8)) +#define BYTES_PER_RISCV_VECTOR (poly_uint16 (riscv_vector_chunks * riscv_bytes_per_vector_chunk)) #endif #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \ diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md index 493f00c..c517ae0 100644 --- a/gcc/config/riscv/riscv.md +++ b/gcc/config/riscv/riscv.md @@ -2162,7 +2162,7 @@ (lshiftrt:GPR (match_dup 3) (match_dup 2)))] { /* Op2 is a VOIDmode constant, so get the mode size from op1. */ - operands[2] = GEN_INT (GET_MODE_BITSIZE (GET_MODE (operands[1])) + operands[2] = GEN_INT (GET_MODE_BITSIZE (GET_MODE (operands[1])).to_constant () - exact_log2 (INTVAL (operands[2]) + 1)); }) diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 1367a2c..e9e5cd1 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -3217,7 +3217,7 @@ DONE; }) -(define_insn "*maddld<mode>4" +(define_insn "maddld<mode>4" [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") (plus:GPR (mult:GPR (match_operand:GPR 1 "gpc_reg_operand" "r") (match_operand:GPR 2 "gpc_reg_operand" "r")) @@ -3226,6 +3226,52 @@ "maddld %0,%1,%2,%3" [(set_attr "type" "mul")]) +(define_expand "<u>maddditi4" + [(set (match_operand:TI 0 "gpc_reg_operand") + (plus:TI + (mult:TI (any_extend:TI (match_operand:DI 1 "gpc_reg_operand")) + (any_extend:TI (match_operand:DI 2 "gpc_reg_operand"))) + (any_extend:TI (match_operand:DI 3 "gpc_reg_operand"))))] + "TARGET_MADDLD && TARGET_POWERPC64" +{ + rtx op0_lo = gen_rtx_SUBREG (DImode, operands[0], BYTES_BIG_ENDIAN ? 8 : 0); + rtx op0_hi = gen_rtx_SUBREG (DImode, operands[0], BYTES_BIG_ENDIAN ? 0 : 8); + + emit_insn (gen_maddlddi4 (op0_lo, operands[1], operands[2], operands[3])); + + if (BYTES_BIG_ENDIAN) + emit_insn (gen_<u>madddi4_highpart (op0_hi, operands[1], operands[2], + operands[3])); + else + emit_insn (gen_<u>madddi4_highpart_le (op0_hi, operands[1], operands[2], + operands[3])); + DONE; +}) + +(define_insn "<u>madddi4_highpart" + [(set (match_operand:DI 0 "gpc_reg_operand" "=r") + (subreg:DI + (plus:TI + (mult:TI (any_extend:TI (match_operand:DI 1 "gpc_reg_operand" "r")) + (any_extend:TI (match_operand:DI 2 "gpc_reg_operand" "r"))) + (any_extend:TI (match_operand:DI 3 "gpc_reg_operand" "r"))) + 0))] + "TARGET_MADDLD && BYTES_BIG_ENDIAN && TARGET_POWERPC64" + "maddhd<u> %0,%1,%2,%3" + [(set_attr "type" "mul")]) + +(define_insn "<u>madddi4_highpart_le" + [(set (match_operand:DI 0 "gpc_reg_operand" "=r") + (subreg:DI + (plus:TI + (mult:TI (any_extend:TI (match_operand:DI 1 "gpc_reg_operand" "r")) + (any_extend:TI (match_operand:DI 2 "gpc_reg_operand" "r"))) + (any_extend:TI (match_operand:DI 3 "gpc_reg_operand" "r"))) + 8))] + "TARGET_MADDLD && !BYTES_BIG_ENDIAN && TARGET_POWERPC64" + "maddhd<u> %0,%1,%2,%3" + [(set_attr "type" "mul")]) + (define_insn "udiv<mode>3" [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") (udiv:GPR (match_operand:GPR 1 "gpc_reg_operand" "r") diff --git a/gcc/config/xtensa/xtensa.cc b/gcc/config/xtensa/xtensa.cc index 6ac879c..b673b67 100644 --- a/gcc/config/xtensa/xtensa.cc +++ b/gcc/config/xtensa/xtensa.cc @@ -3150,7 +3150,6 @@ xtensa_expand_prologue (void) rtx_insn *insn = NULL; rtx note_rtx; - total_size = compute_frame_size (get_frame_size ()); if (flag_stack_usage_info) @@ -3206,10 +3205,17 @@ xtensa_expand_prologue (void) } else { - rtx tmp_reg = gen_rtx_REG (Pmode, A9_REG); - emit_move_insn (tmp_reg, GEN_INT (total_size)); - insn = emit_insn (gen_subsi3 (stack_pointer_rtx, - stack_pointer_rtx, tmp_reg)); + if (xtensa_simm8x256 (-total_size)) + insn = emit_insn (gen_addsi3 (stack_pointer_rtx, + stack_pointer_rtx, + GEN_INT (-total_size))); + else + { + rtx tmp_reg = gen_rtx_REG (Pmode, A9_REG); + emit_move_insn (tmp_reg, GEN_INT (total_size)); + insn = emit_insn (gen_subsi3 (stack_pointer_rtx, + stack_pointer_rtx, tmp_reg)); + } RTX_FRAME_RELATED_P (insn) = 1; note_rtx = gen_rtx_SET (stack_pointer_rtx, plus_constant (Pmode, stack_pointer_rtx, @@ -3237,11 +3243,19 @@ xtensa_expand_prologue (void) if (total_size > 1024 || (!callee_save_size && total_size > 128)) { - rtx tmp_reg = gen_rtx_REG (Pmode, A9_REG); - emit_move_insn (tmp_reg, GEN_INT (total_size - - callee_save_size)); - insn = emit_insn (gen_subsi3 (stack_pointer_rtx, - stack_pointer_rtx, tmp_reg)); + if (xtensa_simm8x256 (callee_save_size - total_size)) + insn = emit_insn (gen_addsi3 (stack_pointer_rtx, + stack_pointer_rtx, + GEN_INT (callee_save_size - + total_size))); + else + { + rtx tmp_reg = gen_rtx_REG (Pmode, A9_REG); + emit_move_insn (tmp_reg, GEN_INT (total_size - + callee_save_size)); + insn = emit_insn (gen_subsi3 (stack_pointer_rtx, + stack_pointer_rtx, tmp_reg)); + } RTX_FRAME_RELATED_P (insn) = 1; note_rtx = gen_rtx_SET (stack_pointer_rtx, plus_constant (Pmode, stack_pointer_rtx, @@ -3315,12 +3329,21 @@ xtensa_expand_epilogue (bool sibcall_p) if (cfun->machine->current_frame_size > (frame_pointer_needed ? 127 : 1024)) { - rtx tmp_reg = gen_rtx_REG (Pmode, A9_REG); - emit_move_insn (tmp_reg, GEN_INT (cfun->machine->current_frame_size - - cfun->machine->callee_save_size)); - emit_insn (gen_addsi3 (stack_pointer_rtx, frame_pointer_needed ? - hard_frame_pointer_rtx : stack_pointer_rtx, - tmp_reg)); + if (xtensa_simm8x256 (cfun->machine->current_frame_size - + cfun->machine->callee_save_size)) + emit_insn (gen_addsi3 (stack_pointer_rtx, frame_pointer_needed ? + hard_frame_pointer_rtx : stack_pointer_rtx, + GEN_INT (cfun->machine->current_frame_size - + cfun->machine->callee_save_size))); + else + { + rtx tmp_reg = gen_rtx_REG (Pmode, A9_REG); + emit_move_insn (tmp_reg, GEN_INT (cfun->machine->current_frame_size - + cfun->machine->callee_save_size)); + emit_insn (gen_addsi3 (stack_pointer_rtx, frame_pointer_needed ? + hard_frame_pointer_rtx : stack_pointer_rtx, + tmp_reg)); + } offset = cfun->machine->callee_save_size - UNITS_PER_WORD; } else @@ -3360,18 +3383,24 @@ xtensa_expand_epilogue (bool sibcall_p) offset = cfun->machine->current_frame_size; else offset = cfun->machine->callee_save_size; - - emit_insn (gen_addsi3 (stack_pointer_rtx, - stack_pointer_rtx, - GEN_INT (offset))); + if (offset) + emit_insn (gen_addsi3 (stack_pointer_rtx, + stack_pointer_rtx, + GEN_INT (offset))); } else { - rtx tmp_reg = gen_rtx_REG (Pmode, A9_REG); - emit_move_insn (tmp_reg, - GEN_INT (cfun->machine->current_frame_size)); - emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, - tmp_reg)); + if (xtensa_simm8x256 (cfun->machine->current_frame_size)) + emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, + GEN_INT (cfun->machine->current_frame_size))); + else + { + rtx tmp_reg = gen_rtx_REG (Pmode, A9_REG); + emit_move_insn (tmp_reg, + GEN_INT (cfun->machine->current_frame_size)); + emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, + tmp_reg)); + } } } diff --git a/gcc/configure b/gcc/configure index 05efa5b..da7a450 100755 --- a/gcc/configure +++ b/gcc/configure @@ -5226,12 +5226,16 @@ else GNATMAKE="$ac_cv_prog_GNATMAKE" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler driver understands Ada" >&5 -$as_echo_n "checking whether compiler driver understands Ada... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler driver understands Ada and is recent enough" >&5 +$as_echo_n "checking whether compiler driver understands Ada and is recent enough... " >&6; } if ${acx_cv_cc_gcc_supports_ada+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.adb <<EOF +pragma Warnings (Off); +with System.CRTL; +pragma Warnings (On); +use type System.CRTL.int64; procedure conftest is begin null; end conftest; EOF acx_cv_cc_gcc_supports_ada=no @@ -19674,7 +19678,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19677 "configure" +#line 19681 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -19780,7 +19784,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19783 "configure" +#line 19787 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f1c96b4..63dda6a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,63 @@ +2022-08-17 Marek Polacek <polacek@redhat.com> + + PR c++/90428 + * typeck.cc (can_do_rvo_p): Rename to ... + (can_elide_copy_prvalue_p): ... this. + (maybe_warn_pessimizing_move): Extend the + -Wredundant-move warning to warn about std::move on a + const-qualified object. + +2022-08-17 Marek Polacek <polacek@redhat.com> + + PR c++/89780 + * pt.cc (tsubst_copy_and_build) <case CALL_EXPR>: Maybe suppress + -Wpessimizing-move. + * typeck.cc (maybe_warn_pessimizing_move): Don't issue warnings + if they are suppressed. + (check_return_expr): Disable -Wpessimizing-move when returning + a dependent expression. + +2022-08-17 Marek Polacek <polacek@redhat.com> + + PR c++/106276 + * call.cc (build_over_call): Call maybe_warn_pessimizing_move. + * cp-tree.h (maybe_warn_pessimizing_move): Declare. + * decl.cc (build_aggr_init_full_exprs): Call + maybe_warn_pessimizing_move. + * typeck.cc (maybe_warn_pessimizing_move): Handle TREE_LIST and + CONSTRUCTOR. Add a bool parameter and use it. Adjust a diagnostic + message. + (check_return_expr): Adjust the call to maybe_warn_pessimizing_move. + +2022-08-17 Tobias Burnus <tobias@codesourcery.com> + Chung-Lin Tang <cltang@codesourcery.com> + + PR c++/104493 + * cp-objcp-common.h (LANG_HOOKS_OMP_MAPPABLE_TYPE): Remove. + * cp-tree.h (cp_omp_mappable_type, cp_omp_emit_unmappable_type_notes): + Remove. + * decl2.cc (cp_omp_mappable_type_1, cp_omp_mappable_type, + cp_omp_emit_unmappable_type_notes): Remove. + (cplus_decl_attributes): Call omp_mappable_type instead of + removed langhook. + * decl.cc (cp_finish_decl): Likewise; call cxx_incomplete_type_inform + in lieu of cp_omp_emit_unmappable_type_notes. + * semantics.cc (finish_omp_clauses): Likewise. + +2022-08-16 Tom Honermann <tom@honermann.net> + + PR c++/106423 + * parser.cc (cp_lexer_saving_tokens): Add comment regarding + diagnostic requirements. + +2022-08-16 Jakub Jelinek <jakub@redhat.com> + + * typeck.cc (cp_build_modify_expr): Implement + P2327R1 - De-deprecating volatile compound operations. Don't warn + for |=, &= or ^= with volatile lhs. + * expr.cc (mark_use) <case MODIFY_EXPR>: Adjust warning wording, + leave out simple. + 2022-08-15 Marek Polacek <polacek@redhat.com> PR c++/106276 diff --git a/gcc/cp/call.cc b/gcc/cp/call.cc index 01a7be1..370137e 100644 --- a/gcc/cp/call.cc +++ b/gcc/cp/call.cc @@ -9627,10 +9627,13 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain) if (!conversion_warning) arg_complain &= ~tf_warning; + if (arg_complain & tf_warning) + maybe_warn_pessimizing_move (arg, type, /*return_p*/false); + val = convert_like_with_context (conv, arg, fn, i - is_method, arg_complain); val = convert_for_arg_passing (type, val, arg_complain); - + if (val == error_mark_node) return error_mark_node; else diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h index 3c04e5c..1a67f14 100644 --- a/gcc/cp/cp-objcp-common.h +++ b/gcc/cp/cp-objcp-common.h @@ -187,8 +187,6 @@ extern tree cxx_simulate_record_decl (location_t, const char *, #define LANG_HOOKS_OMP_FINISH_CLAUSE cxx_omp_finish_clause #undef LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE #define LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE cxx_omp_privatize_by_reference -#undef LANG_HOOKS_OMP_MAPPABLE_TYPE -#define LANG_HOOKS_OMP_MAPPABLE_TYPE cp_omp_mappable_type #undef LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR #define LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR cxx_omp_disregard_value_expr diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 3278b41..9f2ff37 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -6959,8 +6959,6 @@ extern bool possibly_inlined_p (tree); extern int parm_index (tree); extern tree vtv_start_verification_constructor_init_function (void); extern tree vtv_finish_verification_constructor_init_function (tree); -extern bool cp_omp_mappable_type (tree); -extern bool cp_omp_emit_unmappable_type_notes (tree); extern void cp_check_const_attributes (tree); /* in error.cc */ @@ -8101,6 +8099,7 @@ extern tree finish_right_unary_fold_expr (tree, int); extern tree finish_binary_fold_expr (tree, tree, int); extern tree treat_lvalue_as_rvalue_p (tree, bool); extern bool decl_in_std_namespace_p (tree); +extern void maybe_warn_pessimizing_move (tree, tree, bool); /* in typeck2.cc */ extern void require_complete_eh_spec_types (tree, tree); diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index ff56fdd..84a1a01 100644 --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -7220,9 +7220,10 @@ check_array_initializer (tree decl, tree type, tree init) static tree build_aggr_init_full_exprs (tree decl, tree init, int flags) - { gcc_assert (stmts_are_full_exprs_p ()); + if (init) + maybe_warn_pessimizing_move (init, TREE_TYPE (decl), /*return_p*/false); return build_aggr_init (decl, init, flags, tf_warning_or_error); } @@ -8633,11 +8634,13 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p, = remove_attribute ("omp declare target implicit", DECL_ATTRIBUTES (decl)); complete_type (TREE_TYPE (decl)); - if (!cp_omp_mappable_type (TREE_TYPE (decl))) + if (!omp_mappable_type (TREE_TYPE (decl))) { error ("%q+D in declare target directive does not have mappable" " type", decl); - cp_omp_emit_unmappable_type_notes (TREE_TYPE (decl)); + if (TREE_TYPE (decl) != error_mark_node + && !COMPLETE_TYPE_P (TREE_TYPE (decl))) + cxx_incomplete_type_inform (TREE_TYPE (decl)); } else if (!lookup_attribute ("omp declare target", DECL_ATTRIBUTES (decl)) diff --git a/gcc/cp/decl2.cc b/gcc/cp/decl2.cc index 3737e5f..89ab254 100644 --- a/gcc/cp/decl2.cc +++ b/gcc/cp/decl2.cc @@ -49,6 +49,7 @@ along with GCC; see the file COPYING3. If not see #include "c-family/c-ada-spec.h" #include "asan.h" #include "optabs-query.h" +#include "omp-general.h" /* Id for dumping the raw trees. */ int raw_dump_id; @@ -1578,62 +1579,6 @@ cp_check_const_attributes (tree attributes) } } -/* Return true if TYPE is an OpenMP mappable type. - If NOTES is non-zero, emit a note message for each problem. */ -static bool -cp_omp_mappable_type_1 (tree type, bool notes) -{ - bool result = true; - - /* Mappable type has to be complete. */ - if (type == error_mark_node || !COMPLETE_TYPE_P (type)) - { - if (notes && type != error_mark_node) - { - tree decl = TYPE_MAIN_DECL (type); - inform ((decl ? DECL_SOURCE_LOCATION (decl) : input_location), - "incomplete type %qT is not mappable", type); - } - result = false; - } - /* Arrays have mappable type if the elements have mappable type. */ - while (TREE_CODE (type) == ARRAY_TYPE) - type = TREE_TYPE (type); - /* All data members must be non-static. */ - if (CLASS_TYPE_P (type)) - { - tree field; - for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field)) - if (VAR_P (field)) - { - if (notes) - inform (DECL_SOURCE_LOCATION (field), - "static field %qD is not mappable", field); - result = false; - } - /* All fields must have mappable types. */ - else if (TREE_CODE (field) == FIELD_DECL - && !cp_omp_mappable_type_1 (TREE_TYPE (field), notes)) - result = false; - } - return result; -} - -/* Return true if TYPE is an OpenMP mappable type. */ -bool -cp_omp_mappable_type (tree type) -{ - return cp_omp_mappable_type_1 (type, false); -} - -/* Return true if TYPE is an OpenMP mappable type. - Emit an error messages if not. */ -bool -cp_omp_emit_unmappable_type_notes (tree type) -{ - return cp_omp_mappable_type_1 (type, true); -} - /* Return the last pushed declaration for the symbol DECL or NULL when no such declaration exists. */ @@ -1709,7 +1654,7 @@ cplus_decl_attributes (tree *decl, tree attributes, int flags) *decl); else if (VAR_P (*decl) && (processing_template_decl - || !cp_omp_mappable_type (TREE_TYPE (*decl)))) + || !omp_mappable_type (TREE_TYPE (*decl)))) attributes = tree_cons (get_identifier ("omp declare target implicit"), NULL_TREE, attributes); else diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index 33926d2..68fc78e 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -924,7 +924,10 @@ cp_lexer_saving_tokens (const cp_lexer* lexer) /* Store the next token from the preprocessor in *TOKEN. Return true if we reach EOF. If LEXER is NULL, assume we are handling an initial #pragma pch_preprocess, and thus want the lexer to return - processed strings. */ + processed strings. + + Diagnostics issued from this function must have their controlling option (if + any) in c.opt annotated as a libcpp option via the CppReason property. */ static void cp_lexer_get_preprocessor_token (unsigned flags, cp_token *token) diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index 6c581fe0..fe7e809 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -21215,6 +21215,9 @@ tsubst_copy_and_build (tree t, CALL_EXPR_ORDERED_ARGS (call) = ord; CALL_EXPR_REVERSE_ARGS (call) = rev; } + if (warning_suppressed_p (t, OPT_Wpessimizing_move)) + /* This also suppresses -Wredundant-move. */ + suppress_warning (ret, OPT_Wpessimizing_move); } RETURN (ret); diff --git a/gcc/cp/semantics.cc b/gcc/cp/semantics.cc index 16dea05..ae7c8ea 100644 --- a/gcc/cp/semantics.cc +++ b/gcc/cp/semantics.cc @@ -7992,13 +7992,15 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort) t = OMP_CLAUSE_DECL (c); if (TREE_CODE (t) != TREE_LIST && !type_dependent_expression_p (t) - && !cp_omp_mappable_type (TREE_TYPE (t))) + && !omp_mappable_type (TREE_TYPE (t))) { error_at (OMP_CLAUSE_LOCATION (c), "array section does not have mappable type " "in %qs clause", omp_clause_code_name[OMP_CLAUSE_CODE (c)]); - cp_omp_emit_unmappable_type_notes (TREE_TYPE (t)); + if (TREE_TYPE (t) != error_mark_node + && !COMPLETE_TYPE_P (TREE_TYPE (t))) + cxx_incomplete_type_inform (TREE_TYPE (t)); remove = true; } while (TREE_CODE (t) == ARRAY_REF) @@ -8134,12 +8136,14 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort) t, omp_clause_code_name[OMP_CLAUSE_CODE (c)]); remove = true; } - else if (!cp_omp_mappable_type (TREE_TYPE (t))) + else if (!omp_mappable_type (TREE_TYPE (t))) { error_at (OMP_CLAUSE_LOCATION (c), "%qE does not have a mappable type in %qs clause", t, omp_clause_code_name[OMP_CLAUSE_CODE (c)]); - cp_omp_emit_unmappable_type_notes (TREE_TYPE (t)); + if (TREE_TYPE (t) != error_mark_node + && !COMPLETE_TYPE_P (TREE_TYPE (t))) + cxx_incomplete_type_inform (TREE_TYPE (t)); remove = true; } while (TREE_CODE (t) == COMPONENT_REF) @@ -8232,14 +8236,16 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort) == GOMP_MAP_FIRSTPRIVATE_POINTER))) && t == OMP_CLAUSE_DECL (c) && !type_dependent_expression_p (t) - && !cp_omp_mappable_type (TYPE_REF_P (TREE_TYPE (t)) - ? TREE_TYPE (TREE_TYPE (t)) - : TREE_TYPE (t))) + && !omp_mappable_type (TYPE_REF_P (TREE_TYPE (t)) + ? TREE_TYPE (TREE_TYPE (t)) + : TREE_TYPE (t))) { error_at (OMP_CLAUSE_LOCATION (c), "%qD does not have a mappable type in %qs clause", t, omp_clause_code_name[OMP_CLAUSE_CODE (c)]); - cp_omp_emit_unmappable_type_notes (TREE_TYPE (t)); + if (TREE_TYPE (t) != error_mark_node + && !COMPLETE_TYPE_P (TREE_TYPE (t))) + cxx_incomplete_type_inform (TREE_TYPE (t)); remove = true; } else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP @@ -8409,12 +8415,14 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort) cname); remove = true; } - else if (!cp_omp_mappable_type (TREE_TYPE (t))) + else if (!omp_mappable_type (TREE_TYPE (t))) { error_at (OMP_CLAUSE_LOCATION (c), "%qD does not have a mappable type in %qs clause", t, cname); - cp_omp_emit_unmappable_type_notes (TREE_TYPE (t)); + if (TREE_TYPE (t) != error_mark_node + && !COMPLETE_TYPE_P (TREE_TYPE (t))) + cxx_incomplete_type_inform (TREE_TYPE (t)); remove = true; } if (remove) diff --git a/gcc/cp/typeck.cc b/gcc/cp/typeck.cc index 6b38c8c..992ebfd 100644 --- a/gcc/cp/typeck.cc +++ b/gcc/cp/typeck.cc @@ -10301,7 +10301,7 @@ can_do_nrvo_p (tree retval, tree functype) prvalue. */ static bool -can_do_rvo_p (tree retval, tree functype) +can_elide_copy_prvalue_p (tree retval, tree functype) { if (functype == error_mark_node) return false; @@ -10372,17 +10372,17 @@ treat_lvalue_as_rvalue_p (tree expr, bool return_p) } } -/* Warn about wrong usage of std::move in a return statement. RETVAL - is the expression we are returning; FUNCTYPE is the type the function - is declared to return. */ +/* Warn about dubious usage of std::move (in a return statement, if RETURN_P + is true). EXPR is the std::move expression; TYPE is the type of the object + being initialized. */ -static void -maybe_warn_pessimizing_move (tree retval, tree functype) +void +maybe_warn_pessimizing_move (tree expr, tree type, bool return_p) { if (!(warn_pessimizing_move || warn_redundant_move)) return; - location_t loc = cp_expr_loc_or_input_loc (retval); + const location_t loc = cp_expr_loc_or_input_loc (expr); /* C++98 doesn't know move. */ if (cxx_dialect < cxx11) @@ -10394,67 +10394,130 @@ maybe_warn_pessimizing_move (tree retval, tree functype) return; /* This is only interesting for class types. */ - if (!CLASS_TYPE_P (functype)) + if (!CLASS_TYPE_P (type)) return; - /* We're looking for *std::move<T&> ((T &) &arg). */ - if (REFERENCE_REF_P (retval) - && TREE_CODE (TREE_OPERAND (retval, 0)) == CALL_EXPR) - { - tree fn = TREE_OPERAND (retval, 0); - if (is_std_move_p (fn)) - { - tree arg = CALL_EXPR_ARG (fn, 0); - tree moved; - if (TREE_CODE (arg) != NOP_EXPR) - return; - arg = TREE_OPERAND (arg, 0); - if (TREE_CODE (arg) != ADDR_EXPR) - return; - arg = TREE_OPERAND (arg, 0); - arg = convert_from_reference (arg); - /* Warn if we could do copy elision were it not for the move. */ - if (can_do_nrvo_p (arg, functype)) - { - auto_diagnostic_group d; - if (warning_at (loc, OPT_Wpessimizing_move, - "moving a local object in a return statement " - "prevents copy elision")) - inform (loc, "remove %<std::move%> call"); - } - else if (can_do_rvo_p (arg, functype)) + /* A a = std::move (A()); */ + if (TREE_CODE (expr) == TREE_LIST) + { + if (list_length (expr) == 1) + expr = TREE_VALUE (expr); + else + return; + } + /* A a = {std::move (A())}; + A a{std::move (A())}; */ + else if (TREE_CODE (expr) == CONSTRUCTOR) + { + if (CONSTRUCTOR_NELTS (expr) == 1) + expr = CONSTRUCTOR_ELT (expr, 0)->value; + else + return; + } + + /* First, check if this is a call to std::move. */ + if (!REFERENCE_REF_P (expr) + || TREE_CODE (TREE_OPERAND (expr, 0)) != CALL_EXPR) + return; + tree fn = TREE_OPERAND (expr, 0); + if (!is_std_move_p (fn)) + return; + tree arg = CALL_EXPR_ARG (fn, 0); + if (TREE_CODE (arg) != NOP_EXPR) + return; + /* If we're looking at *std::move<T&> ((T &) &arg), do the pessimizing N/RVO + and implicitly-movable warnings. */ + if (TREE_CODE (TREE_OPERAND (arg, 0)) == ADDR_EXPR) + { + arg = TREE_OPERAND (arg, 0); + arg = TREE_OPERAND (arg, 0); + arg = convert_from_reference (arg); + if (can_elide_copy_prvalue_p (arg, type)) + { + auto_diagnostic_group d; + if (warning_at (loc, OPT_Wpessimizing_move, + "moving a temporary object prevents copy elision")) + inform (loc, "remove %<std::move%> call"); + } + /* The rest of the warnings is only relevant for when we are returning + from a function. */ + if (!return_p) + return; + + tree moved; + /* Warn if we could do copy elision were it not for the move. */ + if (can_do_nrvo_p (arg, type)) + { + auto_diagnostic_group d; + if (!warning_suppressed_p (expr, OPT_Wpessimizing_move) + && warning_at (loc, OPT_Wpessimizing_move, + "moving a local object in a return statement " + "prevents copy elision")) + inform (loc, "remove %<std::move%> call"); + } + /* Warn if the move is redundant. It is redundant when we would + do maybe-rvalue overload resolution even without std::move. */ + else if (warn_redundant_move + && !warning_suppressed_p (expr, OPT_Wredundant_move) + && (moved = treat_lvalue_as_rvalue_p (arg, /*return*/true))) + { + /* Make sure that overload resolution would actually succeed + if we removed the std::move call. */ + tree t = convert_for_initialization (NULL_TREE, type, + moved, + (LOOKUP_NORMAL + | LOOKUP_ONLYCONVERTING + | LOOKUP_PREFER_RVALUE), + ICR_RETURN, NULL_TREE, 0, + tf_none); + /* If this worked, implicit rvalue would work, so the call to + std::move is redundant. */ + if (t != error_mark_node + /* Trying to move something const will never succeed unless + there's T(const T&&), which it almost never is, and if + so, T wouldn't be error_mark_node now: the above convert_ + call with LOOKUP_PREFER_RVALUE returns an error if a const T& + overload is selected. */ + || (CP_TYPE_CONST_P (TREE_TYPE (arg)) + && same_type_ignoring_top_level_qualifiers_p + (TREE_TYPE (arg), type))) { auto_diagnostic_group d; - if (warning_at (loc, OPT_Wpessimizing_move, - "moving a temporary object in a return statement " - "prevents copy elision")) + if (warning_at (loc, OPT_Wredundant_move, + "redundant move in return statement")) inform (loc, "remove %<std::move%> call"); } - /* Warn if the move is redundant. It is redundant when we would - do maybe-rvalue overload resolution even without std::move. */ - else if (warn_redundant_move - && (moved = treat_lvalue_as_rvalue_p (arg, /*return*/true))) - { - /* Make sure that overload resolution would actually succeed - if we removed the std::move call. */ - tree t = convert_for_initialization (NULL_TREE, functype, - moved, - (LOOKUP_NORMAL - | LOOKUP_ONLYCONVERTING - | LOOKUP_PREFER_RVALUE), - ICR_RETURN, NULL_TREE, 0, - tf_none); - /* If this worked, implicit rvalue would work, so the call to - std::move is redundant. */ - if (t != error_mark_node) - { - auto_diagnostic_group d; - if (warning_at (loc, OPT_Wredundant_move, - "redundant move in return statement")) - inform (loc, "remove %<std::move%> call"); - } - } } + } + /* Also try to warn about redundant std::move in code such as + T f (const T& t) + { + return std::move(t); + } + for which EXPR will be something like + *std::move<const T&> ((const struct T &) (const struct T *) t) + and where the std::move does nothing if T does not have a T(const T&&) + constructor, because the argument is const. It will not use T(T&&) + because that would mean losing the const. */ + else if (TYPE_REF_P (TREE_TYPE (arg)) + && CP_TYPE_CONST_P (TREE_TYPE (TREE_TYPE (arg)))) + { + tree rtype = TREE_TYPE (TREE_TYPE (arg)); + if (!same_type_ignoring_top_level_qualifiers_p (rtype, type)) + return; + /* Check for the unlikely case there's T(const T&&) (we don't care if + it's deleted). */ + for (tree fn : ovl_range (CLASSTYPE_CONSTRUCTORS (rtype))) + if (move_fn_p (fn)) + { + tree t = TREE_VALUE (FUNCTION_FIRST_USER_PARMTYPE (fn)); + if (UNLIKELY (CP_TYPE_CONST_P (TREE_TYPE (t)))) + return; + } + auto_diagnostic_group d; + if (warning_at (loc, OPT_Wredundant_move, + "redundant move in return statement")) + inform (loc, "remove %<std::move%> call"); } } @@ -10677,6 +10740,11 @@ check_return_expr (tree retval, bool *no_warning) /* We don't know if this is an lvalue or rvalue use, but either way we can mark it as read. */ mark_exp_read (retval); + /* Disable our std::move warnings when we're returning + a dependent expression (c++/89780). */ + if (retval && TREE_CODE (retval) == CALL_EXPR) + /* This also suppresses -Wredundant-move. */ + suppress_warning (retval, OPT_Wpessimizing_move); return retval; } @@ -10722,7 +10790,7 @@ check_return_expr (tree retval, bool *no_warning) return NULL_TREE; if (!named_return_value_okay_p) - maybe_warn_pessimizing_move (retval, functype); + maybe_warn_pessimizing_move (retval, functype, /*return_p*/true); /* Do any required conversions. */ if (bare_retval == result || DECL_CONSTRUCTOR_P (current_function_decl)) diff --git a/gcc/d/ChangeLog b/gcc/d/ChangeLog index 0d4c037..ebb6391 100644 --- a/gcc/d/ChangeLog +++ b/gcc/d/ChangeLog @@ -1,3 +1,9 @@ +2022-08-16 Iain Buclaw <ibuclaw@gdcproject.org> + + PR d/106638 + * gdc.texi: Update DIP links to point at upstream dlang/DIPs + repository. + 2022-08-15 Iain Buclaw <ibuclaw@gdcproject.org> * d-tree.h (d_defer_declaration): Declare. diff --git a/gcc/diagnostic-spec.cc b/gcc/diagnostic-spec.cc index 4341ccf..aece896 100644 --- a/gcc/diagnostic-spec.cc +++ b/gcc/diagnostic-spec.cc @@ -96,7 +96,7 @@ nowarn_spec_t::nowarn_spec_t (opt_code opt) case OPT_Winit_self: case OPT_Wuninitialized: case OPT_Wmaybe_uninitialized: - m_bits = NW_UNINIT; + m_bits = NW_UNINIT; break; case OPT_Wdangling_pointer_: @@ -105,6 +105,11 @@ nowarn_spec_t::nowarn_spec_t (opt_code opt) m_bits = NW_DANGLING; break; + case OPT_Wpessimizing_move: + case OPT_Wredundant_move: + m_bits = NW_REDUNDANT; + break; + default: /* A catchall group for everything else. */ m_bits = NW_OTHER; diff --git a/gcc/diagnostic-spec.h b/gcc/diagnostic-spec.h index 28e5e5c..e5f1c12 100644 --- a/gcc/diagnostic-spec.h +++ b/gcc/diagnostic-spec.h @@ -45,9 +45,11 @@ public: NW_DANGLING = 1 << 5, /* All other unclassified warnings. */ NW_OTHER = 1 << 6, + /* Warnings about redundant calls. */ + NW_REDUNDANT = 1 << 7, /* All groups of warnings. */ NW_ALL = (NW_ACCESS | NW_LEXICAL | NW_NONNULL - | NW_UNINIT | NW_VFLOW | NW_DANGLING | NW_OTHER) + | NW_UNINIT | NW_VFLOW | NW_DANGLING | NW_REDUNDANT | NW_OTHER) }; nowarn_spec_t (): m_bits () { } diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 74968c9..678059b 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,23 @@ +2022-08-17 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + Jakub Jelinek <jakub@redhat.com> + + PR fortran/46539 + * lang.opt (static-libquadmath): New option. + * invoke.texi (-static-libquadmath): Document it. + * options.cc (gfc_handle_option): Error out if -static-libquadmath + is passed but we do not support it. + +2022-08-17 Tobias Burnus <tobias@codesourcery.com> + + PR fortran/106566 + * openmp.cc (gfc_match_omp_clauses): Fix setting linear-step value + to 1 when not specified. + (gfc_match_omp_declare_simd): Accept module procedures. + +2022-08-16 Martin Liska <mliska@suse.cz> + + * gfortran.texi: Fix link destination to a valid URL. + 2022-07-31 Harald Anlauf <anlauf@gmx.de> Steven G. Kargl <kargl@gcc.gnu.org> diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi index 251e151..0d0343d 100644 --- a/gcc/fortran/invoke.texi +++ b/gcc/fortran/invoke.texi @@ -138,7 +138,7 @@ and warnings}. @item Link Options @xref{Link Options,,Options for influencing the linking step}. -@gccoptlist{-static-libgfortran} +@gccoptlist{-static-libgfortran -static-libquadmath} @item Runtime Options @xref{Runtime Options,,Options for influencing runtime behavior}. @@ -1393,6 +1393,20 @@ configured, this option has no effect. @end table +@table @gcctabopt +@item -static-libquadmath +@opindex @code{static-libquadmath} +On systems that provide @file{libquadmath} as a shared and a static +library, this option forces the use of the static version. If no +shared version of @file{libquadmath} was built when the compiler was +configured, this option has no effect. + +Please note that the @file{libquadmath} runtime library is licensed under the +GNU Lesser General Public License (LGPL), and linking it statically introduces +requirements when redistributing the resulting binaries. +@end table + + @node Runtime Options @section Influencing runtime behavior @cindex options, runtime diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt index cf39712..e8cd735 100644 --- a/gcc/fortran/lang.opt +++ b/gcc/fortran/lang.opt @@ -863,6 +863,10 @@ static-libgfortran Fortran Statically link the GNU Fortran helper library (libgfortran). +static-libquadmath +Fortran +Statically link the GCC Quad-Precision Math Library (libquadmath). + std=f2003 Fortran Conform to the ISO Fortran 2003 standard. diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc index a7eb6c3..5949077 100644 --- a/gcc/fortran/openmp.cc +++ b/gcc/fortran/openmp.cc @@ -2480,7 +2480,7 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask, goto error; } } - else + if (step == NULL) { step = gfc_get_constant_expr (BT_INTEGER, gfc_default_integer_kind, @@ -4213,9 +4213,13 @@ gfc_match_omp_declare_simd (void) gfc_omp_declare_simd *ods; bool needs_space = false; - switch (gfc_match (" ( %s ) ", &proc_name)) + switch (gfc_match (" ( ")) { - case MATCH_YES: break; + case MATCH_YES: + if (gfc_match_symbol (&proc_name, /* host assoc = */ true) != MATCH_YES + || gfc_match (" ) ") != MATCH_YES) + return MATCH_ERROR; + break; case MATCH_NO: proc_name = NULL; needs_space = true; break; case MATCH_ERROR: return MATCH_ERROR; } diff --git a/gcc/fortran/options.cc b/gcc/fortran/options.cc index d0fa634..38249d6 100644 --- a/gcc/fortran/options.cc +++ b/gcc/fortran/options.cc @@ -692,6 +692,13 @@ gfc_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value, #endif break; + case OPT_static_libquadmath: +#ifndef HAVE_LD_STATIC_DYNAMIC + gfc_fatal_error ("%<-static-libquadmath%> is not supported in this " + "configuration"); +#endif + break; + case OPT_fintrinsic_modules_path: case OPT_fintrinsic_modules_path_: @@ -4585,12 +4585,14 @@ driver_handle_option (struct gcc_options *opts, case OPT_static_libgcc: case OPT_shared_libgcc: case OPT_static_libgfortran: + case OPT_static_libquadmath: case OPT_static_libphobos: case OPT_static_libstdc__: /* These are always valid, since gcc.cc itself understands the first two, gfortranspec.cc understands -static-libgfortran, - d-spec.cc understands -static-libphobos, and g++spec.cc - understands -static-libstdc++ */ + d-spec.cc understands -static-libphobos, g++spec.cc + understands -static-libstdc++ and libgfortran.spec handles + -static-libquadmath. */ validated = true; break; diff --git a/gcc/gcov-dump.cc b/gcc/gcov-dump.cc index 85b1be8..03023bf 100644 --- a/gcc/gcov-dump.cc +++ b/gcc/gcov-dump.cc @@ -17,6 +17,7 @@ along with Gcov; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ #include "config.h" +#define INCLUDE_VECTOR #include "system.h" #include "coretypes.h" #include "tm.h" @@ -28,8 +29,6 @@ along with Gcov; see the file COPYING3. If not see #include "gcov-io.h" #include "gcov-io.cc" -#include <vector> - using namespace std; static void dump_gcov_file (const char *); diff --git a/gcc/gimple-range-fold.cc b/gcc/gimple-range-fold.cc index 689d827..b0b2210 100644 --- a/gcc/gimple-range-fold.cc +++ b/gcc/gimple-range-fold.cc @@ -1580,3 +1580,36 @@ fur_source::register_outgoing_edges (gcond *s, irange &lhs_range, edge e0, edge } } } + +// Given stmt S, fill VEC, up to VEC_SIZE elements, with relevant ssa-names +// on the statement. For efficiency, it is an error to not pass in enough +// elements for the vector. Return the number of ssa-names. + +unsigned +gimple_range_ssa_names (tree *vec, unsigned vec_size, gimple *stmt) +{ + tree ssa; + int count = 0; + + if (range_op_handler (stmt)) + { + gcc_checking_assert (vec_size >= 2); + if ((ssa = gimple_range_ssa_p (gimple_range_operand1 (stmt)))) + vec[count++] = ssa; + if ((ssa = gimple_range_ssa_p (gimple_range_operand2 (stmt)))) + vec[count++] = ssa; + } + else if (is_a<gassign *> (stmt) + && gimple_assign_rhs_code (stmt) == COND_EXPR) + { + gcc_checking_assert (vec_size >= 3); + gassign *st = as_a<gassign *> (stmt); + if ((ssa = gimple_range_ssa_p (gimple_assign_rhs1 (st)))) + vec[count++] = ssa; + if ((ssa = gimple_range_ssa_p (gimple_assign_rhs2 (st)))) + vec[count++] = ssa; + if ((ssa = gimple_range_ssa_p (gimple_assign_rhs3 (st)))) + vec[count++] = ssa; + } + return count; +} diff --git a/gcc/gimple-range-fold.h b/gcc/gimple-range-fold.h index c2f381d..f2eab72 100644 --- a/gcc/gimple-range-fold.h +++ b/gcc/gimple-range-fold.h @@ -96,6 +96,14 @@ range_compatible_p (tree type1, tree type2) && TYPE_SIGN (type1) == TYPE_SIGN (type2)); } +extern tree gimple_range_operand1 (const gimple *s); +extern tree gimple_range_operand2 (const gimple *s); + +// Given stmt S, fill VEC, up to VEC_SIZE elements, with relevant ssa-names +// on the statement. For efficiency, it is an error to not pass in enough +// elements for the vector. Return the number of ssa-names. + +unsigned gimple_range_ssa_names (tree *vec, unsigned vec_size, gimple *stmt); // Source of all operands for fold_using_range and gori_compute. // It abstracts out the source of an operand so it can come from a stmt or @@ -150,9 +158,6 @@ protected: relation_oracle *m_oracle; }; -extern tree gimple_range_operand1 (const gimple *s); -extern tree gimple_range_operand2 (const gimple *s); - // This class uses ranges to fold a gimple statement producinf a range for // the LHS. The source of all operands is supplied via the fur_source class // which provides a range_query as well as a source location and any other diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc index 8879e44..957b8d5 100644 --- a/gcc/gimple-range-gori.cc +++ b/gcc/gimple-range-gori.cc @@ -331,7 +331,7 @@ range_def_chain::has_def_chain (tree name) bitmap range_def_chain::get_def_chain (tree name) { - tree ssa1, ssa2, ssa3; + tree ssa[3]; unsigned v = SSA_NAME_VERSION (name); // If it has already been processed, just return the cached value. @@ -347,23 +347,10 @@ range_def_chain::get_def_chain (tree name) } gimple *stmt = SSA_NAME_DEF_STMT (name); - if (range_op_handler (stmt)) + unsigned count = gimple_range_ssa_names (ssa, 3, stmt); + if (count == 0) { - ssa1 = gimple_range_ssa_p (gimple_range_operand1 (stmt)); - ssa2 = gimple_range_ssa_p (gimple_range_operand2 (stmt)); - ssa3 = NULL_TREE; - } - else if (is_a<gassign *> (stmt) - && gimple_assign_rhs_code (stmt) == COND_EXPR) - { - gassign *st = as_a<gassign *> (stmt); - ssa1 = gimple_range_ssa_p (gimple_assign_rhs1 (st)); - ssa2 = gimple_range_ssa_p (gimple_assign_rhs2 (st)); - ssa3 = gimple_range_ssa_p (gimple_assign_rhs3 (st)); - } - else - { - // Stmts not understood are always imports. + // Stmts not understood or with no operands are always imports. set_import (m_def_chain[v], name, NULL); return NULL; } @@ -373,17 +360,13 @@ range_def_chain::get_def_chain (tree name) return NULL; // Increase the depth if we have a pair of ssa-names. - if (ssa1 && ssa2) + if (count > 1) m_logical_depth++; - register_dependency (name, ssa1, gimple_bb (stmt)); - register_dependency (name, ssa2, gimple_bb (stmt)); - register_dependency (name, ssa3, gimple_bb (stmt)); - // Stmts with no understandable operands are also imports. - if (!ssa1 && !ssa2 & !ssa3) - set_import (m_def_chain[v], name, NULL); + for (unsigned x = 0; x < count; x++) + register_dependency (name, ssa[x], gimple_bb (stmt)); - if (ssa1 && ssa2) + if (count > 1) m_logical_depth--; return m_def_chain[v].bm; diff --git a/gcc/gimple-range-path.cc b/gcc/gimple-range-path.cc index c99d77d..ff991b7 100644 --- a/gcc/gimple-range-path.cc +++ b/gcc/gimple-range-path.cc @@ -435,11 +435,10 @@ path_range_query::compute_ranges_in_block (basic_block bb) e->src->index, e->dest->index); path_oracle *p = get_path_oracle (); - p->reset_path (); // ?? Instead of nuking the root oracle altogether, we could // reset the path oracle to search for relations from the top of // the loop with the root oracle. Something for future development. - p->set_root_oracle (nullptr); + p->reset_path (); } gori_compute &g = m_ranger->gori (); @@ -558,26 +557,10 @@ path_range_query::compute_exit_dependencies (bitmap dependencies, else if (gassign *ass = dyn_cast <gassign *> (def_stmt)) { tree ssa[3]; - if (range_op_handler (ass)) - { - ssa[0] = gimple_range_ssa_p (gimple_range_operand1 (ass)); - ssa[1] = gimple_range_ssa_p (gimple_range_operand2 (ass)); - ssa[2] = NULL_TREE; - } - else if (gimple_assign_rhs_code (ass) == COND_EXPR) - { - ssa[0] = gimple_range_ssa_p (gimple_assign_rhs1 (ass)); - ssa[1] = gimple_range_ssa_p (gimple_assign_rhs2 (ass)); - ssa[2] = gimple_range_ssa_p (gimple_assign_rhs3 (ass)); - } - else - continue; - for (unsigned j = 0; j < 3; ++j) - { - tree rhs = ssa[j]; - if (rhs && add_to_exit_dependencies (rhs, dependencies)) - worklist.safe_push (rhs); - } + unsigned count = gimple_range_ssa_names (ssa, 3, ass); + for (unsigned j = 0; j < count; ++j) + if (add_to_exit_dependencies (ssa[j], dependencies)) + worklist.safe_push (ssa[j]); } } // Exported booleans along the path, may help conditionals. @@ -615,7 +598,10 @@ path_range_query::compute_ranges (const vec<basic_block> &path, compute_exit_dependencies (m_exit_dependencies, m_path); if (m_resolve) - get_path_oracle ()->reset_path (); + { + path_oracle *p = get_path_oracle (); + p->reset_path (m_ranger->oracle ()); + } if (DEBUG_SOLVER) { diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc index f0fbdb4..f9e7060 100644 --- a/gcc/gimplify.cc +++ b/gcc/gimplify.cc @@ -7885,7 +7885,7 @@ omp_notice_variable (struct gimplify_omp_ctx *ctx, tree decl, bool in_code) if (gimplify_omp_ctxp->target_firstprivatize_array_bases && omp_privatize_by_reference (decl)) type = TREE_TYPE (type); - if (!lang_hooks.types.omp_mappable_type (type)) + if (!omp_mappable_type (type)) { error ("%qD referenced in target region does not have " "a mappable type", decl); diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h index 4e17915..0f1bfbf 100644 --- a/gcc/langhooks-def.h +++ b/gcc/langhooks-def.h @@ -88,7 +88,6 @@ extern tree lhd_omp_array_size (tree, gimple_seq *); struct gimplify_omp_ctx; extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *, tree); -extern bool lhd_omp_mappable_type (tree); extern bool lhd_omp_scalar_p (tree, bool); extern tree *lhd_omp_get_decl_init (tree); extern void lhd_omp_finish_decl_inits (); @@ -206,7 +205,6 @@ extern tree lhd_unit_size_without_reusable_padding (tree); #define LANG_HOOKS_TYPE_MAX_SIZE lhd_return_null_const_tree #define LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES \ lhd_omp_firstprivatize_type_sizes -#define LANG_HOOKS_OMP_MAPPABLE_TYPE lhd_omp_mappable_type #define LANG_HOOKS_TYPE_HASH_EQ NULL #define LANG_HOOKS_COPY_LANG_QUALIFIERS NULL #define LANG_HOOKS_GET_ARRAY_DESCR_INFO NULL @@ -235,7 +233,6 @@ extern tree lhd_unit_size_without_reusable_padding (tree); LANG_HOOKS_INCOMPLETE_TYPE_ERROR, \ LANG_HOOKS_TYPE_MAX_SIZE, \ LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES, \ - LANG_HOOKS_OMP_MAPPABLE_TYPE, \ LANG_HOOKS_TYPE_HASH_EQ, \ LANG_HOOKS_COPY_LANG_QUALIFIERS, \ LANG_HOOKS_GET_ARRAY_DESCR_INFO, \ diff --git a/gcc/langhooks.cc b/gcc/langhooks.cc index a933407..7d97567 100644 --- a/gcc/langhooks.cc +++ b/gcc/langhooks.cc @@ -686,17 +686,6 @@ lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *c ATTRIBUTE_UNUSED, { } -/* Return true if TYPE is an OpenMP mappable type. */ - -bool -lhd_omp_mappable_type (tree type) -{ - /* Mappable type has to be complete. */ - if (type == error_mark_node || !COMPLETE_TYPE_P (type)) - return false; - return true; -} - /* Common function for add_builtin_function, add_builtin_function_ext_scope and simulate_builtin_function_decl. */ diff --git a/gcc/langhooks.h b/gcc/langhooks.h index 97aa9e0..b1b2b0e 100644 --- a/gcc/langhooks.h +++ b/gcc/langhooks.h @@ -128,9 +128,6 @@ struct lang_hooks_for_types firstprivate variables. */ void (*omp_firstprivatize_type_sizes) (struct gimplify_omp_ctx *, tree); - /* Return true if TYPE is a mappable type. */ - bool (*omp_mappable_type) (tree type); - /* Return TRUE if TYPE1 and TYPE2 are identical for type hashing purposes. Called only after doing all language independent checks. At present, this function is only called when both TYPE1 and TYPE2 are diff --git a/gcc/lto-cgraph.cc b/gcc/lto-cgraph.cc index 6d9c36e..39af9c1 100644 --- a/gcc/lto-cgraph.cc +++ b/gcc/lto-cgraph.cc @@ -1881,6 +1881,11 @@ input_offload_tables (bool do_force_output) if (tmp_decl != NULL_TREE) fn2 = IDENTIFIER_POINTER (DECL_NAME (tmp_decl)); } + if (fn1 == fn2) + { + fn1 = requires_fn; + fn2 = file_data->file_name; + } char buf1[sizeof ("unified_address, unified_shared_memory, " "reverse_offload")]; diff --git a/gcc/omp-general.cc b/gcc/omp-general.cc index a406c57..33792ad 100644 --- a/gcc/omp-general.cc +++ b/gcc/omp-general.cc @@ -80,6 +80,17 @@ omp_check_optional_argument (tree decl, bool for_present_check) return lang_hooks.decls.omp_check_optional_argument (decl, for_present_check); } +/* Return true if TYPE is an OpenMP mappable type. */ + +bool +omp_mappable_type (tree type) +{ + /* Mappable type has to be complete. */ + if (type == error_mark_node || !COMPLETE_TYPE_P (type)) + return false; + return true; +} + /* True if OpenMP should privatize what this DECL points to rather than the DECL itself. */ diff --git a/gcc/omp-general.h b/gcc/omp-general.h index 74e90e1..1b5455a 100644 --- a/gcc/omp-general.h +++ b/gcc/omp-general.h @@ -94,6 +94,7 @@ struct omp_for_data extern tree omp_find_clause (tree clauses, enum omp_clause_code kind); extern bool omp_is_allocatable_or_ptr (tree decl); extern tree omp_check_optional_argument (tree decl, bool for_present_check); +extern bool omp_mappable_type (tree type); extern bool omp_privatize_by_reference (tree decl); extern void omp_adjust_for_condition (location_t loc, enum tree_code *cond_code, tree *n2, tree v, tree step); diff --git a/gcc/omp-low.cc b/gcc/omp-low.cc index 3c4b859..fdf34d6 100644 --- a/gcc/omp-low.cc +++ b/gcc/omp-low.cc @@ -6188,6 +6188,8 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist, && gimple_omp_for_combined_into_p (ctx->stmt)) { tree t = OMP_CLAUSE_LINEAR_STEP (c); + if (DECL_P (t)) + t = build_outer_var_ref (t, ctx); tree stept = TREE_TYPE (t); tree ct = omp_find_clause (clauses, OMP_CLAUSE__LOOPTEMP_); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7379a89..c7c5abb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,111 @@ +2022-08-17 Maciej W. Rozycki <macro@embecosm.com> + + * gcc.target/riscv/fmax-snan.c: Add `dg-require-effective-target + hard_float'. + * gcc.target/riscv/fmaxf-snan.c: Likewise. + * gcc.target/riscv/fmin-snan.c: Likewise. + * gcc.target/riscv/fminf-snan.c: Likewise. + +2022-08-17 Marek Polacek <polacek@redhat.com> + + PR c++/67906 + * g++.dg/cpp0x/Wredundant-move11.C: New test. + +2022-08-17 Marek Polacek <polacek@redhat.com> + + PR c++/90428 + * g++.dg/cpp0x/Wredundant-move1.C: Adjust dg-warning. + * g++.dg/cpp0x/Wredundant-move9.C: Likewise. + * g++.dg/cpp0x/Wredundant-move10.C: New test. + +2022-08-17 Marek Polacek <polacek@redhat.com> + + PR c++/89780 + * g++.dg/cpp0x/Wpessimizing-move3.C: Remove dg-warning. + * g++.dg/cpp0x/Wredundant-move2.C: Likewise. + * g++.dg/cpp0x/Wpessimizing-move9.C: New file. + +2022-08-17 Marek Polacek <polacek@redhat.com> + + PR c++/106276 + * g++.dg/cpp0x/Wpessimizing-move7.C: Add dg-warning. + * g++.dg/cpp0x/Wpessimizing-move8.C: New test. + +2022-08-17 Tobias Burnus <tobias@codesourcery.com> + + PR fortran/106566 + * gfortran.dg/gomp/declare-simd-4.f90: New test. + * gfortran.dg/gomp/declare-simd-5.f90: New test. + * gfortran.dg/gomp/declare-simd-6.f90: New test. + +2022-08-17 Tobias Burnus <tobias@codesourcery.com> + Chung-Lin Tang <cltang@codesourcery.com> + + PR c++/104493 + * g++.dg/gomp/unmappable-1.C: Remove dg-error; remove dg-note no + longer shown as TYPE_MAIN_DECL is NULL. + * c-c++-common/gomp/map-incomplete-type.c: New test. + +2022-08-17 Xi Ruoyao <xry111@xry111.site> + + * gcc.target/loongarch/fmax-fmin.c: New test. + +2022-08-16 Jason Merrill <jason@redhat.com> + + * g++.dg/warn/Wstringop-overflow-4.C: Only xfail for C++98. + * g++.target/i386/bfloat_cpp_typecheck.C: Remove xfail. + +2022-08-16 Tom Honermann <tom@honermann.net> + + PR c++/106423 + * g++.dg/cpp0x/keywords2.C: New test. + * g++.dg/cpp2a/keywords2.C: New test. + +2022-08-16 Kito Cheng <kito.cheng@sifive.com> + + * gcc.target/riscv/_Float16-zfh-1.c: New. + * gcc.target/riscv/_Float16-zfh-2.c: Ditto. + * gcc.target/riscv/_Float16-zfh-3.c: Ditto. + * gcc.target/riscv/_Float16-zfhmin-1.c: Ditto. + * gcc.target/riscv/_Float16-zfhmin-2.c: Ditto. + * gcc.target/riscv/_Float16-zfhmin-3.c: Ditto. + * gcc.target/riscv/arch-16.c: Ditto. + * gcc.target/riscv/arch-17.c: Ditto. + * gcc.target/riscv/predef-21.c: Ditto. + * gcc.target/riscv/predef-22.c: Ditto. + +2022-08-16 Kito Cheng <kito.cheng@sifive.com> + + * g++.target/riscv/_Float16.C: New. + * gcc.target/riscv/_Float16-soft-1.c: Ditto. + * gcc.target/riscv/_Float16-soft-2.c: Ditto. + * gcc.target/riscv/_Float16-soft-3.c: Ditto. + * gcc.target/riscv/_Float16-soft-4.c: Ditto. + * gcc.target/riscv/_Float16.c: Ditto. + +2022-08-16 Jakub Jelinek <jakub@redhat.com> + + * g++.dg/cpp2a/volatile1.C: Adjust for de-deprecation of volatile + compound |=, &= and ^= operations. + * g++.dg/cpp2a/volatile3.C: Likewise. + * g++.dg/cpp2a/volatile5.C: Likewise. + +2022-08-16 Richard Biener <rguenther@suse.de> + + PR middle-end/106630 + * gcc.dg/torture/pr106630.c: New testcase. + +2022-08-16 Kewen.Lin <linkw@gcc.gnu.org> + + PR target/103353 + * gcc.target/powerpc/pr103353.c: New test. + +2022-08-16 Kewen Lin <linkw@linux.ibm.com> + + PR tree-optimization/106322 + * gcc.target/i386/pr106322.c: New test. + * gcc.target/powerpc/pr106322.c: New test. + 2022-08-15 Iain Buclaw <ibuclaw@gdcproject.org> PR d/106623 diff --git a/gcc/testsuite/c-c++-common/gomp/map-incomplete-type.c b/gcc/testsuite/c-c++-common/gomp/map-incomplete-type.c new file mode 100644 index 0000000..29702de --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/map-incomplete-type.c @@ -0,0 +1,17 @@ +struct incomplete_t; +/* { dg-note "forward declaration of 'struct incomplete_t'" "" { target c++ } .-1 } */ + +/* Note: This note is only printed with C++ (trice); the loc is available due to TYPE_MAIN_DECL. */ + +struct incomplete_t *ptr; +int i; + +void +foo (void) +{ + #pragma omp target enter data map(to: i) map(to: ptr[0]) + /* All apply to the line above. The first error is printed twice. */ + /* { dg-error "invalid use of undefined type 'struct incomplete_t'" "" { target c } .-2 } */ + /* { dg-error "invalid use of incomplete type 'struct incomplete_t'" "" { target c++ } .-3 } */ + /* { dg-error "array section does not have mappable type in 'map' clause" "" { target *-*-* } .-4 } */ +} diff --git a/gcc/testsuite/g++.dg/cpp0x/Wpessimizing-move3.C b/gcc/testsuite/g++.dg/cpp0x/Wpessimizing-move3.C index a1af123..c81f29a 100644 --- a/gcc/testsuite/g++.dg/cpp0x/Wpessimizing-move3.C +++ b/gcc/testsuite/g++.dg/cpp0x/Wpessimizing-move3.C @@ -39,7 +39,7 @@ Tp1 fn2 () { Tp2 t; - return std::move (t); // { dg-warning "moving a local object in a return statement prevents copy elision" } + return std::move (t); } template<typename Tp1, typename Tp2> diff --git a/gcc/testsuite/g++.dg/cpp0x/Wpessimizing-move7.C b/gcc/testsuite/g++.dg/cpp0x/Wpessimizing-move7.C index cd4eaa0..a17c7a8 100644 --- a/gcc/testsuite/g++.dg/cpp0x/Wpessimizing-move7.C +++ b/gcc/testsuite/g++.dg/cpp0x/Wpessimizing-move7.C @@ -30,23 +30,23 @@ static A foo (); A fn1 () { - return std::move (A{}); // { dg-warning "moving a temporary object in a return statement prevents copy elision" } - return std::move (A()); // { dg-warning "moving a temporary object in a return statement prevents copy elision" } - return std::move (foo ()); // { dg-warning "moving a temporary object in a return statement prevents copy elision" } + return std::move (A{}); // { dg-warning "moving a temporary object prevents copy elision" } + return std::move (A()); // { dg-warning "moving a temporary object prevents copy elision" } + return std::move (foo ()); // { dg-warning "moving a temporary object prevents copy elision" } } B fn2 () { - return std::move (A()); - return std::move (A{}); - return std::move (foo ()); + return std::move (A()); // { dg-warning "moving a temporary object prevents copy elision" } + return std::move (A{}); // { dg-warning "moving a temporary object prevents copy elision" } + return std::move (foo ()); // { dg-warning "moving a temporary object prevents copy elision" } } template <typename T1, typename T2> T1 fn3 () { - return std::move (T2{}); // { dg-warning "moving a temporary object in a return statement prevents copy elision" } + return std::move (T2{}); // { dg-warning "moving a temporary object prevents copy elision" } } void @@ -58,6 +58,6 @@ do_fn3 () char take_buffer; struct label_text { - label_text take() { return std::move(label_text(&take_buffer)); } // { dg-warning "moving a temporary object in a return statement prevents copy elision" } + label_text take() { return std::move(label_text(&take_buffer)); } // { dg-warning "moving a temporary object prevents copy elision" } label_text(char *); }; diff --git a/gcc/testsuite/g++.dg/cpp0x/Wpessimizing-move8.C b/gcc/testsuite/g++.dg/cpp0x/Wpessimizing-move8.C new file mode 100644 index 0000000..51406c8 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/Wpessimizing-move8.C @@ -0,0 +1,65 @@ +// PR c++/106276 +// { dg-do compile { target c++11 } } +// { dg-options "-Wpessimizing-move" } + +// Define std::move. +namespace std { + template<typename _Tp> + struct remove_reference + { typedef _Tp type; }; + + template<typename _Tp> + struct remove_reference<_Tp&> + { typedef _Tp type; }; + + template<typename _Tp> + struct remove_reference<_Tp&&> + { typedef _Tp type; }; + + template<typename _Tp> + constexpr typename std::remove_reference<_Tp>::type&& + move(_Tp&& __t) noexcept + { return static_cast<typename std::remove_reference<_Tp>::type&&>(__t); } +} + +struct A { A(); A(const A&) = delete; A(A&&); }; +struct B { B(A); }; +struct X { }; + +void foo (A); +void bar (X); + +void +fn1 () +{ + A a1 = std::move (A()); // { dg-warning "moving a temporary object prevents copy elision" } + A a2 = std::move (A{}); // { dg-warning "moving a temporary object prevents copy elision" } + A a3(std::move (A())); // { dg-warning "moving a temporary object prevents copy elision" } + A a4(std::move (A{})); // { dg-warning "moving a temporary object prevents copy elision" } + A a5{std::move (A())}; // { dg-warning "moving a temporary object prevents copy elision" } + A a6{std::move (A{})}; // { dg-warning "moving a temporary object prevents copy elision" } + A a7 = {std::move (A())}; // { dg-warning "moving a temporary object prevents copy elision" } + A a8 = {std::move (A{})}; // { dg-warning "moving a temporary object prevents copy elision" } + + B b1 = std::move (A()); // { dg-warning "moving a temporary object prevents copy elision" } + B b2(std::move (A())); // { dg-warning "moving a temporary object prevents copy elision" } + B b3{std::move (A())}; // { dg-warning "moving a temporary object prevents copy elision" } + B b4 = {std::move (A())}; // { dg-warning "moving a temporary object prevents copy elision" } + + X x1 = std::move (X()); // { dg-warning "moving a temporary object prevents copy elision" } + X x2 = std::move (X{}); // { dg-warning "moving a temporary object prevents copy elision" } + X x3(std::move (X())); // { dg-warning "moving a temporary object prevents copy elision" } + X x4(std::move (X{})); // { dg-warning "moving a temporary object prevents copy elision" } + X x5{std::move (X())}; // { dg-warning "moving a temporary object prevents copy elision" } + X x6{std::move (X{})}; // { dg-warning "moving a temporary object prevents copy elision" } + X x7 = {std::move (X())}; // { dg-warning "moving a temporary object prevents copy elision" } + X x8 = {std::move (X{})}; // { dg-warning "moving a temporary object prevents copy elision" } + + foo (std::move (A())); // { dg-warning "moving a temporary object prevents copy elision" } + foo (std::move (A{})); // { dg-warning "moving a temporary object prevents copy elision" } + bar (std::move (X())); // { dg-warning "moving a temporary object prevents copy elision" } + bar (std::move (X{})); // { dg-warning "moving a temporary object prevents copy elision" } + + foo (std::move (a1)); + bar (std::move (x1)); +} diff --git a/gcc/testsuite/g++.dg/cpp0x/Wpessimizing-move9.C b/gcc/testsuite/g++.dg/cpp0x/Wpessimizing-move9.C new file mode 100644 index 0000000..898040e --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/Wpessimizing-move9.C @@ -0,0 +1,89 @@ +// PR c++/89780 +// { dg-do compile { target c++11 } } +// { dg-options "-Wpessimizing-move -Wredundant-move" } + +// Define std::move. +namespace std { + template<typename _Tp> + struct remove_reference + { typedef _Tp type; }; + + template<typename _Tp> + struct remove_reference<_Tp&> + { typedef _Tp type; }; + + template<typename _Tp> + struct remove_reference<_Tp&&> + { typedef _Tp type; }; + + template<typename _Tp> + constexpr typename std::remove_reference<_Tp>::type&& + move(_Tp&& __t) noexcept + { return static_cast<typename std::remove_reference<_Tp>::type&&>(__t); } +} + +struct Dest { + Dest() = default; + Dest(Dest&&); + Dest(const Dest&); +}; +struct Source : Dest {}; + +template <typename T> +Dest withMove() { + T x; + return std::move(x); +} + +template Dest withMove<Dest>(); +template Dest withMove<Source>(); + +template<typename T> +Dest bar () { + return std::move(T()); // { dg-warning "moving a temporary object prevents copy elision" } +} + +template Dest bar<Dest>(); +template Dest bar<Source>(); + +template<typename T> +Dest baz (T x) { + return std::move(x); +} + +void +call_baz () +{ + Dest d; + Source s; + baz (d); + baz (s); +} + +template<typename> +Dest foo () +{ + Dest d; + return std::move(d); // { dg-warning "moving a local object in a return statement prevents copy elision" } +} + +template Dest foo<int>(); + +template<typename> +Dest qux () { + return std::move(Dest()); // { dg-warning "moving a temporary object prevents copy elision" } +} + +template Dest qux<int>(); + +template<typename> +Dest qui (Dest x) { + return std::move(x); // { dg-warning "redundant move in return statement" } +} + +void +call_qui () +{ + Dest d; + qui<int> (d); +} diff --git a/gcc/testsuite/g++.dg/cpp0x/Wredundant-move1.C b/gcc/testsuite/g++.dg/cpp0x/Wredundant-move1.C index ce4087b4..c227019 100644 --- a/gcc/testsuite/g++.dg/cpp0x/Wredundant-move1.C +++ b/gcc/testsuite/g++.dg/cpp0x/Wredundant-move1.C @@ -60,7 +60,8 @@ fn4 (const T t) { // t is const: will decay into copy despite std::move, so it's redundant. // We used to warn about this, but no longer since c++/87378. - return std::move (t); // { dg-warning "redundant move" "" { target c++20 } } + // Now we warn again since c++/90428. + return std::move (t); // { dg-warning "redundant move" } } int diff --git a/gcc/testsuite/g++.dg/cpp0x/Wredundant-move10.C b/gcc/testsuite/g++.dg/cpp0x/Wredundant-move10.C new file mode 100644 index 0000000..a215a47 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/Wredundant-move10.C @@ -0,0 +1,61 @@ +// PR c++/90428 +// { dg-do compile { target c++11 } } +// { dg-options "-Wredundant-move" } + +// Define std::move. +namespace std { + template<typename _Tp> + struct remove_reference + { typedef _Tp type; }; + + template<typename _Tp> + struct remove_reference<_Tp&> + { typedef _Tp type; }; + + template<typename _Tp> + struct remove_reference<_Tp&&> + { typedef _Tp type; }; + + template<typename _Tp> + constexpr typename std::remove_reference<_Tp>::type&& + move(_Tp&& __t) noexcept + { return static_cast<typename std::remove_reference<_Tp>::type&&>(__t); } +} + +struct T { T(); T(const T&); T(T&&) = delete; }; +struct S : T { }; +struct W { W(const W&); W(W&&) = delete; W(const W&&); }; + +T f1(T t) +{ + const T& rt = t; + return std::move(rt); // { dg-warning "redundant move" } +} + +T f2(const T& t) +{ + return std::move(t); // { dg-warning "redundant move" } +} + +W f3(const W& w) +{ + return std::move(w); +} + +T f4(const S& s) +{ + return std::move(s); +} + +T f5(const T t) +{ + return std::move(t); // { dg-warning "redundant move" } +} + +struct S1 { S1(S1 &&) = delete; S1(const S1&); }; +struct S2: S1 {}; + +S1 f3(const S2 s) +{ + return std::move(s); // { dg-warning "redundant move" "" { target c++20 } } +} diff --git a/gcc/testsuite/g++.dg/cpp0x/Wredundant-move11.C b/gcc/testsuite/g++.dg/cpp0x/Wredundant-move11.C new file mode 100644 index 0000000..5dfa37f --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/Wredundant-move11.C @@ -0,0 +1,32 @@ +// PR c++/67906 +// { dg-do compile { target c++11 } } +// { dg-options "-Wall -Wextra" } + +// Define std::move. +namespace std { + template<typename _Tp> + struct remove_reference + { typedef _Tp type; }; + + template<typename _Tp> + struct remove_reference<_Tp&> + { typedef _Tp type; }; + + template<typename _Tp> + struct remove_reference<_Tp&&> + { typedef _Tp type; }; + + template<typename _Tp> + constexpr typename std::remove_reference<_Tp>::type&& + move(_Tp&& __t) noexcept + { return static_cast<typename std::remove_reference<_Tp>::type&&>(__t); } +} + +struct X { + X() { } + X(const X&) { } + X(const X&&) { } +}; + +const X x; +const X y = std::move(x); diff --git a/gcc/testsuite/g++.dg/cpp0x/Wredundant-move2.C b/gcc/testsuite/g++.dg/cpp0x/Wredundant-move2.C index f181afe..6e0aa4b 100644 --- a/gcc/testsuite/g++.dg/cpp0x/Wredundant-move2.C +++ b/gcc/testsuite/g++.dg/cpp0x/Wredundant-move2.C @@ -37,14 +37,14 @@ template<typename Tp1, typename Tp2> Tp1 fn2 (Tp2 t) { - return std::move (t); // { dg-warning "redundant move in return statement" } + return std::move (t); } template<typename Tp1, typename Tp2> Tp1 fn3 (Tp2 t) { - return std::move (t); // { dg-warning "redundant move in return statement" } + return std::move (t); } int diff --git a/gcc/testsuite/g++.dg/cpp0x/Wredundant-move9.C b/gcc/testsuite/g++.dg/cpp0x/Wredundant-move9.C index ca1e23b..489ecd2 100644 --- a/gcc/testsuite/g++.dg/cpp0x/Wredundant-move9.C +++ b/gcc/testsuite/g++.dg/cpp0x/Wredundant-move9.C @@ -61,7 +61,8 @@ fn4 (const T<int> t) { // t is const: will decay into copy despite std::move, so it's redundant. // We used to warn about this, but no longer since c++/87378. - return std::move (t); // { dg-warning "redundant move" "" { target c++20 } } + // Now we warn again since c++/90428. + return std::move (t); // { dg-warning "redundant move" } } int diff --git a/gcc/testsuite/g++.dg/cpp0x/keywords2.C b/gcc/testsuite/g++.dg/cpp0x/keywords2.C new file mode 100644 index 0000000..d67d01e --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/keywords2.C @@ -0,0 +1,16 @@ +// { dg-do compile { target c++98_only } } +// { dg-options "-Wc++11-compat" } + +// Validate suppression of -Wc++11-compat diagnostics. +#pragma GCC diagnostic ignored "-Wc++11-compat" +int alignof; +int alignas; +int constexpr; +int decltype; +int noexcept; +int nullptr; +int static_assert; +int thread_local; +int _Alignas; +int _Alignof; +int _Thread_local; diff --git a/gcc/testsuite/g++.dg/cpp2a/keywords2.C b/gcc/testsuite/g++.dg/cpp2a/keywords2.C new file mode 100644 index 0000000..8714a7b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/keywords2.C @@ -0,0 +1,13 @@ +// { dg-do compile { target c++17_down } } +// { dg-options "-Wc++20-compat" } + +// Validate suppression of -Wc++20-compat diagnostics. +#pragma GCC diagnostic ignored "-Wc++20-compat" +int constinit; +int consteval; +int requires; +int concept; +int co_await; +int co_yield; +int co_return; +int char8_t; diff --git a/gcc/testsuite/g++.dg/gomp/unmappable-1.C b/gcc/testsuite/g++.dg/gomp/unmappable-1.C index 364f884..28ba184 100644 --- a/gcc/testsuite/g++.dg/gomp/unmappable-1.C +++ b/gcc/testsuite/g++.dg/gomp/unmappable-1.C @@ -4,7 +4,7 @@ class C { public: - static int static_member; /* { dg-message "static field .C::static_member. is not mappable" } */ + static int static_member; virtual void f() {} }; @@ -14,7 +14,6 @@ int main () { #pragma omp target map(v) /* { dg-error ".v. does not have a mappable type in .map. clause" } */ - /* { dg-message "incomplete type .C \\\[\\\]. is not mappable" "" { target *-*-* } .-1 } */ { } } diff --git a/gcc/testsuite/g++.dg/warn/Wstringop-overflow-4.C b/gcc/testsuite/g++.dg/warn/Wstringop-overflow-4.C index c9d6393..3716d2d 100644 --- a/gcc/testsuite/g++.dg/warn/Wstringop-overflow-4.C +++ b/gcc/testsuite/g++.dg/warn/Wstringop-overflow-4.C @@ -195,7 +195,7 @@ void test_strcpy_new_int16_t (size_t n, const size_t vals[]) iftmp.2_33 = _45 * 2; ;; iftmp.2_33 = 0 _34 = operator new [] (iftmp.2_33); ;; new [] (0) */ - T (S (2), new int16_t[r_dmin_dmax + 1]); // { dg-bogus "into a region of size" "" { xfail *-*-*} } + T (S (2), new int16_t[r_dmin_dmax + 1]); // { dg-bogus "into a region of size" "" { xfail c++98_only } } T (S (9), new int16_t[r_dmin_dmax * 2 + 1]); } diff --git a/gcc/testsuite/g++.target/i386/bfloat_cpp_typecheck.C b/gcc/testsuite/g++.target/i386/bfloat_cpp_typecheck.C index 5152336..b800a6d 100644 --- a/gcc/testsuite/g++.target/i386/bfloat_cpp_typecheck.C +++ b/gcc/testsuite/g++.target/i386/bfloat_cpp_typecheck.C @@ -3,8 +3,8 @@ void foo (void) { - __bf16 (); /* { dg-bogus {invalid conversion to type '__bf16'} "" { xfail *-*-* } } */ - __bf16 a = __bf16(); /* { dg-bogus {invalid conversion to type '__bf16'} "" { xfail *-*-* } } */ + __bf16 (); /* { dg-bogus {invalid conversion to type '__bf16'} } */ + __bf16 a = __bf16(); /* { dg-bogus {invalid conversion to type '__bf16'} } */ __bf16 (0x1234); /* { dg-error {invalid conversion to type '__bf16'} } */ __bf16 (0.1); /* { dg-error {invalid conversion to type '__bf16'} } */ } diff --git a/gcc/testsuite/g++.target/i386/vect-bfloat16-1.C b/gcc/testsuite/g++.target/i386/vect-bfloat16-1.C new file mode 100644 index 0000000..71b4d86 --- /dev/null +++ b/gcc/testsuite/g++.target/i386/vect-bfloat16-1.C @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512fp16 -mavx512vl -O2" } */ +/* { dg-final { scan-assembler-times "vpblendmw" 1 } } */ + +typedef short v8hi __attribute__((vector_size(16))); +typedef __bf16 v8bf __attribute__((vector_size(16))); + +v8bf +foo (v8hi a, v8hi b, v8bf c, v8bf d) +{ + return a > b ? c : d; +} + diff --git a/gcc/testsuite/gcc.target/i386/vect-bfloat16-1.c b/gcc/testsuite/gcc.target/i386/vect-bfloat16-1.c new file mode 100644 index 0000000..dd33f1a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vect-bfloat16-1.c @@ -0,0 +1,30 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512fp16 -O2" } */ + +/* { dg-final { scan-assembler-times "vpbroadcastw" 1 { target { ! ia32 } } } } */ +/* { dg-final { scan-assembler-times "vpblendw" 1 { target { ! ia32 } } } } */ +/* { dg-final { scan-assembler-times "vmovsh" 1 { target { ! ia32 } } } } */ + +/* { dg-final { scan-assembler-times "vpinsrw" 2 { target ia32 } } } */ +#include <immintrin.h> + +typedef __bf16 __v8bf __attribute__ ((__vector_size__ (16))); +typedef __bf16 __m128bf16 __attribute__ ((__vector_size__ (16), __may_alias__)); + +__m128bf16 +__attribute__ ((noinline, noclone)) +foo1 (__m128bf16 a, __bf16 f) +{ + __v8bf x = (__v8bf) a; + x[2] = f; + return (__m128bf16) x; +} + +__m128bf16 +__attribute__ ((noinline, noclone)) +foo2 (__m128bf16 a, __bf16 f) +{ + __v8bf x = (__v8bf) a; + x[0] = f; + return (__m128bf16) x; +} diff --git a/gcc/testsuite/gcc.target/i386/vect-bfloat16-2a.c b/gcc/testsuite/gcc.target/i386/vect-bfloat16-2a.c new file mode 100644 index 0000000..70152d0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vect-bfloat16-2a.c @@ -0,0 +1,121 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512fp16 -O2" } */ + +typedef __bf16 v8bf __attribute__ ((__vector_size__ (16))); +typedef __bf16 v16bf __attribute__ ((__vector_size__ (32))); +typedef __bf16 v32bf __attribute__ ((__vector_size__ (64))); + +#define VEC_EXTRACT(V,S,IDX) \ + S \ + __attribute__((noipa)) \ + vec_extract_##V##_##IDX (V v) \ + { \ + return v[IDX]; \ + } + +#define VEC_SET(V,S,IDX) \ + V \ + __attribute__((noipa)) \ + vec_set_##V##_##IDX (V v, S s) \ + { \ + v[IDX] = s; \ + return v; \ + } + +v8bf +vec_init_v8bf (__bf16 a1, __bf16 a2, __bf16 a3, __bf16 a4, + __bf16 a5, __bf16 a6, __bf16 a7, __bf16 a8) +{ + return __extension__ (v8bf) {a1, a2, a3, a4, a5, a6, a7, a8}; +} + +v16bf +vec_init_v16bf (__bf16 a1, __bf16 a2, __bf16 a3, __bf16 a4, + __bf16 a5, __bf16 a6, __bf16 a7, __bf16 a8, + __bf16 a9, __bf16 a10, __bf16 a11, __bf16 a12, + __bf16 a13, __bf16 a14, __bf16 a15, __bf16 a16) +{ + return __extension__ (v16bf) {a1, a2, a3, a4, a5, a6, a7, a8, + a9, a10, a11, a12, a13, a14, a15, a16}; +} + +v32bf +vec_init_v32bf (__bf16 a1, __bf16 a2, __bf16 a3, __bf16 a4, + __bf16 a5, __bf16 a6, __bf16 a7, __bf16 a8, + __bf16 a9, __bf16 a10, __bf16 a11, __bf16 a12, + __bf16 a13, __bf16 a14, __bf16 a15, __bf16 a16, + __bf16 a17, __bf16 a18, __bf16 a19, __bf16 a20, + __bf16 a21, __bf16 a22, __bf16 a23, __bf16 a24, + __bf16 a25, __bf16 a26, __bf16 a27, __bf16 a28, + __bf16 a29, __bf16 a30, __bf16 a31, __bf16 a32) +{ + return __extension__ (v32bf) {a1, a2, a3, a4, a5, a6, a7, a8, + a9, a10, a11, a12, a13, a14, a15, a16, + a17, a18, a19, a20, a21, a22, a23, a24, + a25, a26, a27, a28, a29, a30, a31, a32}; +} + +v8bf +vec_init_dup_v8bf (__bf16 a1) +{ + return __extension__ (v8bf) {a1, a1, a1, a1, a1, a1, a1, a1}; +} + +v16bf +vec_init_dup_v16bf (__bf16 a1) +{ + return __extension__ (v16bf) {a1, a1, a1, a1, a1, a1, a1, a1, + a1, a1, a1, a1, a1, a1, a1, a1}; +} + +v32bf +vec_init_dup_v32bf (__bf16 a1) +{ + return __extension__ (v32bf) {a1, a1, a1, a1, a1, a1, a1, a1, + a1, a1, a1, a1, a1, a1, a1, a1, + a1, a1, a1, a1, a1, a1, a1, a1, + a1, a1, a1, a1, a1, a1, a1, a1}; +} + +/* { dg-final { scan-assembler-times "vpunpcklwd" 28 } } */ +/* { dg-final { scan-assembler-times "vpunpckldq" 14 } } */ +/* { dg-final { scan-assembler-times "vpunpcklqdq" 7 } } */ + +VEC_EXTRACT (v8bf, __bf16, 0); +VEC_EXTRACT (v8bf, __bf16, 4); +VEC_EXTRACT (v16bf, __bf16, 0); +VEC_EXTRACT (v16bf, __bf16, 3); +VEC_EXTRACT (v16bf, __bf16, 8); +VEC_EXTRACT (v16bf, __bf16, 15); +VEC_EXTRACT (v32bf, __bf16, 0); +VEC_EXTRACT (v32bf, __bf16, 5); +VEC_EXTRACT (v32bf, __bf16, 8); +VEC_EXTRACT (v32bf, __bf16, 14); +VEC_EXTRACT (v32bf, __bf16, 16); +VEC_EXTRACT (v32bf, __bf16, 24); +VEC_EXTRACT (v32bf, __bf16, 28); +/* { dg-final { scan-assembler-times "vpsrldq\[\t ]*\\\$8" 2 } } */ +/* { dg-final { scan-assembler-times "vpsrldq\[\t ]*\\\$6" 1 } } */ +/* { dg-final { scan-assembler-times "vpsrldq\[\t ]*\\\$14" 1 } } */ +/* { dg-final { scan-assembler-times "vpsrldq\[\t ]*\\\$10" 1 } } */ +/* { dg-final { scan-assembler-times "vpsrldq\[\t ]*\\\$12" 1 } } */ +/* { dg-final { scan-assembler-times "vextract" 9 } } */ + +VEC_SET (v8bf, __bf16, 4); +VEC_SET (v16bf, __bf16, 3); +VEC_SET (v16bf, __bf16, 8); +VEC_SET (v16bf, __bf16, 15); +VEC_SET (v32bf, __bf16, 5); +VEC_SET (v32bf, __bf16, 8); +VEC_SET (v32bf, __bf16, 14); +VEC_SET (v32bf, __bf16, 16); +VEC_SET (v32bf, __bf16, 24); +VEC_SET (v32bf, __bf16, 28); +/* { dg-final { scan-assembler-times "vpbroadcastw" 13 { target { ! ia32 } } } } */ +/* { dg-final { scan-assembler-times "vpblendw" 4 { target { ! ia32 } } } } */ + +/* { dg-final { scan-assembler-times "vpbroadcastw" 12 { target ia32 } } } */ +/* { dg-final { scan-assembler-times "vpblendw" 3 { target ia32 } } } */ +/* { dg-final { scan-assembler-times "vpinsrw" 1 { target ia32 } } } */ + +/* { dg-final { scan-assembler-times "vpblendd" 3 } } */ diff --git a/gcc/testsuite/gcc.target/i386/vect-bfloat16-2b.c b/gcc/testsuite/gcc.target/i386/vect-bfloat16-2b.c new file mode 100644 index 0000000..29bf601 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vect-bfloat16-2b.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512f -mno-avx512bw -O2" } */ + +#include "vect-bfloat16-2a.c" + +/* { dg-final { scan-assembler-times "vpunpcklwd" 28 } } */ +/* { dg-final { scan-assembler-times "vpunpckldq" 14 } } */ +/* { dg-final { scan-assembler-times "vpunpcklqdq" 7 } } */ + +/* { dg-final { scan-assembler-times "vpsrldq\[\t ]*\\\$8" 1 } } */ +/* { dg-final { scan-assembler-times "vpsrldq\[\t ]*\\\$6" 1 } } */ +/* { dg-final { scan-assembler-times "vpsrldq\[\t ]*\\\$14" 1 } } */ +/* { dg-final { scan-assembler-times "vextract" 2 } } */ + +/* { dg-final { scan-assembler-times "vpbroadcastw" 7 { target { ! ia32 } } } } */ +/* { dg-final { scan-assembler-times "vpblendw" 4 { target { ! ia32 } } } } */ + +/* { dg-final { scan-assembler-times "vpbroadcastw" 6 { target ia32 } } } */ +/* { dg-final { scan-assembler-times "vpblendw" 3 { target ia32 } } } */ +/* { dg-final { scan-assembler-times "vpinsrw" 63 { target ia32 } } } */ + +/* { dg-final { scan-assembler-times "vpblendd" 3 } } */ diff --git a/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_1.c b/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_1.c new file mode 100644 index 0000000..3804bac --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_1.c @@ -0,0 +1,258 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512fp16 -O2" } */ + +#include <immintrin.h> + +typedef __bf16 __v8bf __attribute__ ((__vector_size__ (16))); +typedef __bf16 __m128bf16 __attribute__ ((__vector_size__ (16), __may_alias__)); + +__bf16 glob_bfloat; +__m128bf16 glob_bfloat_vec; + +__m256 is_a_float_vec; +__m128 is_a_float_pair; + +__m128h *float_ptr; +__m128h is_a_float16_vec; + +__v8si is_an_int_vec; +__v4si is_an_int_pair; +__v8hi is_a_short_vec; + +int is_an_int; +short is_a_short_int; +float is_a_float; +float is_a_float16; +double is_a_double; + +__m128bf16 footest (__m128bf16 vector0) +{ + /* Initialisation */ + + __m128bf16 vector1_1; + __m128bf16 vector1_2 = glob_bfloat_vec; + __m128bf16 vector1_3 = is_a_float_vec; /* { dg-error {incompatible types when initializing type '__m128bf16' {aka '__vector\(8\) __bf16'} using type '__m256'} }*/ + __m128bf16 vector1_4 = is_an_int_vec; /* { dg-error {incompatible types when initializing type '__m128bf16' {aka '__vector\(8\) __bf16'} using type '__v8si'} } */ + __m128bf16 vector1_5 = is_a_float16_vec; /* { dg-error {incompatible types when initializing type '__m128bf16' {aka '__vector\(8\) __bf16'} using type '__m128h'} } */ + __m128bf16 vector1_6 = is_a_float_pair; /* { dg-error {incompatible types when initializing type '__m128bf16' {aka '__vector\(8\) __bf16'} using type '__m128'} } */ + __m128bf16 vector1_7 = is_an_int_pair; /* { dg-error {incompatible types when initializing type '__m128bf16' {aka '__vector\(8\) __bf16'} using type '__v4si'} } */ + __m128bf16 vector1_8 = is_a_short_vec; /* { dg-error {incompatible types when initializing type '__m128bf16' {aka '__vector\(8\) __bf16'} using type '__v8hi'} } */ + + __v8si initi_1_1 = glob_bfloat_vec; /* { dg-error {incompatible types when initializing type '__v8si' using type '__m128bf16' {aka '__vector\(8\) __bf16'}} } */ + __m256 initi_1_2 = glob_bfloat_vec; /* { dg-error {incompatible types when initializing type '__m256' using type '__m128bf16' {aka '__vector\(8\) __bf16'}} } */ + __m128h initi_1_3 = glob_bfloat_vec; /* { dg-error {incompatible types when initializing type '__m128h' using type '__m128bf16' {aka '__vector\(8\) __bf16'}} } */ + __m128 initi_1_4 = glob_bfloat_vec; /* { dg-error {incompatible types when initializing type '__m128' using type '__m128bf16' {aka '__vector\(8\) __bf16'}} } */ + __v4si initi_1_5 = glob_bfloat_vec; /* { dg-error {incompatible types when initializing type '__v4si' using type '__m128bf16' {aka '__vector\(8\) __bf16'}} } */ + __v4hi initi_1_6 = glob_bfloat_vec; /* { dg-error {incompatible types when initializing type '__v4hi' using type '__m128bf16' {aka '__vector\(8\) __bf16'}} } */ + + __m128bf16 vector2_1 = {}; + __m128bf16 vector2_2 = { glob_bfloat }; + __m128bf16 vector2_3 = { glob_bfloat, glob_bfloat, glob_bfloat, glob_bfloat }; + __m128bf16 vector2_4 = { 0 }; /* { dg-error {invalid conversion to type '__bf16'} } */ + __m128bf16 vector2_5 = { 0.1 }; /* { dg-error {invalid conversion to type '__bf16'} } */ + __m128bf16 vector2_6 = { is_a_float16 }; /* { dg-error {invalid conversion to type '__bf16'} } */ + __m128bf16 vector2_7 = { is_a_float }; /* { dg-error {invalid conversion to type '__bf16'} } */ + __m128bf16 vector2_8 = { is_an_int }; /* { dg-error {invalid conversion to type '__bf16'} } */ + __m128bf16 vector2_9 = { is_a_short_int }; /* { dg-error {invalid conversion to type '__bf16'} } */ + __m128bf16 vector2_10 = { 0.0, 0, is_a_short_int, is_a_float }; /* { dg-error {invalid conversion to type '__bf16'} } */ + + __v8si initi_2_1 = { glob_bfloat }; /* { dg-error {invalid conversion from type '__bf16'} } */ + __m256 initi_2_2 = { glob_bfloat }; /* { dg-error {invalid conversion from type '__bf16'} } */ + __m128h initi_2_3 = { glob_bfloat }; /* { dg-error {invalid conversion from type '__bf16'} } */ + __m128 initi_2_4 = { glob_bfloat }; /* { dg-error {invalid conversion from type '__bf16'} } */ + __v4si initi_2_5 = { glob_bfloat }; /* { dg-error {invalid conversion from type '__bf16'} } */ + __v4hi initi_2_6 = { glob_bfloat }; /* { dg-error {invalid conversion from type '__bf16'} } */ + + /* Assignments to/from vectors. */ + + glob_bfloat_vec = glob_bfloat_vec; + glob_bfloat_vec = 0; /* { dg-error {incompatible types when assigning to type '__m128bf16' {aka '__vector\(8\) __bf16'} from type 'int'} } */ + glob_bfloat_vec = 0.1; /* { dg-error {incompatible types when assigning to type '__m128bf16' {aka '__vector\(8\) __bf16'} from type 'double'} } */ + glob_bfloat_vec = is_a_float_vec; /* { dg-error {incompatible types when assigning to type '__m128bf16' {aka '__vector\(8\) __bf16'} from type '__m256'} } */ + glob_bfloat_vec = is_an_int_vec; /* { dg-error {incompatible types when assigning to type '__m128bf16' {aka '__vector\(8\) __bf16'} from type '__v8si'} } */ + glob_bfloat_vec = is_a_float16_vec; /* { dg-error {incompatible types when assigning to type '__m128bf16' {aka '__vector\(8\) __bf16'} from type '__m128h'} } */ + glob_bfloat_vec = is_a_float_pair; /* { dg-error {incompatible types when assigning to type '__m128bf16' {aka '__vector\(8\) __bf16'} from type '__m128'} } */ + glob_bfloat_vec = is_an_int_pair; /* { dg-error {incompatible types when assigning to type '__m128bf16' {aka '__vector\(8\) __bf16'} from type '__v4si'} } */ + glob_bfloat_vec = is_a_short_vec; /* { dg-error {incompatible types when assigning to type '__m128bf16' {aka '__vector\(8\) __bf16'} from type '__v8hi'} } */ + + is_an_int_vec = glob_bfloat_vec; /* { dg-error {incompatible types when assigning to type '__v8si' from type '__m128bf16' {aka '__vector\(8\) __bf16'}} } */ + is_a_float_vec = glob_bfloat_vec; /* { dg-error {incompatible types when assigning to type '__m256' from type '__m128bf16' {aka '__vector\(8\) __bf16'}} } */ + is_a_float16_vec = glob_bfloat_vec; /* { dg-error {incompatible types when assigning to type '__m128h' from type '__m128bf16' {aka '__vector\(8\) __bf16'}} } */ + is_a_float_pair = glob_bfloat_vec; /* { dg-error {incompatible types when assigning to type '__m128' from type '__m128bf16' {aka '__vector\(8\) __bf16'}} } */ + is_an_int_pair = glob_bfloat_vec; /* { dg-error {incompatible types when assigning to type '__v4si' from type '__m128bf16' {aka '__vector\(8\) __bf16'}} } */ + is_a_short_vec = glob_bfloat_vec;/* { dg-error {incompatible types when assigning to type '__v8hi' from type '__m128bf16' {aka '__vector\(8\) __bf16'}} } */ + + /* Assignments to/from elements. */ + + vector2_3[0] = glob_bfloat; + vector2_3[0] = is_an_int; /* { dg-error {invalid conversion to type '__bf16'} } */ + vector2_3[0] = is_a_short_int; /* { dg-error {invalid conversion to type '__bf16'} } */ + vector2_3[0] = is_a_float; /* { dg-error {invalid conversion to type '__bf16'} } */ + vector2_3[0] = is_a_float16; /* { dg-error {invalid conversion to type '__bf16'} } */ + vector2_3[0] = 0; /* { dg-error {invalid conversion to type '__bf16'} } */ + vector2_3[0] = 0.1; /* { dg-error {invalid conversion to type '__bf16'} } */ + + glob_bfloat = vector2_3[0]; + is_an_int = vector2_3[0]; /* { dg-error {invalid conversion from type '__bf16'} } */ + is_a_short_int = vector2_3[0]; /* { dg-error {invalid conversion from type '__bf16'} } */ + is_a_float = vector2_3[0]; /* { dg-error {invalid conversion from type '__bf16'} } */ + is_a_float16 = vector2_3[0]; /* { dg-error {invalid conversion from type '__bf16'} } */ + + /* Compound literals. */ + + (__m128bf16) {}; + + (__m128bf16) { 0 }; /* { dg-error {invalid conversion to type '__bf16'} } */ + (__m128bf16) { 0.1 }; /* { dg-error {invalid conversion to type '__bf16'} } */ + (__m128bf16) { is_a_float_vec }; /* { dg-error {incompatible types when initializing type '__bf16' using type '__m256'} } */ + (__m128bf16) { is_an_int_vec }; /* { dg-error {incompatible types when initializing type '__bf16' using type '__v8si'} } */ + (__m128bf16) { is_a_float_pair }; /* { dg-error {incompatible types when initializing type '__bf16' using type '__m128'} } */ + (__m128bf16) { is_an_int_pair }; /* { dg-error {incompatible types when initializing type '__bf16' using type '__v4si'} } */ + (__m128bf16) { is_a_float16_vec }; /* { dg-error {incompatible types when initializing type '__bf16' using type '__m128h'} } */ + (__m128bf16) { is_a_short_vec }; /* { dg-error {incompatible types when initializing type '__bf16' using type '__v8hi'} } */ + + (__m128bf16) { glob_bfloat_vec }; /* { dg-error {incompatible types when initializing type '__bf16' using type '__m128bf16' {aka '__vector\(8\) __bf16'}} } */ + (__v8si) { glob_bfloat_vec }; /* { dg-error {incompatible types when initializing type 'int' using type '__m128bf16' {aka '__vector\(8\) __bf16'}} } */ + (__m256) { glob_bfloat_vec }; /* { dg-error {incompatible types when initializing type 'float' using type '__m128bf16' {aka '__vector\(8\) __bf16'}} } */ + (__v4si) { glob_bfloat_vec }; /* { dg-error {incompatible types when initializing type 'int' using type '__m128bf16' {aka '__vector\(8\) __bf16'}} } */ + (__m256h) { glob_bfloat_vec }; /* { dg-error {incompatible types when initializing type '_Float16' using type '__m128bf16' {aka '__vector\(8\) __bf16'}} } */ + (__v8hi) { glob_bfloat_vec }; /* { dg-error {incompatible types when initializing type 'short int' using type '__m128bf16' {aka '__vector\(8\) __bf16'}} } */ + + /* Casting. */ + + (void) glob_bfloat_vec; + (__m128bf16) glob_bfloat_vec; + + (__bf16) glob_bfloat_vec; /* { dg-error {aggregate value used where a floating-point was expected} } */ + (short) glob_bfloat_vec; /* { dg-error {cannot convert a vector of type '__m128bf16' {aka '__vector\(8\) __bf16'} to type 'short int' which has different size} } */ + (int) glob_bfloat_vec; /* { dg-error {cannot convert a vector of type '__m128bf16' {aka '__vector\(8\) __bf16'} to type 'int' which has different size} } */ + (_Float16) glob_bfloat_vec; /* { dg-error {aggregate value used where a floating-point was expected} } */ + (float) glob_bfloat_vec; /* { dg-error {aggregate value used where a floating-point was expected} } */ + (double) glob_bfloat_vec; /* { dg-error {aggregate value used where a floating-point was expected} } */ + + (__v8si) glob_bfloat_vec; /* { dg-error {cannot convert a value of type '__m128bf16' {aka '__vector\(8\) __bf16'} to vector type '__vector\(8\) int' which has different size} } */ + (__m256) glob_bfloat_vec; /* { dg-error {cannot convert a value of type '__m128bf16' {aka '__vector\(8\) __bf16'} to vector type '__vector\(8\) float' which has different size} } */ + (__m128h) glob_bfloat_vec; + (__v4si) glob_bfloat_vec; + (__m128) glob_bfloat_vec; + (__v8hi) glob_bfloat_vec; + + (__m128bf16) is_an_int_vec; /* { dg-error {cannot convert a value of type '__v8si' to vector type '__vector\(8\) __bf16' which has different size} } */ + (__m128bf16) is_a_float_vec; /* { dg-error {cannot convert a value of type '__m256' to vector type '__vector\(8\) __bf16' which has different size} } */ + (__m128bf16) is_a_float16_vec; + (__m128bf16) is_an_int_pair; + (__m128bf16) is_a_float_pair; + (__m128bf16) is_a_short_vec; + (__m128bf16) is_a_double; /* { dg-error {cannot convert value to a vector} } */ + + /* Arrays and Structs. */ + + typedef __m128bf16 array_type[2]; + extern __m128bf16 extern_array[]; + + __m128bf16 array[2]; + __m128bf16 zero_length_array[0]; + __m128bf16 empty_init_array[] = {}; + typedef __m128bf16 some_other_type[is_an_int]; + + struct struct1 { + __m128bf16 a; + }; + + union union1 { + __m128bf16 a; + }; + + /* Addressing and dereferencing. */ + + __m128bf16 *bfloat_ptr = &vector0; + vector0 = *bfloat_ptr; + + /* Pointer assignment. */ + + __m128bf16 *bfloat_ptr2 = bfloat_ptr; + __m128bf16 *bfloat_ptr3 = array; + + /* Pointer arithmetic. */ + + ++bfloat_ptr; + --bfloat_ptr; + bfloat_ptr++; + bfloat_ptr--; + bfloat_ptr += 1; + bfloat_ptr -= 1; + bfloat_ptr - bfloat_ptr2; + bfloat_ptr = &bfloat_ptr3[0]; + bfloat_ptr = &bfloat_ptr3[1]; + + /* Simple comparison. */ + vector0 > glob_bfloat_vec; /* { dg-error {operation not permitted on type '__bf16'} } */ + glob_bfloat_vec == vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + vector0 > is_a_float_vec; /* { dg-error {operation not permitted on type '__bf16'} } */ + is_a_float_vec == vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + vector0 > 0; /* { dg-error {operation not permitted on type '__bf16'} } */ + 0 == vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + vector0 > 0.1; /* { dg-error {operation not permitted on type '__bf16'} } */ + 0.1 == vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + vector0 > is_an_int_vec; /* { dg-error {operation not permitted on type '__bf16'} } */ + is_an_int_vec == vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + + /* Pointer comparison. */ + + bfloat_ptr == &vector0; + bfloat_ptr != &vector0; + bfloat_ptr < &vector0; + bfloat_ptr <= &vector0; + bfloat_ptr > &vector0; + bfloat_ptr >= &vector0; + bfloat_ptr == bfloat_ptr2; + bfloat_ptr != bfloat_ptr2; + bfloat_ptr < bfloat_ptr2; + bfloat_ptr <= bfloat_ptr2; + bfloat_ptr > bfloat_ptr2; + bfloat_ptr >= bfloat_ptr2; + + /* Conditional expressions. */ + + 0 ? vector0 : vector0; + 0 ? vector0 : is_a_float_vec; /* { dg-error {type mismatch in conditional expression} } */ + 0 ? is_a_float_vec : vector0; /* { dg-error {type mismatch in conditional expression} } */ + 0 ? vector0 : is_a_float16_vec; /* { dg-error {type mismatch in conditional expression} } */ + 0 ? is_a_float16_vec : vector0; /* { dg-error {type mismatch in conditional expression} } */ + 0 ? vector0 : 0; /* { dg-error {type mismatch in conditional expression} } */ + 0 ? 0 : vector0; /* { dg-error {type mismatch in conditional expression} } */ + 0 ? 0.1 : vector0; /* { dg-error {type mismatch in conditional expression} } */ + 0 ? vector0 : 0.1; /* { dg-error {type mismatch in conditional expression} } */ + 0 ? bfloat_ptr : bfloat_ptr2; + 0 ? bfloat_ptr : float_ptr; /* { dg-warning {pointer type mismatch in conditional expression} } */ + 0 ? float_ptr : bfloat_ptr; /* { dg-warning {pointer type mismatch in conditional expression} } */ + + vector0 ? vector0 : vector0; /* { dg-error {used vector type where scalar is required} } */ + vector0 ? is_a_float16_vec : vector0; /* { dg-error {used vector type where scalar is required} } */ + vector0 ? vector0 : is_a_float16_vec; /* { dg-error {used vector type where scalar is required} } */ + vector0 ? is_a_float16_vec : is_a_float16_vec; /* { dg-error {used vector type where scalar is required} } */ + + /* Unary operators. */ + + +vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + -vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + ~vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + !vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + *vector0; /* { dg-error {invalid type argument of unary '\*'} } */ + __real vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + __imag vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + ++vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + --vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + vector0++; /* { dg-error {operation not permitted on type '__bf16'} } */ + vector0--; /* { dg-error {operation not permitted on type '__bf16'} } */ + + /* Binary arithmetic operations. */ + + vector0 = glob_bfloat_vec + *bfloat_ptr; /* { dg-error {operation not permitted on type '__bf16'} } */ + vector0 = glob_bfloat_vec + 0.1; /* { dg-error {operation not permitted on type '__bf16'} } */ + vector0 = glob_bfloat_vec + 0; /* { dg-error {operation not permitted on type '__bf16'} } */ + vector0 = glob_bfloat_vec + is_a_float_vec; /* { dg-error {operation not permitted on type '__bf16'} } */ + + return vector0; +} + diff --git a/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_2.c b/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_2.c new file mode 100644 index 0000000..f63b41d8 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vect-bfloat16-typecheck_2.c @@ -0,0 +1,248 @@ +/* { dg-do compile } */ +/* { dg-options "-mavx512fp16 -O2" } */ + +#include <immintrin.h> + +typedef __bf16 __v16bf __attribute__ ((__vector_size__ (32))); +typedef __bf16 __m256bf16 __attribute__ ((__vector_size__ (32), __may_alias__)); + +__bf16 glob_bfloat; +__m256bf16 glob_bfloat_vec; + +__m256 is_a_float_vec; + +__m256h *float_ptr; +__m256h is_a_float16_vec; + +__v8si is_an_int_vec; +__m256i is_a_long_int_pair; +__v16hi is_a_short_vec; + +int is_an_int; +short is_a_short_int; +float is_a_float; +float is_a_float16; +double is_a_double; + +__m256bf16 footest (__m256bf16 vector0) +{ + /* Initialisation */ + + __m256bf16 vector1_1; + __m256bf16 vector1_2 = glob_bfloat_vec; + __m256bf16 vector1_3 = is_a_float_vec; /* { dg-error {incompatible types when initializing type '__m256bf16' {aka '__vector\(16\) __bf16'} using type '__m256'} } */ + __m256bf16 vector1_4 = is_an_int_vec; /* { dg-error {incompatible types when initializing type '__m256bf16' {aka '__vector\(16\) __bf16'} using type '__v8si'} } */ + __m256bf16 vector1_5 = is_a_float16_vec; /* { dg-error {incompatible types when initializing type '__m256bf16' {aka '__vector\(16\) __bf16'} using type '__m256h'} } */ + __m256bf16 vector1_7 = is_a_long_int_pair; /* { dg-error {incompatible types when initializing type '__m256bf16' {aka '__vector\(16\) __bf16'} using type '__m256i'} } */ + __m256bf16 vector1_8 = is_a_short_vec; /* { dg-error {incompatible types when initializing type '__m256bf16' {aka '__vector\(16\) __bf16'} using type '__v16hi'} } */ + + __v8si initi_1_1 = glob_bfloat_vec; /* { dg-error {incompatible types when initializing type '__v8si' using type '__m256bf16' {aka '__vector\(16\) __bf16'}} } */ + __m256 initi_1_2 = glob_bfloat_vec; /* { dg-error {incompatible types when initializing type '__m256' using type '__m256bf16' {aka '__vector\(16\) __bf16'}} } */ + __m256h initi_1_3 = glob_bfloat_vec; /* { dg-error {incompatible types when initializing type '__m256h' using type '__m256bf16' {aka '__vector\(16\) __bf16'}} } */ + __m256i initi_1_5 = glob_bfloat_vec; /* { dg-error {incompatible types when initializing type '__m256i' using type '__m256bf16' {aka '__vector\(16\) __bf16'}} } */ + __v16hi initi_1_6 = glob_bfloat_vec; /* { dg-error {incompatible types when initializing type '__v16hi' using type '__m256bf16' {aka '__vector\(16\) __bf16'}} } */ + + __m256bf16 vector2_1 = {}; + __m256bf16 vector2_2 = { glob_bfloat }; + __m256bf16 vector2_3 = { glob_bfloat, glob_bfloat, glob_bfloat, glob_bfloat }; + __m256bf16 vector2_4 = { 0 }; /* { dg-error {invalid conversion to type '__bf16'} } */ + __m256bf16 vector2_5 = { 0.1 }; /* { dg-error {invalid conversion to type '__bf16'} } */ + __m256bf16 vector2_6 = { is_a_float16 }; /* { dg-error {invalid conversion to type '__bf16'} } */ + __m256bf16 vector2_7 = { is_a_float }; /* { dg-error {invalid conversion to type '__bf16'} } */ + __m256bf16 vector2_8 = { is_an_int }; /* { dg-error {invalid conversion to type '__bf16'} } */ + __m256bf16 vector2_9 = { is_a_short_int }; /* { dg-error {invalid conversion to type '__bf16'} } */ + __m256bf16 vector2_10 = { 0.0, 0, is_a_short_int, is_a_float }; /* { dg-error "invalid conversion to type '__bf16'" } */ + + __v8si initi_2_1 = { glob_bfloat }; /* { dg-error {invalid conversion from type '__bf16'} } */ + __m256 initi_2_2 = { glob_bfloat }; /* { dg-error {invalid conversion from type '__bf16'} } */ + __m256h initi_2_3 = { glob_bfloat }; /* { dg-error {invalid conversion from type '__bf16'} } */ + __m256i initi_2_5 = { glob_bfloat }; /* { dg-error {invalid conversion from type '__bf16'} } */ + __v16hi initi_2_6 = { glob_bfloat }; /* { dg-error {invalid conversion from type '__bf16'} } */ + + /* Assignments to/from vectors. */ + + glob_bfloat_vec = glob_bfloat_vec; + glob_bfloat_vec = 0; /* { dg-error {incompatible types when assigning to type '__m256bf16' {aka '__vector\(16\) __bf16'} from type 'int'} } */ + glob_bfloat_vec = 0.1; /* { dg-error {incompatible types when assigning to type '__m256bf16' {aka '__vector\(16\) __bf16'} from type 'double'} } */ + glob_bfloat_vec = is_a_float_vec; /* { dg-error {incompatible types when assigning to type '__m256bf16' {aka '__vector\(16\) __bf16'} from type '__m256'} } */ + glob_bfloat_vec = is_an_int_vec; /* { dg-error {incompatible types when assigning to type '__m256bf16' {aka '__vector\(16\) __bf16'} from type '__v8si'} } */ + glob_bfloat_vec = is_a_float16_vec; /* { dg-error {incompatible types when assigning to type '__m256bf16' {aka '__vector\(16\) __bf16'} from type '__m256h'} } */ + glob_bfloat_vec = is_a_long_int_pair; /* { dg-error {incompatible types when assigning to type '__m256bf16' {aka '__vector\(16\) __bf16'} from type '__m256i'} } */ + glob_bfloat_vec = is_a_short_vec; /* { dg-error {incompatible types when assigning to type '__m256bf16' {aka '__vector\(16\) __bf16'} from type '__v16hi'} } */ + + is_an_int_vec = glob_bfloat_vec; /* { dg-error {incompatible types when assigning to type '__v8si' from type '__m256bf16' {aka '__vector\(16\) __bf16'}} } */ + is_a_float_vec = glob_bfloat_vec; /* { dg-error {incompatible types when assigning to type '__m256' from type '__m256bf16' {aka '__vector\(16\) __bf16'}} } */ + is_a_float16_vec = glob_bfloat_vec; /* { dg-error {incompatible types when assigning to type '__m256h' from type '__m256bf16' {aka '__vector\(16\) __bf16'}} } */ + is_a_long_int_pair = glob_bfloat_vec; /* { dg-error {incompatible types when assigning to type '__m256i' from type '__m256bf16' {aka '__vector\(16\) __bf16'}} } */ + is_a_short_vec = glob_bfloat_vec;/* { dg-error {incompatible types when assigning to type '__v16hi' from type '__m256bf16' {aka '__vector\(16\) __bf16'}} } */ + + /* Assignments to/from elements. */ + + vector2_3[0] = glob_bfloat; + vector2_3[0] = is_an_int; /* { dg-error {invalid conversion to type '__bf16'} } */ + vector2_3[0] = is_a_short_int; /* { dg-error {invalid conversion to type '__bf16'} } */ + vector2_3[0] = is_a_float; /* { dg-error {invalid conversion to type '__bf16'} } */ + vector2_3[0] = is_a_float16; /* { dg-error {invalid conversion to type '__bf16'} } */ + vector2_3[0] = 0; /* { dg-error {invalid conversion to type '__bf16'} } */ + vector2_3[0] = 0.1; /* { dg-error {invalid conversion to type '__bf16'} } */ + + glob_bfloat = vector2_3[0]; + is_an_int = vector2_3[0]; /* { dg-error {invalid conversion from type '__bf16'} } */ + is_a_short_int = vector2_3[0]; /* { dg-error {invalid conversion from type '__bf16'} } */ + is_a_float = vector2_3[0]; /* { dg-error {invalid conversion from type '__bf16'} } */ + is_a_float16 = vector2_3[0]; /* { dg-error {invalid conversion from type '__bf16'} } */ + + /* Compound literals. */ + + (__m256bf16) {}; + + (__m256bf16) { 0 }; /* { dg-error {invalid conversion to type '__bf16'} } */ + (__m256bf16) { 0.1 }; /* { dg-error {invalid conversion to type '__bf16'} } */ + (__m256bf16) { is_a_float_vec }; /* { dg-error {incompatible types when initializing type '__bf16' using type '__m256'} } */ + (__m256bf16) { is_an_int_vec }; /* { dg-error {incompatible types when initializing type '__bf16' using type '__v8si'} } */ + (__m256bf16) { is_a_long_int_pair }; /* { dg-error {incompatible types when initializing type '__bf16' using type '__m256i'} } */ + (__m256bf16) { is_a_float16_vec }; /* { dg-error {incompatible types when initializing type '__bf16' using type '__m256h'} } */ + (__m256bf16) { is_a_short_vec }; /* { dg-error {incompatible types when initializing type '__bf16' using type '__v16hi'} } */ + + (__m256bf16) { glob_bfloat_vec }; /* { dg-error {incompatible types when initializing type '__bf16' using type '__m256bf16' {aka '__vector\(16\) __bf16'}} } */ + (__v8si) { glob_bfloat_vec }; /* { dg-error {incompatible types when initializing type 'int' using type '__m256bf16' {aka '__vector\(16\) __bf16'}} } */ + (__m256) { glob_bfloat_vec }; /* { dg-error {incompatible types when initializing type 'float' using type '__m256bf16' {aka '__vector\(16\) __bf16'}} } */ + (__m256i) { glob_bfloat_vec }; /* { dg-error {incompatible types when initializing type 'long long int' using type '__m256bf16' {aka '__vector\(16\) __bf16'}} } */ + (__m256h) { glob_bfloat_vec }; /* { dg-error {incompatible types when initializing type '_Float16' using type '__m256bf16' {aka '__vector\(16\) __bf16'}} } */ + (__v16hi) { glob_bfloat_vec }; /* { dg-error {incompatible types when initializing type 'short int' using type '__m256bf16' {aka '__vector\(16\) __bf16'}} } */ + + /* Casting. */ + + (void) glob_bfloat_vec; + (__m256bf16) glob_bfloat_vec; + + (__bf16) glob_bfloat_vec; /* { dg-error {aggregate value used where a floating-point was expected} } */ + (short) glob_bfloat_vec; /* { dg-error {cannot convert a vector of type '__m256bf16' {aka '__vector\(16\) __bf16'} to type 'short int' which has different size} } */ + (int) glob_bfloat_vec; /* { dg-error {cannot convert a vector of type '__m256bf16' {aka '__vector\(16\) __bf16'} to type 'int' which has different size} } */ + (_Float16) glob_bfloat_vec; /* { dg-error {aggregate value used where a floating-point was expected} } */ + (float) glob_bfloat_vec; /* { dg-error {aggregate value used where a floating-point was expected} } */ + (double) glob_bfloat_vec; /* { dg-error {aggregate value used where a floating-point was expected} } */ + + (__v8si) glob_bfloat_vec; + (__m256) glob_bfloat_vec; + (__m256h) glob_bfloat_vec; + (__m256i) glob_bfloat_vec; + (__v16hi) glob_bfloat_vec; + + (__m256bf16) is_an_int_vec; + (__m256bf16) is_a_float_vec; + (__m256bf16) is_a_float16_vec; + (__m256bf16) is_a_long_int_pair; + (__m256bf16) is_a_short_vec; + + /* Arrays and Structs. */ + + typedef __m256bf16 array_type[2]; + extern __m256bf16 extern_array[]; + + __m256bf16 array[2]; + __m256bf16 zero_length_array[0]; + __m256bf16 empty_init_array[] = {}; + typedef __m256bf16 some_other_type[is_an_int]; + + struct struct1 { + __m256bf16 a; + }; + + union union1 { + __m256bf16 a; + }; + + /* Addressing and dereferencing. */ + + __m256bf16 *bfloat_ptr = &vector0; + vector0 = *bfloat_ptr; + + /* Pointer assignment. */ + + __m256bf16 *bfloat_ptr2 = bfloat_ptr; + __m256bf16 *bfloat_ptr3 = array; + + /* Pointer arithmetic. */ + + ++bfloat_ptr; + --bfloat_ptr; + bfloat_ptr++; + bfloat_ptr--; + bfloat_ptr += 1; + bfloat_ptr -= 1; + bfloat_ptr - bfloat_ptr2; + bfloat_ptr = &bfloat_ptr3[0]; + bfloat_ptr = &bfloat_ptr3[1]; + + /* Simple comparison. */ + vector0 > glob_bfloat_vec; /* { dg-error {operation not permitted on type '__bf16'} } */ + glob_bfloat_vec == vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + vector0 > is_a_float_vec; /* { dg-error {operation not permitted on type '__bf16'} } */ + is_a_float_vec == vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + vector0 > 0; /* { dg-error {operation not permitted on type '__bf16'} } */ + 0 == vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + vector0 > 0.1; /* { dg-error {operation not permitted on type '__bf16'} } */ + 0.1 == vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + vector0 > is_an_int_vec; /* { dg-error {operation not permitted on type '__bf16'} } */ + is_an_int_vec == vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + + /* Pointer comparison. */ + + bfloat_ptr == &vector0; + bfloat_ptr != &vector0; + bfloat_ptr < &vector0; + bfloat_ptr <= &vector0; + bfloat_ptr > &vector0; + bfloat_ptr >= &vector0; + bfloat_ptr == bfloat_ptr2; + bfloat_ptr != bfloat_ptr2; + bfloat_ptr < bfloat_ptr2; + bfloat_ptr <= bfloat_ptr2; + bfloat_ptr > bfloat_ptr2; + bfloat_ptr >= bfloat_ptr2; + + /* Conditional expressions. */ + + 0 ? vector0 : vector0; + 0 ? vector0 : is_a_float_vec; /* { dg-error {type mismatch in conditional expression} } */ + 0 ? is_a_float_vec : vector0; /* { dg-error {type mismatch in conditional expression} } */ + 0 ? vector0 : is_a_float16_vec; /* { dg-error {type mismatch in conditional expression} } */ + 0 ? is_a_float16_vec : vector0; /* { dg-error {type mismatch in conditional expression} } */ + 0 ? vector0 : 0; /* { dg-error {type mismatch in conditional expression} } */ + 0 ? 0 : vector0; /* { dg-error {type mismatch in conditional expression} } */ + 0 ? 0.1 : vector0; /* { dg-error {type mismatch in conditional expression} } */ + 0 ? vector0 : 0.1; /* { dg-error {type mismatch in conditional expression} } */ + 0 ? bfloat_ptr : bfloat_ptr2; + 0 ? bfloat_ptr : float_ptr; /* { dg-warning {pointer type mismatch in conditional expression} } */ + 0 ? float_ptr : bfloat_ptr; /* { dg-warning {pointer type mismatch in conditional expression} } */ + + vector0 ? vector0 : vector0; /* { dg-error {used vector type where scalar is required} } */ + vector0 ? is_a_float16_vec : vector0; /* { dg-error {used vector type where scalar is required} } */ + vector0 ? vector0 : is_a_float16_vec; /* { dg-error {used vector type where scalar is required} } */ + vector0 ? is_a_float16_vec : is_a_float16_vec; /* { dg-error {used vector type where scalar is required} } */ + + /* Unary operators. */ + + +vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + -vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + ~vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + !vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + *vector0; /* { dg-error {invalid type argument of unary '\*'} } */ + __real vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + __imag vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + ++vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + --vector0; /* { dg-error {operation not permitted on type '__bf16'} } */ + vector0++; /* { dg-error {operation not permitted on type '__bf16'} } */ + vector0--; /* { dg-error {operation not permitted on type '__bf16'} } */ + + /* Binary arithmetic operations. */ + + vector0 = glob_bfloat_vec + *bfloat_ptr; /* { dg-error {operation not permitted on type '__bf16'} } */ + vector0 = glob_bfloat_vec + 0.1; /* { dg-error {operation not permitted on type '__bf16'} } */ + vector0 = glob_bfloat_vec + 0; /* { dg-error {operation not permitted on type '__bf16'} } */ + vector0 = glob_bfloat_vec + is_a_float_vec; /* { dg-error {operation not permitted on type '__bf16'} } */ + + return vector0; +} + diff --git a/gcc/testsuite/gcc.target/loongarch/fmax-fmin.c b/gcc/testsuite/gcc.target/loongarch/fmax-fmin.c new file mode 100644 index 0000000..92cf8a1 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/fmax-fmin.c @@ -0,0 +1,30 @@ +/* { dg-do compile } */ +/* { dg-options "-mdouble-float -fno-finite-math-only" } */ +/* { dg-final { scan-assembler "fmin\\.s" } } */ +/* { dg-final { scan-assembler "fmin\\.d" } } */ +/* { dg-final { scan-assembler "fmax\\.s" } } */ +/* { dg-final { scan-assembler "fmax\\.d" } } */ + +double +_fmax(double a, double b) +{ + return __builtin_fmax(a, b); +} + +float +_fmaxf(float a, float b) +{ + return __builtin_fmaxf(a, b); +} + +double +_fmin(double a, double b) +{ + return __builtin_fmin(a, b); +} + +float +_fminf(float a, float b) +{ + return __builtin_fminf(a, b); +} diff --git a/gcc/testsuite/gcc.target/loongarch/tls-gd-noplt.c b/gcc/testsuite/gcc.target/loongarch/tls-gd-noplt.c new file mode 100644 index 0000000..32a0acf --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/tls-gd-noplt.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-plt -mcmodel=normal" } */ +/* { dg-final { scan-assembler "pcalau12i\t.*%got_pc_hi20\\(__tls_get_addr\\)" } } */ + +__attribute__ ((tls_model ("global-dynamic"))) __thread int a; + +void +test (void) +{ + a = 10; +} + diff --git a/gcc/testsuite/gcc.target/powerpc/pr103109-1.c b/gcc/testsuite/gcc.target/powerpc/pr103109-1.c new file mode 100644 index 0000000..097a44e --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr103109-1.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -mdejagnu-cpu=power9" } */ +/* { dg-require-effective-target int128 } */ +/* { dg-require-effective-target powerpc_p9modulo_ok } */ +/* { dg-require-effective-target has_arch_ppc64 } */ +/* { dg-final { scan-assembler-times {\mmaddld\M} 2 } } */ +/* { dg-final { scan-assembler-times {\mmaddhd\M} 1 } } */ +/* { dg-final { scan-assembler-times {\mmaddhdu\M} 1 } } */ + +#include "pr103109.h" diff --git a/gcc/testsuite/gcc.target/powerpc/pr103109-2.c b/gcc/testsuite/gcc.target/powerpc/pr103109-2.c new file mode 100644 index 0000000..4b93519 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr103109-2.c @@ -0,0 +1,96 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -mdejagnu-cpu=power9" } */ +/* { dg-require-effective-target int128 } */ +/* { dg-require-effective-target p9modulo_hw } */ +/* { dg-require-effective-target has_arch_ppc64 } */ + +#include "pr103109.h" + +union U { + __int128 i128; + struct { + long l1; + long l2; + } s; +}; + +__int128 +create_i128 (long most_sig, long least_sig) +{ + union U u; + +#if __LITTLE_ENDIAN__ + u.s.l1 = least_sig; + u.s.l2 = most_sig; +#else + u.s.l1 = most_sig; + u.s.l2 = least_sig; +#endif + return u.i128; +} + +#define DEBUG 0 + +#if DEBUG +#include <stdio.h> +#include <stdlib.h> + +void print_i128(__int128 val, int unsignedp) +{ + if (unsignedp) + printf(" %llu ", (unsigned long long)(val >> 64)); + else + printf(" %lld ", (signed long long)(val >> 64)); + + printf("%llu (0x%llx %llx)", + (unsigned long long)(val & 0xFFFFFFFFFFFFFFFF), + (unsigned long long)(val >> 64), + (unsigned long long)(val & 0xFFFFFFFFFFFFFFFF)); +} +#endif + +void abort (void); + +int main () +{ + long a = 0xFEDCBA9876543210L; + long b = 0x1000000L; + long c = 0x123456L; + __int128 expected_result = create_i128 (0xFFFFFFFFFFFEDCBAL, + 0x9876543210123456L); + + __int128 result = multiply_add (a, b, c); + + if (result != expected_result) + { +#if DEBUG + printf ("ERROR: multiply_add (%lld, %lld, %lld) = ", a, b, c); + print_i128 (result, 0); + printf ("\n does not match expected_result = "); + print_i128 (expected_result, 0); + printf ("\n\n"); +#else + abort(); +#endif + } + + unsigned long au = 0xFEDCBA9876543210UL; + unsigned long bu = 0x1000000UL; + unsigned long cu = 0x123456UL; + unsigned __int128 expected_resultu = create_i128 (0x0000000000FEDCBAL, + 0x9876543210123456L); + + unsigned __int128 resultu = multiply_addu (au, bu, cu); + if (resultu != expected_resultu) + { +#if DEBUG + printf ("ERROR: multiply_addu (%llu, %llu, %llu) = ", au, bu, cu); + print_i128 (resultu, 1); + printf ("\n does not match expected_result = "); + print_i128 (expected_resultu, 1); + printf ("\n\n"); +#else + abort(); +#endif + } +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr103109.h b/gcc/testsuite/gcc.target/powerpc/pr103109.h new file mode 100644 index 0000000..d16a5dd --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr103109.h @@ -0,0 +1,12 @@ +__attribute__((noinline)) +__int128 multiply_add (long a, long b, long c) +{ + return (__int128) a * b + c; +} + +__attribute__((noinline)) +unsigned __int128 multiply_addu (unsigned long a, unsigned long b, + unsigned long c) +{ + return (unsigned __int128) a * b + c; +} diff --git a/gcc/testsuite/gcc.target/riscv/fmax-snan.c b/gcc/testsuite/gcc.target/riscv/fmax-snan.c index ba4823a..aabaad5 100644 --- a/gcc/testsuite/gcc.target/riscv/fmax-snan.c +++ b/gcc/testsuite/gcc.target/riscv/fmax-snan.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-require-effective-target hard_float } */ /* { dg-options "-fno-finite-math-only -fsigned-zeros -fsignaling-nans -dp" } */ double diff --git a/gcc/testsuite/gcc.target/riscv/fmaxf-snan.c b/gcc/testsuite/gcc.target/riscv/fmaxf-snan.c index faada3a..f74a817 100644 --- a/gcc/testsuite/gcc.target/riscv/fmaxf-snan.c +++ b/gcc/testsuite/gcc.target/riscv/fmaxf-snan.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-require-effective-target hard_float } */ /* { dg-options "-fno-finite-math-only -fsigned-zeros -fsignaling-nans -dp" } */ float diff --git a/gcc/testsuite/gcc.target/riscv/fmin-snan.c b/gcc/testsuite/gcc.target/riscv/fmin-snan.c index b511380..3b2e8c3 100644 --- a/gcc/testsuite/gcc.target/riscv/fmin-snan.c +++ b/gcc/testsuite/gcc.target/riscv/fmin-snan.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-require-effective-target hard_float } */ /* { dg-options "-fno-finite-math-only -fsigned-zeros -fsignaling-nans -dp" } */ double diff --git a/gcc/testsuite/gcc.target/riscv/fminf-snan.c b/gcc/testsuite/gcc.target/riscv/fminf-snan.c index 39dd8fe..d28822e 100644 --- a/gcc/testsuite/gcc.target/riscv/fminf-snan.c +++ b/gcc/testsuite/gcc.target/riscv/fminf-snan.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-require-effective-target hard_float } */ /* { dg-options "-fno-finite-math-only -fsigned-zeros -fsignaling-nans -dp" } */ float diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-simd-4.f90 b/gcc/testsuite/gfortran.dg/gomp/declare-simd-4.f90 new file mode 100644 index 0000000..27a75ab --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/declare-simd-4.f90 @@ -0,0 +1,42 @@ +! { dg-do compile } +! { dg-additional-options "-fdump-tree-gimple" } +! +! PR fortran/106566 +! +! { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare simd \\(linear\\(0:ref,step\\(4\\)\\) simdlen\\(8\\)\\)\\)\\)" 2 "gimple" } } +! { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare simd \\(linear\\(0:ref,step\\(8\\)\\) simdlen\\(8\\)\\)\\)\\)" 2 "gimple" } } + +subroutine add_one2(p) + implicit none + !$omp declare simd(add_one2) linear(p: ref) simdlen(8) + integer(kind=4) :: p + + p = p + 1 +end subroutine + +subroutine linear_add_one2(p) + implicit none + !$omp declare simd(linear_add_one2) linear(p: ref, step(2)) simdlen(8) + integer(kind=4) :: p + + p = p + 1 +end subroutine + +module m + integer, parameter :: NN = 1023 + integer(kind=4) :: a(NN) +contains + subroutine module_add_one2(q) + implicit none + !$omp declare simd(module_add_one2) linear(q: ref) simdlen(8) + integer(kind=4) :: q + q = q + 1 + end subroutine + + subroutine linear_add_one2(q) + implicit none + !$omp declare simd(linear_add_one2) linear(q: ref, step(2)) simdlen(8) + integer(kind=4) :: q + q = q + 1 + end subroutine +end module diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-simd-5.f90 b/gcc/testsuite/gfortran.dg/gomp/declare-simd-5.f90 new file mode 100644 index 0000000..f5880f5 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/declare-simd-5.f90 @@ -0,0 +1,49 @@ +! { dg-do compile } +! +! PR fortran/106566 +! + +subroutine add_one2(p) + implicit none + procedure(add_one2) :: ext1 + !$omp declare simd(ext1) linear(p: ref) simdlen(8) ! { dg-error "OMP DECLARE SIMD should refer to containing procedure 'add_one2'" } + integer :: p + + p = p + 1 +end subroutine + +subroutine linear_add_one2(p) + implicit none + procedure(linear_add_one2) :: ext2 + !$omp declare simd(ext2) linear(p: ref, step(2)) simdlen(8) ! { dg-error "OMP DECLARE SIMD should refer to containing procedure 'linear_add_one2'" } + integer :: p + + p = p + 1 +end subroutine + +module m + integer, parameter :: NN = 1023 + integer :: a(NN) +contains + subroutine some_proc(r) + integer :: r + end subroutine + subroutine module_add_one2(q) + implicit none + !$omp declare simd(some_proc) linear(q: ref) simdlen(8) ! { dg-error "OMP DECLARE SIMD should refer to containing procedure 'module_add_one2'" } + integer :: q + q = q + 1 + end subroutine + + subroutine module_linear_add_one2(q) + implicit none + interface + subroutine other_proc(r) + integer :: r + end subroutine + end interface + !$omp declare simd(other_proc) linear(q: ref, step(2)) simdlen(8) ! { dg-error "OMP DECLARE SIMD should refer to containing procedure 'module_linear_add_one2'" } + integer :: q + q = q + 1 + end subroutine +end module diff --git a/gcc/testsuite/gfortran.dg/gomp/declare-simd-6.f90 b/gcc/testsuite/gfortran.dg/gomp/declare-simd-6.f90 new file mode 100644 index 0000000..83f2c0a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/declare-simd-6.f90 @@ -0,0 +1,42 @@ +! { dg-do compile } +! { dg-additional-options "-fdump-tree-gimple" } +! +! PR fortran/106566 +! +! { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare simd \\(linear\\(ref\\(0\\):4\\) simdlen\\(8\\)\\)\\)\\)" 2 "gimple" } } +! { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare simd \\(linear\\(ref\\(0\\):8\\) simdlen\\(8\\)\\)\\)\\)" 2 "gimple" } } + +subroutine add_one2(p) + implicit none + !$omp declare simd(add_one2) linear(ref(p)) simdlen(8) + integer(kind=4) :: p + + p = p + 1 +end subroutine + +subroutine linear_add_one2(p) + implicit none + !$omp declare simd(linear_add_one2) linear(ref(p) : 2) simdlen(8) + integer(kind=4) :: p + + p = p + 1 +end subroutine + +module m + integer, parameter :: NN = 1023 + integer(kind=4) :: a(NN) +contains + subroutine module_add_one2(q) + implicit none + !$omp declare simd(module_add_one2) linear(ref(q)) simdlen(8) + integer(kind=4) :: q + q = q + 1 + end subroutine + + subroutine linear_add_one2(q) + implicit none + !$omp declare simd(linear_add_one2) linear(ref(q) : 2) simdlen(8) + integer(kind=4) :: q + q = q + 1 + end subroutine +end module diff --git a/gcc/tree-ssa-threadbackward.cc b/gcc/tree-ssa-threadbackward.cc index 1c36283..7698e1f 100644 --- a/gcc/tree-ssa-threadbackward.cc +++ b/gcc/tree-ssa-threadbackward.cc @@ -61,15 +61,33 @@ public: class back_threader_profitability { public: - back_threader_profitability (bool speed_p) - : m_speed_p (speed_p) - { } - bool profitable_path_p (const vec<basic_block> &, tree name, edge taken, - bool *irreducible_loop = NULL); + back_threader_profitability (bool speed_p, gimple *stmt); + bool possibly_profitable_path_p (const vec<basic_block> &, tree, bool *); + bool profitable_path_p (const vec<basic_block> &, + edge taken, bool *irreducible_loop); private: const bool m_speed_p; + int m_exit_jump_benefit; + bool m_threaded_multiway_branch; + // The following are computed by possibly_profitable_path_p + bool m_threaded_through_latch; + bool m_multiway_branch_in_path; + bool m_contains_hot_bb; + int m_n_insns; }; +back_threader_profitability::back_threader_profitability (bool speed_p, + gimple *last) + : m_speed_p (speed_p) +{ + m_threaded_multiway_branch = (gimple_code (last) == GIMPLE_SWITCH + || gimple_code (last) == GIMPLE_GOTO); + // The forward threader has estimate_threading_killed_stmts, in + // particular it estimates further DCE from eliminating the exit + // control stmt. + m_exit_jump_benefit = estimate_num_insns (last, &eni_size_weights); +} + // Back threader flags. #define BT_NONE 0 // Generate fast code at the expense of code size. @@ -86,11 +104,11 @@ public: unsigned thread_blocks (); private: void maybe_thread_block (basic_block bb); - void find_paths (basic_block bb, tree name); bool debug_counter (); - edge maybe_register_path (); + edge maybe_register_path (back_threader_profitability &); void maybe_register_path_dump (edge taken_edge); - void find_paths_to_names (basic_block bb, bitmap imports, unsigned); + void find_paths_to_names (basic_block bb, bitmap imports, unsigned, + back_threader_profitability &); edge find_taken_edge (const vec<basic_block> &path); edge find_taken_edge_cond (const vec<basic_block> &path, gcond *); edge find_taken_edge_switch (const vec<basic_block> &path, gswitch *); @@ -98,7 +116,6 @@ private: virtual void dump (FILE *out); back_threader_registry m_registry; - back_threader_profitability m_profit; path_range_query *m_solver; // Current path being analyzed. @@ -131,8 +148,7 @@ private: const edge back_threader::UNREACHABLE_EDGE = (edge) -1; back_threader::back_threader (function *fun, unsigned flags, bool first) - : m_profit (flags & BT_SPEED), - m_first (first) + : m_first (first) { if (flags & BT_SPEED) loop_optimizer_init (LOOPS_HAVE_PREHEADERS | LOOPS_HAVE_SIMPLE_LATCHES); @@ -226,7 +242,7 @@ back_threader::maybe_register_path_dump (edge taken) // unreachable. edge -back_threader::maybe_register_path () +back_threader::maybe_register_path (back_threader_profitability &profit) { edge taken_edge = find_taken_edge (m_path); @@ -241,8 +257,7 @@ back_threader::maybe_register_path () else { bool irreducible = false; - if (m_profit.profitable_path_p (m_path, m_name, taken_edge, - &irreducible) + if (profit.profitable_path_p (m_path, taken_edge, &irreducible) && debug_counter () && m_registry.register_path (m_path, taken_edge)) { @@ -342,17 +357,26 @@ back_threader::find_taken_edge_cond (const vec<basic_block> &path, void back_threader::find_paths_to_names (basic_block bb, bitmap interesting, - unsigned overall_paths) + unsigned overall_paths, + back_threader_profitability &profit) { if (m_visited_bbs.add (bb)) return; m_path.safe_push (bb); - // Try to resolve the path without looking back. + // Try to resolve the path without looking back. Avoid resolving paths + // we know are large but are not (yet) recognized as Finite State Machine. + // ??? Ideally we'd explore the cheapest path to the loop backedge here, + // avoiding the exponential greedy search and only start that from there. + // Precomputing a path-size-to-immediate-dominator-of-successor for each + // edge might help here. Alternatively copying divergent control flow + // on the way to the backedge could be worthwhile. + bool large_non_fsm; if (m_path.length () > 1 - && (!m_profit.profitable_path_p (m_path, m_name, NULL) - || maybe_register_path ())) + && (!profit.possibly_profitable_path_p (m_path, m_name, &large_non_fsm) + || (!large_non_fsm + && maybe_register_path (profit)))) ; // The backwards thread copier cannot copy blocks that do not belong @@ -474,7 +498,8 @@ back_threader::find_paths_to_names (basic_block bb, bitmap interesting, } } } - find_paths_to_names (e->src, new_interesting, overall_paths); + find_paths_to_names (e->src, new_interesting, overall_paths, + profit); // Restore new_interesting. for (int def : unwind) bitmap_clear_bit (new_interesting, def); @@ -500,73 +525,16 @@ back_threader::find_paths_to_names (basic_block bb, bitmap interesting, } // Search backwards from BB looking for paths where the final -// conditional out of BB can be determined. NAME is the LHS of the -// final conditional. Register such paths for jump threading. - -void -back_threader::find_paths (basic_block bb, tree name) -{ - gimple *stmt = last_stmt (bb); - if (!stmt - || (gimple_code (stmt) != GIMPLE_COND - && gimple_code (stmt) != GIMPLE_SWITCH)) - return; - - if (EDGE_COUNT (bb->succs) > 1) - { - m_last_stmt = stmt; - m_visited_bbs.empty (); - m_path.truncate (0); - m_name = name; - - // We compute imports of the path during discovery starting - // just with names used in the conditional. - bitmap_clear (m_imports); - ssa_op_iter iter; - FOR_EACH_SSA_TREE_OPERAND (name, stmt, iter, SSA_OP_USE) - { - if (!gimple_range_ssa_p (name)) - return; - bitmap_set_bit (m_imports, SSA_NAME_VERSION (name)); - } - - // Interesting is the set of imports we still not have see - // the definition of. So while imports only grow, the - // set of interesting defs dwindles and once empty we can - // stop searching. - auto_bitmap interesting; - bitmap_copy (interesting, m_imports); - find_paths_to_names (bb, interesting, 1); - } -} - -// Simple helper to get the last statement from BB, which is assumed -// to be a control statement. Return NULL if the last statement is -// not a control statement. - -static gimple * -get_gimple_control_stmt (basic_block bb) -{ - gimple_stmt_iterator gsi = gsi_last_nondebug_bb (bb); - - if (gsi_end_p (gsi)) - return NULL; - - gimple *stmt = gsi_stmt (gsi); - enum gimple_code code = gimple_code (stmt); - if (code == GIMPLE_COND || code == GIMPLE_SWITCH || code == GIMPLE_GOTO) - return stmt; - return NULL; -} - -// Search backwards from BB looking for paths where the final // conditional maybe threaded to a successor block. Record such paths // for jump threading. void back_threader::maybe_thread_block (basic_block bb) { - gimple *stmt = get_gimple_control_stmt (bb); + if (EDGE_COUNT (bb->succs) <= 1) + return; + + gimple *stmt = last_stmt (bb); if (!stmt) return; @@ -576,12 +544,33 @@ back_threader::maybe_thread_block (basic_block bb) name = gimple_switch_index (as_a <gswitch *> (stmt)); else if (code == GIMPLE_COND) name = gimple_cond_lhs (stmt); - else if (code == GIMPLE_GOTO) - name = gimple_goto_dest (stmt); else - name = NULL; + return; - find_paths (bb, name); + m_last_stmt = stmt; + m_visited_bbs.empty (); + m_path.truncate (0); + m_name = name; + + // We compute imports of the path during discovery starting + // just with names used in the conditional. + bitmap_clear (m_imports); + ssa_op_iter iter; + FOR_EACH_SSA_TREE_OPERAND (name, stmt, iter, SSA_OP_USE) + { + if (!gimple_range_ssa_p (name)) + return; + bitmap_set_bit (m_imports, SSA_NAME_VERSION (name)); + } + + // Interesting is the set of imports we still not have see + // the definition of. So while imports only grow, the + // set of interesting defs dwindles and once empty we can + // stop searching. + auto_bitmap interesting; + bitmap_copy (interesting, m_imports); + back_threader_profitability profit (m_flags & BT_SPEED, stmt); + find_paths_to_names (bb, interesting, 1, profit); } DEBUG_FUNCTION void @@ -615,26 +604,23 @@ back_threader::debug () dump (stderr); } -/* Examine jump threading path PATH and return TRUE if it is profitable to - thread it, otherwise return FALSE. +/* Examine jump threading path PATH and return TRUE if it is possibly + profitable to thread it, otherwise return FALSE. If this function + returns TRUE profitable_path_p might not be satisfied but when + the path is extended it might be. In particular indicate in + *LARGE_NON_FSM whether the thread is too large for a non-FSM thread + but would be OK if we extend the path to cover the loop backedge. NAME is the SSA_NAME of the variable we found to have a constant value on PATH. If unknown, SSA_NAME is NULL. - If the taken edge out of the path is known ahead of time it is passed in - TAKEN_EDGE, otherwise it is NULL. - - CREATES_IRREDUCIBLE_LOOP, if non-null is set to TRUE if threading this path - would create an irreducible loop. - ?? It seems we should be able to loosen some of the restrictions in this function after loop optimizations have run. */ bool -back_threader_profitability::profitable_path_p (const vec<basic_block> &m_path, - tree name, - edge taken_edge, - bool *creates_irreducible_loop) +back_threader_profitability::possibly_profitable_path_p + (const vec<basic_block> &m_path, tree name, + bool *large_non_fsm) { gcc_checking_assert (!m_path.is_empty ()); @@ -650,13 +636,15 @@ back_threader_profitability::profitable_path_p (const vec<basic_block> &m_path, if (m_path.length () <= 1) return false; - int n_insns = 0; gimple_stmt_iterator gsi; loop_p loop = m_path[0]->loop_father; - bool threaded_through_latch = false; - bool multiway_branch_in_path = false; - bool threaded_multiway_branch = false; - bool contains_hot_bb = false; + + // We recompute the following, when we rewrite possibly_profitable_path_p + // to work incrementally on added BBs we have to unwind them on backtracking + m_n_insns = 0; + m_threaded_through_latch = false; + m_multiway_branch_in_path = false; + m_contains_hot_bb = false; if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "Checking profitability of path (backwards): "); @@ -679,7 +667,7 @@ back_threader_profitability::profitable_path_p (const vec<basic_block> &m_path, it ends in a multiway branch. */ if (j < m_path.length () - 1) { - int orig_n_insns = n_insns; + int orig_n_insns = m_n_insns; /* PHIs in the path will create degenerate PHIS in the copied path which will then get propagated away, so looking at just the duplicate path the PHIs would @@ -714,12 +702,12 @@ back_threader_profitability::profitable_path_p (const vec<basic_block> &m_path, && (SSA_NAME_VAR (dst) != SSA_NAME_VAR (name) || !SSA_NAME_VAR (dst)) && !virtual_operand_p (dst)) - ++n_insns; + ++m_n_insns; } } - if (!contains_hot_bb && m_speed_p) - contains_hot_bb |= optimize_bb_for_speed_p (bb); + if (!m_contains_hot_bb && m_speed_p) + m_contains_hot_bb |= optimize_bb_for_speed_p (bb); for (gsi = gsi_after_labels (bb); !gsi_end_p (gsi); gsi_next_nondebug (&gsi)) @@ -735,10 +723,10 @@ back_threader_profitability::profitable_path_p (const vec<basic_block> &m_path, /* Do not count empty statements and labels. */ if (gimple_code (stmt) != GIMPLE_NOP && !is_gimple_debug (stmt)) - n_insns += estimate_num_insns (stmt, &eni_size_weights); + m_n_insns += estimate_num_insns (stmt, &eni_size_weights); } if (dump_file && (dump_flags & TDF_DETAILS)) - fprintf (dump_file, " (%i insns)", n_insns-orig_n_insns); + fprintf (dump_file, " (%i insns)", m_n_insns-orig_n_insns); /* We do not look at the block with the threaded branch in this loop. So if any block with a last statement that @@ -747,14 +735,13 @@ back_threader_profitability::profitable_path_p (const vec<basic_block> &m_path, The block in PATH[0] is special, it's the block were we're going to be able to eliminate its branch. */ - gimple *last = last_stmt (bb); - if (last && (gimple_code (last) == GIMPLE_SWITCH - || gimple_code (last) == GIMPLE_GOTO)) + if (j > 0) { - if (j == 0) - threaded_multiway_branch = true; - else - multiway_branch_in_path = true; + gimple *last = last_stmt (bb); + if (last + && (gimple_code (last) == GIMPLE_SWITCH + || gimple_code (last) == GIMPLE_GOTO)) + m_multiway_branch_in_path = true; } } @@ -763,50 +750,29 @@ back_threader_profitability::profitable_path_p (const vec<basic_block> &m_path, through the loop latch. */ if (loop->latch == bb) { - threaded_through_latch = true; + m_threaded_through_latch = true; if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, " (latch)"); } } - gimple *stmt = get_gimple_control_stmt (m_path[0]); - gcc_assert (stmt); - /* We are going to remove the control statement at the end of the last block in the threading path. So don't count it against our statement count. */ - - int stmt_insns = estimate_num_insns (stmt, &eni_size_weights); - n_insns-= stmt_insns; + m_n_insns -= m_exit_jump_benefit; if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "\n Control statement insns: %i\n" " Overall: %i insns\n", - stmt_insns, n_insns); - - if (creates_irreducible_loop) - { - /* If this path threaded through the loop latch back into the - same loop and the destination does not dominate the loop - latch, then this thread would create an irreducible loop. */ - *creates_irreducible_loop = false; - if (taken_edge - && threaded_through_latch - && loop == taken_edge->dest->loop_father - && (determine_bb_domination_status (loop, taken_edge->dest) - == DOMST_NONDOMINATING)) - *creates_irreducible_loop = true; - } + m_exit_jump_benefit, m_n_insns); /* Threading is profitable if the path duplicated is hot but also in a case we separate cold path from hot path and permit optimization of the hot path later. Be on the agressive side here. In some testcases, as in PR 78407 this leads to noticeable improvements. */ - if (m_speed_p - && ((taken_edge && optimize_edge_for_speed_p (taken_edge)) - || contains_hot_bb)) + if (m_speed_p) { - if (n_insns >= param_max_fsm_thread_path_insns) + if (m_n_insns >= param_max_fsm_thread_path_insns) { if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, " FAIL: Jump-thread path not considered: " @@ -814,29 +780,104 @@ back_threader_profitability::profitable_path_p (const vec<basic_block> &m_path, "exceeds PARAM_MAX_FSM_THREAD_PATH_INSNS.\n"); return false; } - if (taken_edge && probably_never_executed_edge_p (cfun, taken_edge)) + edge entry = find_edge (m_path[m_path.length () - 1], + m_path[m_path.length () - 2]); + if (probably_never_executed_edge_p (cfun, entry)) { if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, " FAIL: Jump-thread path not considered: " - "path leads to probably never executed edge.\n"); + "path entry is probably never executed.\n"); return false; } - edge entry = find_edge (m_path[m_path.length () - 1], - m_path[m_path.length () - 2]); - if (probably_never_executed_edge_p (cfun, entry)) + } + else if (m_n_insns > 1) + { + if (dump_file && (dump_flags & TDF_DETAILS)) + fprintf (dump_file, " FAIL: Jump-thread path not considered: " + "duplication of %i insns is needed and optimizing for size.\n", + m_n_insns); + return false; + } + + /* The generic copier used by the backthreader does not re-use an + existing threading path to reduce code duplication. So for that + case, drastically reduce the number of statements we are allowed + to copy. We don't know yet whether we will thread through the latch + so we have to be permissive and continue threading, but indicate + to the caller the thread, if final, wouldn't be profitable. */ + if ((!m_threaded_multiway_branch + || !loop->latch + || loop->latch->index == EXIT_BLOCK) + && (m_n_insns * param_fsm_scale_path_stmts + >= param_max_jump_thread_duplication_stmts)) + { + if (dump_file && (dump_flags & TDF_DETAILS)) + fprintf (dump_file, + " FAIL: Did not thread around loop and would copy too " + "many statements.\n"); + return false; + } + *large_non_fsm = (!(m_threaded_through_latch && m_threaded_multiway_branch) + && (m_n_insns * param_fsm_scale_path_stmts + >= param_max_jump_thread_duplication_stmts)); + + return true; +} + +/* Examine jump threading path PATH and return TRUE if it is profitable to + thread it, otherwise return FALSE. + + The taken edge out of the path is TAKEN_EDGE. + + CREATES_IRREDUCIBLE_LOOP is set to TRUE if threading this path + would create an irreducible loop. + + ?? It seems we should be able to loosen some of the restrictions in + this function after loop optimizations have run. */ + +bool +back_threader_profitability::profitable_path_p (const vec<basic_block> &m_path, + edge taken_edge, + bool *creates_irreducible_loop) +{ + // We can assume that possibly_profitable_path_p holds here + + loop_p loop = m_path[0]->loop_father; + + if (dump_file && (dump_flags & TDF_DETAILS)) + fprintf (dump_file, "Checking profitability of path (backwards): "); + + /* If this path threaded through the loop latch back into the + same loop and the destination does not dominate the loop + latch, then this thread would create an irreducible loop. */ + *creates_irreducible_loop = false; + if (m_threaded_through_latch + && loop == taken_edge->dest->loop_father + && (determine_bb_domination_status (loop, taken_edge->dest) + == DOMST_NONDOMINATING)) + *creates_irreducible_loop = true; + + /* Threading is profitable if the path duplicated is hot but also + in a case we separate cold path from hot path and permit optimization + of the hot path later. Be on the agressive side here. In some testcases, + as in PR 78407 this leads to noticeable improvements. */ + if (m_speed_p + && (optimize_edge_for_speed_p (taken_edge) || m_contains_hot_bb)) + { + if (probably_never_executed_edge_p (cfun, taken_edge)) { if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, " FAIL: Jump-thread path not considered: " - "path entry is probably never executed.\n"); + "path leads to probably never executed edge.\n"); return false; } } - else if (n_insns > 1) + else if (m_n_insns > 1) { if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, " FAIL: Jump-thread path not considered: " "duplication of %i insns is needed and optimizing for size.\n", - n_insns); + m_n_insns); return false; } @@ -849,10 +890,9 @@ back_threader_profitability::profitable_path_p (const vec<basic_block> &m_path, the path -- in that case there's little the traditional loop optimizer would have done anyway, so an irreducible loop is not so bad. */ - if (!threaded_multiway_branch - && creates_irreducible_loop + if (!m_threaded_multiway_branch && *creates_irreducible_loop - && (n_insns * (unsigned) param_fsm_scale_path_stmts + && (m_n_insns * (unsigned) param_fsm_scale_path_stmts > (m_path.length () * (unsigned) param_fsm_scale_path_blocks))) @@ -861,6 +901,7 @@ back_threader_profitability::profitable_path_p (const vec<basic_block> &m_path, fprintf (dump_file, " FAIL: Would create irreducible loop without threading " "multiway branch.\n"); + /* We compute creates_irreducible_loop only late. */ return false; } @@ -868,8 +909,8 @@ back_threader_profitability::profitable_path_p (const vec<basic_block> &m_path, existing threading path to reduce code duplication. So for that case, drastically reduce the number of statements we are allowed to copy. */ - if (!(threaded_through_latch && threaded_multiway_branch) - && (n_insns * param_fsm_scale_path_stmts + if (!(m_threaded_through_latch && m_threaded_multiway_branch) + && (m_n_insns * param_fsm_scale_path_stmts >= param_max_jump_thread_duplication_stmts)) { if (dump_file && (dump_flags & TDF_DETAILS)) @@ -883,7 +924,7 @@ back_threader_profitability::profitable_path_p (const vec<basic_block> &m_path, explode the CFG due to duplicating the edges for that multi-way branch. So like above, only allow a multi-way branch on the path if we actually thread a multi-way branch. */ - if (!threaded_multiway_branch && multiway_branch_in_path) + if (!m_threaded_multiway_branch && m_multiway_branch_in_path) { if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, @@ -896,20 +937,20 @@ back_threader_profitability::profitable_path_p (const vec<basic_block> &m_path, the latch. This could alter the loop form sufficiently to cause loop optimizations to fail. Disable these threads until after loop optimizations have run. */ - if ((threaded_through_latch - || (taken_edge && taken_edge->dest == loop->latch)) + if ((m_threaded_through_latch || taken_edge->dest == loop->latch) && !(cfun->curr_properties & PROP_loop_opts_done) && empty_block_p (loop->latch)) { if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, - " FAIL: Thread through latch before loop opts would create non-empty latch\n"); + " FAIL: Thread through latch before loop opts would create " + "non-empty latch\n"); return false; - } return true; } + /* The current path PATH is a vector of blocks forming a jump threading path in reverse order. TAKEN_EDGE is the edge taken from path[0]. diff --git a/gcc/value-relation.cc b/gcc/value-relation.cc index 3f0957c..7fc22d3 100644 --- a/gcc/value-relation.cc +++ b/gcc/value-relation.cc @@ -1513,11 +1513,13 @@ path_oracle::query_relation (basic_block bb, tree ssa1, tree ssa2) return query_relation (bb, equiv_1, equiv_2); } -// Reset any relations registered on this path. +// Reset any relations registered on this path. ORACLE is the root +// oracle to use. void -path_oracle::reset_path () +path_oracle::reset_path (relation_oracle *oracle) { + set_root_oracle (oracle); m_equiv.m_next = NULL; bitmap_clear (m_equiv.m_names); m_relations.m_head = NULL; diff --git a/gcc/value-relation.h b/gcc/value-relation.h index 77e1208..64884a8 100644 --- a/gcc/value-relation.h +++ b/gcc/value-relation.h @@ -242,7 +242,7 @@ public: relation_kind query_relation (basic_block, tree, tree) final override; relation_kind query_relation (basic_block, const_bitmap, const_bitmap) final override; - void reset_path (); + void reset_path (relation_oracle *oracle = NULL); void set_root_oracle (relation_oracle *oracle) { m_root = oracle; } void dump (FILE *, basic_block) const final override; void dump (FILE *) const final override; diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 259adb9..ac99688 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,9 @@ +2022-08-16 Tom Honermann <tom@honermann.net> + + PR c++/106423 + * include/cpplib.h (cpp_warning_reason): Add CPP_W_CXX20_COMPAT. + * init.cc (cpp_create_reader): Add cpp_warn_cxx20_compat. + 2022-08-08 Tom Honermann <tom@honermann.net> PR preprocessor/106426 diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index f9c042d..26e2b4c 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -547,6 +547,9 @@ struct cpp_options /* True if warn about differences between C++98 and C++11. */ bool cpp_warn_cxx11_compat; + /* True if warn about differences between C++17 and C++20. */ + bool cpp_warn_cxx20_compat; + /* Nonzero if bidirectional control characters checking is on. See enum cpp_bidirectional_level. */ unsigned char cpp_warn_bidirectional; @@ -655,6 +658,7 @@ enum cpp_warning_reason { CPP_W_C90_C99_COMPAT, CPP_W_C11_C2X_COMPAT, CPP_W_CXX11_COMPAT, + CPP_W_CXX20_COMPAT, CPP_W_EXPANSION_TO_DEFINED, CPP_W_BIDIRECTIONAL }; diff --git a/libcpp/init.cc b/libcpp/init.cc index 0242da5..59641a7 100644 --- a/libcpp/init.cc +++ b/libcpp/init.cc @@ -202,6 +202,7 @@ cpp_create_reader (enum c_lang lang, cpp_hash_table *table, CPP_OPTION (pfile, cpp_warn_c90_c99_compat) = -1; CPP_OPTION (pfile, cpp_warn_c11_c2x_compat) = -1; CPP_OPTION (pfile, cpp_warn_cxx11_compat) = 0; + CPP_OPTION (pfile, cpp_warn_cxx20_compat) = 0; CPP_OPTION (pfile, cpp_warn_deprecated) = 1; CPP_OPTION (pfile, cpp_warn_long_long) = 0; CPP_OPTION (pfile, dollars_in_ident) = 1; diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index fcae8df..5fe8e73 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,121 @@ +2022-08-16 Kito Cheng <kito.cheng@sifive.com> + + * config/riscv/sfp-machine.h (_FP_NANFRAC_H): New. + (_FP_NANFRAC_H): Ditto. + (_FP_NANSIGN_H): Ditto. + * config/riscv/t-softfp32 (softfp_extensions): Add HF related + routines. + (softfp_truncations): Ditto. + (softfp_extras): Ditto. + * config/riscv/t-softfp64 (softfp_extras): Add HF related routines. + +2022-08-16 Kito Cheng <kito.cheng@sifive.com> + + * soft-fp/fixhfdi.c: New. + * soft-fp/fixhfsi.c: Likewise. + * soft-fp/fixunshfdi.c: Likewise. + * soft-fp/fixunshfsi.c: Likewise. + * soft-fp/floatdihf.c: Likewise. + * soft-fp/floatsihf.c: Likewise. + * soft-fp/floatundihf.c: Likewise. + * soft-fp/floatunsihf.c: Likewise. + * soft-fp/adddf3.c: Updating copyright years, removing "Contributed by" + lines and update URL for license. + * soft-fp/addsf3.c: Likewise. + * soft-fp/addtf3.c: Likewise. + * soft-fp/divdf3.c: Likewise. + * soft-fp/divsf3.c: Likewise. + * soft-fp/divtf3.c: Likewise. + * soft-fp/double.h: Likewise. + * soft-fp/eqdf2.c: Likewise. + * soft-fp/eqhf2.c: Likewise. + * soft-fp/eqsf2.c: Likewise. + * soft-fp/eqtf2.c: Likewise. + * soft-fp/extenddftf2.c: Likewise. + * soft-fp/extended.h: Likewise. + * soft-fp/extendhfdf2.c: Likewise. + * soft-fp/extendhfsf2.c: Likewise. + * soft-fp/extendhftf2.c: Likewise. + * soft-fp/extendhfxf2.c: Likewise. + * soft-fp/extendsfdf2.c: Likewise. + * soft-fp/extendsftf2.c: Likewise. + * soft-fp/extendxftf2.c: Likewise. + * soft-fp/fixdfdi.c: Likewise. + * soft-fp/fixdfsi.c: Likewise. + * soft-fp/fixdfti.c: Likewise. + * soft-fp/fixhfti.c: Likewise. + * soft-fp/fixsfdi.c: Likewise. + * soft-fp/fixsfsi.c: Likewise. + * soft-fp/fixsfti.c: Likewise. + * soft-fp/fixtfdi.c: Likewise. + * soft-fp/fixtfsi.c: Likewise. + * soft-fp/fixtfti.c: Likewise. + * soft-fp/fixunsdfdi.c: Likewise. + * soft-fp/fixunsdfsi.c: Likewise. + * soft-fp/fixunsdfti.c: Likewise. + * soft-fp/fixunshfti.c: Likewise. + * soft-fp/fixunssfdi.c: Likewise. + * soft-fp/fixunssfsi.c: Likewise. + * soft-fp/fixunssfti.c: Likewise. + * soft-fp/fixunstfdi.c: Likewise. + * soft-fp/fixunstfsi.c: Likewise. + * soft-fp/fixunstfti.c: Likewise. + * soft-fp/floatdidf.c: Likewise. + * soft-fp/floatdisf.c: Likewise. + * soft-fp/floatditf.c: Likewise. + * soft-fp/floatsidf.c: Likewise. + * soft-fp/floatsisf.c: Likewise. + * soft-fp/floatsitf.c: Likewise. + * soft-fp/floattidf.c: Likewise. + * soft-fp/floattihf.c: Likewise. + * soft-fp/floattisf.c: Likewise. + * soft-fp/floattitf.c: Likewise. + * soft-fp/floatundidf.c: Likewise. + * soft-fp/floatundisf.c: Likewise. + * soft-fp/floatunditf.c: Likewise. + * soft-fp/floatunsidf.c: Likewise. + * soft-fp/floatunsisf.c: Likewise. + * soft-fp/floatunsitf.c: Likewise. + * soft-fp/floatuntidf.c: Likewise. + * soft-fp/floatuntihf.c: Likewise. + * soft-fp/floatuntisf.c: Likewise. + * soft-fp/floatuntitf.c: Likewise. + * soft-fp/gedf2.c: Likewise. + * soft-fp/gesf2.c: Likewise. + * soft-fp/getf2.c: Likewise. + * soft-fp/half.h: Likewise. + * soft-fp/ledf2.c: Likewise. + * soft-fp/lesf2.c: Likewise. + * soft-fp/letf2.c: Likewise. + * soft-fp/muldf3.c: Likewise. + * soft-fp/mulsf3.c: Likewise. + * soft-fp/multf3.c: Likewise. + * soft-fp/negdf2.c: Likewise. + * soft-fp/negsf2.c: Likewise. + * soft-fp/negtf2.c: Likewise. + * soft-fp/op-1.h: Likewise. + * soft-fp/op-2.h: Likewise. + * soft-fp/op-4.h: Likewise. + * soft-fp/op-8.h: Likewise. + * soft-fp/op-common.h: Likewise. + * soft-fp/quad.h: Likewise. + * soft-fp/single.h: Likewise. + * soft-fp/soft-fp.h: Likewise. + * soft-fp/subdf3.c: Likewise. + * soft-fp/subsf3.c: Likewise. + * soft-fp/subtf3.c: Likewise. + * soft-fp/truncdfhf2.c: Likewise. + * soft-fp/truncdfsf2.c: Likewise. + * soft-fp/truncsfhf2.c: Likewise. + * soft-fp/trunctfdf2.c: Likewise. + * soft-fp/trunctfhf2.c: Likewise. + * soft-fp/trunctfsf2.c: Likewise. + * soft-fp/trunctfxf2.c: Likewise. + * soft-fp/truncxfhf2.c: Likewise. + * soft-fp/unorddf2.c: Likewise. + * soft-fp/unordsf2.c: Likewise. + * soft-fp/unordtf2.c: Likewise. + 2022-07-18 Claudiu Zissulescu <claziss@synopsys.com> * config/arc/lib2funcs.c (udivmodsi4): Update AND mask. diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 9d7f83d..e163cd6 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,14 @@ +2022-08-17 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + Jakub Jelinek <jakub@redhat.com> + + PR fortran/46539 + * acinclude.m4 (LIBQUADSPEC): From $FC -static-libgfortran -### + output determine -Bstatic/-Bdynamic, -bstatic/-bdynamic, + -aarchive_shared/-adefault linker support or Darwin remapping + of -lgfortran to libgfortran.a%s and use that around or instead + of -lquadmath in LIBQUADSPEC. + * configure: Regenerated. + 2022-08-01 Jakub Jelinek <jakub@redhat.com> PR libfortran/106079 diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4 index b4cc0bd..a73207e 100644 --- a/libgfortran/acinclude.m4 +++ b/libgfortran/acinclude.m4 @@ -356,18 +356,39 @@ AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [ ac_[]_AC_LANG_ABBREV[]_werror_flag=$ac_xsave_[]_AC_LANG_ABBREV[]_werror_flag ]) + dnl Determine -Bstatic ... -Bdynamic etc. support from gfortran -### stderr. + touch conftest1.$ac_objext conftest2.$ac_objext + LQUADMATH=-lquadmath + $FC -static-libgfortran -### -o conftest \ + conftest1.$ac_objext -lgfortran conftest2.$ac_objext 2>&1 >/dev/null \ + | grep "conftest1.$ac_objext.*conftest2.$ac_objext" > conftest.cmd + if grep "conftest1.$ac_objext.* -Bstatic -lgfortran -Bdynamic .*conftest2.$ac_objext" \ + conftest.cmd >/dev/null 2>&1; then + LQUADMATH="%{static-libquadmath:-Bstatic} -lquadmath %{static-libquadmath:-Bdynamic}" + elif grep "conftest1.$ac_objext.* -bstatic -lgfortran -bdynamic .*conftest2.$ac_objext" \ + conftest.cmd >/dev/null 2>&1; then + LQUADMATH="%{static-libquadmath:-bstatic} -lquadmath %{static-libquadmath:-bdynamic}" + elif grep "conftest1.$ac_objext.* -aarchive_shared -lgfortran -adefault .*conftest2.$ac_objext" \ + conftest.cmd >/dev/null 2>&1; then + LQUADMATH="%{static-libquadmath:-aarchive_shared} -lquadmath %{static-libquadmath:-adefault}" + elif grep "conftest1.$ac_objext.*libgfortran.a .*conftest2.$ac_objext" \ + conftest.cmd >/dev/null 2>&1; then + LQUADMATH="%{static-libquadmath:libquadmath.a%s;:-lquadmath}" + fi + rm -f conftest1.$ac_objext conftest2.$ac_objext conftest conftest.cmd + dnl For static libgfortran linkage, depend on libquadmath only if needed. dnl If using *f128 APIs from libc/libm, depend on libquadmath only if needed dnl even for dynamic libgfortran linkage, and don't link libgfortran against dnl -lquadmath. if test "x$libgfor_cv_have_as_needed" = xyes; then if test "x$USE_IEC_60559" = xyes; then - LIBQUADSPEC="$libgfor_cv_as_needed_option -lquadmath $libgfor_cv_no_as_needed_option" + LIBQUADSPEC="$libgfor_cv_as_needed_option $LQUADMATH $libgfor_cv_no_as_needed_option" else - LIBQUADSPEC="%{static-libgfortran:$libgfor_cv_as_needed_option} -lquadmath %{static-libgfortran:$libgfor_cv_no_as_needed_option}" + LIBQUADSPEC="%{static-libgfortran:$libgfor_cv_as_needed_option} $LQUADMATH %{static-libgfortran:$libgfor_cv_no_as_needed_option}" fi else - LIBQUADSPEC="-lquadmath" + LIBQUADSPEC="$LQUADMATH" fi if test "x$USE_IEC_60559" != xyes; then if test -f ../libquadmath/libquadmath.la; then diff --git a/libgfortran/configure b/libgfortran/configure index 581f1dc..beb0ec4 100755 --- a/libgfortran/configure +++ b/libgfortran/configure @@ -30323,14 +30323,34 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have_as_needed" >&5 $as_echo "$libgfor_cv_have_as_needed" >&6; } + touch conftest1.$ac_objext conftest2.$ac_objext + LQUADMATH=-lquadmath + $FC -static-libgfortran -### -o conftest \ + conftest1.$ac_objext -lgfortran conftest2.$ac_objext 2>&1 >/dev/null \ + | grep "conftest1.$ac_objext.*conftest2.$ac_objext" > conftest.cmd + if grep "conftest1.$ac_objext.* -Bstatic -lgfortran -Bdynamic .*conftest2.$ac_objext" \ + conftest.cmd >/dev/null 2>&1; then + LQUADMATH="%{static-libquadmath:-Bstatic} -lquadmath %{static-libquadmath:-Bdynamic}" + elif grep "conftest1.$ac_objext.* -bstatic -lgfortran -bdynamic .*conftest2.$ac_objext" \ + conftest.cmd >/dev/null 2>&1; then + LQUADMATH="%{static-libquadmath:-bstatic} -lquadmath %{static-libquadmath:-bdynamic}" + elif grep "conftest1.$ac_objext.* -aarchive_shared -lgfortran -adefault .*conftest2.$ac_objext" \ + conftest.cmd >/dev/null 2>&1; then + LQUADMATH="%{static-libquadmath:-aarchive_shared} -lquadmath %{static-libquadmath:-adefault}" + elif grep "conftest1.$ac_objext.*libgfortran.a .*conftest2.$ac_objext" \ + conftest.cmd >/dev/null 2>&1; then + LQUADMATH="%{static-libquadmath:libquadmath.a%s;:-lquadmath}" + fi + rm -f conftest1.$ac_objext conftest2.$ac_objext conftest conftest.cmd + if test "x$libgfor_cv_have_as_needed" = xyes; then if test "x$USE_IEC_60559" = xyes; then - LIBQUADSPEC="$libgfor_cv_as_needed_option -lquadmath $libgfor_cv_no_as_needed_option" + LIBQUADSPEC="$libgfor_cv_as_needed_option $LQUADMATH $libgfor_cv_no_as_needed_option" else - LIBQUADSPEC="%{static-libgfortran:$libgfor_cv_as_needed_option} -lquadmath %{static-libgfortran:$libgfor_cv_no_as_needed_option}" + LIBQUADSPEC="%{static-libgfortran:$libgfor_cv_as_needed_option} $LQUADMATH %{static-libgfortran:$libgfor_cv_no_as_needed_option}" fi else - LIBQUADSPEC="-lquadmath" + LIBQUADSPEC="$LQUADMATH" fi if test "x$USE_IEC_60559" != xyes; then if test -f ../libquadmath/libquadmath.la; then diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 0de22b1..cc7b4dc 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,13 @@ +2022-08-17 Tobias Burnus <tobias@codesourcery.com> + + PR middle-end/106548 + * testsuite/libgomp.c/linear-2.c: New test. + +2022-08-17 Tobias Burnus <tobias@codesourcery.com> + + * splay-tree.h: Fix splay_* macro unsetting if + splay_tree_prefix is defined. + 2022-07-29 Tobias Burnus <tobias@codesourcery.com> * testsuite/libgomp.c-c++-common/pr106449-2.c: New test. diff --git a/libgomp/splay-tree.h b/libgomp/splay-tree.h index 8d66dfb..992381c 100644 --- a/libgomp/splay-tree.h +++ b/libgomp/splay-tree.h @@ -107,24 +107,24 @@ extern void splay_tree_foreach (splay_tree, splay_tree_callback, void *); #else /* splay_tree_c */ # ifdef splay_tree_prefix # include "splay-tree.c" -# undef splay_tree_name_1 -# undef splay_tree_name -# undef splay_tree_node_s -# undef splay_tree_s -# undef splay_tree_key_s -# undef splay_tree_node -# undef splay_tree -# undef splay_tree_key -# undef splay_compare -# undef splay_tree_lookup -# undef splay_tree_insert -# undef splay_tree_remove -# undef splay_tree_foreach -# undef splay_tree_callback -# undef splay_tree_c # endif +# undef splay_tree_c #endif /* #ifndef splay_tree_c */ #ifdef splay_tree_prefix +# undef splay_tree_name_1 +# undef splay_tree_name +# undef splay_tree_node_s +# undef splay_tree_s +# undef splay_tree_key_s +# undef splay_tree_node +# undef splay_tree +# undef splay_tree_key +# undef splay_compare +# undef splay_tree_lookup +# undef splay_tree_insert +# undef splay_tree_remove +# undef splay_tree_foreach +# undef splay_tree_callback # undef splay_tree_prefix #endif diff --git a/libgomp/testsuite/libgomp.c/linear-2.c b/libgomp/testsuite/libgomp.c/linear-2.c new file mode 100644 index 0000000..fd549a8 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/linear-2.c @@ -0,0 +1,254 @@ +/* PR middle-end/106548. */ +/* { dg-additional-options "-msse2" { target sse2_runtime } } */ +/* { dg-additional-options "-mavx" { target avx_runtime } } */ + +int a[256]; + +__attribute__((noinline, noclone)) int +f1 (int i) +{ + #pragma omp parallel for simd linear (i: 4) + for (int j = 16; j < 64; j++) + { + a[i] = j; + i += 4; + } + return i; +} + +__attribute__((noinline, noclone)) short int +f2 (short int i, char k) +{ + #pragma omp parallel for simd linear (i: k + 1) + for (long j = 16; j < 64; j++) + { + a[i] = j; + i += 4; + } + return i; +} + +__attribute__((noinline, noclone)) long long int +f3 (long long int i, long long int k) +{ + #pragma omp parallel for simd linear (i: k) + for (short j = 16; j < 64; j++) + { + a[i] = j; + i += 4; + } + return i; +} + +__attribute__((noinline, noclone)) int +f4 (int i) +{ + #pragma omp parallel for simd linear (i: 4) schedule(static, 3) + for (int j = 16; j < 64; j++) + { + a[i] = j; + i += 4; + } + return i; +} + +__attribute__((noinline, noclone)) short int +f5 (short int i, char k) +{ + #pragma omp parallel for simd linear (i: k + 1) schedule(static, 5) + for (long j = 16; j < 64; j++) + { + a[i] = j; + i += 4; + } + return i; +} + +__attribute__((noinline, noclone)) long long int +f6 (long long int i, long long int k) +{ + #pragma omp parallel for simd linear (i: k) schedule(static, 7) + for (short j = 16; j < 64; j++) + { + a[i] = j; + i += 4; + } + return i; +} + +__attribute__((noinline, noclone)) int +f7 (int i) +{ + #pragma omp parallel for simd linear (i: 4) schedule(dynamic, 3) + for (int j = 16; j < 64; j++) + { + a[i] = j; + i += 4; + } + return i; +} + +__attribute__((noinline, noclone)) short int +f8 (short int i, char k) +{ + #pragma omp parallel for simd linear (i: k + 1) schedule(dynamic, 5) + for (long j = 16; j < 64; j++) + { + a[i] = j; + i += 4; + } + return i; +} + +__attribute__((noinline, noclone)) long long int +f9 (long long int i, long long int k) +{ + #pragma omp parallel for simd linear (i: k) schedule(dynamic, 7) + for (short j = 16; j < 64; j++) + { + a[i] = j; + i += 4; + } + return i; +} + +__attribute__((noinline, noclone)) int +f10 (int i, long step) +{ + #pragma omp parallel for simd linear (i: 4) + for (int j = 16; j < 112; j += step) + { + a[i] = j / 2 + 8; + i += 4; + } + return i; +} + +__attribute__((noinline, noclone)) short int +f11 (short int i, char k, char step) +{ + #pragma omp parallel for simd linear (i: k + 1) + for (long j = 16; j < 112; j += step) + { + a[i] = j / 2 + 8; + i += 4; + } + return i; +} + +__attribute__((noinline, noclone)) long long int +f12 (long long int i, long long int k, int step) +{ + #pragma omp parallel for simd linear (i: k) + for (short j = 16; j < 112; j += step) + { + a[i] = j / 2 + 8; + i += 4; + } + return i; +} + +__attribute__((noinline, noclone)) int +f13 (int i, long long int step) +{ + #pragma omp parallel for simd linear (i: 4) schedule(static, 3) + for (int j = 16; j < 112; j += step) + { + a[i] = j / 2 + 8; + i += 4; + } + return i; +} + +__attribute__((noinline, noclone)) short int +f14 (short int i, char k, int step) +{ + #pragma omp parallel for simd linear (i: k + 1) schedule(static, 5) + for (long j = 16; j < 112; j += step) + { + a[i] = j / 2 + 8; + i += 4; + } + return i; +} + +__attribute__((noinline, noclone)) long long int +f15 (long long int i, long long int k, long int step) +{ + #pragma omp parallel for simd linear (i: k) schedule(static, 7) + for (short j = 16; j < 112; j += step) + { + a[i] = j / 2 + 8; + i += 4; + } + return i; +} + +__attribute__((noinline, noclone)) int +f16 (int i, long long int step) +{ + #pragma omp parallel for simd linear (i: 4) schedule(dynamic, 3) + for (int j = 16; j < 112; j += step) + { + a[i] = j / 2 + 8; + i += 4; + } + return i; +} + +__attribute__((noinline, noclone)) short int +f17 (short int i, char k, int step) +{ + #pragma omp parallel for simd linear (i: k + 1) schedule(dynamic, 5) + for (long j = 16; j < 112; j += step) + { + a[i] = j / 2 + 8; + i += 4; + } + return i; +} + +__attribute__((noinline, noclone)) long long int +f18 (long long int i, long long int k, long int step) +{ + #pragma omp parallel for simd linear (i: k) schedule(dynamic, 7) + for (short j = 16; j < 112; j += step) + { + a[i] = j / 2 + 8; + i += 4; + } + return i; +} + +int +main () +{ +#define TEST(x) \ + if (x != 8 + 48 * 4) \ + __builtin_abort (); \ + for (int i = 0; i < 256; i++) \ + if (a[i] != (((i & 3) == 0 && i >= 8 \ + && i < 8 + 48 * 4) \ + ? ((i - 8) / 4) + 16 : 0)) \ + __builtin_abort (); \ + __builtin_memset (a, 0, sizeof (a)) + TEST (f1 (8)); + TEST (f2 (8, 3)); + TEST (f3 (8LL, 4LL)); + TEST (f4 (8)); + TEST (f5 (8, 3)); + TEST (f6 (8LL, 4LL)); + TEST (f7 (8)); + TEST (f8 (8, 3)); + TEST (f9 (8LL, 4LL)); + TEST (f10 (8, 2)); + TEST (f11 (8, 3, 2)); + TEST (f12 (8LL, 4LL, 2)); + TEST (f13 (8, 2)); + TEST (f14 (8, 3, 2)); + TEST (f15 (8LL, 4LL, 2)); + TEST (f16 (8, 2)); + TEST (f17 (8, 3, 2)); + TEST (f18 (8LL, 4LL, 2)); + return 0; +} diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 4585e01..48cd1e8 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,7 @@ +2022-08-17 Keef Aragon <keef.aragon@konscious.net> + + * libsupc++/eh_alloc.cc (pool::free): Inverse comparison. + 2022-08-08 François Dumont <fdumont@gcc.gnu.org> * include/debug/formatter.h (__singular_value_init): New _Iterator_state enum entry. diff --git a/libstdc++-v3/libsupc++/eh_alloc.cc b/libstdc++-v3/libsupc++/eh_alloc.cc index c85b9ae..68f3198 100644 --- a/libstdc++-v3/libsupc++/eh_alloc.cc +++ b/libstdc++-v3/libsupc++/eh_alloc.cc @@ -224,8 +224,8 @@ namespace free_entry **fe; for (fe = &first_free_entry; (*fe)->next - && (reinterpret_cast <char *> ((*fe)->next) - > reinterpret_cast <char *> (e) + sz); + && (reinterpret_cast <char *> (e) + sz + > reinterpret_cast <char *> ((*fe)->next)); fe = &(*fe)->next) ; // If we can merge the next block into us do so and continue |