------- Comment #1 from tkoenig at gcc dot gnu dot org 2008-12-21 12:03 ------- To clarify, we could detect that the variable only ever has the value of 'yes'. We already do the right thing with constants:
$ cat foo-2.f90 program main character(len=3), parameter :: a = 'yes' print *,'yes' == a end program main $ gfortran -fdump-tree-original foo-2.f90 $ grep compare foo-2.f90.003t.original $ -- tkoenig at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Priority|P3 |P5 Summary|eliminate constant string |eliminate some string |comparisons |comparisons http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38592