This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/13869] [tree-ssa] wrong code with a simple loop
- From: "law at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Feb 2004 20:50:41 -0000
- Subject: [Bug optimization/13869] [tree-ssa] wrong code with a simple loop
- References: <20040126203538.13869.stefaandr@hotmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From law at redhat dot com 2004-02-09 20:50 -------
Subject: Re: [tree-ssa] wrong code with a simple loop
In message <20040128212153.4623.qmail@sources.redhat.com>, "steven at gcc dot g
nu dot org" writes:
>After DCE2, not a whole lot remains of the original function:
>
>main ()
>{
> int i;
> int my_bool;
>
> # BLOCK 0
> # PRED: ENTRY (fallthru)
> # SUCC: 1 (fallthru)
>
> # BLOCK 1
> # PRED: 0 (fallthru) 1 (true)
> # i_2 = PHI <0(0), i_24(1)>;
><L2>:;
> i_24 = i_2 + 1;
> if (i_24 <= 9) goto <L2>; else goto <L4>;
> # SUCC: 2 (false) 1 (true)
>
> # BLOCK 2
> # PRED: 1 (false)
><L4>:;
> return 0;
> # SUCC: EXIT
>}
>
>So returns 0 with optimization enabled.
>
>Perhaps Jeff can look into all those dead assignments???
I'm not sure what you want me to do. The dead assignments in the dom
dumps are normal as dom does not try to eliminate dead code. That is
the job of DCE. In fact, DOM can create dead code when jumps are
threaded (as an artifact of the out-of-ssa translation we must do).
Jeff
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13869