This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ICE for mips-linux-gcc -O2
Richard Sandiford wrote:
> Thiemo Seufer <ths@networkno.de> writes:
> > * config/mips/mips.c (override_options): Don't allow too small
> > integers in FP registers, there are no appropriate load/store
> > instructions.
>
> This is the right idea, but...
>
> > /* Allow integer modes that fit into a single
> > register. We need to put integers into FPRs
> > when using instructions like cvt and trunc. */
> > - || (class == MODE_INT && size <= UNITS_PER_FPREG)
> > + || (class == MODE_INT && size == UNITS_PER_FPREG)
> > /* Allow TFmode for CCmode reloads. */
> > || (ISA_HAS_8CC && mode == TFmode));
> >
>
> ...I don't think this is quite right. We must still allow FPRs to
> store SImode on 64-bit targets. How about:
>
> || (class == MODE_INT
> && size >= MIN_UNITS_PER_WORD
> && size <= UNITS_PER_FPREG)
Right, I missed that.
> Also, I believe ChangeLogs are supposed to say "what" not "why".
> It'd probably be better if you drop the ", there are no..." bit
> from the changelog and add it to the comment instead.
Patch updated accordingly, tested the same way as the last one.
Thiemo
2005-12-08 Thiemo Seufer <ths@networkno.de>
* config/mips/mips.c (override_options): Don't allow too small
integers in FP registers.
Index: gcc/config/mips/mips.c
===================================================================
--- gcc/config/mips/mips.c (revision 107837)
+++ gcc/config/mips/mips.c (working copy)
@@ -4916,8 +4916,13 @@
&& size <= UNITS_PER_FPVALUE)
/* Allow integer modes that fit into a single
register. We need to put integers into FPRs
- when using instructions like cvt and trunc. */
- || (class == MODE_INT && size <= UNITS_PER_FPREG)
+ when using instructions like cvt and trunc.
+ We can't allow sizes smaller than a word,
+ the FPU has no appropriate load/store
+ instructions for those. */
+ || (class == MODE_INT
+ && size >= MIN_UNITS_PER_WORD
+ && size <= UNITS_PER_FPREG)
/* Allow TFmode for CCmode reloads. */
|| (ISA_HAS_8CC && mode == TFmode));