mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-18 22:54:00 +00:00
core/gcc to 5.1.0-4
This commit is contained in:
parent
15a46690ad
commit
c686bc8655
5 changed files with 157 additions and 116 deletions
|
@ -15,12 +15,11 @@
|
||||||
noautobuild=1
|
noautobuild=1
|
||||||
|
|
||||||
pkgname=('gcc' 'gcc-libs' 'gcc-fortran' 'gcc-objc' 'gcc-go')
|
pkgname=('gcc' 'gcc-libs' 'gcc-fortran' 'gcc-objc' 'gcc-go')
|
||||||
pkgver=4.9.2
|
pkgver=5.1.0
|
||||||
_pkgver=4.9
|
_pkgver=5
|
||||||
_islver=0.12.2
|
_islver=0.14.1
|
||||||
_cloogver=0.18.1
|
|
||||||
pkgrel=4
|
pkgrel=4
|
||||||
_snapshot=4.9-20150304
|
_snapshot=5-20150519
|
||||||
pkgdesc="The GNU Compiler Collection"
|
pkgdesc="The GNU Compiler Collection"
|
||||||
arch=('i686' 'x86_64')
|
arch=('i686' 'x86_64')
|
||||||
license=('GPL' 'LGPL' 'FDL' 'custom')
|
license=('GPL' 'LGPL' 'FDL' 'custom')
|
||||||
|
@ -31,11 +30,13 @@ options=('!emptydirs' '!distcc')
|
||||||
source=(#ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2
|
source=(#ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2
|
||||||
ftp://gcc.gnu.org/pub/gcc/snapshots/${_snapshot}/gcc-${_snapshot}.tar.bz2
|
ftp://gcc.gnu.org/pub/gcc/snapshots/${_snapshot}/gcc-${_snapshot}.tar.bz2
|
||||||
http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2
|
http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2
|
||||||
http://www.bastoul.net/cloog/pages/download/cloog-${_cloogver}.tar.gz
|
pr65882.patch
|
||||||
|
pr66035.patch
|
||||||
0001-ARMv5-disable-LDRD-STRD.patch)
|
0001-ARMv5-disable-LDRD-STRD.patch)
|
||||||
md5sums=('863bb9d2a9551c9b7447cfc8b7cc7498'
|
md5sums=('8acc1b53380be0dd56e67990ba1fc06e'
|
||||||
'e039bfcfb6c2ab039b8ee69bf883e824'
|
'118d1a379abf7606a3334c98a8411c79'
|
||||||
'e34fca0540d840e5d0f6427e98c92252'
|
'9a9cc98e916fd37c7b3dad50f29d2f48'
|
||||||
|
'5b980076cd5fcbc3aff6014f306282dd'
|
||||||
'924a9bcdd7852410667f04ce18c305d7')
|
'924a9bcdd7852410667f04ce18c305d7')
|
||||||
|
|
||||||
if [ -n "${_snapshot}" ]; then
|
if [ -n "${_snapshot}" ]; then
|
||||||
|
@ -49,9 +50,8 @@ _libdir="usr/lib/gcc/$CHOST/$pkgver"
|
||||||
prepare() {
|
prepare() {
|
||||||
cd ${srcdir}/${_basedir}
|
cd ${srcdir}/${_basedir}
|
||||||
|
|
||||||
# link isl/cloog for in-tree builds
|
# link isl for in-tree build
|
||||||
ln -s ../isl-${_islver} isl
|
ln -s ../isl-${_islver} isl
|
||||||
ln -s ../cloog-${_cloogver} cloog
|
|
||||||
|
|
||||||
# Do not run fixincludes
|
# Do not run fixincludes
|
||||||
sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
|
sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
|
||||||
|
@ -61,6 +61,12 @@ prepare() {
|
||||||
# hack! - some configure tests for header files using "$CPP $CPPFLAGS"
|
# hack! - some configure tests for header files using "$CPP $CPPFLAGS"
|
||||||
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure
|
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure
|
||||||
|
|
||||||
|
# https://gcc.gnu.org/ml/gcc-patches/2015-04/msg01558.html
|
||||||
|
patch -p1 -i ${srcdir}/pr65882.patch
|
||||||
|
|
||||||
|
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66035
|
||||||
|
patch -p1 -i ${srcdir}/pr66035.patch
|
||||||
|
|
||||||
# ALARM: Specify build host types, triplet patch
|
# ALARM: Specify build host types, triplet patch
|
||||||
[[ $CARCH == "arm" ]] && CONFIGFLAG="--host=armv5tel-unknown-linux-gnueabi --build=armv5tel-unknown-linux-gnueabi --with-arch=armv5te --with-float=soft"
|
[[ $CARCH == "arm" ]] && CONFIGFLAG="--host=armv5tel-unknown-linux-gnueabi --build=armv5tel-unknown-linux-gnueabi --with-arch=armv5te --with-float=soft"
|
||||||
[[ $CARCH == "armv6h" ]] && CONFIGFLAG="--host=armv6l-unknown-linux-gnueabihf --build=armv6l-unknown-linux-gnueabihf --with-arch=armv6 --with-float=hard --with-fpu=vfp"
|
[[ $CARCH == "armv6h" ]] && CONFIGFLAG="--host=armv6l-unknown-linux-gnueabihf --build=armv6l-unknown-linux-gnueabihf --with-arch=armv6 --with-float=hard --with-fpu=vfp"
|
||||||
|
@ -85,21 +91,17 @@ build() {
|
||||||
--mandir=/usr/share/man --infodir=/usr/share/info \
|
--mandir=/usr/share/man --infodir=/usr/share/info \
|
||||||
--with-bugurl=https://github.com/archlinuxarm/PKGBUILDs/issues \
|
--with-bugurl=https://github.com/archlinuxarm/PKGBUILDs/issues \
|
||||||
--enable-languages=c,c++,fortran,go,lto,objc,obj-c++ \
|
--enable-languages=c,c++,fortran,go,lto,objc,obj-c++ \
|
||||||
--enable-shared --enable-threads=posix \
|
--enable-shared --enable-threads=posix --enable-libmpx \
|
||||||
--with-system-zlib --enable-__cxa_atexit \
|
--with-system-zlib --with-isl --enable-__cxa_atexit \
|
||||||
--disable-libunwind-exceptions --enable-clocale=gnu \
|
--disable-libunwind-exceptions --enable-clocale=gnu \
|
||||||
--disable-libstdcxx-pch --disable-libssp \
|
--disable-libstdcxx-pch --disable-libssp \
|
||||||
--enable-gnu-unique-object --enable-linker-build-id \
|
--enable-gnu-unique-object --enable-linker-build-id \
|
||||||
--enable-cloog-backend=isl \
|
|
||||||
--enable-lto --enable-plugin --enable-install-libiberty \
|
--enable-lto --enable-plugin --enable-install-libiberty \
|
||||||
--with-linker-hash-style=gnu \
|
--with-linker-hash-style=gnu --enable-gnu-indirect-function \
|
||||||
--disable-multilib --disable-werror \
|
--disable-multilib --disable-werror \
|
||||||
--enable-checking=release $CONFIGFLAG
|
--enable-checking=release \
|
||||||
|
--with-default-libstdcxx-abi=c++98 \
|
||||||
# gcc-5.0 changes
|
$CONFIGFLAG
|
||||||
# --with-default-libstdcxx-abi=c++98 - before gcc-5.0 c++ rebuild
|
|
||||||
# --enable-gnu-indirect-function
|
|
||||||
# --with-isl - cloog no longer needed
|
|
||||||
|
|
||||||
make
|
make
|
||||||
|
|
||||||
|
@ -112,18 +114,18 @@ check() {
|
||||||
|
|
||||||
# increase stack size to prevent test failures
|
# increase stack size to prevent test failures
|
||||||
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31827
|
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31827
|
||||||
#ulimit -s 32768
|
ulimit -s 32768
|
||||||
|
|
||||||
# do not abort on error as some are "expected"
|
# do not abort on error as some are "expected"
|
||||||
#make -k check || true
|
make -k check || true
|
||||||
#${srcdir}/${_basedir}/contrib/test_summary
|
${srcdir}/${_basedir}/contrib/test_summary
|
||||||
}
|
}
|
||||||
|
|
||||||
package_gcc-libs()
|
package_gcc-libs()
|
||||||
{
|
{
|
||||||
pkgdesc="Runtime libraries shipped by GCC"
|
pkgdesc="Runtime libraries shipped by GCC"
|
||||||
groups=('base')
|
groups=('base')
|
||||||
depends=('glibc>=2.20')
|
depends=('glibc>=2.21')
|
||||||
options=('!emptydirs' '!strip')
|
options=('!emptydirs' '!strip')
|
||||||
install=gcc-libs.install
|
install=gcc-libs.install
|
||||||
|
|
||||||
|
@ -145,6 +147,9 @@ package_gcc-libs()
|
||||||
|
|
||||||
make -C $CHOST/libstdc++-v3/po DESTDIR=${pkgdir} install
|
make -C $CHOST/libstdc++-v3/po DESTDIR=${pkgdir} install
|
||||||
|
|
||||||
|
make -C $CHOST/libmpx DESTDIR=${pkgdir} install
|
||||||
|
rm ${pkgdir}/usr/lib/libmpx.spec
|
||||||
|
|
||||||
for lib in libgomp \
|
for lib in libgomp \
|
||||||
libitm \
|
libitm \
|
||||||
libquadmath; do
|
libquadmath; do
|
||||||
|
@ -159,7 +164,7 @@ package_gcc-libs()
|
||||||
package_gcc()
|
package_gcc()
|
||||||
{
|
{
|
||||||
pkgdesc="The GNU Compiler Collection - C and C++ frontends"
|
pkgdesc="The GNU Compiler Collection - C and C++ frontends"
|
||||||
depends=("gcc-libs=$pkgver-$pkgrel" 'binutils>=2.24' 'libmpc')
|
depends=("gcc-libs=$pkgver-$pkgrel" 'binutils>=2.25' 'libmpc')
|
||||||
groups=('base-devel')
|
groups=('base-devel')
|
||||||
options=('staticlibs')
|
options=('staticlibs')
|
||||||
install=gcc.install
|
install=gcc.install
|
||||||
|
@ -169,7 +174,7 @@ package_gcc()
|
||||||
make -C gcc DESTDIR=${pkgdir} install-driver install-cpp install-gcc-ar \
|
make -C gcc DESTDIR=${pkgdir} install-driver install-cpp install-gcc-ar \
|
||||||
c++.install-common install-headers install-plugin install-lto-wrapper
|
c++.install-common install-headers install-plugin install-lto-wrapper
|
||||||
|
|
||||||
install -m755 gcc/gcov $pkgdir/usr/bin/
|
install -m755 -t $pkgdir/usr/bin/ gcc/gcov{,-tool}
|
||||||
install -m755 -t $pkgdir/${_libdir}/ gcc/{cc1,cc1plus,collect2,lto1}
|
install -m755 -t $pkgdir/${_libdir}/ gcc/{cc1,cc1plus,collect2,lto1}
|
||||||
|
|
||||||
make -C $CHOST/libgcc DESTDIR=${pkgdir} install
|
make -C $CHOST/libgcc DESTDIR=${pkgdir} install
|
||||||
|
@ -180,6 +185,7 @@ package_gcc()
|
||||||
make -C $CHOST/libstdc++-v3/libsupc++ DESTDIR=${pkgdir} install
|
make -C $CHOST/libstdc++-v3/libsupc++ DESTDIR=${pkgdir} install
|
||||||
make -C $CHOST/libstdc++-v3/python DESTDIR=${pkgdir} install
|
make -C $CHOST/libstdc++-v3/python DESTDIR=${pkgdir} install
|
||||||
|
|
||||||
|
make DESTDIR=${pkgdir} install-libcc1
|
||||||
install -d $pkgdir/usr/share/gdb/auto-load/usr/lib
|
install -d $pkgdir/usr/share/gdb/auto-load/usr/lib
|
||||||
mv $pkgdir/usr/lib/libstdc++.so.6.*-gdb.py \
|
mv $pkgdir/usr/lib/libstdc++.so.6.*-gdb.py \
|
||||||
$pkgdir/usr/share/gdb/auto-load/usr/lib/
|
$pkgdir/usr/share/gdb/auto-load/usr/lib/
|
||||||
|
@ -187,12 +193,17 @@ package_gcc()
|
||||||
|
|
||||||
make DESTDIR=${pkgdir} install-fixincludes
|
make DESTDIR=${pkgdir} install-fixincludes
|
||||||
make -C gcc DESTDIR=${pkgdir} install-mkheaders
|
make -C gcc DESTDIR=${pkgdir} install-mkheaders
|
||||||
|
|
||||||
make -C lto-plugin DESTDIR=${pkgdir} install
|
make -C lto-plugin DESTDIR=${pkgdir} install
|
||||||
|
install -dm755 ${pkgdir}/usr/lib/bfd-plugins/
|
||||||
|
ln -s /usr/lib/gcc/$CHOST/${pkgver}/liblto_plugin.so \
|
||||||
|
${pkgdir}/usr/lib/bfd-plugins/
|
||||||
|
|
||||||
make -C $CHOST/libgomp DESTDIR=${pkgdir} install-nodist_toolexeclibHEADERS \
|
make -C $CHOST/libgomp DESTDIR=${pkgdir} install-nodist_toolexeclibHEADERS \
|
||||||
install-nodist_libsubincludeHEADERS
|
install-nodist_libsubincludeHEADERS
|
||||||
make -C $CHOST/libitm DESTDIR=${pkgdir} install-nodist_toolexeclibHEADERS
|
make -C $CHOST/libitm DESTDIR=${pkgdir} install-nodist_toolexeclibHEADERS
|
||||||
make -C $CHOST/libquadmath DESTDIR=${pkgdir} install-nodist_libsubincludeHEADERS
|
make -C $CHOST/libquadmath DESTDIR=${pkgdir} install-nodist_libsubincludeHEADERS
|
||||||
|
make -C $CHOST/libmpx DESTDIR=${pkgdir} install-nodist_toolexeclibHEADERS
|
||||||
|
|
||||||
make -C libiberty DESTDIR=${pkgdir} install
|
make -C libiberty DESTDIR=${pkgdir} install
|
||||||
# install PIC version of libiberty
|
# install PIC version of libiberty
|
||||||
|
@ -253,7 +264,8 @@ package_gcc-fortran()
|
||||||
install=gcc-fortran.install
|
install=gcc-fortran.install
|
||||||
|
|
||||||
cd ${srcdir}/gcc-build
|
cd ${srcdir}/gcc-build
|
||||||
make -C $CHOST/libgfortran DESTDIR=$pkgdir install-{{caf,my}execlibLTLIBRARIES,toolexeclibDATA}
|
make -C $CHOST/libgfortran DESTDIR=$pkgdir install-{caf,my}execlibLTLIBRARIES \
|
||||||
|
install-{toolexeclibDATA,nodist_fincludeHEADERS}
|
||||||
make -C $CHOST/libgomp DESTDIR=$pkgdir install-nodist_fincludeHEADERS
|
make -C $CHOST/libgomp DESTDIR=$pkgdir install-nodist_fincludeHEADERS
|
||||||
make -C gcc DESTDIR=$pkgdir fortran.install-{common,man,info}
|
make -C gcc DESTDIR=$pkgdir fortran.install-{common,man,info}
|
||||||
install -Dm755 gcc/f951 $pkgdir/${_libdir}/f951
|
install -Dm755 gcc/f951 $pkgdir/${_libdir}/f951
|
||||||
|
@ -284,6 +296,7 @@ package_gcc-go()
|
||||||
{
|
{
|
||||||
pkgdesc="Go front-end for GCC"
|
pkgdesc="Go front-end for GCC"
|
||||||
depends=("gcc=$pkgver-$pkgrel")
|
depends=("gcc=$pkgver-$pkgrel")
|
||||||
|
conflicts=('go')
|
||||||
options=('!emptydirs')
|
options=('!emptydirs')
|
||||||
install=gcc-go.install
|
install=gcc-go.install
|
||||||
|
|
||||||
|
@ -292,6 +305,8 @@ package_gcc-go()
|
||||||
make -C gcc DESTDIR=$pkgdir go.install-{common,man,info}
|
make -C gcc DESTDIR=$pkgdir go.install-{common,man,info}
|
||||||
install -Dm755 gcc/go1 $pkgdir/${_libdir}/go1
|
install -Dm755 gcc/go1 $pkgdir/${_libdir}/go1
|
||||||
|
|
||||||
|
make DESTDIR=${pkgdir} install-gotools
|
||||||
|
|
||||||
# Install Runtime Library Exception
|
# Install Runtime Library Exception
|
||||||
install -d ${pkgdir}/usr/share/licenses/gcc-go/
|
install -d ${pkgdir}/usr/share/licenses/gcc-go/
|
||||||
ln -s ../gcc-libs/RUNTIME.LIBRARY.EXCEPTION ${pkgdir}/usr/share/licenses/gcc-go/
|
ln -s ../gcc-libs/RUNTIME.LIBRARY.EXCEPTION ${pkgdir}/usr/share/licenses/gcc-go/
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
|
|
||||||
index 968b703..3f8e6e6 100644
|
|
||||||
--- a/gcc/c-family/c-opts.c
|
|
||||||
+++ b/gcc/c-family/c-opts.c
|
|
||||||
@@ -1438,6 +1438,12 @@ c_finish_options (void)
|
|
||||||
static void
|
|
||||||
push_command_line_include (void)
|
|
||||||
{
|
|
||||||
+ /* This can happen if disabled by -imacros for example.
|
|
||||||
+ Punt so that we don't set "<command-line>" as the filename for
|
|
||||||
+ the header. */
|
|
||||||
+ if (include_cursor > deferred_count)
|
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
if (!done_preinclude)
|
|
||||||
{
|
|
||||||
done_preinclude = true;
|
|
|
@ -1,71 +0,0 @@
|
||||||
diff -Naur gcc-4.9-20140604-old/gcc/graphite-clast-to-gimple.c gcc-4.9-20140604/gcc/graphite-clast-to-gimple.c
|
|
||||||
--- gcc-4.9-20140604-old/gcc/graphite-clast-to-gimple.c 2014-03-03 21:39:22.000000000 +1000
|
|
||||||
+++ gcc-4.9-20140604/gcc/graphite-clast-to-gimple.c 2014-06-25 15:07:57.958697105 +1000
|
|
||||||
@@ -28,6 +28,8 @@
|
|
||||||
#include <isl/constraint.h>
|
|
||||||
#include <isl/ilp.h>
|
|
||||||
#include <isl/aff.h>
|
|
||||||
+#include <isl/deprecated/int.h>
|
|
||||||
+#include <isl/deprecated/ilp_int.h>
|
|
||||||
#include <cloog/cloog.h>
|
|
||||||
#include <cloog/isl/domain.h>
|
|
||||||
#endif
|
|
||||||
diff -Naur gcc-4.9-20140604-old/gcc/graphite-interchange.c gcc-4.9-20140604/gcc/graphite-interchange.c
|
|
||||||
--- gcc-4.9-20140604-old/gcc/graphite-interchange.c 2014-01-03 08:23:26.000000000 +1000
|
|
||||||
+++ gcc-4.9-20140604/gcc/graphite-interchange.c 2014-06-25 15:10:06.882899243 +1000
|
|
||||||
@@ -29,6 +29,9 @@
|
|
||||||
#include <isl/map.h>
|
|
||||||
#include <isl/union_map.h>
|
|
||||||
#include <isl/ilp.h>
|
|
||||||
+#include <isl/deprecated/int.h>
|
|
||||||
+#include <isl/deprecated/ilp_int.h>
|
|
||||||
+#include <isl/deprecated/constraint_int.h>
|
|
||||||
#include <cloog/cloog.h>
|
|
||||||
#include <cloog/isl/domain.h>
|
|
||||||
#endif
|
|
||||||
diff -Naur gcc-4.9-20140604-old/gcc/graphite-optimize-isl.c gcc-4.9-20140604/gcc/graphite-optimize-isl.c
|
|
||||||
--- gcc-4.9-20140604-old/gcc/graphite-optimize-isl.c 2014-01-03 08:23:26.000000000 +1000
|
|
||||||
+++ gcc-4.9-20140604/gcc/graphite-optimize-isl.c 2014-06-25 15:16:57.038386166 +1000
|
|
||||||
@@ -28,6 +28,8 @@
|
|
||||||
#include <isl/band.h>
|
|
||||||
#include <isl/aff.h>
|
|
||||||
#include <isl/options.h>
|
|
||||||
+#include <isl/deprecated/int.h>
|
|
||||||
+#include <isl/deprecated/aff_int.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "system.h"
|
|
||||||
@@ -373,7 +375,7 @@
|
|
||||||
{
|
|
||||||
for (i = ScheduleDimensions - 1 ; i >= 0 ; i--)
|
|
||||||
{
|
|
||||||
- if (isl_band_member_is_zero_distance (Band, i))
|
|
||||||
+ if (isl_band_member_is_coincident (Band, i))
|
|
||||||
{
|
|
||||||
isl_map *TileMap;
|
|
||||||
isl_union_map *TileUMap;
|
|
||||||
diff -Naur gcc-4.9-20140604-old/gcc/graphite-poly.c gcc-4.9-20140604/gcc/graphite-poly.c
|
|
||||||
--- gcc-4.9-20140604-old/gcc/graphite-poly.c 2014-01-03 08:23:26.000000000 +1000
|
|
||||||
+++ gcc-4.9-20140604/gcc/graphite-poly.c 2014-06-25 15:18:01.207157796 +1000
|
|
||||||
@@ -28,6 +28,8 @@
|
|
||||||
#include <isl/constraint.h>
|
|
||||||
#include <isl/ilp.h>
|
|
||||||
#include <isl/aff.h>
|
|
||||||
+#include <isl/deprecated/int.h>
|
|
||||||
+#include <isl/deprecated/ilp_int.h>
|
|
||||||
#include <cloog/cloog.h>
|
|
||||||
#include <cloog/isl/domain.h>
|
|
||||||
#endif
|
|
||||||
diff -Naur gcc-4.9-20140604-old/gcc/graphite-sese-to-poly.c gcc-4.9-20140604/gcc/graphite-sese-to-poly.c
|
|
||||||
--- gcc-4.9-20140604-old/gcc/graphite-sese-to-poly.c 2014-04-08 20:59:40.000000000 +1000
|
|
||||||
+++ gcc-4.9-20140604/gcc/graphite-sese-to-poly.c 2014-06-25 15:19:46.575140398 +1000
|
|
||||||
@@ -26,6 +26,9 @@
|
|
||||||
#include <isl/union_map.h>
|
|
||||||
#include <isl/constraint.h>
|
|
||||||
#include <isl/aff.h>
|
|
||||||
+#include <isl/deprecated/int.h>
|
|
||||||
+#include <isl/deprecated/aff_int.h>
|
|
||||||
+#include <isl/deprecated/constraint_int.h>
|
|
||||||
#include <cloog/cloog.h>
|
|
||||||
#include <cloog/cloog.h>
|
|
||||||
#include <cloog/isl/domain.h>
|
|
66
core/gcc/pr65882.patch
Normal file
66
core/gcc/pr65882.patch
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
|
||||||
|
index 7bdf236..689d542 100644
|
||||||
|
--- a/gcc/cp/call.c
|
||||||
|
+++ b/gcc/cp/call.c
|
||||||
|
@@ -5677,8 +5677,9 @@ build_new_op_1 (location_t loc, enum tree_code code, int flags, tree arg1,
|
||||||
|
case TRUTH_ORIF_EXPR:
|
||||||
|
case TRUTH_AND_EXPR:
|
||||||
|
case TRUTH_OR_EXPR:
|
||||||
|
- warn_logical_operator (loc, code, boolean_type_node,
|
||||||
|
- code_orig_arg1, arg1, code_orig_arg2, arg2);
|
||||||
|
+ if (complain & tf_warning)
|
||||||
|
+ warn_logical_operator (loc, code, boolean_type_node,
|
||||||
|
+ code_orig_arg1, arg1, code_orig_arg2, arg2);
|
||||||
|
/* Fall through. */
|
||||||
|
case GT_EXPR:
|
||||||
|
case LT_EXPR:
|
||||||
|
@@ -5686,8 +5687,9 @@ build_new_op_1 (location_t loc, enum tree_code code, int flags, tree arg1,
|
||||||
|
case LE_EXPR:
|
||||||
|
case EQ_EXPR:
|
||||||
|
case NE_EXPR:
|
||||||
|
- if ((code_orig_arg1 == BOOLEAN_TYPE)
|
||||||
|
- ^ (code_orig_arg2 == BOOLEAN_TYPE))
|
||||||
|
+ if ((complain & tf_warning)
|
||||||
|
+ && ((code_orig_arg1 == BOOLEAN_TYPE)
|
||||||
|
+ ^ (code_orig_arg2 == BOOLEAN_TYPE)))
|
||||||
|
maybe_warn_bool_compare (loc, code, arg1, arg2);
|
||||||
|
/* Fall through. */
|
||||||
|
case PLUS_EXPR:
|
||||||
|
diff --git a/gcc/testsuite/g++.dg/diagnostic/inhibit-warn.C b/gcc/testsuite/g++.dg/diagnostic/inhibit-warn.C
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..5655eb4
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/gcc/testsuite/g++.dg/diagnostic/inhibit-warn.C
|
||||||
|
@@ -0,0 +1,32 @@
|
||||||
|
+// PR c++/65882
|
||||||
|
+// { dg-do compile { target c++11 } }
|
||||||
|
+// { dg-options "-Wbool-compare" }
|
||||||
|
+
|
||||||
|
+// Check that we don't ICE because of reentering error reporting routines while
|
||||||
|
+// evaluating template parameters
|
||||||
|
+
|
||||||
|
+template<typename>
|
||||||
|
+struct type_function {
|
||||||
|
+ static constexpr bool value = false;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+template<bool>
|
||||||
|
+struct dependent_type {
|
||||||
|
+ typedef int type;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+template<typename T>
|
||||||
|
+typename dependent_type<(5 > type_function<T>::value)>::type
|
||||||
|
+bar();
|
||||||
|
+
|
||||||
|
+template<typename T>
|
||||||
|
+typename dependent_type<(5 > type_function<T>::value)>::type
|
||||||
|
+foo()
|
||||||
|
+{
|
||||||
|
+ return bar<int>();
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int main()
|
||||||
|
+{
|
||||||
|
+ foo<int>();
|
||||||
|
+}
|
48
core/gcc/pr66035.patch
Normal file
48
core/gcc/pr66035.patch
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
--- a/gcc/fortran/trans-expr.c
|
||||||
|
+++ a/gcc/fortran/trans-expr.c
|
||||||
|
@@ -6897,6 +6897,30 @@ alloc_scalar_allocatable_for_subcomponent_assignment (stmtblock_t *block,
|
||||||
|
TREE_TYPE (tmp), tmp,
|
||||||
|
fold_convert (TREE_TYPE (tmp), size));
|
||||||
|
}
|
||||||
|
+ else if (cm->ts.type == BT_CLASS)
|
||||||
|
+ {
|
||||||
|
+ gcc_assert (expr2->ts.type == BT_CLASS || expr2->ts.type == BT_DERIVED);
|
||||||
|
+ if (expr2->ts.type == BT_DERIVED)
|
||||||
|
+ {
|
||||||
|
+ tmp = gfc_get_symbol_decl (gfc_find_vtab (&expr2->ts));
|
||||||
|
+ tmp = gfc_build_addr_expr (NULL_TREE, tmp);
|
||||||
|
+ size = fold_convert (size_type_node, gfc_vptr_size_get (tmp));
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ gfc_expr *e2vtab;
|
||||||
|
+ gfc_se se;
|
||||||
|
+ e2vtab = gfc_find_and_cut_at_last_class_ref (expr2);
|
||||||
|
+ gfc_add_vptr_component (e2vtab);
|
||||||
|
+ gfc_add_size_component (e2vtab);
|
||||||
|
+ gfc_init_se (&se, NULL);
|
||||||
|
+ gfc_conv_expr (&se, e2vtab);
|
||||||
|
+ gfc_add_block_to_block (block, &se.pre);
|
||||||
|
+ size = fold_convert (size_type_node, se.expr);
|
||||||
|
+ gfc_free_expr (e2vtab);
|
||||||
|
+ }
|
||||||
|
+ size_in_bytes = size;
|
||||||
|
+ }
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Otherwise use the length in bytes of the rhs. */
|
||||||
|
@@ -7068,6 +7092,14 @@ gfc_trans_subcomponent_assign (tree dest, gfc_component * cm, gfc_expr * expr,
|
||||||
|
tmp = gfc_build_memcpy_call (tmp, se.expr, size);
|
||||||
|
gfc_add_expr_to_block (&block, tmp);
|
||||||
|
}
|
||||||
|
+ else if (cm->ts.type == BT_CLASS && expr->ts.type == BT_CLASS)
|
||||||
|
+ {
|
||||||
|
+ tmp = gfc_copy_class_to_class (se.expr, dest, integer_one_node,
|
||||||
|
+ CLASS_DATA (cm)->attr.unlimited_polymorphic);
|
||||||
|
+ gfc_add_expr_to_block (&block, tmp);
|
||||||
|
+ gfc_add_modify (&block, gfc_class_vptr_get (dest),
|
||||||
|
+ gfc_class_vptr_get (se.expr));
|
||||||
|
+ }
|
||||||
|
else
|
||||||
|
gfc_add_modify (&block, tmp,
|
||||||
|
fold_convert (TREE_TYPE (tmp), se.expr));
|
Loading…
Reference in a new issue