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: [patch] 2 patches for PR tree-optimization/34648


Eric Botcazou wrote:
The second patch changes tree_could_throw_p() such that ECF_CONST and
ECF_PURE will also return false. According to the comments in tree.h
this should be true.

Which comments?


/* Nonzero if this is a call to a function whose return value depends
  solely on its arguments, has no side effects, and does not read
  global memory.  */
#define ECF_CONST               1

A throw could have side effects could it not?, so therefore it shouldn't be ECF_CONST. PURE is documented as the same, except it can read memory.

My concern is that we have some cases where it isn't true and this will now
cause some other issue to pop up. Does anyone know for a fact that this is
a safe change?

I think that you're changing the semantics of ECF_CONST and ECF_PURE.



which is why I am asking, if its practical use does not match how I interpreted the comments in tree.h, we can abandon the patch to tree_could_throw_p(). The comments do not explicitly say nothrow is orthogonal to const, just implies it isn't.



In any case, both patches have been tested individually as well as
together. Bootstraps on x86_64-linux-gnu and causes no new regressions
in the testsuite.

With Ada enabled?


Whatever the default is. So, no, its with c,c++,fortran,java and objc.

Andrew


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