This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Longer-term, I think what constant folding really needs are two functions tree_expr_lower_bound and tree_expr_upper_bound, where we can implement some form of interval arithmetic. Then the two current functions tree_expr_nonnegative_p and tree_expr_nonzero_p can easily be implemented by testing the returned bounds against zero. This will provide for more accurate implementations, but also enable many more optimizations, for example, comparisons against any integer constant, or comparisons between expressions with non-overlapping bounds.
For example, we could remove bounds checks from "switch (x & 7)"...
-- Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290 Saturnushof 14, 3738 XG Maartensdijk, The Netherlands Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html GNU Fortran 95: http://gcc.gnu.org/fortran/ (under construction)
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |