This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/42874] New: Error on correct code
- From: "krebbel at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jan 2010 15:58:23 -0000
- Subject: [Bug c/42874] New: Error on correct code
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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