[dataflow, committed] fix pr/31025

Paolo Bonzini bonzini@gnu.org
Fri Mar 16 12:43:00 GMT 2007


This is a fix for a bug in dataflow analysis that occurs when
you have an interesting combination of may-uninitialized
variables and function calls.  The bug is detected by an
assertion check in caller-save.c.

caller_save uses REG_N_CALLS_CROSSED it to decide what to save
(in advance), and urec to decide whether to save something (while
scanning the insns).  But REG_N_CALLS_CROSSED is always computed
using live, not urec.  

And since reg 58 is not in live but it is in urec, caller_save
thinks that reg 58 doesn't have to be saved (using live) and yet
it tries to save it (using urec).

The fix is to use urec to compute reg_info data whenever it is
available.  This gives worse info in general (urec is completely
brain-damaged) but consistent info.

I committed it after regtesting on i686-pc-linux-gnu twice
(on dataflow-branch "as is", and without Steven's DCE patch).

Paolo


2007-03-16  Paolo Bonzini  <bonzini@gnu.org>

        PR rtl-optimization/31025
        * gfortran.dg/pr31025.f90: New.


real*8 function f(x)
t1 = g(0)
if(x .eq. 0) then
  f = 0
else if(x .eq. 1) then
  f = t1 *log( t1 )
end if
end
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: df-pr31025.patch
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070316/1bafe8d3/attachment.ksh>


More information about the Gcc-patches mailing list