- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using 8.1.023.
I have code that includes SCCS keywords. After compiling, I then search for the keyword string @(#) in the object code. When compiling with -g, the string is there. When compiling with no options it isn't there (not surprising since O2 removes dead storage). However, when I specify O0 without using -g, the string still is not in the object code.
Does the Intel compiler remove dead storage even when optimizations are turned off with O0?
Thanks,
Chris Josefy
Link Copied
10 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, it does. Add the VOLATILE declaration if you don't want it to do so.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have added code as such:
Code:
CHARACTER*80, VOLATILE :: SCCSID DATA SCCSID /'"...."'/
However, the SCCSID still doesn't show up. Any help is appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hmm. I suggest then that you use !DEC$ IDENT for this, as that is its intended purpose. For example:
!DEC$ IDENT "string"
!DEC$ IDENT "string"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the help Steve, but that code still didn't work for me.
With both the VOLATILE and the way you just mentioned, compiling with no options takes out the string, but using -g leaves it in.
Any other thoughts?
Thanks,
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hmm. That's a bug. I'll report it.
Do you need this just once in a program or once per routine? If for a program, this works:
character(30) ident :: ident = "My ident string"
common /ident/ ident
Do you need this just once in a program or once per routine? If for a program, this works:
character(30) ident :: ident = "My ident string"
common /ident/ ident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Because the strings are SCCS keywords, they are unique to each routine. What would really be nice is a compiler option to not remove dead storage.
Thanks for all your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The IDENT directive is what should be used for this, if it worked.... I can't think of a reasonable workaround for subroutines - sorry. The bug will be fixed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I understand the logic behind IDENT, but shouldn't there be an option to turn off the "dead storage" and "dead code" removal? It seems strange that there is no way to compile code and have the object code contain exactly the same variables as the source.
This is a huge problem for companies that want to use optimizations and source control at the same time.
Even if IDENT worked, that would require code changes in every single module. A compiler option that removes this "optimization" would be much better.
Message Edited by cjosefy on 03-10-2005 10:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't understand what difference it makes as to whether the ident string is in an IDENT directive or in a variable.
The program executes correctly with or without the dead storage eliminated. As you noted, the storage is preserved if you ask for debugging. What purpose would such an option have that isn't already provided by a supported feature? Disabling optimizations is always a tricky issue, as it can cause instability in other parts of the compiler that assumes the optimization was done. It also has a cost in testing and documentation.
The program executes correctly with or without the dead storage eliminated. As you noted, the storage is preserved if you ask for debugging. What purpose would such an option have that isn't already provided by a supported feature? Disabling optimizations is always a tricky issue, as it can cause instability in other parts of the compiler that assumes the optimization was done. It also has a cost in testing and documentation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The option would be useful for porting legacy code. If you have thousands of modules that would require this IDENT string instead of a variable, that isn't very feasible for a large company.
I say this because I would think the target consumer for this compiler is companies that are using legacy code. I can't imagine much new code is being written in FORTRAN, and any option that enables less change when porting code is good.
The AIX FORTRAN compiler did not remove dead storage by default as the Intel compiler does. I bet Intel has many customers transitioning off the AIX platform. This option could be invaluable to them.

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