From 870cb9b24635855ce4e2f8ef799fee361a7e4294 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 30 2018 16:51:21 +0000 Subject: import devtoolset-7-gcc-7.3.1-5.13.el7 --- diff --git a/SOURCES/0005-Allow-comparisons-between-INTEGER-and-REAL.patch b/SOURCES/0005-Allow-comparisons-between-INTEGER-and-REAL.patch index 29c1162..63d1e19 100644 --- a/SOURCES/0005-Allow-comparisons-between-INTEGER-and-REAL.patch +++ b/SOURCES/0005-Allow-comparisons-between-INTEGER-and-REAL.patch @@ -750,8 +750,8 @@ diff -Nrup a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_const_promotion.f + if (mn_i .ne. 1) STOP 24 + END PROGRAM diff -Nrup a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion-2.f b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion-2.f ---- a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion-2.f 1969-12-31 17:00:00.000000000 -0700 -+++ b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion-2.f 2018-06-05 11:50:45.288707657 -0600 +--- a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion-2.f 1969-12-31 19:00:00.000000000 -0500 ++++ b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion-2.f 2018-07-13 14:46:45.000000000 -0400 @@ -0,0 +1,114 @@ +! { dg-do compile } +! { dg-options "-fdec" } @@ -762,18 +762,18 @@ diff -Nrup a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion-2.f b/gc +! + PROGRAM promotion_int_real + REAL l/0.0/ -+ LOGICAL a_i -+ LOGICAL*4 a2_i -+ LOGICAL b_i -+ LOGICAL*8 b2_i -+ LOGICAL x_i -+ LOGICAL y_i -+ CHARACTER a_r -+ CHARACTER*4 a2_r -+ CHARACTER b_r -+ CHARACTER*8 b2_r -+ CHARACTER x_r -+ CHARACTER y_r ++ LOGICAL a_l ++ LOGICAL*4 a2_l ++ LOGICAL b_l ++ LOGICAL*8 b2_l ++ LOGICAL x_l ++ LOGICAL y_l ++ CHARACTER a_c ++ CHARACTER*4 a2_c ++ CHARACTER b_c ++ CHARACTER*8 b2_c ++ CHARACTER x_c ++ CHARACTER y_c + + INTEGER m_i/0/ + REAL m_r/0.0/ @@ -793,83 +793,83 @@ diff -Nrup a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion-2.f b/gc + INTEGER mx_i/0/ + REAL mx_r/0.0/ + -+ m_i = MOD(a_i, b_i) ! { dg-error "" } ++ m_i = MOD(a_l, b_l) ! { dg-error "" } + if (m_i .ne. 1) STOP 1 -+ m_i = MOD(a2_i, b2_i) ! { dg-error "" } ++ m_i = MOD(a2_l, b2_l) ! { dg-error "" } + if (m_i .ne. 1) STOP 2 -+ m_r = MOD(a_r, b_r) ! { dg-error "" } ++ m_r = MOD(a_c, b_c) ! { dg-error "" } + if (abs(m_r - 1.0) > 1.0D-6) STOP 3 -+ m_r = MOD(a2_r, b2_r) ! { dg-error "" } ++ m_r = MOD(a2_c, b2_c) ! { dg-error "" } + if (abs(m_r - 1.0) > 1.0D-6) STOP 4 -+ m_r = MOD(a_i, b_r) ! { dg-error "" } ++ m_r = MOD(a_l, b_c) ! { dg-error "" } + if (abs(m_r - 1.0) > 1.0D-6) STOP 5 -+ m_r = MOD(a_r, b_i) ! { dg-error "" } ++ m_r = MOD(a_c, b_l) ! { dg-error "" } + if (abs(m_r - 1.0) > 1.0D-6) STOP 6 + -+ md_i = MODULO(a_i, b_i) ! { dg-error "" } ++ md_i = MODULO(a_l, b_l) ! { dg-error "" } + if (md_i .ne. 1) STOP 7 -+ md_i = MODULO(a2_i, b2_i) ! { dg-error "" } ++ md_i = MODULO(a2_l, b2_l) ! { dg-error "" } + if (md_i .ne. 1) STOP 8 -+ md_r = MODULO(a_r, b_r) ! { dg-error "" } ++ md_r = MODULO(a_c, b_c) ! { dg-error "" } + if (abs(md_r - 1.0) > 1.0D-6) STOP 9 -+ md_r = MODULO(a2_r, b2_r) ! { dg-error "" } ++ md_r = MODULO(a2_c, b2_c) ! { dg-error "" } + if (abs(md_r - 1.0) > 1.0D-6) STOP 10 -+ md_r = MODULO(a_i, b_r) ! { dg-error "" } ++ md_r = MODULO(a_l, b_c) ! { dg-error "" } + if (abs(md_r - 1.0) > 1.0D-6) STOP 11 -+ md_r = MODULO(a_r, b_i) ! { dg-error "" } ++ md_r = MODULO(a_c, b_l) ! { dg-error "" } + if (abs(md_r - 1.0) > 1.0D-6) STOP 12 + -+ d_i = DIM(a_i, b_i) ! { dg-error "" } ++ d_i = DIM(a_l, b_l) ! { dg-error "" } + if (d_i .ne. 1) STOP 13 -+ d_i = DIM(a2_i, b2_i) ! { dg-error "" } ++ d_i = DIM(a2_l, b2_l) ! { dg-error "" } + if (d_i .ne. 1) STOP 14 -+ d_r = DIM(a_r, b_r) ! { dg-error "" } ++ d_r = DIM(a_c, b_c) ! { dg-error "" } + if (abs(d_r - 1.0) > 1.0D-6) STOP 15 -+ d_r = DIM(a2_r, b2_r) ! { dg-error "" } ++ d_r = DIM(a2_c, b2_c) ! { dg-error "" } + if (abs(d_r - 1.0) > 1.0D-6) STOP 16 -+ d_r = DIM(a_r, b_i) ! { dg-error "" } ++ d_r = DIM(a_c, b_l) ! { dg-error "" } + if (abs(d_r - 1.0) > 1.0D-6) STOP 17 -+ d_r = DIM(b_i, a_r) ! { dg-error "" } ++ d_r = DIM(b_l, a_c) ! { dg-error "" } + if (abs(d_r) > 1.0D-6) STOP 18 + -+ s_i = SIGN(-a_i, b_i) ! { dg-error "" } ++ s_i = SIGN(-a_l, b_l) ! { dg-error "" } + if (s_i .ne. 4) STOP 19 -+ s_i = SIGN(-a2_i, b2_i) ! { dg-error "" } ++ s_i = SIGN(-a2_l, b2_l) ! { dg-error "" } + if (s_i .ne. 4) STOP 20 -+ s_r = SIGN(a_r, -b_r) ! { dg-error "" } -+ if (abs(s_r - (-a_r)) > 1.0D-6) STOP 21 ! { dg-error "" } -+ s_r = SIGN(a2_r, -b2_r) ! { dg-error "" } -+ if (abs(s_r - (-a2_r)) > 1.0D-6) STOP 22 ! { dg-error "" } -+ s_r = SIGN(a_r, -b_i) ! { dg-error "" } -+ if (abs(s_r - (-a_r)) > 1.0D-6) STOP 23 ! { dg-error "" } -+ s_r = SIGN(-a_i, b_r) ! { dg-error "" } -+ if (abs(s_r - a_r) > 1.0D-6) STOP 24 ! { dg-error "" } -+ -+ mx_i = MAX(-a_i, -b_i, x_i, y_i) ! { dg-error "" } -+ if (mx_i .ne. x_i) STOP 25 ! { dg-error "" } -+ mx_i = MAX(-a2_i, -b2_i, x_i, y_i) ! { dg-error "" } -+ if (mx_i .ne. x_i) STOP 26 ! { dg-error "" } -+ mx_r = MAX(-a_r, -b_r, x_r, y_r) ! { dg-error "" } -+ if (abs(mx_r - x_r) > 1.0D-6) STOP 27 ! { dg-error "" } -+ mx_r = MAX(-a_r, -b_r, x_r, y_r) ! { dg-error "" } -+ if (abs(mx_r - x_r) > 1.0D-6) STOP 28 ! { dg-error "" } -+ mx_r = MAX(-a_i, -b_r, x_r, y_i) ! { dg-error "" } -+ if (abs(mx_r - x_r) > 1.0D-6) STOP 29 ! { dg-error "" } -+ -+ mn_i = MIN(-a_i, -b_i, x_i, y_i) ! { dg-error "" } -+ if (mn_i .ne. -a_i) STOP 31 ! { dg-error "" } -+ mn_i = MIN(-a2_i, -b2_i, x_i, y_i) ! { dg-error "" } -+ if (mn_i .ne. -a2_i) STOP 32 ! { dg-error "" } -+ mn_r = MIN(-a_r, -b_r, x_r, y_r) ! { dg-error "" } -+ if (abs(mn_r - (-a_r)) > 1.0D-6) STOP 33 ! { dg-error "" } -+ mn_r = MIN(-a2_r, -b2_r, x_r, y_r) ! { dg-error "" } -+ if (abs(mn_r - (-a2_r)) > 1.0D-6) STOP 34 ! { dg-error "" } -+ mn_r = MIN(-a_i, -b_r, x_r, y_i) ! { dg-error "" } -+ if (abs(mn_r - (-a_r)) > 1.0D-6) STOP 35 ! { dg-error "" } ++ s_r = SIGN(a_c, -b_c) ! { dg-error "" } ++ if (abs(s_r - (-a_c)) > 1.0D-6) STOP 21 ! { dg-error "" } ++ s_r = SIGN(a2_c, -b2_c) ! { dg-error "" } ++ if (abs(s_r - (-a2_c)) > 1.0D-6) STOP 22 ! { dg-error "" } ++ s_r = SIGN(a_c, -b_l) ! { dg-error "" } ++ if (abs(s_r - (-a_c)) > 1.0D-6) STOP 23 ! { dg-error "" } ++ s_r = SIGN(-a_l, b_c) ! { dg-error "" } ++ if (abs(s_r - a_c) > 1.0D-6) STOP 24 ! { dg-error "" } ++ ++ mx_i = MAX(-a_l, -b_l, x_l, y_l) ! { dg-error "" } ++ if (mx_i .ne. x_l) STOP 25 ! { dg-error "" } ++ mx_i = MAX(-a2_l, -b2_l, x_l, y_l) ! { dg-error "" } ++ if (mx_i .ne. x_l) STOP 26 ! { dg-error "" } ++ mx_r = MAX(-a_c, -b_c, x_c, y_c) ! { dg-error "" } ++ if (abs(mx_r - x_c) > 1.0D-6) STOP 27 ! { dg-error "" } ++ mx_r = MAX(-a_c, -b_c, x_c, y_c) ! { dg-error "" } ++ if (abs(mx_r - x_c) > 1.0D-6) STOP 28 ! { dg-error "" } ++ mx_r = MAX(-a_l, -b_c, x_c, y_l) ! { dg-error "" } ++ if (abs(mx_r - x_c) > 1.0D-6) STOP 29 ! { dg-error "" } ++ ++ mn_i = MIN(-a_l, -b_l, x_l, y_l) ! { dg-error "" } ++ if (mn_i .ne. -a_l) STOP 31 ! { dg-error "" } ++ mn_i = MIN(-a2_l, -b2_l, x_l, y_l) ! { dg-error "" } ++ if (mn_i .ne. -a2_l) STOP 32 ! { dg-error "" } ++ mn_r = MIN(-a_c, -b_c, x_c, y_c) ! { dg-error "" } ++ if (abs(mn_r - (-a_c)) > 1.0D-6) STOP 33 ! { dg-error "" } ++ mn_r = MIN(-a2_c, -b2_c, x_c, y_c) ! { dg-error "" } ++ if (abs(mn_r - (-a2_c)) > 1.0D-6) STOP 34 ! { dg-error "" } ++ mn_r = MIN(-a_l, -b_c, x_c, y_l) ! { dg-error "" } ++ if (abs(mn_r - (-a_c)) > 1.0D-6) STOP 35 ! { dg-error "" } + END PROGRAM diff -Nrup a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion-3.f b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion-3.f ---- a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion-3.f 1969-12-31 17:00:00.000000000 -0700 -+++ b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion-3.f 2018-06-05 11:50:45.288707657 -0600 +--- a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion-3.f 1969-12-31 19:00:00.000000000 -0500 ++++ b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion-3.f 2018-07-13 14:46:45.000000000 -0400 @@ -0,0 +1,114 @@ +! { dg-do compile } +! { dg-options "-fdec" } @@ -882,16 +882,16 @@ diff -Nrup a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion-3.f b/gc + REAL l/0.0/ + INTEGER a_i/4/ + INTEGER*4 a2_i/4/ -+ CHARACTER b_i -+ CHARACTER*8 b2_i ++ CHARACTER b_c ++ CHARACTER*8 b2_c + INTEGER x_i/2/ -+ CHARACTER y_i ++ CHARACTER y_c + REAL a_r/4.0/ + REAL*4 a2_r/4.0/ -+ LOGICAL b_r -+ LOGICAL*8 b2_r ++ LOGICAL b_l ++ LOGICAL*8 b2_l + REAL x_r/2.0/ -+ LOGICAL y_r ++ LOGICAL y_l + + INTEGER m_i/0/ + REAL m_r/0.0/ @@ -911,78 +911,78 @@ diff -Nrup a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion-3.f b/gc + INTEGER mx_i/0/ + REAL mx_r/0.0/ + -+ m_i = MOD(a_i, b_i) ! { dg-error "" } ++ m_i = MOD(a_i, b_c) ! { dg-error "" } + if (m_i .ne. 1) STOP 1 -+ m_i = MOD(a2_i, b2_i) ! { dg-error "" } ++ m_i = MOD(a2_i, b2_c) ! { dg-error "" } + if (m_i .ne. 1) STOP 2 -+ m_r = MOD(a_r, b_r) ! { dg-error "" } ++ m_r = MOD(a_r, b_l) ! { dg-error "" } + if (abs(m_r - 1.0) > 1.0D-6) STOP 3 -+ m_r = MOD(a2_r, b2_r) ! { dg-error "" } ++ m_r = MOD(a2_r, b2_l) ! { dg-error "" } + if (abs(m_r - 1.0) > 1.0D-6) STOP 4 -+ m_r = MOD(a_i, b_r) ! { dg-error "" } ++ m_r = MOD(a_i, b_l) ! { dg-error "" } + if (abs(m_r - 1.0) > 1.0D-6) STOP 5 -+ m_r = MOD(a_r, b_i) ! { dg-error "" } ++ m_r = MOD(a_r, b_c) ! { dg-error "" } + if (abs(m_r - 1.0) > 1.0D-6) STOP 6 + -+ md_i = MODULO(a_i, b_i) ! { dg-error "" } ++ md_i = MODULO(a_i, b_c) ! { dg-error "" } + if (md_i .ne. 1) STOP 7 -+ md_i = MODULO(a2_i, b2_i) ! { dg-error "" } ++ md_i = MODULO(a2_i, b2_c) ! { dg-error "" } + if (md_i .ne. 1) STOP 8 -+ md_r = MODULO(a_r, b_r) ! { dg-error "" } ++ md_r = MODULO(a_r, b_l) ! { dg-error "" } + if (abs(md_r - 1.0) > 1.0D-6) STOP 9 -+ md_r = MODULO(a2_r, b2_r) ! { dg-error "" } ++ md_r = MODULO(a2_r, b2_l) ! { dg-error "" } + if (abs(md_r - 1.0) > 1.0D-6) STOP 10 -+ md_r = MODULO(a_i, b_r) ! { dg-error "" } ++ md_r = MODULO(a_i, b_l) ! { dg-error "" } + if (abs(md_r - 1.0) > 1.0D-6) STOP 11 -+ md_r = MODULO(a_r, b_i) ! { dg-error "" } ++ md_r = MODULO(a_r, b_c) ! { dg-error "" } + if (abs(md_r - 1.0) > 1.0D-6) STOP 12 + -+ d_i = DIM(a_i, b_i) ! { dg-error "" } ++ d_i = DIM(a_i, b_c) ! { dg-error "" } + if (d_i .ne. 1) STOP 13 -+ d_i = DIM(a2_i, b2_i) ! { dg-error "" } ++ d_i = DIM(a2_i, b2_c) ! { dg-error "" } + if (d_i .ne. 1) STOP 14 -+ d_r = DIM(a_r, b_r) ! { dg-error "" } ++ d_r = DIM(a_r, b_l) ! { dg-error "" } + if (abs(d_r - 1.0) > 1.0D-6) STOP 15 -+ d_r = DIM(a2_r, b2_r) ! { dg-error "" } ++ d_r = DIM(a2_r, b2_l) ! { dg-error "" } + if (abs(d_r - 1.0) > 1.0D-6) STOP 16 -+ d_r = DIM(a_r, b_i) ! { dg-error "" } ++ d_r = DIM(a_r, b_c) ! { dg-error "" } + if (abs(d_r - 1.0) > 1.0D-6) STOP 17 -+ d_r = DIM(b_i, a_r) ! { dg-error "" } ++ d_r = DIM(b_c, a_r) ! { dg-error "" } + if (abs(d_r) > 1.0D-6) STOP 18 + -+ s_i = SIGN(-a_i, b_i) ! { dg-error "" } ++ s_i = SIGN(-a_i, b_c) ! { dg-error "" } + if (s_i .ne. 4) STOP 19 -+ s_i = SIGN(-a2_i, b2_i) ! { dg-error "" } ++ s_i = SIGN(-a2_i, b2_c) ! { dg-error "" } + if (s_i .ne. 4) STOP 20 -+ s_r = SIGN(a_r, -b_r) ! { dg-error "" } ++ s_r = SIGN(a_r, -b_l) ! { dg-error "" } + if (abs(s_r - (-a_r)) > 1.0D-6) STOP 21 -+ s_r = SIGN(a2_r, -b2_r) ! { dg-error "" } ++ s_r = SIGN(a2_r, -b2_l) ! { dg-error "" } + if (abs(s_r - (-a2_r)) > 1.0D-6) STOP 22 -+ s_r = SIGN(a_r, -b_i) ! { dg-error "" } ++ s_r = SIGN(a_r, -b_c) ! { dg-error "" } + if (abs(s_r - (-a_r)) > 1.0D-6) STOP 23 -+ s_r = SIGN(-a_i, b_r) ! { dg-error "" } ++ s_r = SIGN(-a_i, b_l) ! { dg-error "" } + if (abs(s_r - a_r) > 1.0D-6) STOP 24 + -+ mx_i = MAX(-a_i, -b_i, x_i, y_i) ! { dg-error "" } ++ mx_i = MAX(-a_i, -b_c, x_i, y_c) ! { dg-error "" } + if (mx_i .ne. x_i) STOP 25 -+ mx_i = MAX(-a2_i, -b2_i, x_i, y_i) ! { dg-error "" } ++ mx_i = MAX(-a2_i, -b2_c, x_i, y_c) ! { dg-error "" } + if (mx_i .ne. x_i) STOP 26 -+ mx_r = MAX(-a_r, -b_r, x_r, y_r) ! { dg-error "" } ++ mx_r = MAX(-a_r, -b_l, x_r, y_l) ! { dg-error "" } + if (abs(mx_r - x_r) > 1.0D-6) STOP 27 -+ mx_r = MAX(-a_r, -b_r, x_r, y_r) ! { dg-error "" } ++ mx_r = MAX(-a_r, -b_l, x_r, y_l) ! { dg-error "" } + if (abs(mx_r - x_r) > 1.0D-6) STOP 28 -+ mx_r = MAX(-a_i, -b_r, x_r, y_i) ! { dg-error "" } ++ mx_r = MAX(-a_i, -b_l, x_r, y_c) ! { dg-error "" } + if (abs(mx_r - x_r) > 1.0D-6) STOP 29 + -+ mn_i = MIN(-a_i, -b_i, x_i, y_i) ! { dg-error "" } ++ mn_i = MIN(-a_i, -b_c, x_i, y_c) ! { dg-error "" } + if (mn_i .ne. -a_i) STOP 31 -+ mn_i = MIN(-a2_i, -b2_i, x_i, y_i) ! { dg-error "" } ++ mn_i = MIN(-a2_i, -b2_c, x_i, y_c) ! { dg-error "" } + if (mn_i .ne. -a2_i) STOP 32 -+ mn_r = MIN(-a_r, -b_r, x_r, y_r) ! { dg-error "" } ++ mn_r = MIN(-a_r, -b_l, x_r, y_l) ! { dg-error "" } + if (abs(mn_r - (-a_r)) > 1.0D-6) STOP 33 -+ mn_r = MIN(-a2_r, -b2_r, x_r, y_r) ! { dg-error "" } ++ mn_r = MIN(-a2_r, -b2_l, x_r, y_l) ! { dg-error "" } + if (abs(mn_r - (-a2_r)) > 1.0D-6) STOP 34 -+ mn_r = MIN(-a_i, -b_r, x_r, y_i) ! { dg-error "" } ++ mn_r = MIN(-a_i, -b_l, x_r, y_c) ! { dg-error "" } + if (abs(mn_r - (-a_r)) > 1.0D-6) STOP 35 + END PROGRAM diff -Nrup a/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion.f b/gcc/testsuite/gfortran.dg/dec_intrinsic_int_real_promotion.f diff --git a/SOURCES/gcc7-fortran-equivalence.patch b/SOURCES/gcc7-fortran-equivalence.patch new file mode 100644 index 0000000..6145b23 --- /dev/null +++ b/SOURCES/gcc7-fortran-equivalence.patch @@ -0,0 +1,202 @@ +diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h +index c373419..880630a 100644 +--- a/gcc/fortran/gfortran.h ++++ b/gcc/fortran/gfortran.h +@@ -2867,6 +2867,7 @@ bool gfc_merge_new_implicit (gfc_typespec *); + void gfc_set_implicit_none (bool, bool, locus *); + void gfc_check_function_type (gfc_namespace *); + bool gfc_is_intrinsic_typename (const char *); ++bool check_conflict (symbol_attribute *, const char *, locus *); + + gfc_typespec *gfc_get_default_type (const char *, gfc_namespace *); + bool gfc_set_default_type (gfc_symbol *, int, gfc_namespace *); +diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c +index 67ad504..29b40fd 100644 +--- a/gcc/fortran/symbol.c ++++ b/gcc/fortran/symbol.c +@@ -363,7 +363,7 @@ gfc_check_function_type (gfc_namespace *ns) + goto conflict_std;\ + } + +-static bool ++bool + check_conflict (symbol_attribute *attr, const char *name, locus *where) + { + static const char *dummy = "DUMMY", *save = "SAVE", *pointer = "POINTER", +@@ -496,7 +496,9 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where) + conf (allocatable, elemental); + + conf (in_common, automatic); ++#if 0 + conf (in_equivalence, automatic); ++#endif + conf (result, automatic); + conf (use_assoc, automatic); + conf (dummy, automatic); +diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c +index 36370eb..4cfaf61 100644 +--- a/gcc/fortran/trans-common.c ++++ b/gcc/fortran/trans-common.c +@@ -948,6 +948,61 @@ add_condition (segment_info *f, gfc_equiv *eq1, gfc_equiv *eq2) + confirm_condition (f, eq1, n, eq2); + } + ++static void ++accumulate_equivalence_attributes (symbol_attribute *dummy_symbol, gfc_equiv *e) ++{ ++ symbol_attribute attr = e->expr->symtree->n.sym->attr; ++ ++ dummy_symbol->dummy |= attr.dummy; ++ dummy_symbol->pointer |= attr.pointer; ++ dummy_symbol->target |= attr.target; ++ dummy_symbol->external |= attr.external; ++ dummy_symbol->intrinsic |= attr.intrinsic; ++ dummy_symbol->allocatable |= attr.allocatable; ++ dummy_symbol->elemental |= attr.elemental; ++ dummy_symbol->recursive |= attr.recursive; ++ dummy_symbol->in_common |= attr.in_common; ++ dummy_symbol->result |= attr.result; ++ dummy_symbol->in_namelist |= attr.in_namelist; ++ dummy_symbol->optional |= attr.optional; ++ dummy_symbol->entry |= attr.entry; ++ dummy_symbol->function |= attr.function; ++ dummy_symbol->subroutine |= attr.subroutine; ++ dummy_symbol->dimension |= attr.dimension; ++ dummy_symbol->in_equivalence |= attr.in_equivalence; ++ dummy_symbol->use_assoc |= attr.use_assoc; ++ dummy_symbol->cray_pointer |= attr.cray_pointer; ++ dummy_symbol->cray_pointee |= attr.cray_pointee; ++ dummy_symbol->data |= attr.data; ++ dummy_symbol->value |= attr.value; ++ dummy_symbol->volatile_ |= attr.volatile_; ++ dummy_symbol->is_protected |= attr.is_protected; ++ dummy_symbol->is_bind_c |= attr.is_bind_c; ++ dummy_symbol->procedure |= attr.procedure; ++ dummy_symbol->proc_pointer |= attr.proc_pointer; ++ dummy_symbol->abstract |= attr.abstract; ++ dummy_symbol->asynchronous |= attr.asynchronous; ++ dummy_symbol->codimension |= attr.codimension; ++ dummy_symbol->contiguous |= attr.contiguous; ++ dummy_symbol->generic |= attr.generic; ++ dummy_symbol->automatic |= attr.automatic; ++ dummy_symbol->threadprivate |= attr.threadprivate; ++ dummy_symbol->omp_declare_target |= attr.omp_declare_target; ++ dummy_symbol->omp_declare_target_link |= attr.omp_declare_target_link; ++ dummy_symbol->oacc_declare_copyin |= attr.oacc_declare_copyin; ++ dummy_symbol->oacc_declare_create |= attr.oacc_declare_create; ++ dummy_symbol->oacc_declare_deviceptr |= attr.oacc_declare_deviceptr; ++ dummy_symbol->oacc_declare_device_resident ++ |= attr.oacc_declare_device_resident; ++ ++ /* Not strictly correct, but probably close enough. */ ++ if (attr.save > dummy_symbol->save) ++ dummy_symbol->save = attr.save; ++ if (attr.intent > dummy_symbol->intent) ++ dummy_symbol->intent = attr.intent; ++ if (attr.access > dummy_symbol->access) ++ dummy_symbol->access = attr.access; ++} + + /* Given a segment element, search through the equivalence lists for unused + conditions that involve the symbol. Add these rules to the segment. */ +@@ -966,8 +1021,11 @@ find_equivalence (segment_info *n) + + /* Search the equivalence list, including the root (first) element + for the symbol that owns the segment. */ ++ symbol_attribute dummy_symbol; ++ memset (&dummy_symbol, 0, sizeof (dummy_symbol)); + for (e2 = e1; e2; e2 = e2->eq) + { ++ accumulate_equivalence_attributes (&dummy_symbol, e2); + if (!e2->used && e2->expr->symtree->n.sym == n->sym) + { + eq = e2; +@@ -975,6 +1033,8 @@ find_equivalence (segment_info *n) + } + } + ++ check_conflict (&dummy_symbol, e1->expr->symtree->name, &e1->expr->where); ++ + /* Go to the next root element. */ + if (eq == NULL) + continue; +diff -Nrcp gcc-8.2.1-20180801/gcc/fortran/trans-common.c save/gcc/fortran/trans-common.c +*** a/gcc/fortran/trans-common.c 2018-08-14 18:17:28.000000000 -0400 +--- b/gcc/fortran/trans-common.c 2018-08-14 17:57:51.000000000 -0400 +*************** build_field (segment_info *h, tree union +*** 339,345 **** + /* Get storage for local equivalence. */ + + static tree +! build_equiv_decl (tree union_type, bool is_init, bool is_saved) + { + tree decl; + char name[18]; +--- 339,345 ---- + /* Get storage for local equivalence. */ + + static tree +! build_equiv_decl (tree union_type, bool is_init, bool is_saved, bool is_auto) + { + tree decl; + char name[18]; +*************** build_equiv_decl (tree union_type, bool +*** 359,366 **** + DECL_ARTIFICIAL (decl) = 1; + DECL_IGNORED_P (decl) = 1; + +! if (!gfc_can_put_var_on_stack (DECL_SIZE_UNIT (decl)) +! || is_saved) + TREE_STATIC (decl) = 1; + + TREE_ADDRESSABLE (decl) = 1; +--- 359,367 ---- + DECL_ARTIFICIAL (decl) = 1; + DECL_IGNORED_P (decl) = 1; + +! if (!is_auto +! && (!gfc_can_put_var_on_stack (DECL_SIZE_UNIT (decl)) +! || is_saved)) + TREE_STATIC (decl) = 1; + + TREE_ADDRESSABLE (decl) = 1; +*************** create_common (gfc_common_head *com, seg +*** 611,616 **** +--- 612,618 ---- + tree decl; + bool is_init = false; + bool is_saved = false; ++ bool is_automatic = false; + + /* Declare the variables inside the common block. + If the current common block contains any equivalence object, then +*************** create_common (gfc_common_head *com, seg +*** 654,659 **** +--- 656,665 ---- + /* Has SAVE attribute. */ + if (s->sym->attr.save) + is_saved = true; ++ ++ /* Has AUTOMATIC attribute. */ ++ if (s->sym->attr.automatic) ++ is_automatic = true; + } + + finish_record_layout (rli, true); +*************** create_common (gfc_common_head *com, seg +*** 661,667 **** + if (com) + decl = build_common_decl (com, union_type, is_init); + else +! decl = build_equiv_decl (union_type, is_init, is_saved); + + if (is_init) + { +--- 667,673 ---- + if (com) + decl = build_common_decl (com, union_type, is_init); + else +! decl = build_equiv_decl (union_type, is_init, is_saved, is_automatic); + + if (is_init) + { diff --git a/SOURCES/gcc7-fortran-include.patch b/SOURCES/gcc7-fortran-include.patch index 5914f9e..7b9a305 100644 --- a/SOURCES/gcc7-fortran-include.patch +++ b/SOURCES/gcc7-fortran-include.patch @@ -39,7 +39,7 @@ index 55d6daf..9c9a208 100644 + else + line_tail->next = b; + -+ line_tail = b; ++ line_tail = b; + + while (file_changes_cur < file_changes_count) + file_changes[file_changes_cur++].lb = b; diff --git a/SOURCES/gcc7-pr86138.patch b/SOURCES/gcc7-pr86138.patch new file mode 100644 index 0000000..8a5f364 --- /dev/null +++ b/SOURCES/gcc7-pr86138.patch @@ -0,0 +1,129 @@ +2018-06-22 Jonathan Wakely + + PR libstdc++/86138 + * include/bits/basic_string.tcc: + [__cplusplus > 201402 && !_GLIBCXX_USE_CXX11_ABI] + (basic_string::_Rep::_S_empty_rep_storage) + (basic_string::_Rep::_S_empty_rep_storage): Add explicit + instantiation declarations. + [__cplusplus > 201402] (operator>>, operator<<, getline): Re-enable + explicit instantiation declarations. + * testsuite/21_strings/basic_string/cons/char/86138.cc: New. + * testsuite/21_strings/basic_string/cons/wchar_t/86138.cc: New. + +--- libstdc++-v3/include/bits/basic_string.tcc ++++ libstdc++-v3/include/bits/basic_string.tcc +@@ -1597,8 +1597,21 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + + // Inhibit implicit instantiations for required instantiations, + // which are defined via explicit instantiations elsewhere. +-#if _GLIBCXX_EXTERN_TEMPLATE > 0 && __cplusplus <= 201402L ++#if _GLIBCXX_EXTERN_TEMPLATE > 0 ++ // The explicit instantiations definitions in src/c++11/string-inst.cc ++ // are compiled as C++14, so the new C++17 members aren't instantiated. ++ // Until those definitions are compiled as C++17 suppress the declaration, ++ // so C++17 code will implicitly instantiate std::string and std::wstring ++ // as needed. ++# if __cplusplus <= 201402L + extern template class basic_string; ++# elif ! _GLIBCXX_USE_CXX11_ABI ++ // Still need to prevent implicit instantiation of the COW empty rep, ++ // to ensure the definition in libstdc++.so is unique (PR 86138). ++ extern template basic_string::size_type ++ basic_string::_Rep::_S_empty_rep_storage[]; ++# endif ++ + extern template + basic_istream& + operator>>(basic_istream&, string&); +@@ -1613,7 +1626,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + getline(basic_istream&, string&); + + #ifdef _GLIBCXX_USE_WCHAR_T ++# if __cplusplus <= 201402L + extern template class basic_string; ++# elif ! _GLIBCXX_USE_CXX11_ABI ++ extern template basic_string::size_type ++ basic_string::_Rep::_S_empty_rep_storage[]; ++# endif ++ + extern template + basic_istream& + operator>>(basic_istream&, wstring&); +@@ -1626,8 +1645,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION + extern template + basic_istream& + getline(basic_istream&, wstring&); +-#endif +-#endif ++#endif // _GLIBCXX_USE_WCHAR_T ++#endif // _GLIBCXX_EXTERN_TEMPLATE > 0 + + _GLIBCXX_END_NAMESPACE_VERSION + } // namespace std +--- /dev/null ++++ libstdc++-v3/testsuite/21_strings/basic_string/cons/char/86138.cc +@@ -0,0 +1,30 @@ ++// Copyright (C) 2018 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING3. If not see ++// . ++ ++// { dg-options "-std=gnu++17" } ++// { dg-do compile { target c++1z } } ++// { dg-final { scan-assembler-not "_ZNSs4_Rep20_S_empty_rep_storageE:" } } ++ ++#undef _GLIBCXX_USE_CXX11_ABI ++#define _GLIBCXX_USE_CXX11_ABI 0 ++#include ++ ++void ++test01(std::string* s) ++{ ++ s->~basic_string(); ++} +--- /dev/null ++++ libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/86138.cc +@@ -0,0 +1,30 @@ ++// Copyright (C) 2018 Free Software Foundation, Inc. ++// ++// This file is part of the GNU ISO C++ Library. This library is free ++// software; you can redistribute it and/or modify it under the ++// terms of the GNU General Public License as published by the ++// Free Software Foundation; either version 3, or (at your option) ++// any later version. ++ ++// This library is distributed in the hope that it will be useful, ++// but WITHOUT ANY WARRANTY; without even the implied warranty of ++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++// GNU General Public License for more details. ++ ++// You should have received a copy of the GNU General Public License along ++// with this library; see the file COPYING3. If not see ++// . ++ ++// { dg-options "-std=gnu++17" } ++// { dg-do compile { target c++1z } } ++// { dg-final { scan-assembler-not "_ZNSbIwSt11char_traitsIwESaIwEE4_Rep20_S_empty_rep_storageE:" } } ++ ++#undef _GLIBCXX_USE_CXX11_ABI ++#define _GLIBCXX_USE_CXX11_ABI 0 ++#include ++ ++void ++test01(std::wstring* s) ++{ ++ s->~basic_string(); ++} diff --git a/SPECS/gcc.spec b/SPECS/gcc.spec index ea230bf..0ffe51e 100644 --- a/SPECS/gcc.spec +++ b/SPECS/gcc.spec @@ -95,7 +95,7 @@ Summary: GCC version 7 Name: %{?scl_prefix}gcc Version: %{gcc_version} -Release: %{gcc_release}.10%{?dist} +Release: %{gcc_release}.13%{?dist} # libgcc, libgfortran, libgomp, libstdc++ and crtstuff have # GCC Runtime Exception. License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD @@ -259,6 +259,7 @@ Patch13: gcc7-rh1512529-aarch64.patch Patch14: gcc7-pr84524.patch Patch15: gcc7-pr84128.patch Patch16: gcc7-rh1570967.patch +Patch17: gcc7-pr86138.patch Patch1000: gcc7-libstdc++-compat.patch Patch1001: gcc7-alt-compat-test.patch @@ -294,6 +295,7 @@ Patch3020: 0020-Add-test-for-STRUCTURE-and-RECORD.patch Patch3022: 0022-Default-values-for-certain-field-descriptors-in-form.patch Patch3023: gcc7-fortranlines.patch Patch3024: gcc7-fortran-include.patch +Patch3025: gcc7-fortran-equivalence.patch @@ -689,6 +691,7 @@ This package contains the Memory Protection Extensions static runtime libraries. %patch14 -p0 -b .pr84524~ %patch15 -p0 -b .pr84128~ %patch16 -p0 -b .rh1570967~ +%patch17 -p0 -b .pr86138~ %if 0%{?rhel} <= 7 %patch1000 -p0 -b .libstdc++-compat~ @@ -746,6 +749,7 @@ cd .. %patch3022 -p1 -b .fortran22~ %patch3023 -p1 -b .fortran23~ %patch3024 -p1 -b .fortran24~ +%patch3025 -p1 -b .fortran25~ %endif echo 'Red Hat %{version}-%{gcc_release}' > gcc/DEV-PHASE @@ -2901,6 +2905,15 @@ fi %doc rpm.doc/changelogs/libcc1/ChangeLog* %changelog +* Tue Aug 14 2018 Marek Polacek 7.3.1-5.13 +- prevent implicit instantiation of COW empty rep (#1572583) + +* Tue Aug 14 2018 Jeff Law 7.3.1-5.12 +- Fix codegen issue with EQUIVALENCE/AUTOMATIC + +* Fri Jul 13 2018 Jeff Law 7.3.1-5.11 +- Revamp attribute checking for EQUIVALENCEs + * Tue Jun 12 2018 Marek Polacek 7.3.1-5.10 - bump for rebuild @@ -2909,7 +2922,6 @@ fi - Integrate updates to patches #0005 and #0014. Add testcases for - various legacy fortran extensions (#1586289) - * Sat May 19 2018 Marek Polacek 7.3.1-5.8 - bump for rebuild