This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: how do I promise const to the optimizer?
- From: "John \(Eljay\) Love-Jensen" <eljay at adobe dot com>
- To: "Marco Manfredini" <mldb at gmx dot net>, <gcc-help at gcc dot gnu dot org>
- Date: Wed, 25 Apr 2007 05:14:34 -0700
- Subject: RE: how do I promise const to the optimizer?
- References: <200704251415.45867.mldb@gmx.net>
Hi Marco,
Does this work:
int bar(const val *__restrict__ x, const int t)
{
const int value = x->tag * t;
return fun(x, value) + fun(x, value);
}
Should optimize nicely.
HTH,
--Eljay