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 tree-optimization/14701] [tree-ssa] pure function optimization is not done until CSE.


------- Additional Comments From steven at gcc dot gnu dot org  2004-05-17 07:05 -------
copyrename2 dump: 
======================================== 
;; Function foo (foo) 
 
foo (t) 
{ 
  int T.1; 
  int T.0; 
 
  # BLOCK 0 
  # PRED: ENTRY [100.0%]  (fallthru) 
  #   VUSE <.GLOBAL_VAR_4>; 
  T.0_2 = bar (t_1); 
  if (T.0_2 != 0) goto <L0>; else goto <L1>; 
  # SUCC: 2 [33.0%]  (false) 1 [67.0%]  (true) 
 
  # BLOCK 1 
  # PRED: 0 [67.0%]  (true) 
<L0>:; 
  abort (); 
  # SUCC: 
 
  # BLOCK 2 
  # PRED: 0 [33.0%]  (false) 
<L1>:; 
  #   VUSE <.GLOBAL_VAR_4>; 
  T.1_3 = bar (t_1); 
  if (T.1_3 != 0) goto <L2>; else goto <L3>; 
  # SUCC: 4 [53.5%]  (false) 3 [46.5%]  (true) 
 
  # BLOCK 3 
  # PRED: 2 [46.5%]  (true) 
<L2>:; 
  abort (); 
  # SUCC: 
 
  # BLOCK 4 
  # PRED: 2 [53.5%]  (false) 
<L3>:; 
  return; 
  # SUCC: EXIT [100.0%] 
 
} 
======================================== 
 
dom2 dump: 
======================================== 
foo (t) 
{ 
  int T.1; 
  int T.0; 
 
  # BLOCK 0 
  # PRED: ENTRY [100.0%]  (fallthru) 
  #   VUSE <.GLOBAL_VAR_4>; 
  T.0_2 = bar (t_1); 
  if (T.0_2 != 0) goto <L0>; else goto <L1>; 
  # SUCC: 2 [33.0%]  (false) 1 [67.0%]  (true) 
 
  # BLOCK 1 
  # PRED: 0 [67.0%]  (true) 
<L0>:; 
  abort (); 
  # SUCC: 
 
  # BLOCK 2 
  # PRED: 0 [33.0%]  (false) 
<L1>:; 
  T.1_3 = 0; 
  return; 
  # SUCC: EXIT [100.0%] 
 
} 
======================================== 
 
which finally gives: 
 
foo (t) 
{ 
  int T.1; 
  int T.0; 
 
<bb 0>: 
  if (bar (t) != 0) goto <L0>; else goto <L1>; 
 
<L0>:; 
  abort (); 
 
<L1>:; 
  return; 
} 
 
So this is fixed. 
 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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