mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-31 15:11:04 +08:00
re PR fortran/34248 (ICE on assumed length character function)
2007-11-29 Tobias Burnus <burnus@net-b.de> PR fortran/34248 * trans-decl.c (generate_dependency_declarations): Check for NULL pointers before accessing the string length. 2007-11-29 Tobias Burnus <burnus@net-b.de> PR fortran/34248 * gfortran.dg/result_in_spec_3.f90: New. From-SVN: r130517
This commit is contained in:
parent
5ac74d2542
commit
10650fbb88
@ -1,3 +1,9 @@
|
||||
2007-11-29 Tobias Burnus <burnus@net-b.de>
|
||||
|
||||
PR fortran/34248
|
||||
* trans-decl.c (generate_dependency_declarations): Check
|
||||
for NULL pointers before accessing the string length.
|
||||
|
||||
2007-11-29 Tobias Burnus <burnus@net-b.de>
|
||||
|
||||
PR fortran/34262
|
||||
|
@ -2924,7 +2924,9 @@ generate_dependency_declarations (gfc_symbol *sym)
|
||||
int i;
|
||||
|
||||
if (sym->ts.type == BT_CHARACTER
|
||||
&& sym->ts.cl->length->expr_type != EXPR_CONSTANT)
|
||||
&& sym->ts.cl
|
||||
&& sym->ts.cl->length
|
||||
&& sym->ts.cl->length->expr_type != EXPR_CONSTANT)
|
||||
generate_expr_decls (sym, sym->ts.cl->length);
|
||||
|
||||
if (sym->as && sym->as->rank)
|
||||
|
@ -1,3 +1,8 @@
|
||||
2007-11-29 Tobias Burnus <burnus@net-b.de>
|
||||
|
||||
PR fortran/34248
|
||||
* gfortran.dg/result_in_spec_3.f90: New.
|
||||
|
||||
2007-11-29 Tobias Burnus <burnus@net-b.de>
|
||||
|
||||
PR fortran/34262
|
||||
|
15
gcc/testsuite/gfortran.dg/result_in_spec_3.f90
Normal file
15
gcc/testsuite/gfortran.dg/result_in_spec_3.f90
Normal file
@ -0,0 +1,15 @@
|
||||
! { dg-do compile }
|
||||
!
|
||||
! PR fortran/34248
|
||||
!
|
||||
! There was an ICE for assumed-length functions
|
||||
! if RESULT(...) was used and no value assigned
|
||||
! to the result variable.
|
||||
!
|
||||
character(*) FUNCTION test() RESULT(ctab)
|
||||
ctab = "Hello"
|
||||
END function test
|
||||
|
||||
FUNCTION test2() RESULT(res)
|
||||
character(*) :: res
|
||||
END function test2
|
Loading…
x
Reference in New Issue
Block a user