[Bug rtl-optimization/27661] ICE in subst_reloads

2006-07-20 Thread pinskia at gcc dot gnu dot org


--- Comment #6 from pinskia at gcc dot gnu dot org  2006-07-20 11:16 ---
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED
   Target Milestone|--- |4.2.0


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



[Bug rtl-optimization/27661] ICE in subst_reloads

2006-05-26 Thread uweigand at gcc dot gnu dot org


--- Comment #5 from uweigand at gcc dot gnu dot org  2006-05-26 20:22 
---
Subject: Bug 27661

Author: uweigand
Date: Fri May 26 20:21:53 2006
New Revision: 114141

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=114141
Log:
PR rtl-optimization/27661
* reload.c (find_reloads): When reloading a VOIDmode constant
as address due to an EXTRA_MEMORY_CONSTRAINT or 'o' constraint,
use Pmode as mode of the reload register.

PR rtl-optimization/27661
* gcc.dg/pr27661.c: New test case.

Added:
trunk/gcc/testsuite/gcc.dg/pr27661.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/reload.c
trunk/gcc/testsuite/ChangeLog


-- 


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



[Bug rtl-optimization/27661] ICE in subst_reloads

2006-05-23 Thread patchapp at dberlin dot org


--- Comment #4 from patchapp at dberlin dot org  2006-05-24 03:30 ---
Subject: Bug number PR rtl-optimization/27661

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-05/msg01175.html


-- 


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



[Bug rtl-optimization/27661] ICE in subst_reloads

2006-05-22 Thread uweigand at gcc dot gnu dot org


--- Comment #3 from uweigand at gcc dot gnu dot org  2006-05-22 13:27 
---
Looking somewhat more into this problem, there are other places where
reload decides to reload an CONST_INT as address.  Where this happens,
it usually uses Pmode as the mode to do the reload in (which makes
sense as Pmode should always be valid as the mode of an address).

Look e.g. at the various call sites of find_reloads_address_part.

However, at the place where the decision to reload a valid address
due to and EXTRA_MEMORY_CONSTRAINT or 'o' constraint is made, this
special treatment of VOIDmode constants is missing.  However, it
looks to me that this was simply an oversight here.

Thus, I'd propose something like the following patch (as of right
now completely untested) to replace VOIDmode by Pmode at that place
too.  This should fix the problem.

Index: gcc/reload.c
===
*** gcc/reload.c(revision 113828)
--- gcc/reload.c(working copy)
*** find_reloads (rtx insn, int replace, int
*** 3854,3864 
  goal_alternative_offmemok[i]
  MEM_P (recog_data.operand[i]))
  {
operand_reloadnum[i]
  = push_reload (XEXP (recog_data.operand[i], 0), NULL_RTX,
 XEXP (recog_data.operand[i], 0), (rtx*) 0,
 base_reg_class (VOIDmode, MEM, SCRATCH),
!GET_MODE (XEXP (recog_data.operand[i], 0)),
 VOIDmode, 0, 0, i, RELOAD_FOR_INPUT);
rld[operand_reloadnum[i]].inc
  = GET_MODE_SIZE (GET_MODE (recog_data.operand[i]));
--- 3854,3872 
  goal_alternative_offmemok[i]
  MEM_P (recog_data.operand[i]))
  {
+   /* If the address to be reloaded is a VOIDmode constant,
+  use Pmode as mode of the reload register, as would have
+  been done by find_reloads_address.  */
+   enum machine_mode address_mode;
+   address_mode = GET_MODE (XEXP (recog_data.operand[i], 0));
+   if (address_mode == VOIDmode)
+ address_mode = Pmode;
+
operand_reloadnum[i]
  = push_reload (XEXP (recog_data.operand[i], 0), NULL_RTX,
 XEXP (recog_data.operand[i], 0), (rtx*) 0,
 base_reg_class (VOIDmode, MEM, SCRATCH),
!address_mode,
 VOIDmode, 0, 0, i, RELOAD_FOR_INPUT);
rld[operand_reloadnum[i]].inc
  = GET_MODE_SIZE (GET_MODE (recog_data.operand[i]));


I'll test the patch and propose it on gcc-patches if it works out.
Could you verify this patch helps with your original testcase?


-- 


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



[Bug rtl-optimization/27661] ICE in subst_reloads

2006-05-18 Thread matz at gcc dot gnu dot org


--- Comment #1 from matz at gcc dot gnu dot org  2006-05-18 16:07 ---
Like so perhaps.  It fixes the ICE for me, but I've done no further testing:

--- s390.c.orig 2006-05-18 18:05:59.442621578 +0200
+++ config/s390/s390.c  2006-05-18 18:05:34.632630936 +0200
@@ -2731,6 +2731,9 @@ legitimate_address_p (enum machine_mode
return false;
   if (ad.indx  !REG_OK_FOR_INDEX_STRICT_P (ad.indx))
return false;
+  if (!ad.base  !ad.indx
+   !s390_short_displacement (ad.disp))
+   return false;
 }
   else
 {


-- 


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



[Bug rtl-optimization/27661] ICE in subst_reloads

2006-05-18 Thread krebbel at gcc dot gnu dot org


--- Comment #2 from krebbel at gcc dot gnu dot org  2006-05-18 16:59 ---
Thanks for your comprehensive debugging!

At first glance I would say reload should take a word_mode register and reload
the constant. The code added by your patch to legitimate_address_p says that a
single number is not a valid address which isn't true. We also allow
reg+reg+constant in legitimate_address_p and rely on reload to fix this for Q
and S constraints and I think the same should happen here as well. 


-- 

krebbel at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2006-05-18 16:59:37
   date||


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