public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/65144] Problems printing, reading and accessing substrings of ISO_10646 character variables
       [not found] <bug-65144-4@http.gcc.gnu.org/bugzilla/>
@ 2015-03-01 18:09 ` dominiq at lps dot ens.fr
  2015-03-03 16:39 ` zbeekman at gmail dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-03-01 18:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65144

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-03-01
     Ever confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
AFAICT the substring problem occurs for PARAMETER only:

program test3
  INTEGER,PARAMETER :: ucs4 = selected_char_kind("ISO_10646")
  CHARACTER(3,UCS4),PARAMETER ::
unip=CHAR(INT(Z'5e74'),UCS4)//CHAR(INT(Z'6708'),ucs4)//CHAR(INT(Z'65e5'),ucs4)
  character(3,UCS4) :: uni
  uni = unip
  open(6, encoding="utf-8")
  print *, uni
  print *, uni(2:2)
  print *, unip
  print *, "'",unip(1:1),"'"
end program test3

gives at run time

 年月日
 月
 年月日
 't'
>From gcc-bugs-return-478885-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Mar 01 18:48:20 2015
Return-Path: <gcc-bugs-return-478885-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 91085 invoked by alias); 1 Mar 2015 18:48:19 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 91044 invoked by uid 55); 1 Mar 2015 18:48:10 -0000
From: "olegendo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/61142] [SH] QImode/HImode @(R0,Rm),Rn does not load to Rn = R0
Date: Sun, 01 Mar 2015 18:48:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: olegendo at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-61142-4-iCuNajY7An@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61142-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61142-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg00029.txt.bz2
Content-length: 428

https://gcc.gnu.org/bugzilla/show_bug.cgi?ida142

--- Comment #7 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Author: olegendo
Date: Sun Mar  1 18:47:38 2015
New Revision: 221089

URL: https://gcc.gnu.org/viewcvs?rev"1089&root=gcc&view=rev
Log:
gcc/testsuite/
    PR target/61142
    * gcc.target/sh/sh/pr61142.c: New.

Added:
    trunk/gcc/testsuite/gcc.target/sh/pr61142.c
Modified:
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/65144] Problems printing, reading and accessing substrings of ISO_10646 character variables
       [not found] <bug-65144-4@http.gcc.gnu.org/bugzilla/>
  2015-03-01 18:09 ` [Bug fortran/65144] Problems printing, reading and accessing substrings of ISO_10646 character variables dominiq at lps dot ens.fr
@ 2015-03-03 16:39 ` zbeekman at gmail dot com
  2015-03-03 16:43 ` zbeekman at gmail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: zbeekman at gmail dot com @ 2015-03-03 16:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65144

--- Comment #2 from Zaak <zbeekman at gmail dot com> ---
Try this:

program test3
  INTEGER,PARAMETER :: ucs4 = selected_char_kind("ISO_10646")
  CHARACTER(3,UCS4),PARAMETER ::
unip=CHAR(INT(Z'5e74'),UCS4)//CHAR(INT(Z'6708'),ucs4)//CHAR(INT(Z'65e5'),ucs4)
  character(3,UCS4) :: uni
  uni = unip
  open(6, encoding="utf-8")
  print *, uni
  print *, uni(2:2)
  print *, unip
  print *, "'",unip(1:1),"'"
  call write_it(unip(2:2))
contains
    subroutine write_it(str)
        character(len=*,kind=UCS4) ,intent(in) :: str
        print *, str
    end subroutine write_it
end program test3


I get this error message when I try to compile:

$ gfortran test3.f90
test3.f90:11.16:

  call write_it(unip(2:2))
                1
Error: Type mismatch in argument 'str' at (1); passed CHARACTER(1) to
CHARACTER(4)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/65144] Problems printing, reading and accessing substrings of ISO_10646 character variables
       [not found] <bug-65144-4@http.gcc.gnu.org/bugzilla/>
  2015-03-01 18:09 ` [Bug fortran/65144] Problems printing, reading and accessing substrings of ISO_10646 character variables dominiq at lps dot ens.fr
  2015-03-03 16:39 ` zbeekman at gmail dot com
@ 2015-03-03 16:43 ` zbeekman at gmail dot com
  2015-03-03 19:55 ` zbeekman at gmail dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: zbeekman at gmail dot com @ 2015-03-03 16:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65144

--- Comment #3 from Zaak <zbeekman at gmail dot com> ---
Similarly if I try to use a substring in an if statement:

program test3
  INTEGER,PARAMETER :: ucs4 = selected_char_kind("ISO_10646")
  CHARACTER(3,UCS4),PARAMETER ::
unip=CHAR(INT(Z'5e74'),UCS4)//CHAR(INT(Z'6708'),ucs4)//CHAR(INT(Z'65e5'),ucs4)
  character(3,UCS4) :: uni
  uni = unip
  open(6, encoding="utf-8")
  print *, uni
  print *, uni(2:2)
  print *, unip
  print *, "'",unip(1:1),"'"
  if ( unip(2:2) == CHAR(INT(Z'6708'),ucs4)) print*, unip(2:2) ! This SHOULD be
true
end program test3

I get the following error:

$ gfortran --version && gfortran ISO_10646.f90
GNU Fortran (Homebrew gcc 4.9.2_1) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

ISO_10646.f90:11.7:

  if ( unip(2:2) == CHAR(INT(Z'6708'),ucs4)) print*, unip(2:2) ! This SHOULD be
       1
Error: Operands of comparison operator '==' at (1) are
CHARACTER(1)/CHARACTER(4)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/65144] Problems printing, reading and accessing substrings of ISO_10646 character variables
       [not found] <bug-65144-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2015-03-03 16:43 ` zbeekman at gmail dot com
@ 2015-03-03 19:55 ` zbeekman at gmail dot com
  2015-03-03 20:48 ` zbeekman at gmail dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: zbeekman at gmail dot com @ 2015-03-03 19:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65144

--- Comment #4 from Zaak <zbeekman at gmail dot com> ---
My apologies, I responded too quickly to Dominique... I thought we were talking
about: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65125 and failed to realize
that this was something (related?) different that that bug. I'll work on a more
concise version of the reproducer I attached here, to try to illustrate this
issue more clearly. I might not get to it until later tonight or tomorrow,
however.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/65144] Problems printing, reading and accessing substrings of ISO_10646 character variables
       [not found] <bug-65144-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2015-03-03 19:55 ` zbeekman at gmail dot com
@ 2015-03-03 20:48 ` zbeekman at gmail dot com
  2015-03-03 20:50 ` zbeekman at gmail dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: zbeekman at gmail dot com @ 2015-03-03 20:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65144

--- Comment #5 from Zaak <zbeekman at gmail dot com> ---
Alright, I agree with Dominique, this bug report was erroneous on my part. In
the two follow up programs I posted, (modifing Dominique's) I accidentally used
`unip` substrings instead of `uni` substrings.

In my original post the issue is that I didn't open stdout with
`encoding='utf-8'` and gfortran doesn't allow unicode/utf8 encoded source files
(trying to add `-finput-charset=utf8` to the gfortran flags results in an
error: "f951: warning: command line option '-finput-charset=utf8' is valid for
C/C++/ObjC/ObjC++ but not for Fortran")

I think I'll close this unless anyone objects.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/65144] Problems printing, reading and accessing substrings of ISO_10646 character variables
       [not found] <bug-65144-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2015-03-03 20:48 ` zbeekman at gmail dot com
@ 2015-03-03 20:50 ` zbeekman at gmail dot com
  2015-03-04 20:52 ` zbeekman at gmail dot com
  2021-10-10 19:52 ` anlauf at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: zbeekman at gmail dot com @ 2015-03-03 20:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65144

Zaak <zbeekman at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #6 from Zaak <zbeekman at gmail dot com> ---
See discussion below, especially my last comment for why this is an invalid
bug.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/65144] Problems printing, reading and accessing substrings of ISO_10646 character variables
       [not found] <bug-65144-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2015-03-03 20:50 ` zbeekman at gmail dot com
@ 2015-03-04 20:52 ` zbeekman at gmail dot com
  2021-10-10 19:52 ` anlauf at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: zbeekman at gmail dot com @ 2015-03-04 20:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65144

--- Comment #7 from Zaak <zbeekman at gmail dot com> ---
(In reply to Dominique d'Humieres from comment #1)
> AFAICT the substring problem occurs for PARAMETER only:
> 
> program test3
>   INTEGER,PARAMETER :: ucs4 = selected_char_kind("ISO_10646")
>   CHARACTER(3,UCS4),PARAMETER ::
> unip=CHAR(INT(Z'5e74'),UCS4)//CHAR(INT(Z'6708'),ucs4)//CHAR(INT(Z'65e5'),
> ucs4)
>   character(3,UCS4) :: uni
>   uni = unip
>   open(6, encoding="utf-8")
>   print *, uni
>   print *, uni(2:2)
>   print *, unip
>   print *, "'",unip(1:1),"'"
> end program test3
> 
> gives at run time
> 
>  年月日
>  月
>  年月日
>  't'

As Dominique noted a problem does exist with ISO 10646 characters with the
parameter attribute. Pleas see PR 65151
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65141 for more details
>From gcc-bugs-return-479384-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Mar 04 20:53:37 2015
Return-Path: <gcc-bugs-return-479384-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 71567 invoked by alias); 4 Mar 2015 20:53:37 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 71524 invoked by uid 48); 4 Mar 2015 20:53:34 -0000
From: "zbeekman at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/65144] Problems printing, reading and accessing substrings of ISO_10646 character variables
Date: Wed, 04 Mar 2015 20:53:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.9.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: zbeekman at gmail dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-65144-4-IIlK9GYIMo@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65144-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65144-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg00528.txt.bz2
Content-length: 914

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65144

--- Comment #8 from Zaak <zbeekman at gmail dot com> ---
(In reply to Dominique d'Humieres from comment #1)
> AFAICT the substring problem occurs for PARAMETER only:
> 
> program test3
>   INTEGER,PARAMETER :: ucs4 = selected_char_kind("ISO_10646")
>   CHARACTER(3,UCS4),PARAMETER ::
> unip=CHAR(INT(Z'5e74'),UCS4)//CHAR(INT(Z'6708'),ucs4)//CHAR(INT(Z'65e5'),
> ucs4)
>   character(3,UCS4) :: uni
>   uni = unip
>   open(6, encoding="utf-8")
>   print *, uni
>   print *, uni(2:2)
>   print *, unip
>   print *, "'",unip(1:1),"'"
> end program test3
> 
> gives at run time
> 
>  年月日
>  月
>  年月日
>  't'

As Dominique noted a problem does exist with ISO 10646 characters with the
parameter attribute. Pleas see PR 65151
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65141 for more details
>From gcc-bugs-return-479385-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Mar 04 20:55:50 2015
Return-Path: <gcc-bugs-return-479385-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 73225 invoked by alias); 4 Mar 2015 20:55:50 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 73164 invoked by uid 48); 4 Mar 2015 20:55:46 -0000
From: "zbeekman at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/65144] Problems printing, reading and accessing substrings of ISO_10646 character variables
Date: Wed, 04 Mar 2015 20:55:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.9.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: zbeekman at gmail dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-65144-4-sraS8TmXiI@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65144-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65144-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg00529.txt.bz2
Content-length: 187

https://gcc.gnu.org/bugzilla/show_bug.cgi?ide144

--- Comment #9 from Zaak <zbeekman at gmail dot com> ---
I'm sorry for the duplicate commet and typo... it should be PR 65141 NOT 151


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug fortran/65144] Problems printing, reading and accessing substrings of ISO_10646 character variables
       [not found] <bug-65144-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2015-03-04 20:52 ` zbeekman at gmail dot com
@ 2021-10-10 19:52 ` anlauf at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-10-10 19:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65144
Bug 65144 depends on bug 65141, which changed state.

Bug 65141 Summary: ISO_10646 constant parameters convert kind when used with substring references
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65141

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-10-10 19:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-65144-4@http.gcc.gnu.org/bugzilla/>
2015-03-01 18:09 ` [Bug fortran/65144] Problems printing, reading and accessing substrings of ISO_10646 character variables dominiq at lps dot ens.fr
2015-03-03 16:39 ` zbeekman at gmail dot com
2015-03-03 16:43 ` zbeekman at gmail dot com
2015-03-03 19:55 ` zbeekman at gmail dot com
2015-03-03 20:48 ` zbeekman at gmail dot com
2015-03-03 20:50 ` zbeekman at gmail dot com
2015-03-04 20:52 ` zbeekman at gmail dot com
2021-10-10 19:52 ` anlauf at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).