This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: Seek debugging tip for crash at nullify call


Tobias,

Compile with -fdump-tree-original and -fbounds-check. The loop is rendered as:

 i = 1;
 if (i <= 2)
   {
     while (1)
       {
         {
           logical4 D.932;

           {
             int4 D.930;

(*(struct projector_t[0:] *) p.data)[p.dim[0].stride * D.930 + p.o ffset].bra.data = 0B;
D.930 = i;
if ((logical4) __builtin_expect (p.dim[0].lbound > D.930, 0))
{
_gfortran_runtime_error ("Array reference out of bounds for ar ray \'p\', lower bound of dimension 1 exceeded (in file \'burnus1007.f90\', at l ine 12)");
}
else
{
(void) 0;
}
if ((logical4) __builtin_expect (p.dim[0].ubound < D.930, 0))
{
_gfortran_runtime_error ("Array reference out of bounds for ar ray \'p\', upper bound of dimension 1 exceeded (in file \'burnus1007.f90\', at l ine 12)");
}
else
{
(void) 0;
}
}
{
int4 D.931;


(*(struct projector_t[0:] *) p.data)[p.dim[0].stride * D.931 + p.o ffset].ket.data = 0B;
D.931 = i;
if ((logical4) __builtin_expect (p.dim[0].lbound > D.931, 0))
{
_gfortran_runtime_error ("Array reference out of bounds for ar ray \'p\', lower bound of dimension 1 exceeded (in file \'burnus1007.f90\', at l ine 13)");
}
else
{
(void) 0;
}
if ((logical4) __builtin_expect (p.dim[0].ubound < D.931, 0))
{
_gfortran_runtime_error ("Array reference out of bounds for ar ray \'p\', upper bound of dimension 1 exceeded (in file \'burnus1007.f90\', at l ine 13)");
}
else
{
(void) 0;
}
}
L.2:;
D.932 = i == 2;
i = i + 1;
if (D.932) goto L.3; else (void) 0;
}
}
}
else
{
(void) 0;
}
L.3:;
}


Look at the use of the temporary D.931, in the index expression, before it is set to i!

Without -fbounds-check, i itself is used for the index.

Cheers

Paul


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