public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch, Fortran] PR 42051,43896: [OOP] ICE in gfc_conv_variable, at  fortran/trans-expr.c:551
@ 2010-06-11  7:17 Janus Weil
  2010-06-11  7:18 ` Paul Richard Thomas
  0 siblings, 1 reply; 7+ messages in thread
From: Janus Weil @ 2010-06-11  7:17 UTC (permalink / raw)
  To: gfortran, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1093 bytes --]

Hi all,

here is an OOP patch by Paul, which I am taking up and posting here because

a) it is simple
b) it has been lying around for a while
c) it fixes two bugs (both of which have been reported by real-world
users. In fact they are duplicates.)
d) Paul seems to have little time for gfortran lately :(
e) I simply want to get this baby in finally :)

[Btw, the original test case in PR 42051 still does not work, but this
is apparently due to some other bug, possibly related or equal to PR
44064.]

The patch has been regtested on x86_64-unknown-linux-gnu. Ok for trunk?

Actually, since it's Paul's patch, I guess I could just approve it
myself (I do indeed think it's fine). Therefore I'll just commit it
tomorrow on behalf of Paul if no one objects by then.

Cheers,
Janus



2010-06-11  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/42051
	PR fortran/43896
	* trans-expr.c (gfc_conv_derived_to_class): Handle array-valued
	functions with CLASS formal arguments.


2010-06-11  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/42051
	PR fortran/43896
	* gfortran.dg/class_23.f03: New test.

[-- Attachment #2: pr42051.diff --]
[-- Type: application/octet-stream, Size: 659 bytes --]

Index: gcc/fortran/trans-expr.c
===================================================================
--- gcc/fortran/trans-expr.c	(revision 160588)
+++ gcc/fortran/trans-expr.c	(working copy)
@@ -2492,12 +2492,14 @@ gfc_conv_derived_to_class (gfc_se *parmse, gfc_exp
   ss = gfc_walk_expr (e);
   if (ss == gfc_ss_terminator)
     {
+      parmse->ss = NULL;
       gfc_conv_expr_reference (parmse, e);
       tmp = fold_convert (TREE_TYPE (ctree), parmse->expr);
       gfc_add_modify (&parmse->pre, ctree, tmp);
     }
   else
     {
+      parmse->ss = ss;
       gfc_conv_expr (parmse, e);
       gfc_add_modify (&parmse->pre, ctree, parmse->expr);
     }

[-- Attachment #3: class_23.f03 --]
[-- Type: application/octet-stream, Size: 470 bytes --]

! { dg-do compile }
!
! PR 42051: [OOP] ICE on array-valued function with CLASS formal argument
!
! Original test case by Damian Rouson <damian@rouson.net>
! Modified by Janus Weil <janus@gcc.gnu.org>

  type grid
  end type 

contains

  function return_x(this) result(this_x)
    class(grid) :: this
    real  ,dimension(1) :: this_x
  end function

  subroutine output()
    type(grid) :: mesh
    real ,dimension(1) :: x
    x = return_x(mesh)
  end subroutine

end

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: [Patch, Fortran] PR 42051,43896: [OOP] ICE in gfc_conv_variable, at fortran/trans-expr.c:551
@ 2010-06-11 19:25 Dominique Dhumieres
  0 siblings, 0 replies; 7+ messages in thread
From: Dominique Dhumieres @ 2010-06-11 19:25 UTC (permalink / raw)
  To: fortran; +Cc: gcc-patches, janus, paul.richard.thomas

Paul,

Your patch in http://gcc.gnu.org/ml/fortran/2010-06/msg00112.html
breaks the tests for pr44465 while fixing various problems:
several ICEs for tests in pr41951 disappear, but are replaced with
questionable errors, others give 'Internal Error at (1)', e.g.
a test for pr42888, now the first test in pr42051 compiles and
links along with some others (no more errors "Undefined symbols:
"_vtab$...").

Dominique

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: [Patch, Fortran] PR 42051,43896: [OOP] ICE in gfc_conv_variable, at fortran/trans-expr.c:551
@ 2010-06-11 22:05 Dominique Dhumieres
  0 siblings, 0 replies; 7+ messages in thread
From: Dominique Dhumieres @ 2010-06-11 22:05 UTC (permalink / raw)
  To: fortran; +Cc: gcc-patches, janus, paul.richard.thomas

With the patch in http://gcc.gnu.org/ml/fortran/2010-06/msg00112.html
I have the following failures in the test suite:

[macbook] f90/bug% gfc /opt/gcc/work/gcc/testsuite/gfortran.dg/allocate_derived_1.f90
/opt/gcc/work/gcc/testsuite/gfortran.dg/allocate_derived_1.f90:35.12:
...
end
   1
Internal Error at (1):
find_array_spec(): Component not found

and

[macbook] f90/bug% gfc -O /opt/gcc/work/gcc/testsuite/gfortran.dg/dynamic_dispatch_4.f03
/opt/gcc/work/gcc/testsuite/gfortran.dg/dynamic_dispatch_4.f03: In function 'getit':
/opt/gcc/work/gcc/testsuite/gfortran.dg/dynamic_dispatch_4.f03:79:0: error: statement makes a memory store, but has no VDEFS
a_3.$vptr = D.1778_2;
/opt/gcc/work/gcc/testsuite/gfortran.dg/dynamic_dispatch_4.f03:79:0: internal compiler error: verify_ssa failed

Dominique

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-06-11 21:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-11  7:17 [Patch, Fortran] PR 42051,43896: [OOP] ICE in gfc_conv_variable, at fortran/trans-expr.c:551 Janus Weil
2010-06-11  7:18 ` Paul Richard Thomas
2010-06-11  8:15   ` Paul Richard Thomas
2010-06-11 15:42     ` Paul Richard Thomas
2010-06-11 17:48       ` Janus Weil
2010-06-11 19:25 Dominique Dhumieres
2010-06-11 22:05 Dominique Dhumieres

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).