[Soot-list] I set correct the jump points for goto and targets for if-s but "Cannot compute SCCs for graph with number of heads = 2"
Cristina Ilie
crysgirlro at yahoo.com
Thu Feb 9 04:35:25 EST 2012
Hi,
I generate a code for loops and when I deal with nested loops I have some problems - I receive the exception [1],
specific for situations when a goto has a bad jump or an if has a bad target. For sample loop like:
for (i=0;i<n;i++){
a = b*b;
}
my tool generates the following code [2] which is correct and all works fine. But for this code:
for (j=0;j<n;j++)
for (i=0;i<n;i++){
a =
b*b;
}
my tool generates the following code[3] and throws the exception [1]. I followed the jump points of goto-s and the targets
of if-s and all seem to be ok. I added tags for goto-s and if-s and it can be observed that the first goto (for loop with "j" counter)
the jump point is the last if (if belonging to loop with j counter) and the same for the loop with "i" counter. I codified the loop
with "j" counter with 1 (has the color 1) and the loop with "i" counter with 0 (has the color 0).
Do you have idea what happens?
Cristina
[1] Caused by: java.lang.RuntimeException: Cannot compute SCCs for graph with number of heads = 2 (etc)
[2]
29 : nop tag: [loopFirstPointOfLoop]
30 : adLoop = intAdStack.<IntLinkedStack: int pop()>() tag: []
31 : i = adLoop
tag: []
32 : goto [?= (branch)] tag: [loopGoto 0] target tag: []
33 : nop tag: [loopIfJumpPoint0]
34 : b.<DerivType: double grad> = b.<DerivType: double
grad> + a.<DerivType: double grad> * b.<DerivType: double
value> tag: []
35 :
b.<DerivType: double grad> = b.<DerivType: double grad> +
a.<DerivType: double grad> * b.<DerivType: double value>
tag: []
36 : a.<DerivType: double grad> = 0.0 tag: []
37 : a.<DerivType: double value> = adStack.<Stack: double pop()>() tag: []
38 : i = i + 1 tag: []
39 : if i < n goto nop tag: []
target tag: [loopIfJumpPoint0]
[3]
35 : nop tag: [loopFirstPointOfLoop]
36 : adLoop = intAdStack.<IntLinkedStack: int pop()>() tag: []
37 : j = adLoop tag: []
38 : goto [?= (branch)]
tag: [loopGoto 1] target tag: []
39 : nop tag: [loopIfJumpPoint1]
40 : nop tag: [loopFirstPointOfLoop]
41 : adLoop = intAdStack.<IntLinkedStack: int pop()>() tag: []
42 : i = adLoop tag: []
43 : goto [?=
(branch)] tag: [loopGoto 0] target tag: []
44 : nop tag: [loopIfJumpPoint0]
45 : b.<DerivType: double grad> = b.<DerivType: double
grad> + a.<DerivType: double grad> * b.<DerivType: double
value> tag: []
46 :
b.<DerivType: double grad> = b.<DerivType: double grad> +
a.<DerivType: double grad> * b.<DerivType: double value>
tag: []
47 : a.<DerivType: double grad> = 0.0 tag: []
48 : a.<DerivType: double value> = adStack.<Stack: double pop()>() tag: []
49 : i = i + 1 tag: []
50 : if i < n goto nop tag: [] target tag: [loopIfJumpPoint0]
51 : j = j + 1
tag: []
52 : if j < n goto nop tag: [] target tag: [loopIfJumpPoint1]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20120209/9462dfa5/attachment.html
More information about the Soot-list
mailing list