This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17972] [3.4 Regression] const/pure functions result in bad asm
- From: "ebotcazou at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Mar 2005 22:02:53 -0000
- Subject: [Bug c++/17972] [3.4 Regression] const/pure functions result in bad asm
- References: <20041013124723.17972.mostrows@watson.ibm.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From ebotcazou at gcc dot gnu dot org 2005-03-03 22:02 -------
> There are other places where TREE_SIDE_EFFECTS matters. (Like, "do we
> have to emit this expression at all, if its result is not used?")
OK.
> The counter to your argument is that I don't see why the C++ front end
> should be penalized because other front ends have a workaround for what
> seems to be a bug in the middle end.
Agreed. But I also think that the FEs that don't use tree inlining cannot even
remotely be affected by the problem, so certainly shouldn't be penalized either.
> The stated purpose for stabilize_reference is to make it possible to use
> an expression more than once. If CALL_EXPRs can't be used more than
> once (which your research would seem to prove), then it seems like
> stabilize_reference should handle that.
Sure, but I think CALL_EXPRs without TREE_SIDE_EFFECTS can be reused more than
once, once tree inlining is done, if they happen not to have been inlined. At
least we don't have counter-examples yet.
> OK, I'm confused, then -- I think that either we have to fix this
> problem in stabilize_reference (which seems better to me) or always set
> TREE_SIDE_EFFECTS on CALL_EXPRs in build3.
stabilize_reference is fine with me. We now only have to settle on the
granularity of the change.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17972