This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

[fortran, patch] Fix PR 14377 - simplifying minmax bug.


Hi, Steven, Paul, Bud, etc
  This patch fixes a bug in simplifying minmax. Before returing the simplified
result, it should be converted to the correct type.
  OK to apply?

Feng Wang

ChangeLog entry:
2004-03-03  Feng Wang  <fengwang@nudt.edu.cn>

	PR fortran/14377
	* simplify.c (simplify_min_max): Convert the type of the result.

  

_________________________________________________________
Do You Yahoo!? 
完全免费的雅虎电邮,马上注册获赠额外60兆网络存储空间
http://cn.rd.yahoo.com/mail_cn/tag/?http://cn.mail.yahoo.com
*** simplify.c.orig	Wed Mar  3 16:52:17 2004
--- simplify.c	Wed Mar  3 16:50:26 2004
*************** static gfc_expr *
*** 2150,2158 ****
--- 2150,2160 ----
  simplify_min_max (gfc_expr * expr, int sign)
  {
    gfc_actual_arglist *arg, *last, *extremum;
+   gfc_intrinsic_sym * specific;
  
    last = NULL;
    extremum = NULL;
+   specific = expr->value.function.isym;
  
    arg = expr->value.function.actual;
  
*************** simplify_min_max (gfc_expr * expr, int s
*** 2203,2209 ****
    if (expr->value.function.actual->next != NULL)
      return NULL;
  
!   return gfc_copy_expr (expr->value.function.actual->expr);
  }
  
  
--- 2205,2212 ----
    if (expr->value.function.actual->next != NULL)
      return NULL;
  
!   return gfc_convert_constant (expr->value.function.actual->expr,
! 	specific->ts.type, specific->ts.kind);
  }
  
  

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