public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34396]  New: Length of substrings defined by expressions not correctly computed in constructors
@ 2007-12-08 21:02 dominiq at lps dot ens dot fr
  2007-12-08 23:03 ` [Bug fortran/34396] " burnus at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: dominiq at lps dot ens dot fr @ 2007-12-08 21:02 UTC (permalink / raw)
  To: gcc-bugs

The following code

program array_char
implicit none
integer :: i
character (len=5) :: x, y
character (len=5) :: z(2)
x = "a "
y = "cd"
z = ""
z = (/y(1:len(trim(y))), x(1:len(trim(x)))/) 
print *, "|", z(1), "|  |", z(2), "|"
print '(99i4)', ichar ( [ (z(1)(i:i), i=1,5) ] )
print '(99i4)', ichar ( [ (z(2)(i:i), i=1,5) ] )
end program array_char

gives

[ibook-dhum] f90/bug% a.out
 |cdI|  |a`
           |
  99 100 128  73  16
  97  96  12  17   0

As reported in PR33254, comment #14, the length of the strings seems not
computed inget_array_ctor_var_strlen() by:

          if (ref->u.ss.start->expr_type != EXPR_CONSTANT
              || ref->u.ss.end->expr_type != EXPR_CONSTANT)
            break;


-- 
           Summary: Length of substrings defined by expressions not
                    correctly computed in constructors
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dominiq at lps dot ens dot fr
 GCC build triplet: i686-apple-darwin9
  GCC host triplet: i686-apple-darwin9
GCC target triplet: i686-apple-darwin9


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


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

end of thread, other threads:[~2008-06-17 18:10 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-08 21:02 [Bug fortran/34396] New: Length of substrings defined by expressions not correctly computed in constructors dominiq at lps dot ens dot fr
2007-12-08 23:03 ` [Bug fortran/34396] " burnus at gcc dot gnu dot org
2007-12-08 23:08 ` dominiq at lps dot ens dot fr
2007-12-09  6:20 ` jv244 at cam dot ac dot uk
2007-12-09  6:20 ` jv244 at cam dot ac dot uk
2007-12-09  9:29 ` pault at gcc dot gnu dot org
2007-12-09  9:35 ` dominiq at lps dot ens dot fr
2007-12-09 17:14 ` pault at gcc dot gnu dot org
2007-12-16 11:45 ` pault at gcc dot gnu dot org
2008-01-10 14:29 ` burnus at gcc dot gnu dot org
2008-01-10 19:25 ` pault at gcc dot gnu dot org
2008-01-10 19:25 ` pault at gcc dot gnu dot org
2008-06-17 18:10 ` pault at gcc dot gnu dot 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).