This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran] Add end-of-scope finalization (Part 2 of 2)
- From: Tobias Burnus <burnus at net-b dot de>
- To: fortran at gcc dot gnu dot org
- Date: Wed, 26 Jun 2013 12:02:03 +0200
- Subject: Re: [Patch, Fortran] Add end-of-scope finalization (Part 2 of 2)
- References: <20130626080125 dot 68B903BE1B at mailhost dot lps dot ens dot fr>
Dear Dominique,
Dominique Dhumieres wrote:
Failures in 32 bit mode again!-(
FAIL: gfortran.dg/finalize_18.f90 -O scan-tree-dump-times original "y.cc._vptr->_final \\(&desc.5, \\(integer\\(kind=8\\)\\) y.cc._vptr->_size, 1\\);" 1
I will fix those before committal.
/opt/gcc/work/gcc/testsuite/gfortran.dg/class_48.f90: In function '__final_test2_T.2138.constprop.0':
/opt/gcc/work/gcc/testsuite/gfortran.dg/class_48.f90:39:0: warning: iteration 2147483648 invokes undefined behavior [-Waggressive-loop-optimizations]
class(t), allocatable :: a
^
I have not fully understood why this happens. It seems to have something
to do with cloning/const propagation. Looking at the original dump, the
optimized dump at -O0, -O2 and -O3 - and at the FE code -, I believe the
generated code is correct.
The cloning propagates the rank == 1 into the cloned finalizer, which
permits to drastically simplify the scalarizer. That allows to remove
one loop (the one which is warned about?) and to simplify another loop
into a single trip.
Thus, my working hypothesis is that either the warning is wrong or that
something goes wrong with the loop optimization, triggering the warning.
Tobiashhhhh