[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Bug c/8081] ICE with variably sized types returned from nested functions



http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8081

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-valid-code           |accepts-invalid,
                   |                            |ice-on-invalid-code
          Component|middle-end                  |c
            Summary|ICE with variably sized     |ICE with variably sized
                   |types and nested functions  |types returned from nested
                   |                            |functions
      Known to fail|                            |4.7.0

--- Comment #23 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-11 15:57:03 UTC ---
In PR21374 it was decided to reject the testcase which makes this a C frontend
issue.  Testcase that still ICEs on the trunk even when optimizing:

int
main (int argc, char **argv)
{
  int size = 10;
  typedef struct
    {
      char val[size];
    }
  block;
  block b;
  block __attribute__((noinline))
  retframe_block ()
    {
      return *(block *) &b;
    }
  b=retframe_block ();
  return 0;
}

as alternative to rejecting this case we can lower returning variable-size
types during un-nesting to explicit passing of a return slot and using
memcpy, making the nested function return nothing.

-- 
Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Reply to: