This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/47713] New: String comparison optimization with LLE and friends


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

           Summary: String comparison optimization with LLE and friends
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tkoenig@gcc.gnu.org
            Blocks: 36854


Created attachment 23322
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23322
patch (regression-tested)

A PR to save a patch which I don't really think is appropriate
for late stage 3.  We want to extend the string comparison
optimizations to LLE and friends.  I don't want to forget this
during stage 1 of 4.7 :-)

Test case:

! { dg-do run }
! { dg-options "-O -fdump-tree-original" }
! Check for compile-time simplifications of LLE and friends.
program main
  character(3) :: a
  a = 'ab'
  if (.not. LLE(a,a)) call abort
  if (LLT(a,a)) call abort
  if (.not. LGE(a,a)) call abort
  if (LGT(a,a)) call abort
end program main
! { dg-final { scan-tree-dump-times "gfortran_compare_string" 0 "original" } }
! { dg-final { cleanup-tree-dump "original" } }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]