Bug 490253
| Summary: | gcc optimizes away critical frees with -O2 flag set; does not occur with vanilla | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 4 | Reporter: | Ladar Levison <ladar> | ||||
| Component: | gcc34 | Assignee: | Jakub Jelinek <jakub> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | high | Docs Contact: | |||||
| Priority: | low | ||||||
| Version: | 4.7 | ||||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| URL: | http://lavabit.com | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2012-06-20 16:58:03 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Ladar Levison
2009-03-14 06:37:11 UTC
Yeah, reproduceable also with vanilla gcc 3.4.x. Doesn't reproduce with -mtune=i486, -mtune=i586 or -mtune=i686, so as a workaround just use -mtune=i686, you aren't running on i386 anyway, are you? Or use unsigned int or unsigned long counter instead of unsigned short. The bug is in the loop optimizer, where it incorrectly determines in check_dbra_loop that the induction variable is always non-negative, when HImode 0xf808 obivously is negative and so when the loop is reversed and after HImode subtraction of 1 from 0xf808 (decw) the jns obviously doesn't loop back when it should. I think this got broken by http://gcc.gnu.org/ml/gcc-patches/2003-07/msg01355.html patch, for LTU we should check that the comparison value isn't when considered as signed less than 0. Created attachment 335362 [details]
gcc34-rh490253.patch
Untested patch that cures this bug.
Thank you for submitting this issue for consideration in Red Hat Enterprise Linux. The release for which you requested us to review is now End of Life. Please See https://access.redhat.com/support/policy/updates/errata/ If you would like Red Hat to re-consider your feature request for an active release, please re-open the request via appropriate support channels and provide additional supporting details about the importance of this issue. |