Commit b4e9d41d by Mikael Morin Committed by Jerry DeLisle

re PR fortran/46842 (wrong results with MATMUL(..., TRANSPOSE (func ())) --…

re PR fortran/46842 (wrong results with MATMUL(..., TRANSPOSE (func ())) -- 465.tonto test run miscompares)

2010-12-11  Mikael Morin   <mikael@gcc.gnu.org>
	    Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/46842
	* trans-array.c (dim_ok): New helper function.
	(gfc_conv_expr_descriptor): Use new helper function to check
	function array is full.

Co-Authored-By: Jerry DeLisle <jvdelisle@gcc.gnu.org>

From-SVN: r167713
parent e97cfd97
2010-12-11 Mikael Morin <mikael@gcc.gnu.org>
Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/46842
* trans-array.c (dim_ok): New helper function.
(gfc_conv_expr_descriptor): Use new helper function to check
function array is full.
2010-12-10 Tobias Burnus <burnus@net-b.de>
PR fortran/46540
......
......@@ -5293,6 +5293,16 @@ get_array_charlen (gfc_expr *expr, gfc_se *se)
}
}
/* Helper function to check dimensions. */
static bool
dim_ok (gfc_ss_info *info)
{
int n;
for (n = 0; n < info->dimen; n++)
if (info->dim[n] != n)
return false;
return true;
}
/* Convert an array for passing as an actual argument. Expressions and
vector subscripts are evaluated and stored in a temporary, which is then
......@@ -5378,15 +5388,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
else
full = gfc_full_array_ref_p (info->ref, NULL);
if (full)
for (n = 0; n < info->dimen; n++)
if (info->dim[n] != n)
{
full = 0;
break;
}
if (full)
if (full && dim_ok (info))
{
if (se->direct_byref && !se->byref_noassign)
{
......@@ -5588,7 +5590,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
desc = loop.temp_ss->data.info.descriptor;
}
else if (expr->expr_type == EXPR_FUNCTION)
else if (expr->expr_type == EXPR_FUNCTION && dim_ok (info))
{
desc = info->descriptor;
se->string_length = ss->string_length;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment