looks fine to me.
Where did the original code in cxx_template come from? It shows two
issues in the first place
1. not enough unit test case
2. if this is recent code, code review should have picked this up
(gatekeepers didn't do the proper job :-( )
Sun

On Wed, Aug 10, 2011 at 5:34 AM, Ye, Mei <mei...@amd.com> wrote:
> This patch fixes two bugs that were discovered during development.
>
> The first fix avoids  hoisting of 2nd  if-region (which contains an early
> return) above the intervening code ‘loop’ to be if-merged with the 1st
> if-region.
>
> The second fix corrects a wrong usage of loop index.
>
>
>
> if (a) {
>
> …
>
> }
>
>
>
> loop;  // no dependency on both if-regions.
>
> …
>
> if (a) {
>
>   if (b)
>
>     return;
>
> }
>
>
>
>
>
> -Mei
>
>
>
> Index: be/opt/opt_proactive.cxx
>
> ===================================================================
>
> --- be/opt/opt_proactive.cxx     (revision 1419)
>
> +++ be/opt/opt_proactive.cxx  (working copy)
>
> @@ -3357,6 +3357,9 @@
>
>        return FALSE;
>
>      else if (_action == DO_IFFLIP)
>
>        return FALSE;
>
> +    // Make sure sc1 and sc2 are control equivalent if they are not
> adjacent to each other.
>
> +    else if ((count > 0) && !sc1->Is_ctrl_equiv(sc2))
>
> +      return FALSE;
>
>      else
>
>        return TRUE;
>
>    }
>
> Index: be/com/cxx_template.h
>
> ===================================================================
>
> --- be/com/cxx_template.h        (revision 1418)
>
> +++ be/com/cxx_template.h     (working copy)
>
> @@ -227,7 +227,7 @@
>
>    {
>
>      if (idx < _lastidx) {
>
>         for (int iter = idx; iter < _lastidx; iter++) {
>
> -          _array[idx] = _array[idx+1];
>
> +          _array[iter] = _array[iter+1];
>
>         }
>
>         _array[_lastidx] = NULL;
>
>         Decidx();
>
> ------------------------------------------------------------------------------
> uberSVN's rich system and user administration capabilities and model
> configuration take the hassle out of deploying and managing Subversion and
> the tools developers use with it. Learn more about uberSVN and get a free
> download at:  http://p.sf.net/sfu/wandisco-dev2dev
>
> _______________________________________________
> Open64-devel mailing list
> Open64-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/open64-devel
>
>

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to