public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Fix gimple type checking errors on ppc
@ 2007-07-27 11:00 Zdenek Dvorak
  2007-07-27 13:25 ` Richard Guenther
  0 siblings, 1 reply; 2+ messages in thread
From: Zdenek Dvorak @ 2007-07-27 11:00 UTC (permalink / raw)
  To: gcc-patches

Hello,

build of gcc on ppc and ppc64 is failing for me with gimple type
checking messages.  The problem is in the code generated by
rs6000_gimplify_va_arg, when TREE_TYPE (reg) is not compatible with
sizetype.

Bootstrapped & regtested on {ppc, ppc64}-linux.

Zdenek

	* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Generate the
	operands with compatible type.

Index: config/rs6000/rs6000.c
===================================================================
*** config/rs6000/rs6000.c	(revision 126959)
--- config/rs6000/rs6000.c	(working copy)
*************** rs6000_gimplify_va_arg (tree valist, tre
*** 6465,6471 ****
  	{
  	  regalign = 1;
  	  u = build2 (BIT_AND_EXPR, TREE_TYPE (reg), reg,
! 		     size_int (n_reg - 1));
  	  u = build2 (POSTINCREMENT_EXPR, TREE_TYPE (reg), reg, u);
  	}
        /* _Decimal128 is passed in even/odd fpr pairs; the stored
--- 6465,6471 ----
  	{
  	  regalign = 1;
  	  u = build2 (BIT_AND_EXPR, TREE_TYPE (reg), reg,
! 		     build_int_cst (TREE_TYPE (reg), n_reg - 1));
  	  u = build2 (POSTINCREMENT_EXPR, TREE_TYPE (reg), reg, u);
  	}
        /* _Decimal128 is passed in even/odd fpr pairs; the stored
*************** rs6000_gimplify_va_arg (tree valist, tre
*** 6487,6493 ****
        if (sav_ofs)
  	t = build2 (POINTER_PLUS_EXPR, ptr_type_node, sav, size_int (sav_ofs));
  
!       u = build2 (POSTINCREMENT_EXPR, TREE_TYPE (reg), reg, size_int (n_reg));
        u = fold_convert (sizetype, u);
        u = build2 (MULT_EXPR, sizetype, u, size_int (sav_scale));
        t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t, u);
--- 6487,6494 ----
        if (sav_ofs)
  	t = build2 (POINTER_PLUS_EXPR, ptr_type_node, sav, size_int (sav_ofs));
  
!       u = build2 (POSTINCREMENT_EXPR, TREE_TYPE (reg), reg,
! 		  build_int_cst (TREE_TYPE (reg), n_reg));
        u = fold_convert (sizetype, u);
        u = build2 (MULT_EXPR, sizetype, u, size_int (sav_scale));
        t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t, u);

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

* Re: [patch] Fix gimple type checking errors on ppc
  2007-07-27 11:00 [patch] Fix gimple type checking errors on ppc Zdenek Dvorak
@ 2007-07-27 13:25 ` Richard Guenther
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Guenther @ 2007-07-27 13:25 UTC (permalink / raw)
  To: Zdenek Dvorak; +Cc: gcc-patches

On 7/27/07, Zdenek Dvorak <rakdver@kam.mff.cuni.cz> wrote:
> Hello,
>
> build of gcc on ppc and ppc64 is failing for me with gimple type
> checking messages.  The problem is in the code generated by
> rs6000_gimplify_va_arg, when TREE_TYPE (reg) is not compatible with
> sizetype.
>
> Bootstrapped & regtested on {ppc, ppc64}-linux.

Ok, thanks.

Richard.

> Zdenek
>
>         * config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Generate the
>         operands with compatible type.
>
> Index: config/rs6000/rs6000.c
> ===================================================================
> *** config/rs6000/rs6000.c      (revision 126959)
> --- config/rs6000/rs6000.c      (working copy)
> *************** rs6000_gimplify_va_arg (tree valist, tre
> *** 6465,6471 ****
>         {
>           regalign = 1;
>           u = build2 (BIT_AND_EXPR, TREE_TYPE (reg), reg,
> !                    size_int (n_reg - 1));
>           u = build2 (POSTINCREMENT_EXPR, TREE_TYPE (reg), reg, u);
>         }
>         /* _Decimal128 is passed in even/odd fpr pairs; the stored
> --- 6465,6471 ----
>         {
>           regalign = 1;
>           u = build2 (BIT_AND_EXPR, TREE_TYPE (reg), reg,
> !                    build_int_cst (TREE_TYPE (reg), n_reg - 1));
>           u = build2 (POSTINCREMENT_EXPR, TREE_TYPE (reg), reg, u);
>         }
>         /* _Decimal128 is passed in even/odd fpr pairs; the stored
> *************** rs6000_gimplify_va_arg (tree valist, tre
> *** 6487,6493 ****
>         if (sav_ofs)
>         t = build2 (POINTER_PLUS_EXPR, ptr_type_node, sav, size_int (sav_ofs));
>
> !       u = build2 (POSTINCREMENT_EXPR, TREE_TYPE (reg), reg, size_int (n_reg));
>         u = fold_convert (sizetype, u);
>         u = build2 (MULT_EXPR, sizetype, u, size_int (sav_scale));
>         t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t, u);
> --- 6487,6494 ----
>         if (sav_ofs)
>         t = build2 (POINTER_PLUS_EXPR, ptr_type_node, sav, size_int (sav_ofs));
>
> !       u = build2 (POSTINCREMENT_EXPR, TREE_TYPE (reg), reg,
> !                 build_int_cst (TREE_TYPE (reg), n_reg));
>         u = fold_convert (sizetype, u);
>         u = build2 (MULT_EXPR, sizetype, u, size_int (sav_scale));
>         t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t, u);
>

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

end of thread, other threads:[~2007-07-27 11:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-27 11:00 [patch] Fix gimple type checking errors on ppc Zdenek Dvorak
2007-07-27 13:25 ` Richard Guenther

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).