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: ipa-pure-const fixes


On Sat, Jun 5, 2010 at 1:15 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> noreturn functions should at most become looping pure/const. ?I suppose
>> this worked sofar as a call to abort () _inside_ a noreturn function would
>> magically do that. ?I guess we need to make sure that functions annotated
>> noreturn can at most become looping pure/const as well.
>
> That would certainly help, but I'm under the impression that the problem is
> more serious, the ECF_NORETURN flag seems to overrule side-effects and turn
> calls into ECF_PURE calls alone.

That would mean it would be simple to create a C-only testcase showing this, no?

At least

void __attribute__((noreturn,noinline)) foo(void)
{
  __builtin_trap ();
}
int main ().
{
  foo();
  return 0;
}

or with __builtin_abort (); work as expected.

Now there seems to be an issue with call analysis in IPA mode:

  /* Either calle is unknown or we are doing local analysis.
     Look to see if there are any bits available for the callee (such as by
     declaration or because it is builtin) and process solely on the basis of
     those bits. */
  else if (!ipa || !callee_t)

this disregards that functions for which we do not see the body still
may have callee_t.  Thus the abort/trap call isn't honored at all
during IPA analysis.

Honza?

Richard.

> --
> Eric Botcazou
>


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