Limits on constant folding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I hope I'm using the term "constant folding" here correctly.  If not,
I apologize.

Is there a limit to the amount of mathematical subexpressions that GCC
can remove at compile time?

Assuming the following:

int x = 2 * 3;

Presumably with the right compiler options, that will compile as:

int x = 6;

But if that is more complicated:

int x = 2 * 3 * 4 / 6 / 7 + 8 - 9;

how far will GCC go before it hits some internal limit where it can no
longer do the calculation at compile time?



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux