This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16293] __attribute__(([non-]const)): optimization bug?
- From: "pluto at pld-linux dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jun 2004 10:54:02 -0000
- Subject: [Bug c++/16293] __attribute__(([non-]const)): optimization bug?
- References: <20040630094650.16293.pluto@pld-linux.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pluto at pld-linux dot org 2004-06-30 10:53 -------
(In reply to comment #2)
> How can it be?
>
> Tests such as:
> if (0 && bar_const())
> val++;
> if (0 && bar_nonconst())
> val++;
>
> are short-circuited, so bar_const() and bar_nonconst() never get called.
bar_nonconst() has a side effect -> short-circuit isn't allowed.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16293