--- Additional Comments From mostrows at watson dot ibm dot com 2004-10-13 23:11
---
Subject: Re: const/pure functions result in
bad asm
Here is simpler code that demonstrates the problem. Note, no loops
involved. Further below is compilation and objdump with and without
DBUG
--- Additional Comments From amodra at bigpond dot net dot au 2004-10-13 23:04
---
I see the same behaviour as Michal is reporting with 3.4.3 20041010
gcc miscompiles a do while (0) "loop" into an infinite loop.
--
What|Removed |Added
--
What|Removed |Added
CC||amodra at bigpond dot net
||dot au
http://gcc.gnu.org/bugzilla/
--- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-13 22:02
---
-O1 -DBUG vs -O1 on "GCC: (GNU) 3.4.1 20040619 (prerelease)" is the same. Now with
-fno-inline we
do get different asm but the asm is correct as current_thread_info is marked as const
so we only call it
--- Additional Comments From mostrows at watson dot ibm dot com 2004-10-13 21:45
---
Subject: Re: const/pure functions result in
bad asm
For starters, when compiling without -DBUG, the resulting assembly is
much longer (correct assembly, with -DBUG below, that is without
pure/c
--- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-13 14:51
---
What do you think is wrong, attach the difference. Also const/pure functions can
changed so that they
are only called once. And since they are pure (or is it const) is known not to access
memory, the
b