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] |
This patch moves folding of constant array references out of DOM (where it never belonged) and into the children of fold_stmt. And, yes, it's careful not to muck up stuff like &"foo"[2] and similar constructs. Basically it makes note of when we're inside an ADDR_EXPR and disables constant array reference folding in that case. In my test bucket it picks up the same set of constant array references as mainline does without this patch. We actually get slightly better code in one case -- by optimizing the constant array reference earlier, a useless conditional is exposed earlier, which in turn exposes a related dead memory load early enough that the optimizers get a chance to remove it. Bootstrapped and regression tested on i686-pc-linux-gnu.
Attachment:
PPP
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |