This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/18046] Missed jump threading optimization
- From: "law at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Oct 2004 20:16:55 -0000
- Subject: [Bug tree-optimization/18046] Missed jump threading optimization
- References: <20041018121604.18046.steven@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From law at redhat dot com 2004-10-19 20:16 -------
Subject: Re: Missed jump threading
optimization
On Mon, 2004-10-18 at 16:50, stevenb at suse dot de wrote:
> ------- Additional Comments From stevenb at suse dot de 2004-10-18 22:50 -------
> Subject: Re: Missed jump threading optimization
>
> Hmm, threading the default case sounds interesting, but the real
> reason why the RTL threader catches this and the tree threader does
> not is because on RTL the test case basically looks like this:
>
> extern void foo (void);
> extern int i;
> void
> bar (void)
> {
> if (i == 0)
> foo ();
>
> if (i == 0)
> foo ();
> }
>
> Hey, I can thread that! :-)
>
> So perhaps we should consider lowering SWITCH_EXPRs with only two
> targets to COND_EXPRs after all...? That would be quite easy to
> do.
Jan and maybe others have talked about lowering SWITCH_EXPRs
earlier. I don't recall if it ever got implemented.
jeff
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18046