[Bug fortran/34145] single_char_string.f90 fails with -fdefault-integer-8

2010-09-06 Thread tkoenig at gcc dot gnu dot org


--- Comment #5 from tkoenig at gcc dot gnu dot org  2010-09-06 19:44 ---
Subject: Bug 34145

Author: tkoenig
Date: Mon Sep  6 19:43:58 2010
New Revision: 163932

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=163932
Log:
2010-09-06  Thomas Koenig  tkoe...@gcc.gnu.org

PR fortran/34145
* trans-expr.c (gfc_conv_substring):  If start and end
of the string reference are equal, set the length to one.

2010-09-06  Thomas Koenig  tkoe...@gcc.gnu.org

PR fortran/34145
* gfortran.dg/char_length_17.f90:  New test.


Added:
trunk/gcc/testsuite/gfortran.dg/char_length_17.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/trans-expr.c
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug fortran/34145] single_char_string.f90 fails with -fdefault-integer-8

2010-09-06 Thread tkoenig at gcc dot gnu dot org


--- Comment #6 from tkoenig at gcc dot gnu dot org  2010-09-06 19:44 ---
Fixed on trunk, closing.


-- 

tkoenig at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


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



[Bug fortran/34145] single_char_string.f90 fails with -fdefault-integer-8

2010-09-04 Thread tkoenig at gcc dot gnu dot org


-- 

tkoenig at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |tkoenig at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2007-11-21 12:25:42 |2010-09-04 23:26:31
   date||


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



[Bug fortran/34145] single_char_string.f90 fails with -fdefault-integer-8

2010-06-11 Thread fxcoudert at gcc dot gnu dot org


--- Comment #3 from fxcoudert at gcc dot gnu dot org  2010-06-11 13:38 
---
(In reply to comment #2)
 Still true for gcc version 4.6.0 20100509 (experimental) (GCC)

I don't know if it's worth the extra work, but this can be tackled in
gfc_conv_substring() by checking whether start.expr and end.expr refer to the
same var_decl (stripping conversions). If they do, the length is one.


-- 


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



[Bug fortran/34145] single_char_string.f90 fails with -fdefault-integer-8

2010-06-11 Thread tkoenig at gcc dot gnu dot org


--- Comment #4 from tkoenig at gcc dot gnu dot org  2010-06-11 20:27 ---
(In reply to comment #3)
 (In reply to comment #2)
  Still true for gcc version 4.6.0 20100509 (experimental) (GCC)
 
 I don't know if it's worth the extra work, but this can be tackled in
 gfc_conv_substring() by checking whether start.expr and end.expr refer to the
 same var_decl (stripping conversions). If they do, the length is one.

This is one example where more powerful simplifications could help.

I'm opening a separate PR for this.


-- 


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



[Bug fortran/34145] single_char_string.f90 fails with -fdefault-integer-8

2010-05-09 Thread dfranke at gcc dot gnu dot org


--- Comment #2 from dfranke at gcc dot gnu dot org  2010-05-09 19:14 ---
Still true for gcc version 4.6.0 20100509 (experimental) (GCC)


-- 

dfranke at gcc dot gnu dot org changed:

   What|Removed |Added

OtherBugsDependingO||36854
  nThis||


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



[Bug fortran/34145] single_char_string.f90 fails with -fdefault-integer-8

2007-11-21 Thread fxcoudert at gcc dot gnu dot org


--- Comment #1 from fxcoudert at gcc dot gnu dot org  2007-11-21 12:25 
---
The following (doesn't need to be compiled with -fdefault-integer-8):

  character (len=5) :: c
  integer(kind=8) :: i

  i = 3
  c(i:i) = 'a'
  if (c(i:i) /= 'a') call abort ()
end

gives the tree code below:

integer(kind=4) D.864;
integer(kind=4) D.863;

D.863 = (integer(kind=4)) i;
D.864 = (integer(kind=4)) i;
if (_gfortran_compare_string (MAX_EXPR (1 - D.863) + D.864, 0,
(character(kind=1)[1:5] *) c[D.863]{lb: 1 sz: 1}, 1, a[1]{lb: 1 sz: 1}) !=
0)
_gfortran_abort ();

We simply don't see that D.863 and D.864 are equal, due to the conversion.


-- 

fxcoudert at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2007-11-21 12:25:42
   date||


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