| Anonymous | Login | Signup for a new account | 2013-06-19 05:48 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
| 0005824 | OCaml | OCaml backend (code generation) | public | 2012-11-14 12:22 | 2012-11-17 18:33 | |||||||
| Reporter | chambart | |||||||||||
| Assigned To | ||||||||||||
| Priority | normal | Severity | feature | Reproducibility | always | |||||||
| Status | resolved | Resolution | fixed | |||||||||
| Platform | OS | OS Version | ||||||||||
| Product Version | ||||||||||||
| Target Version | Fixed in Version | 4.01.0+dev | ||||||||||
| Summary | 0005824: [patch] avoid tagging integers before right shifting it | |||||||||||
| Description | When right shifting a value, the rightmost bit can be ignored: let f a = (a lsl 3) lsr 2 is compiled as: (or (>>u (+ (<< (+ a/1009 -1) 3) 1) 2) 1)) but could be: (or (>>u (<< (+ a/1009 -1) 3) 2) 1)) | |||||||||||
| Tags | No tags attached. | |||||||||||
| Attached Files | ||||||||||||
Notes |
|
|
(0008521) xleroy (administrator) 2012-11-17 18:33 |
Well spotted. Patch applied in trunk, revision 13096. Note that the checks "n > 0" in lsr_int and asr_int are probably unnecessary, since the code generated by Plsrint and Pasrint always does an "or 1" afterwards, restoring the correct tag bit even if n = 0. But n = 0 never happens in well-written code, so we can be conservative. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-11-14 12:22 | chambart | New Issue | |
| 2012-11-14 12:22 | chambart | File Added: 0001-Avoid-tagging-before-right-shifting.patch | |
| 2012-11-17 18:33 | xleroy | Note Added: 0008521 | |
| 2012-11-17 18:33 | xleroy | Status | new => resolved |
| 2012-11-17 18:33 | xleroy | Resolution | open => fixed |
| 2012-11-17 18:33 | xleroy | Fixed in Version | => 4.01.0+dev |
| Copyright © 2000 - 2011 MantisBT Group |