This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/14627] [tree-ssa] extra assignment inserted on the tree level


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]