Hi Kelvin,

On Tue, Jan 16, 2018 at 11:15:12AM -0600, Kelvin Nilsen wrote:
> 
> A patch committed on 2018-01-10 is causing an ICE with existing test
> program $GCC_SRC/gcc/testsuite/gcc.target/powerpc/pr83399.c, when
> compiled with the -m32 option.  At the time of the commit, it was
> thought that this was a problem with the recent resolution of PR83399.
> However, further investigation revealed a problem with the patch that
> was just committed.  The generated code did not distinguish between 32-
> and 64-bit targets.
> 
> This patch corrects that problem.
> 
> This has been bootstrapped and tested without regressions on
> powerpc64le-unknown-linux (P8) and on powerpc64-unknown-linux (P7) with
> both -m32 and -m64 target options.  Is this ok for trunk?
> 
> 
> gcc/ChangeLog:
> 
> 2018-01-16  Kelvin Nilsen  <kel...@gcc.gnu.org>
> 

        PR target/83399
?  Or is there another PR?

>       * config/rs6000/rs6000-p8swap.c (rs6000_gen_stvx): Generate
>       different rtl trees depending on TARGET_64BIT.
>       (rs6000_gen_lvx): Likewise.
> 
> Index: gcc/config/rs6000/rs6000-p8swap.c
> ===================================================================
> --- gcc/config/rs6000/rs6000-p8swap.c (revision 256710)
> +++ gcc/config/rs6000/rs6000-p8swap.c (working copy)
> @@ -1554,23 +1554,31 @@ rs6000_gen_stvx (enum machine_mode mode, rtx dest_
>        op1 = XEXP (memory_address, 0);
>        op2 = XEXP (memory_address, 1);
>        if (mode == V16QImode)
> -     stvx = gen_altivec_stvx_v16qi_2op (src_exp, op1, op2);
> +     stvx = TARGET_64BIT ? gen_altivec_stvx_v16qi_2op (src_exp, op1, op2)
> +       : gen_altivec_stvx_v16qi_2op_si (src_exp, op1, op2);

Please indent this like

        stvx = TARGET_64BIT
               ? gen_altivec_stvx_v16qi_2op (src_exp, op1, op2)
               : gen_altivec_stvx_v16qi_2op_si (src_exp, op1, op2);

>        if (mode == V16QImode)
> -     stvx = gen_altivec_stvx_v16qi_1op (src_exp, memory_address);
> +     stvx = TARGET_64BIT ?
> +       gen_altivec_stvx_v16qi_1op (src_exp, memory_address)
> +       : gen_altivec_stvx_v16qi_1op_si (src_exp, memory_address);

You should never have ? at the end of line; and ? and : indent with the
controlling expression.  So:

        stvx = TARGET_64BIT
               ? gen_altivec_stvx_v16qi_1op (src_exp, memory_address)
               : gen_altivec_stvx_v16qi_1op_si (src_exp, memory_address);

Similar everywhere.  Okay with that changed.  Thanks!


Segher

Reply via email to