This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: programming language that does not inhibit further optimization by gcc
- From: Ian Lance Taylor <iant at google dot com>
- To: Albert Abramson <abramson dot albert at gmail dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Tue, 15 Oct 2013 07:45:37 -0700
- Subject: Re: programming language that does not inhibit further optimization by gcc
- Authentication-results: sourceware.org; auth=none
- References: <CAEvgbXFD9egt-32A00+Unf4Q7j_sa7ucBE7p7ZNFiWVnNOW+4A at mail dot gmail dot com>
On Mon, Oct 14, 2013 at 5:31 PM, Albert Abramson
<abramson.albert@gmail.com> wrote:
>
> Is there a language out there (similar to Fortran or a dialect of C)
> that doesn't inhibit the compiler from taking advantage of every
> optimization possible?
Sure: Fortran.
> Is there some way to provide a C/C++ compiler
> with extra information about variables and programs so that it can
> maximize performance or minimize size? For example:
>
> int age = 21; //[0, 150) setting maximum limits, compiler could use byte int
> int outsideTemp = 20; //[-273, 80]
> float ERA = 297; //[0, 1000, 3] [min, max, digits of
> accuracy needed]
Hmmm, OK, that kind of thing is available in PL/1 and, I think, in
Ada. But as far as I know it doesn't help compilers very much in
practice.
Ian