Description of Problem: Using g77 (RedHatLinux7.0) the function ICHAR produces wrong results. How Reproducible: All the time. Steps to Reproduce: FORTRAN code: program test integer ic character*1 ch do 100 i=0,255 ch=char(i) ic=ichar(ch) print *,ic 100 continue end Actual Results: 0,1,...,126,127,-128,-129,...-2,-1 Expected Results: 0,1,...,126,127,128,129,.....254,255 Additional Information: Problem occurs with RH Linux7.0 and g77 version 2.96 (gcc 2.96). Problem does not occur in previous version of RH Linux(5.1) with the gcc version (egcs-2.90.27 980315 (egcs-1.0.2 release)
Created attachment 19610 [details] testing ICHAR
Fixed by Toon Moene in http://gcc.gnu.org/ml/gcc-patches/2001-06/msg00062.html, this patch is already in the patchset for the upcoming gcc-g77-2.96-86.
Thanks for doing this. How can I apply this patch to the current gcc installation? Please advise.
gcc-2.96-86 has been built earlier today, either you can grab it from ftp://people.redhat.com/jakub/gcc/2.96-86/ or wait till it propagates through rawhide mirrors.
*** Bug 52730 has been marked as a duplicate of this bug. ***