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] |
On Wed, Nov 16, 2016 at 4:00 PM, Jakub Jelinek <jakub@redhat.com> wrote: > Jason's recent patch to turn reference vars initialized with invariant > addresses broke the first testcase below, because &self->singleton > is considered TREE_CONSTANT (because self is TREE_CONSTANT VAR_DECL and > singleton field has constant offset), but after going into SSA form > it is not supposed to be TREE_CONSTANT anymore (&self_2->singleton), > because SSA_NAMEs don't have TREE_CONSTANT set on them. > > The following patch fixes it by gimplifying such vars into their > DECL_INITIAL unless in OpenMP regions, where such folding is deferred > until omplower pass finishes. Hmm, this seems like a workaround; why don't we see the same problem with constant pointer variables? A simpler workaround would be to not set TREE_CONSTANT on references in the first place, since the constexpr code doesn't need it. What do you think?
Attachment:
const-ref.diff
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |