[Bug fortran/27980] [4.1 only] Wrong allocation for zero-sized function result
tkoenig at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sun Jul 16 10:12:00 GMT 2006
------- Comment #7 from tkoenig at gcc dot gnu dot org 2006-07-16 10:12 -------
Subject: Bug 27980
Author: tkoenig
Date: Sun Jul 16 10:11:57 2006
New Revision: 115496
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115496
Log:
2006-07-16 Thomas Koenig <Thomas.Koenig@online.de>
PR fortran/27980
Backport from mainline
* trans-array.h (gfc_trans_allocate_temp_array): Add bool
argument.
* trans-array.c (gfc_trans_allocate_temp_array): Add extra
argument "function" to show if we are translating a function.
If we are translating a function, perform checks whether
the size along any argument is negative. In that case,
allocate size 0.
(gfc_trans_array_constructor): Add funciton argument (as
false) to gfc_trans_allocate_temp_array.
(gfc_conv_loop_setup): Likewise.
* trans-expr.c (gfc_trans_function_call): Add funciton
argument (as true) to gfc_trans_allocate_temp_array.
* trans-stmt.c (gfc_conv_elemental_dependencies): Add funciton
argument (as false) to gfc_trans_allocate_temp_array.
* trans-intrinsic.c (gfc_conv_intrinsic_array_transfer):
Likewise.
2006-07-16 Thomas Koenig <Thomas.Koenig@online.de>
PR fortran/27980
* gfortran.dg/allocate_zerosize_2.f90: New test.
Added:
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/allocate_zerosize_2.f90
Modified:
branches/gcc-4_1-branch/gcc/fortran/ChangeLog
branches/gcc-4_1-branch/gcc/fortran/trans-array.c
branches/gcc-4_1-branch/gcc/fortran/trans-array.h
branches/gcc-4_1-branch/gcc/fortran/trans-expr.c
branches/gcc-4_1-branch/gcc/fortran/trans-intrinsic.c
branches/gcc-4_1-branch/gcc/fortran/trans-stmt.c
branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27980
More information about the Gcc-bugs
mailing list