This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/19507] missed tree-optimization (constant for the rest of the function)
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 May 2005 09:35:20 -0000
- Subject: [Bug tree-optimization/19507] missed tree-optimization (constant for the rest of the function)
- References: <20050118161903.19507.rguenth@tat.physik.uni-tuebingen.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From rguenth at gcc dot gnu dot org 2005-05-11 09:35 -------
Mainline now has
void foo(const Flag&) (f)
{
const bool D.1718;
int D.1717;
struct Flag * const this;
const bool D.1713;
int D.1712;
struct Flag * const this;
bool D.1707;
bool retval.1;
bool D.1705;
bool retval.0;
int D.1716;
int D.1711;
<bb 0>:
if (f->flag != 0) goto <L1>; else goto <L5>;
<L1>:;
bar ();
if (f->flag != 0) goto <L4>; else goto <L5>;
<L4>:;
bar () [tail call];
<L5>:;
return;
}
I.e. the missing jump threading is done, but still f->flag is seen as
possibly clobbered by the call to bar(). Still a language lawyer has
to sneak in and tell this optimization would be indeed valid. The key
is privateness or constness of Flag::flag.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19507