diff options
author | Andre Vehreschild <vehre@gmx.de> | 2015-04-07 16:10:43 +0200 |
---|---|---|
committer | Andre Vehreschild <vehre@gcc.gnu.org> | 2015-04-07 16:10:43 +0200 |
commit | 440f9408ea950a29ef7606b6114d84d1a5b53c90 (patch) | |
tree | 55ce32d803f368b6cf5183f678a6422f3e722982 /gcc/fortran | |
parent | 0e081bde913120cdf87ac288c814dfcc9733eacb (diff) | |
download | gcc-440f9408ea950a29ef7606b6114d84d1a5b53c90.zip gcc-440f9408ea950a29ef7606b6114d84d1a5b53c90.tar.gz gcc-440f9408ea950a29ef7606b6114d84d1a5b53c90.tar.bz2 |
re PR fortran/65548 (gfc_conv_procedure_call)
PR fortran/65548
* gfortran.dg/allocate_with_source_5.f90: New test.
* trans-stmt.c (gfc_trans_allocate): For intrinsic functions
use conv_expr_descriptor() instead of conv_expr_reference().
From-SVN: r221897
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-stmt.c | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 7bba9d4..f7b1d38 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2015-04-07 Andre Vehreschild <vehre@gmx.de> + + PR fortran/65548 + * trans-stmt.c (gfc_trans_allocate): For intrinsic functions + use conv_expr_descriptor() instead of conv_expr_reference(). + 2015-03-30 Jakub Jelinek <jakub@redhat.com> PR fortran/65597 diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index a6fb52c..619564b 100644 --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -5049,12 +5049,17 @@ gfc_trans_allocate (gfc_code * code) /* In all other cases evaluate the expr3 and create a temporary. */ gfc_init_se (&se, NULL); - gfc_conv_expr_reference (&se, code->expr3); + if (code->expr3->rank != 0 + && code->expr3->expr_type == EXPR_FUNCTION + && code->expr3->value.function.isym) + gfc_conv_expr_descriptor (&se, code->expr3); + else + gfc_conv_expr_reference (&se, code->expr3); if (code->expr3->ts.type == BT_CLASS) gfc_conv_class_to_class (&se, code->expr3, code->expr3->ts, false, true, - false,false); + false, false); gfc_add_block_to_block (&block, &se.pre); gfc_add_block_to_block (&post, &se.post); /* Prevent aliasing, i.e., se.expr may be already a |