PM strays from SSAASSIGN trail on _same_shape_AxS followPrf
|
|
Bugzilla Link |
727 |
Created on |
Jun 21, 2010 19:51 |
Resolution |
FIXED |
Resolved on |
Jun 21, 2010 23:47 |
Version |
svn |
OS |
Linux |
Architecture |
PC |
Extended Description
PM has a small, but serious bug in the followPrf code.
When tracing back an N_id/guard/extrema chain, the code blindly
follows PRF_ARG1 of any suitable N_prf node it encounters.
This is generally correct, but in the case of _same_shape_AxA, there
are TWO array results, as well as a guard result:
x', y', p = _same_shape_AxA_( x, y);
If we are chasing the second result, y', we end up chasing x,
rather than y. This can lead to very exciting optimizations,
such as CF deciding that [0] >= [50] is TRUE.
1. Stephan: Can you please confirm that _same_shape_AxA is
the only guard that returns two array results?
2. The fix in PM is going to be somewhat ugly. Another approach
would be this one:
- Make _same_shape_AxA_ return only PRF_ARG1 as its primary
result.
- Change -ecc to emit two _same_shape_AxA_ calls, on
(x, y) and on (y', x').
This would eliminate the problem, but it does lack a certain
elegance...
No nice test case, as this is breaking on 16524:16896:MODIFIED
with tinkered CF code (rattler).