public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34145]  New: single_char_string.f90 fails with -fdefault-integer-8
@ 2007-11-18 22:02 tkoenig at gcc dot gnu dot org
  2007-11-21 12:25 ` [Bug fortran/34145] " fxcoudert at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-11-18 22:02 UTC (permalink / raw)
  To: gcc-bugs

The test case passes, but somehow _gfortran_compare_string
is still called.

$ gfortran -fdump-tree-original -fdefault-integer-8 single_char_string.f90 
$ grep _gfortran.*string single_char_string.f90.003t.original 
    if (_gfortran_compare_string (MAX_EXPR <(1 - D.507) + D.508, 0>, (char[1:5]
*) &c[D.507]{lb: 1 sz: 1}, 1, &b[1]{lb: 1 sz: 1}) != 0)
    if (_gfortran_compare_string (MAX_EXPR <(1 - D.509) + D.510, 0>, (char[1:5]
*) &c[D.509]{lb: 1 sz: 1}, 1, &"a"[1]{lb: 1 sz: 1}) != 0)
    if (_gfortran_compare_string (1, &a[1]{lb: 1 sz: 1}, MAX_EXPR <(1 - D.511)
+ D.512, 0>, (char[1:5] *) &c[D.511]{lb: 1 sz: 1}) > 0)


-- 
           Summary: single_char_string.f90 fails with -fdefault-integer-8
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tkoenig at gcc dot gnu dot org


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


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

* [Bug fortran/34145] single_char_string.f90 fails with -fdefault-integer-8
  2007-11-18 22:02 [Bug fortran/34145] New: single_char_string.f90 fails with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
@ 2007-11-21 12:25 ` fxcoudert at gcc dot gnu dot org
  2010-05-09 19:14 ` dfranke at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-11-21 12:25 UTC (permalink / raw)
  To: gcc-bugs



------- 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|0000-00-00 00:00:00         |2007-11-21 12:25:42
               date|                            |


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


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

* [Bug fortran/34145] single_char_string.f90 fails with -fdefault-integer-8
  2007-11-18 22:02 [Bug fortran/34145] New: single_char_string.f90 fails with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
  2007-11-21 12:25 ` [Bug fortran/34145] " fxcoudert at gcc dot gnu dot org
@ 2010-05-09 19:14 ` dfranke at gcc dot gnu dot org
  2010-06-11 13:38 ` fxcoudert at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-09 19:14 UTC (permalink / raw)
  To: gcc-bugs



------- 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


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

* [Bug fortran/34145] single_char_string.f90 fails with -fdefault-integer-8
  2007-11-18 22:02 [Bug fortran/34145] New: single_char_string.f90 fails with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
  2007-11-21 12:25 ` [Bug fortran/34145] " fxcoudert at gcc dot gnu dot org
  2010-05-09 19:14 ` dfranke at gcc dot gnu dot org
@ 2010-06-11 13:38 ` fxcoudert at gcc dot gnu dot org
  2010-06-11 20:27 ` tkoenig at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2010-06-11 13:38 UTC (permalink / raw)
  To: gcc-bugs



------- 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


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

* [Bug fortran/34145] single_char_string.f90 fails with -fdefault-integer-8
  2007-11-18 22:02 [Bug fortran/34145] New: single_char_string.f90 fails with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-06-11 13:38 ` fxcoudert at gcc dot gnu dot org
@ 2010-06-11 20:27 ` tkoenig at gcc dot gnu dot org
  2010-09-04 23:26 ` tkoenig at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2010-06-11 20:27 UTC (permalink / raw)
  To: gcc-bugs



------- 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


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

* [Bug fortran/34145] single_char_string.f90 fails with -fdefault-integer-8
  2007-11-18 22:02 [Bug fortran/34145] New: single_char_string.f90 fails with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2010-06-11 20:27 ` tkoenig at gcc dot gnu dot org
@ 2010-09-04 23:26 ` tkoenig at gcc dot gnu dot org
  2010-09-06 19:44 ` tkoenig at gcc dot gnu dot org
  2010-09-06 19:44 ` tkoenig at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2010-09-04 23:26 UTC (permalink / raw)
  To: gcc-bugs



-- 

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


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

* [Bug fortran/34145] single_char_string.f90 fails with -fdefault-integer-8
  2007-11-18 22:02 [Bug fortran/34145] New: single_char_string.f90 fails with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2010-09-04 23:26 ` tkoenig at gcc dot gnu dot org
@ 2010-09-06 19:44 ` tkoenig at gcc dot gnu dot org
  2010-09-06 19:44 ` tkoenig at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2010-09-06 19:44 UTC (permalink / raw)
  To: gcc-bugs



------- 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=gcc&view=rev&rev=163932
Log:
2010-09-06  Thomas Koenig  <tkoenig@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  <tkoenig@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


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

* [Bug fortran/34145] single_char_string.f90 fails with -fdefault-integer-8
  2007-11-18 22:02 [Bug fortran/34145] New: single_char_string.f90 fails with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2010-09-06 19:44 ` tkoenig at gcc dot gnu dot org
@ 2010-09-06 19:44 ` tkoenig at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2010-09-06 19:44 UTC (permalink / raw)
  To: gcc-bugs



------- 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


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

end of thread, other threads:[~2010-09-06 19:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-18 22:02 [Bug fortran/34145] New: single_char_string.f90 fails with -fdefault-integer-8 tkoenig at gcc dot gnu dot org
2007-11-21 12:25 ` [Bug fortran/34145] " fxcoudert at gcc dot gnu dot org
2010-05-09 19:14 ` dfranke at gcc dot gnu dot org
2010-06-11 13:38 ` fxcoudert at gcc dot gnu dot org
2010-06-11 20:27 ` tkoenig at gcc dot gnu dot org
2010-09-04 23:26 ` tkoenig at gcc dot gnu dot org
2010-09-06 19:44 ` tkoenig at gcc dot gnu dot org
2010-09-06 19:44 ` tkoenig 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).