This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: why are we not using const?
- From: Ross Ridge <rridge at csclub dot uwaterloo dot ca>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 27 Jun 2006 12:15:52 -0400
- Subject: Re: why are we not using const?
Andrew Pinski wrote:
>"Stupid" example where a const argument can change:
>tree a;
>int f(const tree b)
>{
> TREE_CODE(a) = TREE_CODE (b) + 1;
> return TREE_CODE (b);
>}
You're not changing the constant argument "b", just what "b" might point
to. I don't think there are any optimizing opportunities for arguments
declared as const, as opposed to arguments declared as pointing to const.
Ross Ridge