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

Re: [patch, fortran] PR 40628, front-end optimization pass


Thomas Koenig wrote:
> Well, here is an updated version of the patch.
>
> I have also changed the place where the gfc_run_passes is called to
> resolve.c, as pault had suggested on IRC.
>
> Regression-tested, only allocate_with_typespec.f90 failed (which I also
> saw on gcc-testresults).
> OK?
>   
OK. Thanks for the patch - and sorry for the late review.

Nits:

Index: gfortran.h
+/* passes.c */
+
+void gfc_run_passes (gfc_namespace *);


Update the filename in the comment.

! { dg-final { scan-tree-dump-times "memmove" 2 "original" } }

Can you add:
! { dg-final { scan-tree-dump-times "string_trim" 0 "original" } }


  /* Check for direct comparison between identical variables.
     TODO: Handle cases with identical refs.  */
  if (op1->expr_type == EXPR_VARIABLE
      && op2->expr_type == EXPR_VARIABLE
      && op1->symtree == op2->symtree
      && op1->ref == NULL && op2->ref == NULL
      && op1->ts.type != BT_REAL && op2->ts.type != BT_REAL
      && op1->ts.type != BT_COMPLEX && op2->ts.type !=BT_COMPLEX)


Is there a reason that you do not include REAL and COMPLEX variables,
but everything else? (characters, derived types, polymorphic types
(class), integer, Hollerith, ...). Especially, as derived types can also
contains real/complex variables ;-)

It seems to be save to do this comparison also for REAL and COMPLEX.

Tobias

> 2010-07-20  Thomas Koenig  <tkoenig@gcc.gnu.org>
>
> 	* Make-lang.in:  Add fortran/frontend-passes.o.
> 	* gfortran.h:  Add prototype for gfc_run_passes.
> 	* resolve.c (gfc_resolve):  Call gfc_run_passes.
> 	* frontend-passes.c:  New file.
>
> 2010-0717  Thomas Koenig  <tkoenig@gcc.gnu.org>
>
> 	* trim_optimize_1.f90:  New test.
> 	* character_comparision_1.f90:  New test.
>   


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