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]

Re: [C++ Patch] PR 38980


Hi,
Instead of adding the parameter, let's have the C++ front end call a different function that doesn't try to pull out the value from aggregate variables, like C has decl_constant_value_for_optimization.
Ok. The below lives entirely inside the C++ front-end (actually I had already experimented with something similar)

Note I'm using the name decl_constant_value_safe, thus I'm not overloading the name decl_constant_value_for_optimization, because the latter is only used by the C front-end but still exported by c-family. I could move back that decl_constant_value_for_optimization currently in c-common.c to the C front-end, but callers, also C front-end only, would remain in c-family. I'd rather not fiddle further with all of that (looks like long term people would like to have more shared code in c-common.c, seems indeed an excellent idea, but at the moment large chunks are actually used by the C front-end only...).

Tested x86_64-linux.

Paolo.

/////////////////////


Attachment: CL_38980_2
Description: Text document

Attachment: patch_38980_2
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]