- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
sorry for the rather vague question but I could not reproduce my problem in a small code example (which worked perfectly ok), but maybe some of you encountered something similar and can provide an answer nonetheless.
In my code I have something similar to:
------
logical :: valid
call foo( valid )
if (valid ) then
! <- *always* breaks here, independent of 'valid'
endif
------
A breakpoint set inside the if-statement always breaks, independent of the value of 'valid'
('valid' is set in host-associated routine 'foo')
Any guesses why?
Cheers
-Ralf
p.s.Fortran Composer XE 2011, Win7 (same behaviour on win32 & x64).
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Ralf,
If you can't reproduce it in a small example program, could you attach your original program?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ralf,
This may depend on the optimizations. The newer generation processors have a conditional move instruction. This instruction is used to avoid branches. If your code is something like
if(valid) then
a = b
endif
The code generated (pseudo code) would look like
move tempReg, b ! dest, src
test valid
conditional move on true a, tempReg
There is no branches in the above code.
When there are no branches then there is no way to conditionally break (since you cannot break in the middle of an instruction).
You can look at the dissassembly code to confirm if this is the case.
As a work around you can do something like
if(valid) then
if(expression) write(*,*) "expression known to be false"
a = b
endif
Where the expression cannot be predetermined by the compiler as to always being true or false.
The above will generate a branch which then will isolate the breakpoint to the (true) path.
Jim Dempsey
This may depend on the optimizations. The newer generation processors have a conditional move instruction. This instruction is used to avoid branches. If your code is something like
if(valid) then
a = b
endif
The code generated (pseudo code) would look like
move tempReg, b ! dest, src
test valid
conditional move on true a, tempReg
There is no branches in the above code.
When there are no branches then there is no way to conditionally break (since you cannot break in the middle of an instruction).
You can look at the dissassembly code to confirm if this is the case.
As a work around you can do something like
if(valid) then
if(expression) write(*,*) "expression known to be false"
a = b
endif
Where the expression cannot be predetermined by the compiler as to always being true or false.
The above will generate a branch which then will isolate the breakpoint to the (true) path.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting Annalee (Intel)
Hello Ralf,
If you can't reproduce it in a small example program, could you attach your original program?
Thank you Annalee but I'd rather not - it is just an annoyance I can work around it.
Cheers
-Ralf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting jimdempseyatthecove
Ralf,
This may depend on the optimizations. The newer generation processors have a conditional move instruction. This instruction is used to avoid branches. If your code is something like
[snip]
There is no branches in the above code.
When there are no branches then there is no way to conditionally break (since you cannot break in the middle of an instruction).
You can look at the dissassembly code to confirm if this is the case.
As a work around you can do something like
if(valid) then
if(expression) write(*,*) "expression known to be false"
a = b
endif
Where the expression cannot be predetermined by the compiler as to always being true or false.
The above will generate a branch which then will isolate the breakpoint to the (true) path.
Jim Dempsey
This may depend on the optimizations. The newer generation processors have a conditional move instruction. This instruction is used to avoid branches. If your code is something like
[snip]
There is no branches in the above code.
When there are no branches then there is no way to conditionally break (since you cannot break in the middle of an instruction).
You can look at the dissassembly code to confirm if this is the case.
As a work around you can do something like
if(valid) then
if(expression) write(*,*) "expression known to be false"
a = b
endif
Where the expression cannot be predetermined by the compiler as to always being true or false.
The above will generate a branch which then will isolate the breakpoint to the (true) path.
Jim Dempsey
I'll try your workaround.
Cheers
-Ralf
![](/skins/images/B7BA37F9CE4B52FF7CAE1FB0388839C8/responsive_peak/images/icon_anonymous_message.png)
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