Hi Jeff,
On 23/03/18 23:19, Jeff Law wrote:
On 03/23/2018 09:44 AM, Renlin Li wrote:
Hi all,
This is a simple patch to correct the comment for ADDR_EXPR tree code.
The resulting expression of ADDR_EXPR is a tree with POINTER_TYPE.
So the result mode should ptr_mode instead of Pmode.
As far as I understand, Pmode is the addressing mode. But not the mode
to represent a pointer (or address?).
Okay to commit?
Regards,
Renlin
gcc/ChangeLog:
2018-03-23 Renlin Li <renlin...@arm.com>
* tree.def (ADDR_EXPR): Correct the commnet.I'm not sure this is strictly
correct. More importantly, I'm not sure
why we care :-0
Modes are more of a target/RTL issue. Why a tree node needs to specify
a mode in this case vs a type seems to be the more important question.
It is a very minor issue, I just come cross the comment which doesn't seem very
right.
I agree, the type is more meaningful than the machine mode to describe a tree
node.
The result of ADDR_EXPR should be an expression of POINTER_TYPE or
REFERENCE_TYPE as the document indicates.
I can replace the sentence "Result mode is Pmode." with "The result expression will
always have pointer or reference type."
Thanks!
Renlin
jeff