https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116780

--- Comment #11 from denisc at gcc dot gnu.org ---
(In reply to Segher Boessenkool from comment #8)
> (In reply to denisc from comment #2)
> > Comment on attachment 59393 [details]
> > Simplified testcase
> > 
> > void
> > f ()
> > {
> >   volatile char c[0];
> >   c[0] = 0;
> > }
> 
> That is invalid C code, of course (an out of bounds access).

I don't think that it's invalid.(maybe I'm wrong)

Segher, can you suggest how to obtain information (from internal GCC
structures) about such cases ?
ie rewrite TARGET_FRAME_POINTER_REQUIRED hook so that it takes into account
that we have an access to frame but frame-size is zero ?

The current hook:
static bool
avr_frame_pointer_required_p (void) 
{
  return (cfun->calls_alloca
  || cfun->calls_setjmp
  || cfun->has_nonlocal_label
  || crtl->args.info.has_stack_args
  || get_frame_size () > 0);
}

Reply via email to