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/22441] New: ICE on redefined inline function


static inline __attribute__ ((always_inline))
int baz (const unsigned char *addr)
{
  return addr[0] & 0x01;
}

static inline __attribute__ ((always_inline))
int bar (const unsigned char *addr)
{
  return !baz (addr);
}

extern inline __attribute__ ((always_inline))
int baz (const unsigned char *addr)
{
  return addr[0] != 0xff && (0x01 & addr[0]);
}

int
foo (unsigned char *p)
{
  return bar (p);
}

ICEs at -O2 -fno-unit-at-a-time and issues a sorry message with -O2.
Both GCC 3.4.4 and HEAD reject this as invalid.

-- 
           Summary: ICE on redefined inline function
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at redhat dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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