This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/14627] [tree-ssa] extra assignment inserted on the tree level
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Mar 2004 20:12:57 -0000
- Subject: [Bug optimization/14627] [tree-ssa] extra assignment inserted on the tree level
- References: <20040318034843.14627.dann@godzilla.ics.uci.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-03-23 20:12 -------
The reason for the changing *a to a gets rid of the assignenment is because DOM does
not work through &&.
Here is a testcase without the && (and is reproducable with a):
int foo (int a, int b)
{
int i;
_Bool c = 0;
for (i = 0; i < 10; i++)
{
if (a)
if (b)
goto done;
if (!c){
if (a)
c = 1; }
/*else
c = 0;*/ //Basically DOM is adding this statement as it knows that c == 0 at this point
// so it added it to the PHI as 0.
}
done:
return c;
}
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Severity|normal |enhancement
Keywords| |pessimizes-code
Summary|[tree-ssa] extra assignment |[tree-ssa] extra assignment
|inserted |inserted on the tree level
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14627