This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/24486] gcc generates incorrect assignment because of reordering
- From: "manus at eiffel dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Oct 2005 17:20:54 -0000
- Subject: [Bug c/24486] gcc generates incorrect assignment because of reordering
- References: <bug-24486-9608@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from manus at eiffel dot com 2005-10-22 17:20 -------
I agree that relying on gcc's behavior might be the wrong thing to do, but when
this is 15 years old code, you can expect that it will still continue to work.
Moreover, it works on all the C compilers I've ever used except gcc 4.0. This
includes:
- SGI C compiler
- Sun C compiler
- Borland C
- Microsoft C
Too bad that gcc 4.0 breaks this.
The other things is that it occurs without any optimization. I realize that
most of the `unspecified' in the standard is for allowing more optimization,
but when you compile without them, it is rather strange that it does this one.
Would it make sense to have a new option in `gcc' to say that target is always
evaluated after source is? I think that would make transition to gcc 4.0. For
now I can only recommend to my users to stick with the 3.x based versions.
Regards,
Manu
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24486