This is the mail archive of the gcc-bugs@gcc.gnu.org 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]

[Bug fortran/52864] [4.6/4.7/4.8 Regression] Assignment to pointer component for INTENT(IN) dummy argument


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52864

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-04-12 09:52:03 UTC ---
Regarding the original issue (comment 0): The patch has been submitted to
http://gcc.gnu.org/ml/fortran/2012-04/msg00058.html

 * * *

(In reply to comment #2)
> Here's a somewhat different example, but I think it exposes the same
> underlying bug.

Thanks for the bug report!

While the bug is language wise related, it is rather different in terms of the
compiler: It's not a regression and the bug is in a completely different file.

Untested draft patch:

--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -2807,3 +2823,6 @@ compare_parameter_intent (gfc_symbol *formal, gfc_expr
 {
-  if (actual->symtree->n.sym->attr.pointer && !formal->attr.pointer)
+  if (gfc_expr_attr (actual).pointer
+      && ((formal->ts.type == BT_CLASS && formal->attr.class_ok
+          && !CLASS_DATA (formal)->attr.class_pointer)
+         || (formal->ts.type != BT_CLASS && !formal->attr.pointer)))
     return 1;


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