This is the mail archive of the gcc-bugs@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]

[Bug fortran/33850] Unneeded temporary generated for LHS index of array assignment



------- Comment #3 from pault at gcc dot gnu dot org  2007-11-27 20:48 -------
Subject: Bug 33850

Author: pault
Date: Tue Nov 27 20:47:55 2007
New Revision: 130472

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130472
Log:
2007-11-27  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/29389
        *resolve.c (resolve_ordinary_assign): Use find_sym_in_expr to
        test if a temporary should be written for a vector subscript
        on the lhs.

        PR fortran/33850
        * restore.c (pure_stmt_function): Add prototype and new
        function. Calls impure_stmt_fcn.
        (pure_function): Call it.
        (impure_stmt_fcn): New function.

        * expr.c (gfc_traverse_expr): Call *func for all expression
        types, not just variables. Add traversal of character lengths,
        iterators and component character lengths and arrayspecs.
        (expr_set_symbols_referenced): Return false if not a variable.
        * trans-stmt.c (forall_replace, forall_restore): Ditto.
        * resolve.c (forall_index): Ditto.
        (sym_in_expr): New function.
        (find_sym_in_expr): Rewrite to traverse expression calling
        sym_in_expr.
        *trans-decl.c (expr_decls): New function.
        (generate_expr_decls): Rewrite to traverse expression calling
        expr_decls.
        *match.c (check_stmt_fcn): New function.
        (recursive_stmt_fcn): Rewrite to traverse expression calling
        check_stmt_fcn.

2007-11-27  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/29389
        * gfortran.dg/stfunc_6.f90: New test.

        PR fortran/33850
        * gfortran.dg/assign_10.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/assign_10.f90
    trunk/gcc/testsuite/gfortran.dg/stfunc_6.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/expr.c
    trunk/gcc/fortran/match.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/trans-decl.c
    trunk/gcc/fortran/trans-stmt.c
    trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33850


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