This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch, Fortran] PR 40594: [4.5 Regression] wrong-code

Hi all,

here is my fix for PR40594, a regression caused by my PPC patch
(r147206). The fix is simply reverting one hunk of the PPC patch. I'm
still not sure how and why this hunk got in there in the first place,
but as reverting it gave no regressions, it seems it is unneeded (and
in fact wrong, as Daniel's test case showed).

Daniel: Could you verify that the patch fixes your full code? I have
made sure that the reduced test cases in the PR are ok.

Regtested on x86_64-linux-gnu. Ok for trunk?


2009-06-30  Janus Weil  <>

	PR fortran/40594
	* trans-types.c (gfc_get_derived_type): Bugfix, reverting one hunk from

2009-06-30  Janus Weil  <>

	PR fortran/40594
	* gfortran.dg/derived_pointer_recursion_2.f90: New.
Index: gcc/fortran/trans-types.c
--- gcc/fortran/trans-types.c	(revision 149095)
+++ gcc/fortran/trans-types.c	(working copy)
@@ -1946,7 +1946,13 @@ gfc_get_derived_type (gfc_symbol * deriv
   /* derived->backend_decl != 0 means we saw it before, but its
      components' backend_decl may have not been built.  */
   if (derived->backend_decl)
-    return derived->backend_decl;
+    {
+      /* Its components' backend_decl have been built.  */
+      if (TYPE_FIELDS (derived->backend_decl))
+        return derived->backend_decl;
+      else
+        typenode = derived->backend_decl;
+    }
       /* We see this derived type first time, so build the type node.  */

Attachment: derived_pointer_recursion_2.f90
Description: Binary data

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]