Bug 42281 - g77 and ICHAR wrong results
Summary: g77 and ICHAR wrong results
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.0
Hardware: i686
OS: Linux
high
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
: 52730 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-05-25 15:02 UTC by Nikos Baltas
Modified: 2005-10-31 22:00 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed: 2001-06-06 15:08:40 UTC


Attachments (Terms of Use)
testing ICHAR (192 bytes, text/plain)
2001-05-25 15:04 UTC, Nikos Baltas
no flags Details

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. ***


Note You need to log in before you can comment on or make changes to this bug.