Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #5334
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail |
|---|---|
| NNTP-Posting-Date | Sun, 22 May 2011 07:39:08 -0500 |
| From | Pete Becker <pete@versatilecoding.com> |
| Organization | Roundhouse Consulting, Ltd. |
| Newsgroups | comp.lang.c++ |
| Date | Sun, 22 May 2011 08:39:08 -0400 |
| Message-ID | <2011052208390816587-pete@versatilecodingcom> (permalink) |
| References | <e627bb96-b05b-43ac-b6e8-e0ddaf62f9cc@l30g2000vbn.googlegroups.com> <db3320a1-d7d6-4337-af40-10ea1b9a76ee@q12g2000prb.googlegroups.com> <bdb12766-bf2e-4b3c-ab57-7f07e0e530f9@j25g2000vbr.googlegroups.com> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=iso-8859-1; format=flowed |
| Content-Transfer-Encoding | 8bit |
| Subject | Re: Optimization problem |
| User-Agent | Unison/2.1.4 |
| Lines | 41 |
| X-Usenet-Provider | http://www.giganews.com |
| X-Trace | sv3-v29UY7BUw9PPG+YGtWNqcwLaL2NegoS9N2mWwg9jzbmbgySLvS7Lj/g894V1CIVq2dpxRjxuxnRlN7z!AHOA5oe3o1cA5kZI2B1BXierMnYzWaUoGNhcF0e/u2W0ZhY8erv2nnBrE6cJMIMhtk55Zfgw |
| X-Complaints-To | abuse@giganews.com |
| X-DMCA-Notifications | http://www.giganews.com/info/dmca.html |
| X-Abuse-and-DMCA-Info | Please be sure to forward a copy of ALL headers |
| X-Abuse-and-DMCA-Info | Otherwise we will be unable to process your complaint properly |
| X-Postfilter | 1.3.40 |
| X-Original-Bytes | 3084 |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.c++:5334 |
Show key headers only | View raw
On 2011-05-22 04:47:20 -0400, hamze said: > On May 22, 12:25 pm, Joshua Maurice <joshuamaur...@gmail.com> wrote: >> On May 21, 11:29 pm, hamze <hamz...@gmail.com> wrote: >> >>> I have a special device in my system, I must work with it in this >>> manner that : write 4 bytes and read 3 bytes, >>> this device has no reset, so if one of reads or writes miss, from that >>> time device will not work correctly because order of writes and reads >>> are missed. >> >>> this device works right when optimization is off, but when I turn it >>> on it stop working properly in my code. >>> some time i did not use one of its read value, so I think optimization >>> remove it and order of read and writes are missed. >>> how can I solve this problem ? >>> I also test this solution that I defined an asm valotile ( ) and put >>> all reads and write inside it but still turning optimization on >>> corrupt my program result. >> >> From what I've heard in this group, volatile alone is insufficient for >> correct MMIO (memory mapped IO) on most systems. I would suggest >> looking at the docs for your implementation to see what it says about >> correct MMIO. You could also look at the output assembly to see if it >> is indeed not doing as you want. > > thanks alot, you gave me a valuable clue, > I know what is my hardware correct order of MMIO, but I dont know how > to make compiler know about it and force compile not to REORDER my > code. Since there's no code here, just a bunch of hand-waving, it's impossible to say definitively what's going on. But the compiler is not allowed to reorder or combine accesses to volatile objects. -- Pete Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The Standard C++ Library Extensions: a Tutorial and Reference (www.petebecker.com/tr1book)
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Optimization problem hamze <hamze60@gmail.com> - 2011-05-21 23:29 -0700
Re: Optimization problem Joshua Maurice <joshuamaurice@gmail.com> - 2011-05-22 01:25 -0700
Re: Optimization problem hamze <hamze60@gmail.com> - 2011-05-22 01:47 -0700
Re: Optimization problem Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-05-22 11:40 +0000
Re: Optimization problem Pete Becker <pete@versatilecoding.com> - 2011-05-22 08:39 -0400
Re: Optimization problem Nobody <nobody@nowhere.com> - 2011-05-22 15:01 +0100
Re: Optimization problem Geoff <geoff@invalid.invalid> - 2011-05-22 09:14 -0700
csiph-web