[Bug rtl-optimization/14261] ICE due to if-conversion

2006-05-03 Thread krebbel1 at de dot ibm dot com


--- Comment #4 from krebbel1 at de dot ibm dot com  2006-05-03 08:25 ---
The similar problem occurs on s390x:
http://gcc.gnu.org/ml/gcc-patches/2006-03/msg01795.html

The problem (for ia64 and s390x) is fixed on mainline by:
http://gcc.gnu.org/ml/gcc-patches/2006-04/msg00697.html

which unfortunately revealed a problem with paradoxical subregs on big endian
machines which is fixed by:
http://gcc.gnu.org/ml/gcc-patches/2006-04/msg00951.html

(I've added the PR numbers to the changelog entries afterwards, so the patches
aren't mentioned here automatically.)

For gcc 4.1 I've proposed the following trivial patch, in case the others are
considered to risky for gcc 4.1:

Index: gcc/ifcvt.c
===
*** gcc/ifcvt.c.orig2006-03-31 17:03:27.0 +0200
--- gcc/ifcvt.c 2006-03-31 17:04:04.0 +0200
*** noce_process_if_block (struct ce_if_bloc
*** 2231,2236 
--- 2231,2238 
  {
if (no_new_pseudos || GET_MODE (x) == BLKmode)
return FALSE;
+   if (GET_CODE (x) == ZERO_EXTRACT)
+   return FALSE;
x = gen_reg_rtx (GET_MODE (GET_CODE (x) == STRICT_LOW_PART
 ? XEXP (x, 0) : x));
  }


-- 


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



[Bug target/24623] [4.1 Regression] internal compiler error: in propagate_one_insn, at flow.c:1702

2005-11-04 Thread krebbel1 at de dot ibm dot com


--- Comment #5 from krebbel1 at de dot ibm dot com  2005-11-04 08:02 ---
The problem occurs when a landing pad is optimized away but
the special code in s390_regs_ever_clobbered insists on saving all eh
registers. The special code in that function exists because the eh regs
may be read in a function (inside the landing pad) without beeing set
before. In that case s390_regs_ever_clobbered would not consider them
to be saved. With the attached patch the eh regs for a landing pad are
only saved if regs_ever_live is true for them.

I will not post the patch until I have decided how to fix PR 24624. It
is possible that 24624 can only be fixed by reverting my patch introducing
regs_ever_clobbered. If that patch gets reverted this fix is obsolete of
course.

That fixes the testcase in the PR.

Bootstrapped on s390 and s390x - no testsuite regressions.

OK for mainline?

Bye,

-Andreas-


2005-11-03  Andreas Krebbel  <[EMAIL PROTECTED]>

* config/s390/s390.c (s390_regs_ever_clobbered): Only save LIVE eh regs
for a function containing a landing pad.


Index: gcc/config/s390/s390.c
===
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.c,v
retrieving revision 1.257
diff -p -c -r1.257 s390.c
*** gcc/config/s390/s390.c  30 Sep 2005 15:36:15 -  1.257
--- gcc/config/s390/s390.c  3 Nov 2005 12:56:06 -
*** s390_regs_ever_clobbered (int *regs_ever
*** 5874,5880 
   deal with this automatically.  */
if (current_function_calls_eh_return || cfun->machine->has_landing_pad_p)
  for (i = 0; EH_RETURN_DATA_REGNO (i) != INVALID_REGNUM ; i++)
!   regs_ever_clobbered[EH_RETURN_DATA_REGNO (i)] = 1;

/* For nonlocal gotos all call-saved registers have to be saved.
   This flag is also set for the unwinding code in libgcc.
--- 5874,5883 
   deal with this automatically.  */
if (current_function_calls_eh_return || cfun->machine->has_landing_pad_p)
  for (i = 0; EH_RETURN_DATA_REGNO (i) != INVALID_REGNUM ; i++)
!   if (current_function_calls_eh_return 
! || (cfun->machine->has_landing_pad_p 
! && regs_ever_live [EH_RETURN_DATA_REGNO (i)]))
!   regs_ever_clobbered[EH_RETURN_DATA_REGNO (i)] = 1;

/* For nonlocal gotos all call-saved registers have to be saved.
   This flag is also set for the unwinding code in libgcc.


-- 


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



[Bug rtl-optimization/24034] New: Regrename: Inconsistency Failure

2005-09-23 Thread krebbel1 at de dot ibm dot com
gcc -v:

Configured with: /build/gcc-4.1/configure --prefix=/build/gcc-4.1-install
--enable-shared --with-system-zlib --enable-threads=posix --enable-__cxa_atexit
--enable-checking=release --program-suffix=-4.1 --disable-multilib
Thread model: posix
gcc version 4.1.0 20050920 (experimental)

Testcase reduced from 920501-4.c:

Compile with -O3 -funroll-loops

foo ()
{
  int r0[8186];
  int r1[2];
  int i, m, n, m_max;
  int f;
  double fm, ft;
  while (1)
{
  if (m % 4 == 2)
++m;
  if (m_max != 0 && m > m_max)
break;
  while (n % f == 0)
{
  while ((ft != 0) && (ft < fm))
{
  r1[i] = 0;
}
  while (r0[i] != 0 && r1[i] != 0)
{
  if (r0[i] < r1[i])
{
}
}
}
}
}

global alloc puts the uninitialized variables n, f, m_max into r1.

Because global alloc does not consider quantities for uninitialized variables
conflicting with others r1 is also used locally in bb6, bb10 and in bb20.

37.greg:

(insn 265 201 203 20 (set (reg:SI 1 %r1 [93])
(const_int 0 [0x0])) 51 {*movsi_zarch} (nil)
(expr_list:REG_EQUIV (const_int 0 [0x0])
(nil)))

(insn:QI 203 265 204 20 (parallel [
(set (reg:CCL3 33 %cc)
(compare:CCL3 (reg:SI 1 %r1 [93])
(reg:SI 2 %r2 [89])))
(clobber (reg:SI 1 %r1 [93]))
])

Updated life info in 41.csa says that r1 is dead at begin and life at end of 
bb20.

Regrename then decides to rename r1 to r5 and performs a local life update.
Because r1 is not set in bb20 anymore and it is live at bb end it can be
concluded that r1 has to be live at bb start. But this differs from the
state before and the assertion in verify_local_live_at_start ist triggered.

44.rnreg:

Basic block 20:
Closing chain %r1 at insn 203 (terminate_dead)
Register %r1 (1): 265 [GENERAL_REGS] 203 [GENERAL_REGS] 203 [GENERAL_REGS]
Register %r1 in insn 203, renamed as %r5

live_at_start mismatch in bb 20, aborting
New:

first = 0x80531570 current = 0x80531570 indx = 0
0x80531570 next = (nil) prev = (nil) indx = 0
bits = { 0 1 2 3 4 13 15 16 }
Old:
;; basic block 20, loop depth 1, count 0
;; prev block 19, next block 21
;; pred:   18 [79.0%]  19 [100.0%]  (fallthru)
;; succ:   10 [3.5%]  (loop_exit) 21 [96.5%]  (fallthru)
;; Registers live at start:  0 [%r0] 2 [%r2] 3 [%r3] 4 [%r4] 13 [%r13] 15 [%r15]
16 [%f0
]
...
(insn 265 201 203 20 (set (reg:SI 5 %r5 [93])
(const_int 0 [0x0])) 51 {*movsi_zarch} (nil)
(expr_list:REG_EQUIV (const_int 0 [0x0])
(nil)))

(insn:QI 203 265 204 20 (parallel [
(set (reg:CCL3 33 %cc)
(compare:CCL3 (reg:SI 5 %r5 [93])
(reg:SI 2 %r2 [89])))
(clobber (reg:SI 5 %r5 [93]))
])

The problem was already discussed on gcc mailing list:
http://gcc.gnu.org/ml/gcc/2005-08/msg00448.html

A possible solution could be performing a global live update instead of a local
which would not trigger the assertion. Additionally for correct live info we
should call the make_accurate_live_analysis which is used in global alloc
afterwards.

-- 
   Summary: Regrename: Inconsistency Failure
   Product: gcc
   Version: 4.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: rtl-optimization
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: krebbel1 at de dot ibm dot com
CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: s390x-ibm-linux
  GCC host triplet: s390x-ibm-linux
GCC target triplet: s390x-ibm-linux


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


[Bug rtl-optimization/24034] Regrename: Inconsistency Failure

2005-09-23 Thread krebbel1 at de dot ibm dot com


-- 
   What|Removed |Added

 CC||uweigand at gcc dot gnu dot
   ||org


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


[Bug middle-end/24093] [4.1 Regression] cgraph exhausts virtual memory building 197.parser with -profile-use -O3

2005-10-17 Thread krebbel1 at de dot ibm dot com


--- Comment #4 from krebbel1 at de dot ibm dot com  2005-10-17 14:42 ---
I think the problem is that cgraph_decide_recursive_inlining returns true even
if nothing got inlined. That may happen if the function is already more often
inlined into itself than max_depth. In this case the body of the while loop is
not even once executed. With the attached patch the function returns true only
if the counter n got increased at least once indicating that inlining took
place. This patchfixes the bug for the 197.parser testcase and bootstraps on
s390 and s390x without testsuite regressions. It survived a profiledbootstrap
on i686 without producing testsuite regressions.

Index: gcc/ipa-inline.c
===
*** gcc/ipa-inline.c.orig   2005-10-11 17:20:15.0 +0200
--- gcc/ipa-inline.c2005-10-17 13:58:56.0 +0200
*** cgraph_decide_recursive_inlining (struct
*** 650,656 
   function.  At this place we should probably walk the function and
   inline clones and compensate the counts accordingly.  This probably
   doesn't matter much in practice.  */
!   return true;
  }

  /* Set inline_failed for all callers of given function to REASON.  */
--- 650,656 
   function.  At this place we should probably walk the function and
   inline clones and compensate the counts accordingly.  This probably
   doesn't matter much in practice.  */
!   return n > 0;
  }

  /* Set inline_failed for all callers of given function to REASON.  */


-- 


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



[Bug rtl-optimization/24034] [4.1 regression] Regrename: Inconsistency Failure

2005-10-21 Thread krebbel1 at de dot ibm dot com


--- Comment #1 from krebbel1 at de dot ibm dot com  2005-10-21 08:04 ---
This is fixed by:
http://gcc.gnu.org/ml/gcc-patches/2005-10/msg00803.html

Please review.


-- 

krebbel1 at de dot ibm dot com changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
Summary|Regrename: Inconsistency|[4.1 regression] Regrename:
   |Failure |Inconsistency Failure


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



[Bug target/24624] [4.1 Regression] internal compiler error: in reload, at reload1.c:1071

2005-11-03 Thread krebbel1 at de dot ibm dot com


--- Comment #6 from krebbel1 at de dot ibm dot com  2005-11-04 07:56 ---
My patch introduced the s390_regs_ever_clobbered function
which is used instead of regs_ever_live for determining
which registers need saving in function prologue.
This function is called during reload when the elimination
offsets of eliminable registers are calculated. Whithin the
first phase of reload where the reloads only are recorded in
struct reloads without modifying the insn itself the back end
function only sees the registers assigned by global alloc.
Whenever a call clobbered register assigned by global alloc
is changed to a call saved register by reload the back end
can not see this change in the first phase of reload but
afterwards when the changes are applied to the insn. Hence
the elimination offset for the arg pointer can change what
causes the ICE.

Using regs_ever_live is safe even in this first reload phase
because that array is updated when reload information is
recorded in spill_hard_reg.

I've tried a back end hack in s390_regs_ever_clobbered walking 
through the reload_insn_chain if reload_in_progress is set.
For all reload structs I've marked the used reload regs in my
regs_ever_clobbered array. But this is probably wrong because
reload is not bound to the decisions made in the first phase.
It is only assured that the regs in used_spill_regs are sufficient
for covering all spill decisions which will be made later on.
So the better choice should be to look into the used_spill_regs
array which unfortunately is set up after verify_initial_elim_offsets
is called (in select_reload_regs).

For now I don't see how this can be fixed easily. I will discuss the
issue with Ulrich. If we aren't able to come up with a solution I will
revert my patch :(


-- 


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