public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [RS6000] e500 part of pr71680
@ 2016-08-09  9:04 Alan Modra
  2016-08-09 19:59 ` Segher Boessenkool
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Modra @ 2016-08-09  9:04 UTC (permalink / raw)
  To: gcc-patches; +Cc: Segher Boessenkool, Arseny Solokha

The fallback part of HARD_REGNO_CALLER_SAVE_MODE, choose_hard_reg_mode,
returns DFmode for SImode when TARGET_E500_DOUBLE.  This confuses
lra when attempting to save ctr around a call.

Arseny, the bug reporter, has regression tested this patch.
OK to apply?

	PR target/71680
	* config/rs6000/rs6000.h (HARD_REGNO_CALLER_SAVE_MODE): Return
	SImode for TARGET_E500_DOUBLE when given SImode.

diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index af77258..353f388 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -1273,6 +1273,8 @@ enum data_align { align_abi, align_opt, align_both };
    && ((MODE) == VOIDmode || ALTIVEC_OR_VSX_VECTOR_MODE (MODE))		\
    && FP_REGNO_P (REGNO)						\
    ? V2DFmode								\
+   : TARGET_E500_DOUBLE && (MODE) == SImode				\
+   ? SImode								\
    : TARGET_E500_DOUBLE && ((MODE) == VOIDmode || (MODE) == DFmode)	\
    ? DFmode								\
    : !TARGET_E500_DOUBLE && FLOAT128_IBM_P (MODE) && FP_REGNO_P (REGNO)	\

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RS6000] e500 part of pr71680
  2016-08-09  9:04 [RS6000] e500 part of pr71680 Alan Modra
@ 2016-08-09 19:59 ` Segher Boessenkool
  0 siblings, 0 replies; 2+ messages in thread
From: Segher Boessenkool @ 2016-08-09 19:59 UTC (permalink / raw)
  To: Alan Modra; +Cc: gcc-patches, Arseny Solokha

On Tue, Aug 09, 2016 at 06:34:46PM +0930, Alan Modra wrote:
> The fallback part of HARD_REGNO_CALLER_SAVE_MODE, choose_hard_reg_mode,
> returns DFmode for SImode when TARGET_E500_DOUBLE.  This confuses
> lra when attempting to save ctr around a call.
> 
> Arseny, the bug reporter, has regression tested this patch.
> OK to apply?

Okay for trunk, thanks,


Segher


> 	PR target/71680
> 	* config/rs6000/rs6000.h (HARD_REGNO_CALLER_SAVE_MODE): Return
> 	SImode for TARGET_E500_DOUBLE when given SImode.
> 
> diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
> index af77258..353f388 100644
> --- a/gcc/config/rs6000/rs6000.h
> +++ b/gcc/config/rs6000/rs6000.h
> @@ -1273,6 +1273,8 @@ enum data_align { align_abi, align_opt, align_both };
>     && ((MODE) == VOIDmode || ALTIVEC_OR_VSX_VECTOR_MODE (MODE))		\
>     && FP_REGNO_P (REGNO)						\
>     ? V2DFmode								\
> +   : TARGET_E500_DOUBLE && (MODE) == SImode				\
> +   ? SImode								\
>     : TARGET_E500_DOUBLE && ((MODE) == VOIDmode || (MODE) == DFmode)	\
>     ? DFmode								\
>     : !TARGET_E500_DOUBLE && FLOAT128_IBM_P (MODE) && FP_REGNO_P (REGNO)	\

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-08-09 19:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-09  9:04 [RS6000] e500 part of pr71680 Alan Modra
2016-08-09 19:59 ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).