This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: g++ pointer tracking question
- From: Jason Merrill <jason at redhat dot com>
- To: Steve Ellcey <sje at cup dot hp dot com>
- Cc: gcc at gcc dot gnu dot org, law at redhat dot com, Jason Merrill <jason at redhat dot com>
- Date: Sat, 18 May 2002 16:17:37 +0100
- Subject: Re: g++ pointer tracking question
- References: <200205162117.OAA11274@hpsje.cup.hp.com>
Does this fix the problem?
*** calls.c.~1~ Fri May 10 14:22:49 2002
--- calls.c Sat May 18 16:07:09 2002
*************** expand_call (exp, target, ignore)
*** 3086,3092 ****
rtx temp = gen_reg_rtx (GET_MODE (valreg));
/* Mark the return value as a pointer if needed. */
! if (TREE_CODE (TREE_TYPE (exp)) == POINTER_TYPE)
mark_reg_pointer (temp,
TYPE_ALIGN (TREE_TYPE (TREE_TYPE (exp))));
--- 3086,3092 ----
rtx temp = gen_reg_rtx (GET_MODE (valreg));
/* Mark the return value as a pointer if needed. */
! if (POINTER_TYPE_P (TREE_TYPE (exp)))
mark_reg_pointer (temp,
TYPE_ALIGN (TREE_TYPE (TREE_TYPE (exp))));
*************** expand_call (exp, target, ignore)
*** 3118,3124 ****
rtx last, insns;
/* The return value from a malloc-like function is a pointer. */
! if (TREE_CODE (TREE_TYPE (exp)) == POINTER_TYPE)
mark_reg_pointer (temp, BIGGEST_ALIGNMENT);
emit_move_insn (temp, valreg);
--- 3118,3124 ----
rtx last, insns;
/* The return value from a malloc-like function is a pointer. */
! if (POINTER_TYPE_P (TREE_TYPE (exp)))
mark_reg_pointer (temp, BIGGEST_ALIGNMENT);
emit_move_insn (temp, valreg);
*** tree.h.~1~ Thu May 16 05:51:52 2002
--- tree.h Sat May 18 16:06:47 2002
*************** extern void tree_class_check_failed PARA
*** 418,424 ****
reference type. (It should be renamed to INDIRECT_TYPE_P.) */
#define POINTER_TYPE_P(TYPE) \
! (TREE_CODE (TYPE) == POINTER_TYPE || TREE_CODE (TYPE) == REFERENCE_TYPE)
/* Nonzero if TYPE represents a bounded pointer or bounded reference type. */
--- 418,426 ----
reference type. (It should be renamed to INDIRECT_TYPE_P.) */
#define POINTER_TYPE_P(TYPE) \
! ((TREE_CODE (TYPE) == POINTER_TYPE \
! && TREE_CODE (TREE_TYPE (TYPE)) != OFFSET_TYPE) \
! || TREE_CODE (TYPE) == REFERENCE_TYPE)
/* Nonzero if TYPE represents a bounded pointer or bounded reference type. */