public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR32522 -- alpha bootstrap failure
@ 2007-07-27  6:28 Serge Belyshev
  2007-08-03 15:46 ` PING " Serge Belyshev
  2007-08-20  6:55 ` Andrew Pinski
  0 siblings, 2 replies; 3+ messages in thread
From: Serge Belyshev @ 2007-07-27  6:28 UTC (permalink / raw)
  To: gcc-patches

Alpha is broken since pointer-plus merge.
The following patch, based on Andrew's from
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32522#c2 fixes it.

This patch is obvious in the spirit of all pointer-plus backend fixes,
and I added just three lines to Andrew's patch, so it should go in
without waiting for me to get an assignement.

Bootstrapped all languages excluding java on alphaev56-unknown-linux-gnu,
regtest in progress. Please apply.


2007-07-27  Andrew Pinski  <andrew_pinski@playstation.sony.com>
            Serge Belyshev  <belyshev@depni.sinp.msu.ru>

        PR target/32522
        * config/alpha/alpha.c (va_list_skip_additions): Check for
        POINTER_PLUS_EXPR in addition to PLUS_EXPR.
        (alpha_stdarg_optimize_hook): Look for POINTER_PLUS_EXPR instead of
        PLUS_EXPR when checking ap.__base.
        (alpha_va_start): Create POINTER_PLUS_EXPR instead of PLUS_EXPR
        when doing addition on pointer types.  Use size_int instead of
        build_int_cst.
        (alpha_gimplify_va_arg_1): Likewise, but use sizetype instead of
        ptr_type in the second operand.


Index: gcc/config/alpha/alpha.c
===================================================================
--- gcc/config/alpha/alpha.c	(revision 126969)
+++ gcc/config/alpha/alpha.c	(working copy)
@@ -5835,7 +5835,8 @@ va_list_skip_additions (tree lhs)
 
       if ((TREE_CODE (rhs) != NOP_EXPR
 	   && TREE_CODE (rhs) != CONVERT_EXPR
-	   && (TREE_CODE (rhs) != PLUS_EXPR
+	   && ((TREE_CODE (rhs) != PLUS_EXPR
+		&& TREE_CODE (rhs) != POINTER_PLUS_EXPR)
 	       || TREE_CODE (TREE_OPERAND (rhs, 1)) != INTEGER_CST
 	       || !host_integerp (TREE_OPERAND (rhs, 1), 1)))
 	  || TREE_CODE (TREE_OPERAND (rhs, 0)) != SSA_NAME)
@@ -5877,7 +5878,7 @@ alpha_stdarg_optimize_hook (struct stdar
 
   lhs = va_list_skip_additions (TREE_OPERAND (rhs, 0));
   if (lhs == NULL_TREE
-      || TREE_CODE (lhs) != PLUS_EXPR)
+      || TREE_CODE (lhs) != POINTER_PLUS_EXPR)
     return false;
 
   base = TREE_OPERAND (lhs, 0);
@@ -6111,8 +6112,8 @@ alpha_va_start (tree valist, rtx nextarg
 			     valist, offset_field, NULL_TREE);
 
       t = make_tree (ptr_type_node, virtual_incoming_args_rtx);
-      t = build2 (PLUS_EXPR, ptr_type_node, t,
-		  build_int_cst (NULL_TREE, offset));
+      t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t,
+		  size_int (offset));
       t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (base_field), base_field, t);
       TREE_SIDE_EFFECTS (t) = 1;
       expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -6172,8 +6173,8 @@ alpha_gimplify_va_arg_1 (tree type, tree
     }
 
   /* Build the final address and force that value into a temporary.  */
-  addr = build2 (PLUS_EXPR, ptr_type, fold_convert (ptr_type, base),
-	         fold_convert (ptr_type, addend));
+  addr = build2 (POINTER_PLUS_EXPR, ptr_type, fold_convert (ptr_type, base),
+	         fold_convert (sizetype, addend));
   internal_post = NULL;
   gimplify_expr (&addr, pre_p, &internal_post, is_gimple_val, fb_rvalue);
   append_to_statement_list (internal_post, pre_p);

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

* PING [PATCH] Fix PR32522 -- alpha bootstrap failure
  2007-07-27  6:28 [PATCH] Fix PR32522 -- alpha bootstrap failure Serge Belyshev
@ 2007-08-03 15:46 ` Serge Belyshev
  2007-08-20  6:55 ` Andrew Pinski
  1 sibling, 0 replies; 3+ messages in thread
From: Serge Belyshev @ 2007-08-03 15:46 UTC (permalink / raw)
  To: gcc-patches


PING fix alpha bootstrap: http://gcc.gnu.org/ml/gcc-patches/2007-07/msg01962.html

test results with this patch: http://gcc.gnu.org/ml/gcc-testresults/2007-07/msg01096.html

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

* Re: [PATCH] Fix PR32522 -- alpha bootstrap failure
  2007-07-27  6:28 [PATCH] Fix PR32522 -- alpha bootstrap failure Serge Belyshev
  2007-08-03 15:46 ` PING " Serge Belyshev
@ 2007-08-20  6:55 ` Andrew Pinski
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Pinski @ 2007-08-20  6:55 UTC (permalink / raw)
  To: Serge Belyshev; +Cc: gcc-patches

On 7/26/07, Serge Belyshev <belyshev@depni.sinp.msu.ru> wrote:
> Alpha is broken since pointer-plus merge.
> The following patch, based on Andrew's from
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32522#c2 fixes it.
>
> This patch is obvious in the spirit of all pointer-plus backend fixes,
> and I added just three lines to Andrew's patch, so it should go in
> without waiting for me to get an assignement.
>
> Bootstrapped all languages excluding java on alphaev56-unknown-linux-gnu,
> regtest in progress. Please apply.
>
>
> 2007-07-27  Andrew Pinski  <andrew_pinski@playstation.sony.com>
>             Serge Belyshev  <belyshev@depni.sinp.msu.ru>
>
>         PR target/32522
>         * config/alpha/alpha.c (va_list_skip_additions): Check for
>         POINTER_PLUS_EXPR in addition to PLUS_EXPR.
>         (alpha_stdarg_optimize_hook): Look for POINTER_PLUS_EXPR instead of
>         PLUS_EXPR when checking ap.__base.
>         (alpha_va_start): Create POINTER_PLUS_EXPR instead of PLUS_EXPR
>         when doing addition on pointer types.  Use size_int instead of
>         build_int_cst.
>         (alpha_gimplify_va_arg_1): Likewise, but use sizetype instead of
>         ptr_type in the second operand.

I have applied this as obvious.

Thanks,
Andrew Pinski

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

end of thread, other threads:[~2007-08-20  6:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-27  6:28 [PATCH] Fix PR32522 -- alpha bootstrap failure Serge Belyshev
2007-08-03 15:46 ` PING " Serge Belyshev
2007-08-20  6:55 ` Andrew Pinski

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