This is the mail archive of the gcc-patches@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]

Re: [PATCH] Optimize 'a ' as single char string too


Jakub Jelinek wrote:

On:

subroutine foo (c)
  character :: c
  if (c .eq. 'a') call abort
  if (c .eq. 'ab') call abort
  if (c .eq. 'a ') call abort
end subroutine

only the first test is optimized into c == 'a' comparison, the other
two call _gfortran_compare_string.

Strictly speaking, a single character (character string of length 1) can never be equal to 'ab', so that could be removed too - but that's probably a case for the Fortran Frontend ...


--
Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/
Progress of GNU Fortran: http://gcc.gnu.org/gcc-4.5/changes.html#Fortran


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