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

[Bug fortran/13213] [g77] Hex constant problem when compiling with -fugly-logint and -ftypeless-boz


------- Additional Comments From castro at cae dot ca  2003-11-28 16:38 -------
I don't know if it's necessarily related to those bugs... they seem to be an
order of operations problem. The problem I presented here is more of a
typecasting problem. Also, I don't have a problem if I *only* use ugly-logint
(like the other two bugs)... it's only if I use ugly-logint *with* typeless-boz.

In my source line:
RES1 = GPA * X'6B5'
GPA is a REAL, so what I believe is happening is that X'6B5' is being
interpreted as the hex representation of a real (not sure), but anyway, it's
evaluating to zero. If, however, you use the other way:
RES2 = GPA * (X'6B5')
then X'6B5' evaluates to its decimal equivalent: 1717

I found that the same problem occurs with .le., .eq., etc.
If you compile the following lines with BOTH ugly-logint and typeless-boz:
GPA = 5.4
IF (GPA.LE.X'B0')
IF (GPA.LE.(X'B0'))
the first line evaluates to FALSE while the second line evaluates to TRUE.
The same thing happens if you use .EQ., .GT., etc.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13213


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