This is the mail archive of the gcc@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]

Re: How to implement '@' GDB-like operator for libcc1


On Mon, 16 Mar 2015 15:43:21 +0100, Tom Tromey wrote:
> It seems like there should be some kind of reference to &op0, that is,
> lowering ATSIGN_EXPR to *(typeof(OP0)[OP1]*)(&OP0).

OK, I got it now.  I was using GDB-like 'struct type *' where 'struct value *'
should have been as in GCC both are 'tree'.

After fixing that it started working:
	https://github.com/jankratochvil/gcc/commit/abe7d19e06d4daed79720cd1465a1f87763d2095

	ret = copy_node (op0);
	TREE_TYPE (ret) = build_array_type_nelts (TREE_TYPE (op0), tree_to_uhwi (op1));


> Also, I this has to consider the case where OP1 is not a constant.

I find that already checked in gcc/c/c-typeck.c .


Thanks,
Jan


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