summaryrefslogtreecommitdiff
path: root/gcc48-rh1369183.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-01 14:23:42 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-01 14:23:42 +0000
commit82711f6567ef069eebb942e382e2c3fa61fbf538 (patch)
tree22200b7326b32ca672ffb6e4ce6d19a09dc476e5 /gcc48-rh1369183.patch
parent5d624aa0d36abe76a344f0593eae5cf36d083b15 (diff)
automatic import of compat-libgfortran-48openeuler24.03_LTSopeneuler23.09
Diffstat (limited to 'gcc48-rh1369183.patch')
-rw-r--r--gcc48-rh1369183.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/gcc48-rh1369183.patch b/gcc48-rh1369183.patch
new file mode 100644
index 0000000..7127d15
--- /dev/null
+++ b/gcc48-rh1369183.patch
@@ -0,0 +1,52 @@
+2017-03-07 Jakub Jelinek <jakub@redhat.com>
+
+ Partial backport
+ 2016-05-07 Fritz Reese <fritzoreese@gmail.com>
+
+ PR fortran/56226
+ * interface.c (gfc_compare_derived_types): Don't ICE if the
+ derived type or both types have no components.
+
+ * gfortran.dg/rh1369183.f90: New test.
+
+--- gcc/fortran/interface.c.jj 2015-06-18 16:32:45.000000000 +0200
++++ gcc/fortran/interface.c 2017-03-07 18:35:38.982302826 +0100
+@@ -418,6 +418,13 @@ gfc_compare_derived_types (gfc_symbol *d
+ && !(derived1->attr.is_bind_c && derived2->attr.is_bind_c))
+ return 0;
+
++ /* Protect against null components. */
++ if (derived1->attr.zero_comp != derived2->attr.zero_comp)
++ return 0;
++
++ if (derived1->attr.zero_comp)
++ return 1;
++
+ dt1 = derived1->components;
+ dt2 = derived2->components;
+
+--- gcc/testsuite/gfortran.dg/rh1369183.f90.jj 2017-03-07 18:37:39.574775432 +0100
++++ gcc/testsuite/gfortran.dg/rh1369183.f90 2017-03-07 18:38:38.423993194 +0100
+@@ -0,0 +1,22 @@
++! { dg-do compile }
++
++module mod1369183
++ implicit none
++ contains
++ subroutine sub(test)
++ type test_t
++ sequence
++ integer(4) type
++ end type test_t
++ type(test_t),intent(inout) :: test
++ end subroutine sub
++end module mod1369183
++subroutine rh1369183
++ use mod1369183
++ implicit none
++ type test_t
++ sequence
++ end type test_t
++ type(test_t) :: tst
++ call sub(tst) ! { dg-error "Type mismatch in argument" }
++end subroutine rh1369183