[Bug c/45126] volatile lost in optimization

2010-07-29 Thread rguenth at gcc dot gnu dot org


--- Comment #1 from rguenth at gcc dot gnu dot org  2010-07-29 11:25 ---
Possible values for vus are [0, 65535], volatileness does not change that.
Multiplying this as int is always positive (overflow is undefined), so
we can change the test to (vus * vus) != 0.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45126



[Bug c/45126] volatile lost in optimization

2010-07-29 Thread majbrock at dse dot nl


--- Comment #2 from majbrock at dse dot nl  2010-07-29 12:00 ---
Ok, that is a choice.

But even then vus is read only once, where it appeared twice in the expression.
What about the possible side-effects of reading a volatile?


-- 

majbrock at dse dot nl changed:

   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|INVALID |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45126



[Bug c/45126] volatile lost in optimization

2010-07-29 Thread schwab at linux-m68k dot org


--- Comment #3 from schwab at linux-m68k dot org  2010-07-29 12:21 ---
That does not change the fact that vus*vus can be assumed to be non-negative.


-- 

schwab at linux-m68k dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45126



[Bug c/45126] volatile lost in optimization

2010-07-29 Thread majbrock at dse dot nl


--- Comment #4 from majbrock at dse dot nl  2010-07-29 12:41 ---
Andreas said:
>> That does not change the fact that vus*vus can be assumed to be non-negative.

And then this bug was closed again.

So because one part of my report is dismissed you also dismiss the other part?
I already confirmed that you can choose to assume vus*vus to be non-negative.
But still I sustain that vus should read TWICE and it isn't. And thus I
conclude that its volatileness is lost.

Before you close it again can you please explain to me on what grounds vus
should not be read twice?


-- 

majbrock at dse dot nl changed:

   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|INVALID |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45126



[Bug c/45126] volatile lost in optimization

2010-07-29 Thread schwab at linux-m68k dot org


--- Comment #5 from schwab at linux-m68k dot org  2010-07-29 12:55 ---
Works fine here with gcc 4.4.4.

movzwl  vus, %eax
movzwl  vus, %edx


-- 

schwab at linux-m68k dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45126



[Bug c/45126] volatile lost in optimization

2010-07-29 Thread rguenth at gcc dot gnu dot org


--- Comment #6 from rguenth at gcc dot gnu dot org  2010-07-29 13:27 ---
And with all other versions I tried (4.3 and 4.5)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45126



[Bug c/45126] volatile lost in optimization

2010-07-29 Thread majbrock at dse dot nl


--- Comment #7 from majbrock at dse dot nl  2010-07-29 13:30 ---
Thank you both for looking into it and explaining the behaviour.
I feel stupid and apologize, because I was certain that it was not read twice.
Yet now I can no longer reproduce that, so I guess I was wrong after all.

Thanks again.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45126