[Bug translator/11590] New: optimized pre/postfix operators on variable throw away initial variable assignment
mjw at redhat dot com
sourceware-bugzilla@sourceware.org
Wed May 12 13:08:00 GMT 2010
The following testcase shows that the original assignment of the variable is
ignored:
probe begin {
a = 5
// printf("%d ", a)
printf("%d ", (a++))
printf("%d ", (++a))
printf("%d ", (a--))
printf("%d\n", (--a))
exit()
}
$ stap test.stp
0 2 2 0
If we uncomment the actually first use the original assigned value of a things
look correct:
$ stap test.stp
5 5 7 7 5
This is an translation optimization issue, the original script also prints out
the correct value when unoptimized:
$ stap -u test.stp
5 7 7 5
--
Summary: optimized pre/postfix operators on variable throw away
initial variable assignment
Product: systemtap
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: translator
AssignedTo: systemtap at sources dot redhat dot com
ReportedBy: mjw at redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=11590
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the Systemtap
mailing list