[Bug rtl-optimization/21848] [4.1 Regression] load_mems / replace_loop_mems bug causes miscompilation of jcf-io.c / SEGV while processing java/lang/AbstractMethodError

2005-06-25 Thread steven at gcc dot gnu dot org


-- 
   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed||1
   Last reconfirmed|-00-00 00:00:00 |2005-06-25 13:04:49
   date||


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


[Bug rtl-optimization/21848] [4.1 Regression] load_mems / replace_loop_mems bug causes miscompilation of jcf-io.c / SEGV while processing java/lang/AbstractMethodError

2005-06-20 Thread amylaar at gcc dot gnu dot org

--- Additional Comments From amylaar at gcc dot gnu dot org  2005-06-20 
08:48 ---
(In reply to comment #2)
 This was fixed by reverting the patch which caused this.

Which patch was this?

-- 


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


[Bug rtl-optimization/21848] [4.1 Regression] load_mems / replace_loop_mems bug causes miscompilation of jcf-io.c / SEGV while processing java/lang/AbstractMethodError

2005-06-20 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-20 
12:09 ---
(In reply to comment #3)
 (In reply to comment #2)
  This was fixed by reverting the patch which caused this.
 
 Which patch was this?
2005-05-31  Pat Haugen  [EMAIL PROTECTED]

* loop.c (loop_invariant_p, valid_initial_value_p): Revert last
change.


The last change was:
2005-05-30  Pat Haugen  [EMAIL PROTECTED]

* loop.c (loop_invariant_p, valid_initial_value_p): Use
regs_invalidated_by_call instead of call_used_regs.


-- 


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


[Bug rtl-optimization/21848] [4.1 Regression] load_mems / replace_loop_mems bug causes miscompilation of jcf-io.c / SEGV while processing java/lang/AbstractMethodError

2005-06-20 Thread amylaar at gcc dot gnu dot org

--- Additional Comments From amylaar at gcc dot gnu dot org  2005-06-20 
13:05 ---
(In reply to comment #4)
 2005-05-31  Pat Haugen  [EMAIL PROTECTED]
 
   * loop.c (loop_invariant_p, valid_initial_value_p): Revert last
   change.
 
 
 The last change was:
 2005-05-30  Pat Haugen  [EMAIL PROTECTED]
 
   * loop.c (loop_invariant_p, valid_initial_value_p): Use
   regs_invalidated_by_call instead of call_used_regs.
 

The failure that I analyzed involved killing stores to memory, not fixed
registers.  Therefore, the underlying problem has not been fixed, it has
only become latent (again?).  I don't think we should daclare a latent
wrong-code bug as fixed.  We might change the severity amd/or priority,
though.


-- 


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


[Bug rtl-optimization/21848] [4.1 Regression] load_mems / replace_loop_mems bug causes miscompilation of jcf-io.c / SEGV while processing java/lang/AbstractMethodError

2005-06-20 Thread amylaar at gcc dot gnu dot org

--- Additional Comments From amylaar at gcc dot gnu dot org  2005-06-20 
13:21 ---
P.S.: I realize now that the code in gcc/java/jcf-io.c is no longer miscompiled
for i686-pc-linux-gnu because the memory addresses contain stack pointer
references, and the stack pointer is a fixed register, i.e. call used, but not
invalidated by a call.  Hence with Pat Haugen's patch reversed, we falsely
conclude that addresses of the stack locations are not loop invariant.
Two wrongs don't make a right here, though.  The wider context of the
loop_invariant_p code is:

   case REG:
  if ((x == frame_pointer_rtx || x == hard_frame_pointer_rtx
   || x == arg_pointer_rtx || x == pic_offset_table_rtx)
   ! current_function_has_nonlocal_goto)
return 1;

  if (LOOP_INFO (loop)-has_call
   REGNO (x)  FIRST_PSEUDO_REGISTER  call_used_regs[REGNO (x)])
return 0;


I.e. if the libcall parameter values are addressed using an argument or
frame pointer instead of directly via the stack pointer, invalid hoisting of
the stores can still occur. 

-- 


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


[Bug rtl-optimization/21848] [4.1 Regression] load_mems / replace_loop_mems bug causes miscompilation of jcf-io.c / SEGV while processing java/lang/AbstractMethodError

2005-06-20 Thread amylaar at gcc dot gnu dot org

--- Additional Comments From amylaar at gcc dot gnu dot org  2005-06-21 
05:37 ---
The actual reason for the wrong-code generation has not been fixed.
Moreover, AFAICS, on ACCUMULATE_OUTGOING_ARGS targets, the stack
pointer is loop invariant unless current_function_calls_alloca, and
pretending otherwise is an unnecessary pessimization.

-- 
   What|Removed |Added

 Status|RESOLVED|UNCONFIRMED
 Resolution|FIXED   |


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


[Bug rtl-optimization/21848] [4.1 Regression] load_mems / replace_loop_mems bug causes miscompilation of jcf-io.c / SEGV while processing java/lang/AbstractMethodError

2005-06-19 Thread pinskia at gcc dot gnu dot org

--- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-19 
14:06 ---
This was fixed by reverting the patch which caused this.

-- 
   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED


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


[Bug rtl-optimization/21848] [4.1 Regression] load_mems / replace_loop_mems bug causes miscompilation of jcf-io.c / SEGV while processing java/lang/AbstractMethodError

2005-06-01 Thread amylaar at gcc dot gnu dot org


-- 
   What|Removed |Added

   Keywords||patch


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


[Bug rtl-optimization/21848] [4.1 Regression] load_mems / replace_loop_mems bug causes miscompilation of jcf-io.c / SEGV while processing java/lang/AbstractMethodError

2005-05-31 Thread pinskia at gcc dot gnu dot org


-- 
   What|Removed |Added

Summary|load_mems / |[4.1 Regression] load_mems /
   |replace_loop_mems bug causes|replace_loop_mems bug causes
   |miscompilation of jcf-io.c /|miscompilation of jcf-io.c /
   |SEGV while processing   |SEGV while processing
   |java/lang/AbstractMethodErro|java/lang/AbstractMethodErro
   |r   |r
   Target Milestone|--- |4.1.0


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


[Bug rtl-optimization/21848] [4.1 Regression] load_mems / replace_loop_mems bug causes miscompilation of jcf-io.c / SEGV while processing java/lang/AbstractMethodError

2005-05-31 Thread amylaar at gcc dot gnu dot org

--- Additional Comments From amylaar at gcc dot gnu dot org  2005-05-31 
20:56 ---
The problem would not arise if the call was neither const nor pure.

cselib_process_insn has this code:

  if (CALL_P (insn))
{
  for (i = 0; i  FIRST_PSEUDO_REGISTER; i++)
if (call_used_regs[i]
|| (REG_VALUES (i)  REG_VALUES (i)-elt
 HARD_REGNO_CALL_PART_CLOBBERED (i,
  GET_MODE (REG_VALUES (i)-elt-u.val_rtx
  cselib_invalidate_regno (i, reg_raw_mode[i]);

  if (! CONST_OR_PURE_CALL_P (insn))
cselib_invalidate_mem (callmem);
}

So, this explains why ordinary calls work.

There is code in load_mems to take the argument of calls into account, but
it requires CALL_INSN_FUNCTION_USAGE to be set.  So a possible fix would make
sure that CALL_INSN_FUNCTION_USAGE is set correctly, at least for
CONST_OR_PURE_CALL_P functions.

-- 


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


[Bug rtl-optimization/21848] [4.1 Regression] load_mems / replace_loop_mems bug causes miscompilation of jcf-io.c / SEGV while processing java/lang/AbstractMethodError

2005-05-31 Thread amylaar at gcc dot gnu dot org


-- 
   What|Removed |Added

URL||http://gcc.gnu.org/ml/gcc-
   ||patches/2005-
   ||05/msg02946.html


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