This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, fortran] PR33554 - [4.3 regression] Seg.fault: Default initialization of derived type uses uninitialized values
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 01 Oct 2007 21:43:16 -0700
- Subject: Re: [Patch, fortran] PR33554 - [4.3 regression] Seg.fault: Default initialization of derived type uses uninitialized values
- References: <339c37f20710010457q586e06a1la1dec731fb0607ad@mail.gmail.com>
Paul Richard Thomas wrote:
:ADDPATCH fortran:
This regression came about when I rejigged the handling of default
initialization of derived types with intent(out). The block of code
doing the initilization was placed too early and so pre-empted the
calculation of dummy array offsets and lower bounds. This triggered
the segfault. The solution is to move this code to its own function
and to add the translated block to the top of the function body, just
before any deferred trickery is done to the function result. The code
for deferred arrays is then added on top of that. The testcase is the
reporter's with a bit of dejagnuification.
Regtested on cygwin_nt/PIV (will bootstrap and regtest tonight on
x86_ia64) - OK for trunk?
Paul
Paul, OK with fix typo in test case: Delete dash in front of run directive.
Index: gcc/testsuite/gfortran.dg/intent_out_2.f90
===================================================================
*** gcc/testsuite/gfortran.dg/intent_out_2.f90 (révision 0)
--- gcc/testsuite/gfortran.dg/intent_out_2.f90 (révision 0)
***************
*** 0 ****
--- 1,47 ----
+ ! { dg-do -run }
+ ! Tests the fix for PR33554, in which the default initialization
+ ! of temp, in construct_temp, caused a segfault because it was