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

Bug#327301: gcc ICE when duplicate definitions of an inline function are present



Package: gcc-4.0
Version: 4.0.1-6
Severity: important

Hi,

Attached source causes an ICE with current gcc-4.0 in sid, when compiled with gcc -c:

jurijus@bobcat:~$ gcc -c gcc-inline-ice.c
gcc-inline-ice.c: In function 'rt2x00_ioctl_set_wap':
gcc-inline-ice.c:31: warning: pointer targets in passing argument 1 of 'is_valid_ether_addr' differ in signedness
gcc-inline-ice.c:19: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.0/README.Bugs>.
jurijus@bobcat:~$ gcc --version
gcc (GCC) 4.0.2 20050821 (prerelease) (Debian 4.0.1-6)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

It seems like the culprit is the duplicate definition of an always_inline function.

Best regards,

Jurij Smakov                                        jurij@wooyd.org
Key: http://www.wooyd.org/pgpkey/                   KeyID: C99E03CC
typedef unsigned char u8;
typedef unsigned short sa_family_t;

struct sockaddr {
 sa_family_t sa_family;
 char sa_data[14];
};

static inline __attribute__((always_inline)) int is_zero_ether_addr(const u8 *addr)
{
 return !(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]);
}
static inline __attribute__((always_inline)) int is_multicast_ether_addr(const u8 *addr)
{
 return addr[0] & 0x01;
}
static inline __attribute__((always_inline)) int is_valid_ether_addr(const u8 *addr)
{
 return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr);
}

static inline __attribute__((always_inline)) int is_multicast_ether_addr(const u8 *addr)
{
 return ((addr[0] != 0xff) && (0x01 & addr[0]));
}

static int
rt2x00_ioctl_set_wap(struct sockaddr *ap_addr)
{
 int k;
 if(is_valid_ether_addr(&ap_addr->sa_data[0])){
  k = 1;
 } else {
  k = 2;
 }
 return k;
}

Reply to: