Bug 42281

Summary: g77 and ICHAR wrong results
Product: [Retired] Red Hat Linux Reporter: Nikos Baltas <nb>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: high Docs Contact:
Priority: high    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-06-06 15:08:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
testing ICHAR none

Description Nikos Baltas 2001-05-25 15:02:29 UTC
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)

Comment 1 Nikos Baltas 2001-05-25 15:04:22 UTC
Created attachment 19610 [details]
testing ICHAR

Comment 2 Jakub Jelinek 2001-06-05 07:55:06 UTC
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.

Comment 3 Nikos Baltas 2001-06-06 15:08:36 UTC
Thanks for doing this.
How can I apply this patch to the current gcc installation?
Please advise.

Comment 4 Jakub Jelinek 2001-06-07 13:27:06 UTC
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.

Comment 5 Jakub Jelinek 2001-08-28 15:03:38 UTC
*** Bug 52730 has been marked as a duplicate of this bug. ***