This is the mail archive of the gcc-bugs@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]

[Bug c/42874] New: Error on correct code


The following testcase fails with:
sorry, unimplemented: function ?foo? can never be copied because it uses
variable sized variables

When compiled with at least -O1. It works fine with GCC 4.4.3.

void __attribute__ ((always_inline))
foo (const unsigned long *addr, unsigned long size)
{
  typedef struct
  {
    long x[size];
  } addrtype;

  addrtype *a = (void *) addr;
}

Unfortunately these patterns are quite common in the Linux kernel - at least
for S/390. They always used to compile but mainline currently is not able to
build the kernel.


-- 
           Summary: Error on correct code
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: krebbel at gcc dot gnu dot org
 GCC build triplet: s390x-ibm-linux
  GCC host triplet: s390x-ibm-linux
GCC target triplet: s390x-ibm-linux


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


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