This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFA]: Fix PR 4420/3770/3623/3306 (sparc)
- From: Stephane Carrez <Stephane dot Carrez at worldnet dot fr>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 30 Nov 2001 20:19:32 +0100
- Subject: [RFA]: Fix PR 4420/3770/3623/3306 (sparc)
Hi!
The sparc bug reported in PR/3623/4420/3306/3770 represented
by the following error:
(insn 2167 2164 791 (set (reg:SF 66 %f34 [372])
(mem:SF (plus:DI (reg/f:DI 30 %fp)
(const_int 2031 [0x7ef])) [0 S4 A32])) 84 {*movsf_insn_novis} (nil)
(nil))
small.cpp:81: Internal compiler error in reload_cse_simplify_operands, at
reload1.c:8347
is due to a wrong definition of HARD_REGNO_MODE_OK for floating point
registers above %f31 (> 63). Fpu registers %f32..%f62 cannot handle
a SFmode but only a DFmode. The two tables 'hard_32bit_mode_classes'
and 'hard_64bit_mode_classes indicate that these registers can handle
SFmode.
So, gcc can allocate these registers for a SFmode register
but it fails later because the FP_REGS class ('f' constraint) only
represents %f0..%f31 and thus does not contain %f32..%f63.
The following patch fixes the sparc hard_xxx_mode_classes tables to
only allow DF and DI modes for %f32..%f62 registers.
Can you approve/integrate this patch in mainline and 3_0 branch?
It is a regression from 2.95.3.
Thanks,
Stephane
2001-11-30 Stephane Carrez <Stephane.Carrez@sun.com>
* config/sparc/sparc.c (DF_MODES_NO_S): Fix pr/3623, define to
accept DFmode and DImode only.
Index: gcc/config/sparc/sparc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.c,v
retrieving revision 1.135.2.5
diff -u -p -r1.135.2.5 sparc.c
--- sparc.c 2001/05/13 07:10:12 1.135.2.5
+++ sparc.c 2001/11/30 19:12:13
@@ -2982,7 +2982,7 @@ enum sparc_mode_class {
#define DF_MODES (S_MODES | D_MODES)
/* Modes for double-float only quantities. */
-#define DF_MODES_NO_S (D_MODES)
+#define DF_MODES_NO_S ((1 << (int) D_MODE) | (1 << (int) DF_MODE))
/* Modes for quad-float only quantities. */
#define TF_ONLY_MODES (1 << (int) TF_MODE)