- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Now that a new revision of the CVF compiler is coming out, here is a possible bug in the old compiler.
This program:
This program:
This program:
program AssignedGoToTest common /abc/ address, value integer*2 address, value value = 1 assign 20 to address go to address 20 print *, value endfails to warn that is is not valid to assign an address to a 16-bit variable. When it runs, it prints "64" (on my system).
This program:
program AssignedGoToTest common /abc/ address, value !DEC$ ATTRIBUTES DLLIMPORT :: /abc/ integer*2 address, value value = 1 assign 20 to address go to address 20 print *, value endgives the following compiler error message:
f90: Fatal: There has been an internal compiler error (C0000005). Error executing df.exe.Hopefully this problem has already been reported, and is not present in the Intel compiler.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your first bug isn't a compiler bug. You made the incorrect assumption that the value stored by ASSIGN is an address. It may be, or may not be, depending on the size of the variable. It is incorrect for a program to make any assumptions about the value stored - programs which do so are broken.
I can't reproduce your second error in CVF 6.6B.
Steve
I can't reproduce your second error in CVF 6.6B.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I guess we have CVF 6.6, not CVF 6.6B. Is there a way to view the release notes, and get the upgrade, that does not involve FTP, which we can not access?
I'm puzzled by your comment that, "It is incorrect for a program to make any assumptions about the value stored." The compiler in fact interprets the ASSIGN statement by storing a 32-bit value starting at the address of the INTEGER*2. This overwrites the following two bytes of memory in a basically unpredictable way. The least the compiler could do is issue a warning. Or else it should use some scheme to map "statement label values" to 16-bit values. But since it doesn't do any conversion but just merrily overwrites memory, the compiler should at least issue a warning, it seems to me.
I'm puzzled by your comment that, "It is incorrect for a program to make any assumptions about the value stored." The compiler in fact interprets the ASSIGN statement by storing a 32-bit value starting at the address of the INTEGER*2. This overwrites the following two bytes of memory in a basically unpredictable way. The least the compiler could do is issue a warning. Or else it should use some scheme to map "statement label values" to 16-bit values. But since it doesn't do any conversion but just merrily overwrites memory, the compiler should at least issue a warning, it seems to me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is not currently a way to get at the release notes or upgrade by http. I have to ask the HP web people to make the release notes available by FTP, and they're rather slow to respond.
At first, I thought you were mistaken about ASSIGN, but I was able to come up with a test case that showed a problem. It's hard to do so, because in many cases the compiler uses a "shadow variable" and doesn't actually store into the variable you named at all. I can't reproduce it in Intel Visual Fortran, though. It's not supposed to overwrite variables, obviously!
Steve
At first, I thought you were mistaken about ASSIGN, but I was able to come up with a test case that showed a problem. It's hard to do so, because in many cases the compiler uses a "shadow variable" and doesn't actually store into the variable you named at all. I can't reproduce it in Intel Visual Fortran, though. It's not supposed to overwrite variables, obviously!
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CVF 66-66B upgrade is at:
ftp://ftp.compaq.com/pub/products/fortran/vf/CVF-66-66B.exe
Greg
ftp://ftp.compaq.com/pub/products/fortran/vf/CVF-66-66B.exe
Greg
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page