This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit, spu] Fix PR target/44877 for SPU as well


Hello,

I was seeing failures in g++.dg/torture/pr37922.C due to an abort
in spu_expand_builtin_1 on the line:
       gcc_assert (TREE_CODE (TREE_TYPE (arg)) == POINTER_TYPE);
because the middle-end was using a mask_for_load builtin on a
reference type instead of a pointer type.

This is exactly the same problem as noticed on PowerPC as 
PR target/44877, and was fixed by allowing this use in the
backend:

2010-07-08  Michael Meissner  <meissner@linux.vnet.ibm.com>

        PR target/44877
        * config/rs6000/rs6000.c (rs6000_expand_builtin): Use
        POINTER_TYPE_P instead of checking only for POINTER_TYPE for the
        builtin mask for load/store builtins.

The following patch adds the same fix to the spu back-end.

Tested on spu-elf, committed to mainline.

Bye,
Ulrich


ChangeLog:

	PR target/44877
	* config/spu/spu.c (spu_expand_builtin_1): Allow references
	(as well as pointers) as argument to mask_for_load builtins.


Index: gcc/config/spu/spu.c
===================================================================
*** gcc/config/spu/spu.c	(revision 162114)
--- gcc/config/spu/spu.c	(working copy)
*************** spu_expand_builtin_1 (struct spu_builtin
*** 6518,6524 ****
  
        /* get addr */
        arg = CALL_EXPR_ARG (exp, 0);
!       gcc_assert (TREE_CODE (TREE_TYPE (arg)) == POINTER_TYPE);
        op = expand_expr (arg, NULL_RTX, Pmode, EXPAND_NORMAL);
        addr = memory_address (mode, op);
  
--- 6518,6524 ----
  
        /* get addr */
        arg = CALL_EXPR_ARG (exp, 0);
!       gcc_assert (POINTER_TYPE_P (TREE_TYPE (arg)));
        op = expand_expr (arg, NULL_RTX, Pmode, EXPAND_NORMAL);
        addr = memory_address (mode, op);
  
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]