Commit a005570e by Jozef Lawrynowicz Committed by Jeff Law

re PR target/79242 (ICE in simplify_subreg, at simplify-rtx.c:6029)

2018-02-14  Jozef Lawrynowicz <jozefl.gcc@gmail.com>

	PR target/79242
	* machmode.def: Define a complex mode for PARTIAL_INT.
	* genmodes.c (complex_class): Return MODE_COMPLEX_INT for
	MODE_PARTIAL_INT.
	* doc/rtl.texi: Document CSPImode.
	* config/msp430/msp430.c (msp430_hard_regno_nregs): Add CPSImode
	handling.
	(msp430_hard_regno_nregs_with_padding): Likewise.

	PR target/79242
	* gcc.target/msp430/pr79242.c: New test.

From-SVN: r257653
parent 3f5ddefd
2018-02-14 Jozef Lawrynowicz <jozefl.gcc@gmail.com>
PR target/79242
* machmode.def: Define a complex mode for PARTIAL_INT.
* genmodes.c (complex_class): Return MODE_COMPLEX_INT for
MODE_PARTIAL_INT.
* doc/rtl.texi: Document CSPImode.
* config/msp430/msp430.c (msp430_hard_regno_nregs): Add CPSImode
handling.
(msp430_hard_regno_nregs_with_padding): Likewise.
2018-02-13 Peter Bergner <bergner@vnet.ibm.com> 2018-02-13 Peter Bergner <bergner@vnet.ibm.com>
PR target/84279 PR target/84279
......
...@@ -914,6 +914,8 @@ msp430_hard_regno_nregs (unsigned int, machine_mode mode) ...@@ -914,6 +914,8 @@ msp430_hard_regno_nregs (unsigned int, machine_mode mode)
{ {
if (mode == PSImode && msp430x) if (mode == PSImode && msp430x)
return 1; return 1;
if (mode == CPSImode && msp430x)
return 2;
return ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) return ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1)
/ UNITS_PER_WORD); / UNITS_PER_WORD);
} }
...@@ -936,6 +938,8 @@ msp430_hard_regno_nregs_with_padding (int regno ATTRIBUTE_UNUSED, ...@@ -936,6 +938,8 @@ msp430_hard_regno_nregs_with_padding (int regno ATTRIBUTE_UNUSED,
{ {
if (mode == PSImode) if (mode == PSImode)
return 2; return 2;
if (mode == CPSImode)
return 4;
return msp430_hard_regno_nregs (regno, mode); return msp430_hard_regno_nregs (regno, mode);
} }
......
...@@ -1303,10 +1303,11 @@ point values. The floating point values are in @code{QFmode}, ...@@ -1303,10 +1303,11 @@ point values. The floating point values are in @code{QFmode},
@findex CDImode @findex CDImode
@findex CTImode @findex CTImode
@findex COImode @findex COImode
@item CQImode, CHImode, CSImode, CDImode, CTImode, COImode @findex CPSImode
@item CQImode, CHImode, CSImode, CDImode, CTImode, COImode, CPSImode
These modes stand for a complex number represented as a pair of integer These modes stand for a complex number represented as a pair of integer
values. The integer values are in @code{QImode}, @code{HImode}, values. The integer values are in @code{QImode}, @code{HImode},
@code{SImode}, @code{DImode}, @code{TImode}, and @code{OImode}, @code{SImode}, @code{DImode}, @code{TImode}, @code{OImode}, and @code{PSImode},
respectively. respectively.
@findex BND32mode @findex BND32mode
......
...@@ -119,6 +119,7 @@ complex_class (enum mode_class c) ...@@ -119,6 +119,7 @@ complex_class (enum mode_class c)
switch (c) switch (c)
{ {
case MODE_INT: return MODE_COMPLEX_INT; case MODE_INT: return MODE_COMPLEX_INT;
case MODE_PARTIAL_INT: return MODE_COMPLEX_INT;
case MODE_FLOAT: return MODE_COMPLEX_FLOAT; case MODE_FLOAT: return MODE_COMPLEX_FLOAT;
default: default:
error ("no complex class for class %s", mode_class_names[c]); error ("no complex class for class %s", mode_class_names[c]);
......
...@@ -260,6 +260,7 @@ UACCUM_MODE (UTA, 16, 64, 64); /* 64.64 */ ...@@ -260,6 +260,7 @@ UACCUM_MODE (UTA, 16, 64, 64); /* 64.64 */
/* Complex modes. */ /* Complex modes. */
COMPLEX_MODES (INT); COMPLEX_MODES (INT);
COMPLEX_MODES (PARTIAL_INT);
COMPLEX_MODES (FLOAT); COMPLEX_MODES (FLOAT);
/* Decimal floating point modes. */ /* Decimal floating point modes. */
......
2018-02-14 Jozef Lawrynowicz <jozefl.gcc@gmail.com>
PR target/79242
* gcc.target/msp430/pr79242.c: New test.
2018-02-13 Peter Bergner <bergner@vnet.ibm.com> 2018-02-13 Peter Bergner <bergner@vnet.ibm.com>
PR target/84372 PR target/84372
......
/* { dg-do compile } */
/* { dg-skip-if "" { "*-*-*" } { "-mcpu=msp430" "-msmall" } { "" } } */
/* { dg-options "-mcpu=msp430x" } */
typedef _Complex __int20 C;
C
foo (C x, C y)
{
return x + y;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment