This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Confused about code/comment in tree.c:build2
- From: "Bin.Cheng" <amker dot cheng at gmail dot com>
- To: GCC Development <gcc at gcc dot gnu dot org>
- Cc: Richard Biener <rguenther at suse dot de>
- Date: Fri, 31 Jan 2020 12:48:19 +0800
- Subject: Confused about code/comment in tree.c:build2
Hi,
In tree.c:build2 there is following code/comment:
if ((code == MINUS_EXPR || code == PLUS_EXPR || code == MULT_EXPR)
&& arg0 && arg1 && tt && POINTER_TYPE_P (tt)
/* When sizetype precision doesn't match that of pointers
we need to be able to build explicit extensions or truncations
of the offset argument. */
&& TYPE_PRECISION (sizetype) == TYPE_PRECISION (tt))
gcc_assert (TREE_CODE (arg0) == INTEGER_CST
&& TREE_CODE (arg1) == INTEGER_CST);
The comment says specific condition needs to be satisfied if sizetype
precision doesn't match that of pointers, while the code is checking
"==" of precisions? Any explanation?
Thanks,
bin