[Search for users]
[Overall Top Noters]
[List of all Conferences]
[Download this site]
Title: | Digital Fortran |
Notice: | Read notes 1.* for important information |
Moderator: | QUARK::LIONEL |
|
Created: | Thu Jun 01 1995 |
Last Modified: | Fri Jun 06 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 1333 |
Total number of notes: | 6734 |
1317.0. "different results when compile with -g, -g1 or -g3" by MGOF01::HSIMON () Wed May 28 1997 06:59
When I compile the following little fortran program with
-g, -g1 or -g3, I have different results with "print" and
"whatis" using dbx or decladebug.
Any hints?
Hans-Werner
---------------------------------------------------------
dunix 3.2
COMPILER: Digital Fortran 77 V4.1-92-33BL
dbx version 3.11.8
DECladebug Debugger Version 3.0-16
---------- kkk.f ----------------------------------------
program kkk
character*10 otto
dimension aa(10)
otto='otto'
b=3.
r=a*3.
write (*,"(2f12.5)") r,a
stop
end
------ f77 -g -o kkk kkk.f ------------------------------
$ dbx kkk
dbx version 3.11.8
Type 'help' for help.
kkk: 4 otto='otto'
(dbx) print r
0.000000 <--------- ok
(dbx) whatis aa
real AA(1:10) <--------- ok
(dbx) q
------ f77 -g -o kkk kkk.f ------------------------------
$ dbx kkk_g1
dbx version 3.11.8
Type 'help' for help.
kkk: 4 otto='otto'
(dbx) print r
"r" is not defined or not active <-------- ?
(dbx) whatis aa
aa is not defined or not active <-------- ?
(dbx) q
------ f77 -g -o kkk kkk.f ------------------------------
$ dbx kkk_g3
dbx version 3.11.8
Type 'help' for help.
kkk: 7 write (*,"(2f12.5)") r,a
warning: Files compiled -g3: parameter values probably wrong
(dbx) print r
R not active <-------- ?
(dbx) whatis aa
real AA(1:10) <-------- ?
(dbx) q
------ f77 -g -o kkk kkk.f ------------------------------
$ decladebug kkk
Welcome to the DECladebug Debugger Version 3.0-16
------------------
object file name: kkk
Reading symbolic information ...done
(decladebug) print r
0 <-------- ok
(decladebug) whatis aa
float (1:10) aa <-------- ok
(decladebug) q
------ f77 -g -o kkk kkk.f ------------------------------
$ decladebug kkk_g1
Welcome to the DECladebug Debugger Version 3.0-16
------------------
object file name: kkk_g1
Reading symbolic information ...done
(decladebug) print r
Symbol r undefined. <-------- ?
Error: no value for r
(decladebug) whatis aa
Symbol aa undefined. <-------- ?
(decladebug) q
------ f77 -g -o kkk kkk.f ------------------------------
$ decladebug kkk_g3
Welcome to the DECladebug Debugger Version 3.0-16
------------------
object file name: kkk_g3
Reading symbolic information ...done
(decladebug) print r
Symbol r not visible in current scope. <-------- ?
Error: no value for r
(decladebug) whatis aa
Symbol aa not visible in current scope. <-------- ?
(decladebug) q
T.R | Title | User | Personal Name | Date | Lines |
---|
1317.1 | Watch the optimisation level | HERON::BLOMBERG | Trapped inside the universe | Wed May 28 1997 08:14 | 11 |
|
First of all you are using "a" before it's defined.
Depending on the degree of optimisation, your variables might
be optimised away. Compiling -g enforces -O0 if you don't
specify anything else, that's why the results "look ok".
Try compiling -g -O4 and -g3 -O0 and see how the results
vary with the degree of optimisation.
/Ake
|