This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [Patch, fortran] PR33554 - [4.3 regression] Seg.fault: Default initialization of derived type uses uninitialized values


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


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