This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: some problems with gcc/testsuite/gfortran.dg/ tests in 4.3-20061111 with OSX 10.3
- From: Paul Thomas <paulthomas2 at wanadoo dot fr>
- To: Dominique Dhumieres <dominiq at lps dot ens dot fr>
- Cc: fortran at gcc dot gnu dot org
- Date: Tue, 14 Nov 2006 21:03:39 +0100
- Subject: Re: some problems with gcc/testsuite/gfortran.dg/ tests in 4.3-20061111 with OSX 10.3
- References: <20061114144141.50CB15BBAD@mailhost.lps.ens.fr>
Dominique,
The file gcc/testsuite/gfortran.dg/actual_array_interface_1.f90 in the
latest 4.3 snashot (20061111) is empty, as well as:
Yup! I agree. Sorry about that. I have attached the full patch and the
straight up version of the testcase. I even checked that it still works
:-)
I cannot do anything about this until the weekend, at earliest. If
anybody else is doing a commit and has the time or inclination, please
include this missing testcase.
without using any CPU time. Note that the problem disappears if I remove
the PRINT's in the functions SUB and BAR.
The code for sub is:
sub (__result, .__result, i)
{
int4 ..__result;
int4 stride.8;
int4 offset.9;
int4 size.10;
char[0:D.1048][1:..__result] * __result.0;
bit_size_type D.1046;
<unnamed type> D.1047;
int4 D.1048;
bit_size_type D.1049;
<unnamed type> D.1050;
..__result = *i;
{
int4 D.1045;
..__result = *i;
D.1045 = __result->dim[0].stride;
stride.8 = D.1045 == 0 ? 1 : D.1045;
__result.0 = (char[0:D.1048][1:..__result] *) __result->data;
size.10 = NON_LVALUE_EXPR <stride.8>;
offset.9 = -stride.8;
D.1046 = (bit_size_type) (<unnamed type>) ..__result * 8;
D.1047 = (<unnamed type>) ..__result;
D.1048 = size.10 - 1;
D.1049 = SAVE_EXPR <D.1046> * (bit_size_type) (<unnamed type>) size.10;
D.1050 = SAVE_EXPR <D.1047> * (<unnamed type>) size.10;
}
{
struct __st_parameter_dt dt_parm.7;
dt_parm.7.common.filename = "intrinsic_actual_2.f90";
dt_parm.7.common.line = 24;
dt_parm.7.common.unit = 6;
dt_parm.7.common.flags = 128;
_gfortran_st_write (&dt_parm.7);
{
int4 D.1044;
D.1044 = ..__result;
_gfortran_transfer_integer (&dt_parm.7, &D.1044, 4);
}
_gfortran_st_write_done (&dt_parm.7);
}
}
which looks OK apart from the repetition of ..__result = *i; However, I
can see nothing that would make the program hang - can anybody else?
Thanks
Paul
! { dg-do run }
! Tests the fix for PR29490, in which the interface was getting
! messed up over the lower bound on 't' in 'john' and causing
! an ICE in consequence.
!
! Contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
!
program fred
!---------------------------------
real :: dezz(1:10)
real, allocatable :: jack(:)
!
allocate(jack(10)); jack = 9.
dezz = john(jack,1)
print*,'dezz = ',dezz
contains
!---------------------------------
function john(t,il)
!---------------------------------
real :: t(il:)
real :: john(1:10)
john = 10.
end function john
end
Index: gcc/fortran/trans-expr.c
===================================================================
*** gcc/fortran/trans-expr.c (révision 117879)
--- gcc/fortran/trans-expr.c (copie de travail)
*************** gfc_set_interface_mapping_bounds (stmtbl
*** 1297,1303 ****
for (n = 0; n < GFC_TYPE_ARRAY_RANK (type); n++)
{
GFC_TYPE_ARRAY_STRIDE (type, n) = gfc_conv_array_stride (desc, n);
! if (GFC_TYPE_ARRAY_UBOUND (type, n) == NULL_TREE)
{
dim = gfc_rank_cst[n];
tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type,
--- 1297,1310 ----
for (n = 0; n < GFC_TYPE_ARRAY_RANK (type); n++)
{
GFC_TYPE_ARRAY_STRIDE (type, n) = gfc_conv_array_stride (desc, n);
! if (GFC_TYPE_ARRAY_LBOUND (type, n) == NULL_TREE)
! {
! GFC_TYPE_ARRAY_LBOUND (type, n)
! = gfc_conv_descriptor_lbound (desc, dim);
! GFC_TYPE_ARRAY_UBOUND (type, n)
! = gfc_conv_descriptor_ubound (desc, dim);
! }
! else if (GFC_TYPE_ARRAY_UBOUND (type, n) == NULL_TREE)
{
dim = gfc_rank_cst[n];
tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type,
Index: gcc/testsuite/gfortran.dg/actual_array_interface_1.f90
===================================================================
*** gcc/testsuite/gfortran.dg/actual_array_interface_1.f90 (révision 0)
--- gcc/testsuite/gfortran.dg/actual_array_interface_1.f90 (révision 0)
***************
*** 0 ****
--- 1,27 ----
+ ! { dg-do compile }
+ ! Tests the fix for PR29490, in which the creation of the
+ ! interface expression for the first argument of the call to
+ ! 'john' would cause an ICE because GFC_TYPE_ARRAY_LBOUND
+ ! was NULL.
+ !
+ ! Contributed by Philip Mason <pmason@ricardo.com>
+ !
+ !---------------------------------
+ program fred
+ !---------------------------------
+ real :: dezz(1:10)
+ real, allocatable :: jack(:)
+ !
+ allocate(jack(10)); jack = 9.
+ dezz = john(jack,1)
+ print*,'dezz = ',dezz
+
+ contains
+ !---------------------------------
+ function john(t,il)
+ !---------------------------------
+ real :: t(il:)
+ real :: john(1:10)
+ john = 10.
+ end function john
+ end