12.0.1-0.4

This commit is contained in:
Jakub Jelinek 2022-01-29 11:05:44 +01:00
parent 66ac9cc1b6
commit 398138b5f3
8 changed files with 295 additions and 140 deletions

1
.gitignore vendored
View File

@ -59,3 +59,4 @@
/gcc-12.0.0-20220115.tar.xz /gcc-12.0.0-20220115.tar.xz
/gcc-12.0.1-20220118.tar.xz /gcc-12.0.1-20220118.tar.xz
/gcc-12.0.1-20220125.tar.xz /gcc-12.0.1-20220125.tar.xz
/gcc-12.0.1-20220129.tar.xz

View File

@ -1,5 +1,5 @@
%global DATE 20220125 %global DATE 20220129
%global gitrev 03182470d2d2b272f06500184acab6b8ed78d8ad %global gitrev 8b49e9256e108bb3d436946b481cfa6bb11bd1c8
%global gcc_version 12.0.1 %global gcc_version 12.0.1
%global gcc_major 12 %global gcc_major 12
# Note, gcc_release must be integer, if you want to add suffixes to # Note, gcc_release must be integer, if you want to add suffixes to
@ -120,7 +120,7 @@
Summary: Various compilers (C, C++, Objective-C, ...) Summary: Various compilers (C, C++, Objective-C, ...)
Name: gcc Name: gcc
Version: %{gcc_version} Version: %{gcc_version}
Release: %{gcc_release}.3%{?dist} Release: %{gcc_release}.4%{?dist}
# libgcc, libgfortran, libgomp, libstdc++ and crtstuff have # libgcc, libgfortran, libgomp, libstdc++ and crtstuff have
# GCC Runtime Exception. # GCC Runtime Exception.
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
@ -270,9 +270,10 @@ Patch8: gcc12-no-add-needed.patch
Patch9: gcc12-Wno-format-security.patch Patch9: gcc12-Wno-format-security.patch
Patch10: gcc12-rh1574936.patch Patch10: gcc12-rh1574936.patch
Patch11: gcc12-d-shared-libphobos.patch Patch11: gcc12-d-shared-libphobos.patch
Patch12: gcc12-pr104194.patch Patch12: gcc12-pr103514-revert.patch
Patch13: gcc12-pr94193.patch Patch13: gcc12-pr95424-revert.patch
Patch14: gcc12-ifcvt-revert.patch Patch14: gcc12-ifcvt-revert.patch
Patch15: gcc12-pr104253.patch
Patch100: gcc12-fortran-fdec-duplicates.patch Patch100: gcc12-fortran-fdec-duplicates.patch
Patch101: gcc12-fortran-flogical-as-integer.patch Patch101: gcc12-fortran-flogical-as-integer.patch
@ -794,9 +795,10 @@ to NVidia PTX capable devices if available.
%patch10 -p0 -b .rh1574936~ %patch10 -p0 -b .rh1574936~
%endif %endif
%patch11 -p0 -b .d-shared-libphobos~ %patch11 -p0 -b .d-shared-libphobos~
%patch12 -p0 -b .pr104194~ %patch12 -p0 -b .pr103514-revert~
%patch13 -p0 -b .pr94193~ %patch13 -p0 -b .pr95424-revert~
%patch14 -p0 -b .ifcvt-revert~ %patch14 -p0 -b .ifcvt-revert~
%patch15 -p0 -b .pr104253~
%if 0%{?rhel} >= 9 %if 0%{?rhel} >= 9
%patch100 -p1 -b .fortran-fdec-duplicates~ %patch100 -p1 -b .fortran-fdec-duplicates~
@ -973,6 +975,7 @@ CONFIGURE_OPTS="\
%endif %endif
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions \ --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions \
--enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only \ --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only \
--enable-libstdcxx-backtrace \
%ifnarch %{mips} %ifnarch %{mips}
--with-linker-hash-style=gnu \ --with-linker-hash-style=gnu \
%endif %endif
@ -1530,6 +1533,7 @@ mv ../../../../%{_lib}/liblsan_preinit.o liblsan_preinit.o
fi fi
mv -f %{buildroot}%{_prefix}/%{_lib}/libstdc++.*a $FULLLPATH/ mv -f %{buildroot}%{_prefix}/%{_lib}/libstdc++.*a $FULLLPATH/
mv -f %{buildroot}%{_prefix}/%{_lib}/libstdc++fs.*a $FULLLPATH/ mv -f %{buildroot}%{_prefix}/%{_lib}/libstdc++fs.*a $FULLLPATH/
mv -f %{buildroot}%{_prefix}/%{_lib}/libstdc++_libbacktrace.*a $FULLLPATH/
mv -f %{buildroot}%{_prefix}/%{_lib}/libsupc++.*a $FULLLPATH/ mv -f %{buildroot}%{_prefix}/%{_lib}/libsupc++.*a $FULLLPATH/
mv -f %{buildroot}%{_prefix}/%{_lib}/libgfortran.*a $FULLLPATH/ mv -f %{buildroot}%{_prefix}/%{_lib}/libgfortran.*a $FULLLPATH/
%if %{build_objc} %if %{build_objc}
@ -1661,6 +1665,8 @@ ln -sf lib32/libstdc++.a libstdc++.a
ln -sf ../lib64/libstdc++.a 64/libstdc++.a ln -sf ../lib64/libstdc++.a 64/libstdc++.a
ln -sf lib32/libstdc++fs.a libstdc++fs.a ln -sf lib32/libstdc++fs.a libstdc++fs.a
ln -sf ../lib64/libstdc++fs.a 64/libstdc++fs.a ln -sf ../lib64/libstdc++fs.a 64/libstdc++fs.a
ln -sf lib32/libstdc++_libbacktrace.a libstdc++_libbacktrace.a
ln -sf ../lib64/libstdc++_libbacktrace.a 64/libstdc++_libbacktrace.a
ln -sf lib32/libsupc++.a libsupc++.a ln -sf lib32/libsupc++.a libsupc++.a
ln -sf ../lib64/libsupc++.a 64/libsupc++.a ln -sf ../lib64/libsupc++.a 64/libsupc++.a
%if %{build_libquadmath} %if %{build_libquadmath}
@ -1762,6 +1768,8 @@ ln -sf ../lib32/libstdc++.a 32/libstdc++.a
ln -sf lib64/libstdc++.a libstdc++.a ln -sf lib64/libstdc++.a libstdc++.a
ln -sf ../lib32/libstdc++fs.a 32/libstdc++fs.a ln -sf ../lib32/libstdc++fs.a 32/libstdc++fs.a
ln -sf lib64/libstdc++fs.a libstdc++fs.a ln -sf lib64/libstdc++fs.a libstdc++fs.a
ln -sf ../lib32/libstdc++_libbacktrace.a 32/libstdc++_libbacktrace.a
ln -sf lib64/libstdc++_libbacktrace.a libstdc++_libbacktrace.a
ln -sf ../lib32/libsupc++.a 32/libsupc++.a ln -sf ../lib32/libsupc++.a 32/libsupc++.a
ln -sf lib64/libsupc++.a libsupc++.a ln -sf lib64/libsupc++.a libsupc++.a
%if %{build_libquadmath} %if %{build_libquadmath}
@ -1809,6 +1817,7 @@ ln -sf lib64/adalib adalib
ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libgfortran.a 32/libgfortran.a ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libgfortran.a 32/libgfortran.a
ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libstdc++.a 32/libstdc++.a ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libstdc++.a 32/libstdc++.a
ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libstdc++fs.a 32/libstdc++fs.a ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libstdc++fs.a 32/libstdc++fs.a
ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libstdc++_libbacktrace.a 32/libstdc++_libbacktrace.a
ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libsupc++.a 32/libsupc++.a ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libsupc++.a 32/libsupc++.a
%if %{build_libquadmath} %if %{build_libquadmath}
ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libquadmath.a 32/libquadmath.a ln -sf ../../../%{multilib_32_arch}-%{_vendor}-%{_target_os}/%{gcc_major}/libquadmath.a 32/libquadmath.a
@ -1856,7 +1865,7 @@ for d in . $FULLLSUBDIR; do
-o -name libitm.a -o -name liblsan.a \ -o -name libitm.a -o -name liblsan.a \
-o -name libobjc.a -o -name libgdruntime.a -o -name libgphobos.a \ -o -name libobjc.a -o -name libgdruntime.a -o -name libgphobos.a \
-o -name libquadmath.a -o -name libstdc++.a \ -o -name libquadmath.a -o -name libstdc++.a \
-o -name libstdc++fs.a -o -name libsupc++.a \ -o -name libstdc++fs.a -o -name libstdc++_libbacktrace.a -o -name libsupc++.a \
-o -name libtsan.a -o -name libubsan.a \) -a -type f`; do -o -name libtsan.a -o -name libubsan.a \) -a -type f`; do
cp -a $f $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/$d/ cp -a $f $RPM_BUILD_ROOT%{_prefix}/lib/debug%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/$d/
done done
@ -2498,6 +2507,7 @@ end
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libstdc++.so %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libstdc++.so
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libstdc++.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libstdc++.a
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libstdc++fs.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libstdc++fs.a
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libstdc++_libbacktrace.a
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libsupc++.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/64/libsupc++.a
%endif %endif
%ifarch %{multilib_64_archs} %ifarch %{multilib_64_archs}
@ -2505,6 +2515,7 @@ end
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libstdc++.so %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libstdc++.so
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libstdc++.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libstdc++.a
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libstdc++fs.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libstdc++fs.a
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libstdc++_libbacktrace.a
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libsupc++.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/32/libsupc++.a
%endif %endif
%ifarch sparcv9 ppc %{multilib_64_archs} %ifarch sparcv9 ppc %{multilib_64_archs}
@ -2513,6 +2524,7 @@ end
%ifarch sparcv9 sparc64 ppc ppc64 ppc64p7 %ifarch sparcv9 sparc64 ppc ppc64 ppc64p7
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++.a
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++fs.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++fs.a
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++_libbacktrace.a
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libsupc++.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libsupc++.a
%endif %endif
%doc rpm.doc/changelogs/gcc/cp/ChangeLog* %doc rpm.doc/changelogs/gcc/cp/ChangeLog*
@ -2545,13 +2557,16 @@ end
%ifarch sparcv9 ppc %ifarch sparcv9 ppc
%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib32 %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib32
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib32/libstdc++fs.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib32/libstdc++fs.a
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib32/libstdc++_libbacktrace.a
%endif %endif
%ifarch sparc64 ppc64 ppc64p7 %ifarch sparc64 ppc64 ppc64p7
%dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib64 %dir %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib64
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib64/libstdc++fs.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib64/libstdc++fs.a
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/lib64/libstdc++_libbacktrace.a
%endif %endif
%ifnarch sparcv9 sparc64 ppc ppc64 ppc64p7 %ifnarch sparcv9 sparc64 ppc ppc64 ppc64p7
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++fs.a %{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++fs.a
%{_prefix}/lib/gcc/%{gcc_target_platform}/%{gcc_major}/libstdc++_libbacktrace.a
%endif %endif
%doc rpm.doc/changelogs/libstdc++-v3/ChangeLog* libstdc++-v3/README* %doc rpm.doc/changelogs/libstdc++-v3/ChangeLog* libstdc++-v3/README*
@ -3156,6 +3171,22 @@ end
%endif %endif
%changelog %changelog
* Sat Jan 29 2022 Jakub Jelinek <jakub@redhat.com> 12.0.1-0.4
- update from trunk
- PRs ada/104258, analyzer/104224, analyzer/104247, bootstrap/67102,
c++/51344, c++/59950, c++/82632, c++/92752, c++/92944, c++/99895,
c++/100030, c++/100198, c++/100282, c++/101532, c++/101988,
c++/103057, c++/103341, c++/103678, c++/104206, c++/104225,
c++/104226, c++/104235, c++/104245, fortran/84784, fortran/103790,
fortran/104128, fortran/104212, fortran/104227, libfortran/104233,
libstdc++/100516, libstdc++/104161, libstdc++/104217,
libstdc++/104259, lto/104237, middle-end/103642, target/103702,
target/104201, target/104213, target/104239, testsuite/70230,
tree-optimization/104196, tree-optimization/104203,
tree-optimization/104263, tree-optimization/104267, web/104254
- configure with --enable-libstdcxx-backtrace and package
libstdc++_libbacktrace.a
* Tue Jan 25 2022 Jakub Jelinek <jakub@redhat.com> 12.0.1-0.3 * Tue Jan 25 2022 Jakub Jelinek <jakub@redhat.com> 12.0.1-0.3
- update from trunk - update from trunk
- PRs ada/103538, analyzer/94362, analyzer/103685, analyzer/104062, - PRs ada/103538, analyzer/94362, analyzer/103685, analyzer/104062,

View File

@ -0,0 +1,27 @@
2022-01-28 Navid Rahimi <navidrahimi@microsoft.com>
gcc/
PR tree-optimization/103514
* match.pd (a & b) ^ (a == b) -> !(a | b): New optimization.
(a & b) == (a ^ b) -> !(a | b): New optimization.
gcc/testsuite
* gcc.dg/tree-ssa/pr103514.c: Testcase for this optimization.
--- gcc/match.pd
+++ gcc/match.pd
@@ -1784,14 +1784,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(negate (nop_convert? (bit_not @0)))
(plus (view_convert @0) { build_each_one_cst (type); }))
-/* (a & b) ^ (a == b) -> !(a | b) */
-/* (a & b) == (a ^ b) -> !(a | b) */
-(for first_op (bit_xor eq)
- second_op (eq bit_xor)
- (simplify
- (first_op:c (bit_and:c truth_valued_p@0 truth_valued_p@1) (second_op:c @0 @1))
- (bit_not (bit_ior @0 @1))))
-
/* Convert ~ (A - 1) or ~ (A + -1) to -A. */
(simplify
(bit_not (convert? (minus @0 integer_each_onep)))

View File

@ -1,92 +0,0 @@
2022-01-25 Jakub Jelinek <jakub@redhat.com>
PR debug/104194
* dwarf2out.cc (long_double_as_float128): New function.
(modified_type_die): For powerpc64le IEEE 754 quad long double
and complex long double emit those as DW_TAG_typedef to
_Float128 or complex _Float128 base type.
--- gcc/dwarf2out.cc.jj 2022-01-25 05:47:53.987454934 +0100
+++ gcc/dwarf2out.cc 2022-01-25 11:54:25.100522089 +0100
@@ -13568,6 +13568,47 @@ qualified_die_p (dw_die_ref die, int *ma
return type;
}
+/* If TYPE is long double or complex long double that
+ should be emitted as artificial typedef to _Float128 or
+ complex _Float128, return the type it should be emitted as.
+ This is done in case the target already supports 16-byte
+ composite floating point type (ibm_extended_format). */
+
+static tree
+long_double_as_float128 (tree type)
+{
+ if (type != long_double_type_node
+ && type != complex_long_double_type_node)
+ return NULL_TREE;
+
+ machine_mode mode, fmode;
+ if (TREE_CODE (type) == COMPLEX_TYPE)
+ mode = TYPE_MODE (TREE_TYPE (type));
+ else
+ mode = TYPE_MODE (type);
+ if (known_eq (GET_MODE_SIZE (mode), 16) && !MODE_COMPOSITE_P (mode))
+ FOR_EACH_MODE_IN_CLASS (fmode, MODE_FLOAT)
+ if (known_eq (GET_MODE_SIZE (fmode), 16)
+ && MODE_COMPOSITE_P (fmode))
+ {
+ if (type == long_double_type_node)
+ {
+ if (float128_type_node
+ && (TYPE_MODE (float128_type_node)
+ == TYPE_MODE (type)))
+ return float128_type_node;
+ return NULL_TREE;
+ }
+ for (int i = 0; i < NUM_FLOATN_NX_TYPES; i++)
+ if (COMPLEX_FLOATN_NX_TYPE_NODE (i) != NULL_TREE
+ && (TYPE_MODE (COMPLEX_FLOATN_NX_TYPE_NODE (i))
+ == TYPE_MODE (type)))
+ return COMPLEX_FLOATN_NX_TYPE_NODE (i);
+ }
+
+ return NULL_TREE;
+}
+
/* Given a pointer to an arbitrary ..._TYPE tree node, return a debugging
entry that chains the modifiers specified by CV_QUALS in front of the
given type. REVERSE is true if the type is to be interpreted in the
@@ -13848,7 +13889,32 @@ modified_type_die (tree type, int cv_qua
}
else if (is_base_type (type))
{
- mod_type_die = base_type_die (type, reverse);
+ /* If a target supports long double as different floating point
+ modes with the same 16-byte size, use normal DW_TAG_base_type
+ only for the composite (ibm_extended_real_format) type and
+ for the other for the time being emit instead a "_Float128"
+ or "complex _Float128" DW_TAG_base_type and a "long double"
+ or "complex long double" typedef to it. */
+ if (tree other_type = long_double_as_float128 (type))
+ {
+ dw_die_ref other_die;
+ if (TYPE_NAME (other_type))
+ other_die
+ = modified_type_die (other_type, TYPE_UNQUALIFIED, reverse,
+ context_die);
+ else
+ {
+ other_die = base_type_die (type, reverse);
+ add_child_die (comp_unit_die (), other_die);
+ add_name_attribute (other_die,
+ TREE_CODE (type) == COMPLEX_TYPE
+ ? "complex _Float128" : "_Float128");
+ }
+ mod_type_die = new_die_raw (DW_TAG_typedef);
+ add_AT_die_ref (mod_type_die, DW_AT_type, other_die);
+ }
+ else
+ mod_type_die = base_type_die (type, reverse);
/* The DIE with DW_AT_endianity is placed right after the naked DIE. */
if (reverse_base_type)

200
gcc12-pr104253.patch Normal file
View File

@ -0,0 +1,200 @@
If you are on a PowerPC system where the default long double is IEEE
128-bit, GCC will use the wrong names for some of the conversion functions
for the __ibm128 type.
What is happening is when the defult long double is IEEE 128-bit, the
various convert, truncation, and extend functions did not specify a
default name for the conversion. The machine indepentent portions of the
compiler would construct a call with an 'if' name (IFmode being the mode
for IBM 128-bit floating point). This patch specifies to use the
tradiational 'tf' name for these conversion functions.
2022-01-28 Michael Meissner <meissner@the-meissners.org>
gcc/
PR target/104253
* config/rs6000/rs6000.cc (init_float128_ibm): Use the TF names
for builtin conversions between __ibm128 and DImode when long
double uses the IEEE 128-bit format.
gcc/testsuite/
PR target/104253
* gcc.target/powerpc/pr104253.c: New test.
---
gcc/config/rs6000/rs6000.cc | 6 +
gcc/testsuite/gcc.target/powerpc/pr104253.c | 154 ++++++++++++++++++++
2 files changed, 160 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/powerpc/pr104253.c
--- gcc/config/rs6000/rs6000.cc
+++ gcc/config/rs6000/rs6000.cc
@@ -11113,6 +11113,12 @@ init_float128_ibm (machine_mode mode)
set_conv_libfunc (trunc_optab, DDmode, mode, "__dpd_trunctfdd");
set_conv_libfunc (sext_optab, TDmode, mode, "__dpd_extendtftd");
+ set_conv_libfunc (sfix_optab, DImode, mode, "__fixtfdi");
+ set_conv_libfunc (ufix_optab, DImode, mode, "__fixunstfdi");
+
+ set_conv_libfunc (sfloat_optab, mode, DImode, "__floatditf");
+ set_conv_libfunc (ufloat_optab, mode, DImode, "__floatunditf");
+
if (TARGET_POWERPC64)
{
set_conv_libfunc (sfix_optab, TImode, mode, "__fixtfti");
--- gcc/testsuite/gcc.target/powerpc/pr104253.c
+++ gcc/testsuite/gcc.target/powerpc/pr104253.c
@@ -0,0 +1,154 @@
+/*
+ * Require float128 support because __ibm128 currently is not enabled unless we
+ * also have __float128 support.
+ */
+
+/* { dg-do run } */
+/* { require-effective-target ppc_float128_sw } */
+/* { dg-options "-O2 -mvsx -mfloat128" } */
+
+/*
+ * PR target/104253
+ *
+ * Verify that the various conversions to and from __ibm128 work. When the
+ * default for long double is changed to IEEE 128-bit, originally GCC would
+ * call the functions using an 'if' name instead of 'tf.
+ */
+
+#include <stdlib.h>
+
+extern float ibm128_to_sf (__ibm128) __attribute__((noinline));
+extern double ibm128_to_df (__ibm128) __attribute__((noinline));
+extern int ibm128_to_si (__ibm128) __attribute__((noinline));
+extern long long ibm128_to_di (__ibm128) __attribute__((noinline));
+extern unsigned int ibm128_to_usi (__ibm128) __attribute__((noinline));
+extern unsigned long long ibm128_to_udi (__ibm128) __attribute__((noinline));
+
+extern __ibm128 sf_to_ibm128 (float) __attribute__((noinline));
+extern __ibm128 df_to_ibm128 (double) __attribute__((noinline));
+extern __ibm128 si_to_ibm128 (int) __attribute__((noinline));
+extern __ibm128 di_to_ibm128 (long long) __attribute__((noinline));
+extern __ibm128 usi_to_ibm128 (unsigned int) __attribute__((noinline));
+extern __ibm128 udi_to_ibm128 (unsigned long long) __attribute__((noinline));
+
+float
+ibm128_to_sf (__ibm128 x)
+{
+ return x;
+}
+
+double
+ibm128_to_df (__ibm128 x)
+{
+ return x;
+}
+
+int
+ibm128_to_si (__ibm128 x)
+{
+ return x;
+}
+
+long long
+ibm128_to_di (__ibm128 x)
+{
+ return x;
+}
+
+unsigned int
+ibm128_to_usi (__ibm128 x)
+{
+ return x;
+}
+
+unsigned long long
+ibm128_to_udi (__ibm128 x)
+{
+ return x;
+}
+
+__ibm128
+sf_to_ibm128 (float x)
+{
+ return x;
+}
+
+__ibm128
+df_to_ibm128 (double x)
+{
+ return x;
+}
+
+__ibm128
+si_to_ibm128 (int x)
+{
+ return x;
+}
+
+__ibm128
+di_to_ibm128 (long long x)
+{
+ return x;
+}
+
+__ibm128
+usi_to_ibm128 (unsigned int x)
+{
+ return x;
+}
+
+__ibm128
+udi_to_ibm128 (unsigned long long x)
+{
+ return x;
+}
+
+volatile float seven_sf = 7.0f;
+volatile double seven_df = 7.0;
+volatile int seven_si = 7;
+volatile long long seven_di = 7LL;
+volatile unsigned int seven_usi = 7U;
+volatile unsigned long long seven_udi = 7ULL;
+volatile __ibm128 seven_ibm128 = 7.0;
+
+int
+main (void)
+{
+ if (seven_ibm128 != sf_to_ibm128 (seven_sf))
+ abort ();
+
+ if (seven_ibm128 != df_to_ibm128 (seven_df))
+ abort ();
+
+ if (seven_ibm128 != si_to_ibm128 (seven_si))
+ abort ();
+
+ if (seven_ibm128 != di_to_ibm128 (seven_di))
+ abort ();
+
+ if (seven_ibm128 != usi_to_ibm128 (seven_usi))
+ abort ();
+
+ if (seven_ibm128 != udi_to_ibm128 (seven_udi))
+ abort ();
+
+ if (seven_sf != ibm128_to_sf (seven_ibm128))
+ abort ();
+
+ if (seven_df != ibm128_to_df (seven_ibm128))
+ abort ();
+
+ if (seven_si != ibm128_to_si (seven_ibm128))
+ abort ();
+
+ if (seven_di != ibm128_to_di (seven_ibm128))
+ abort ();
+
+ if (seven_usi != ibm128_to_usi (seven_ibm128))
+ abort ();
+
+ if (seven_udi != ibm128_to_udi (seven_ibm128))
+ abort ();
+
+ return 0;
+}

View File

@ -1,39 +0,0 @@
2022-01-25 Jakub Jelinek <jakub@redhat.com>
PR target/94193
* config/rs6000/rs6000.md (feclearexceptsi, feraiseexceptsi):
Use general_operand instead of const_int_operand, drop constraint
and FAIL if operands[1] is not CONST_INT_P.
--- gcc/config/rs6000/rs6000.md.jj 2022-01-25 05:48:01.497340303 +0100
+++ gcc/config/rs6000/rs6000.md 2022-01-25 13:48:13.752709482 +0100
@@ -6959,12 +6959,12 @@ (define_expand "fegetroundsi"
;; Because of these restrictions, this only expands on the desired
;; cases and fallback to a call to libc on any other case.
(define_expand "feclearexceptsi"
- [(use (match_operand:SI 1 "const_int_operand" "n"))
+ [(use (match_operand:SI 1 "general_operand"))
(set (match_operand:SI 0 "gpc_reg_operand")
(const_int 0))]
"TARGET_HARD_FLOAT"
{
- if (!OPTION_GLIBC)
+ if (!OPTION_GLIBC || !CONST_INT_P (operands[1]))
FAIL;
unsigned int fe = INTVAL (operands[1]);
@@ -6999,12 +6999,12 @@ (define_expand "feclearexceptsi"
;; Because of these restrictions, this only expands on the desired
;; cases and fallback to a call to libc on any other case.
(define_expand "feraiseexceptsi"
- [(use (match_operand:SI 1 "const_int_operand" "n"))
+ [(use (match_operand:SI 1 "general_operand"))
(set (match_operand:SI 0 "gpc_reg_operand")
(const_int 0))]
"TARGET_HARD_FLOAT"
{
- if (!OPTION_GLIBC)
+ if (!OPTION_GLIBC || !CONST_INT_P (operands[1]))
FAIL;
unsigned int fe = INTVAL (operands[1]);

View File

@ -0,0 +1,27 @@
2022-01-28 Zhao Wei Liew <zhaoweiliew@gmail.com>
PR tree-optimization/95424
* match.pd: Simplify 1 / X where X is an integer.
--- gcc/match.pd
+++ gcc/match.pd
@@ -435,19 +435,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
&& TYPE_UNSIGNED (type))
(trunc_divmod @0 @1))))
- /* 1 / X -> X == 1 for unsigned integer X.
- 1 / X -> X >= -1 && X <= 1 ? X : 0 for signed integer X.
- But not for 1 / 0 so that we can get proper warnings and errors,
- and not for 1-bit integers as they are edge cases better handled elsewhere. */
-(simplify
- (trunc_div integer_onep@0 @1)
- (if (INTEGRAL_TYPE_P (type) && !integer_zerop (@1) && TYPE_PRECISION (type) > 1)
- (if (TYPE_UNSIGNED (type))
- (eq @1 { build_one_cst (type); })
- (with { tree utype = unsigned_type_for (type); }
- (cond (le (plus (convert:utype @1) { build_one_cst (utype); }) { build_int_cst (utype, 2); })
- @1 { build_zero_cst (type); })))))
-
/* Combine two successive divisions. Note that combining ceil_div
and floor_div is trickier and combining round_div even more so. */
(for div (trunc_div exact_div)

View File

@ -1,4 +1,4 @@
SHA512 (gcc-12.0.1-20220125.tar.xz) = 09c4b7d7fe3e8a2c0f4181da717e476c0868b2bb1c86cdd22482ee4235aebb9eb0c89b5f87b9a0e6852e0cc2876b652c60457996a86dc6e9b9b02ca2ff87613f SHA512 (gcc-12.0.1-20220129.tar.xz) = 119e7c7a4cf54c17e5b9195c4933c738c9689bf1af33b13a97a277077f78910cd4e1b76fa1ef83572d9bbb964e4c352f79de53f636a4c6505c946f3cfb0fc1f7
SHA512 (isl-0.18.tar.bz2) = 85d0b40f4dbf14cb99d17aa07048cdcab2dc3eb527d2fbb1e84c41b2de5f351025370e57448b63b2b8a8cf8a0843a089c3263f9baee1542d5c2e1cb37ed39d94 SHA512 (isl-0.18.tar.bz2) = 85d0b40f4dbf14cb99d17aa07048cdcab2dc3eb527d2fbb1e84c41b2de5f351025370e57448b63b2b8a8cf8a0843a089c3263f9baee1542d5c2e1cb37ed39d94
SHA512 (newlib-cygwin-50e2a63b04bdd018484605fbb954fd1bd5147fa0.tar.xz) = 002a48a7b689a81abbf16161bcaec001a842e67dfbe372e9e109092703bfc666675f16198f60ca429370e8850d564547dc505df81bc3aaca4ce6defbc014ad6c SHA512 (newlib-cygwin-50e2a63b04bdd018484605fbb954fd1bd5147fa0.tar.xz) = 002a48a7b689a81abbf16161bcaec001a842e67dfbe372e9e109092703bfc666675f16198f60ca429370e8850d564547dc505df81bc3aaca4ce6defbc014ad6c
SHA512 (nvptx-tools-5f6f343a302d620b0868edab376c00b15741e39e.tar.xz) = f6d10db94fa1570ae0f94df073fa3c73c8e5ee16d59070b53d94f7db0de8a031bc44d7f3f1852533da04b625ce758e022263855ed43cfc6867e0708d001e53c7 SHA512 (nvptx-tools-5f6f343a302d620b0868edab376c00b15741e39e.tar.xz) = f6d10db94fa1570ae0f94df073fa3c73c8e5ee16d59070b53d94f7db0de8a031bc44d7f3f1852533da04b625ce758e022263855ed43cfc6867e0708d001e53c7