------- Comment #7 from amonakov at gcc dot gnu dot org  2010-03-03 13:38 
-------
(In reply to comment #6)
> This fixes the -O[123] miscompilations. -Os is slightly harder to fix, since 
> we
> use wrong number of iterations (cond bb is executed 11 times, latch bb with
> assignment 10 times).

I don't see what is the proper fix for the -Os problem.  The loop structure is
as follows:
<bb2>
i = 20
goto bb4

 <bb3>
  i--
  a[i] = 0
 <bb4>
  if (i > 10) goto bb3
Thus, bb4 is header, bb3 is latch, number_of_exit_cond_executions() is 11,
just_once_each_iteration_p() is true for both bb3 and bb4 (?!)


-- 

amonakov at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amonakov at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43236

Reply via email to