[Bug fortran/12456] please recognize Fortran STRING(K:K) as single character

fengwang at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Jan 9 02:54:00 GMT 2006



------- Comment #13 from fengwang at gcc dot gnu dot org  2006-01-09 02:54 -------
Subject: Bug 12456

Author: fengwang
Date: Mon Jan  9 02:54:25 2006
New Revision: 109491

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109491
Log:
fortran
2006-01-09  Feng Wang  <fengwang@nudt.edu.cn>

        PR fortran/12456
        * trans-expr.c (gfc_to_single_character): New function that converts
        string to single character if its length is 1.
        (gfc_build_compare_string):New function that compare string and handle
        single character specially.
        (gfc_conv_expr_op): Use gfc_build_compare_string.
        (gfc_trans_string_copy): Use gfc_to_single_character.
        * trans-intrinsic.c (gfc_conv_intrinsic_strcmp): Use
        gfc_build_compare_string.
        * trans.h (gfc_build_compare_string): Add prototype.

2006-01-09  Feng Wang  <fengwang@nudt.edu.cn>

        * simplify.c (gfc_simplify_char): Use UCHAR_MAX instead of literal
        constant.
        (gfc_simplify_ichar): Get the result from unsinged char and in the
        range 0 to UCHAR_MAX instead of CHAR_MIN to CHAR_MAX.

testsuite
2006-01-09  Feng Wang  <fengwang@nudt.edu.cn>

        PR fortran/12456
        * gfortran.dg/single_char_string.f90: New test.

2006-01-09  Feng Wang  <fengwang@nudt.edu.cn>

        * gfortran.dg/ichar2.f90: New test.


Added:
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/ichar_2.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/single_char_string.f90
Modified:
    branches/gcc-4_1-branch/gcc/fortran/ChangeLog
    branches/gcc-4_1-branch/gcc/fortran/simplify.c
    branches/gcc-4_1-branch/gcc/fortran/trans-expr.c
    branches/gcc-4_1-branch/gcc/fortran/trans-intrinsic.c
    branches/gcc-4_1-branch/gcc/fortran/trans.h
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog


-- 


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




More information about the Gcc-bugs mailing list