Bug 159731 - Funnies with inclined functions in C
Summary: Funnies with inclined functions in C
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc4
Version: 4
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-06-07 15:38 UTC by Horst H. von Brand
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: 4.0.1-3
Clone Of:
Environment:
Last Closed: 2005-07-12 13:37:55 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Preprocessed C file where I saw the problem first. (834.66 KB, text/plain)
2005-06-07 15:38 UTC, Horst H. von Brand
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 22441 0 None None None Never

Description Horst H. von Brand 2005-06-07 15:38:26 UTC
Description of problem:
Compiling ipw2200 for my kernel I got unexplained error messages about
unavailable function bodies for inlined functions, I traced that to a function
that was defined twice, and differently.

Version-Release number of selected component (if applicable):
gcc-4.0.0-9

How reproducible:
Sometimes

Steps to Reproduce:
1. Compile attached ipw2200.i file
2.
3.
  
Actual results:
/usr/src/ipw2200-1.0.4/ipw2200.c: In function âipw_rxâ:
/usr/src/ipw2200-1.0.4/net/ieee80211.h:722: sorry, unimplemented: inlining
failed in call to âis_multicast_ether_addrâ: function body not available

Expected results:
Some comprehensible error message. This looks like the offending function isn't
defined, when the problem is that it is defined twice.

Additional info:

Comment 1 Horst H. von Brand 2005-06-07 15:38:27 UTC
Created attachment 115189 [details]
Preprocessed C file where I saw the problem first.

Comment 2 Horst H. von Brand 2005-06-07 15:42:26 UTC
I tried to cut it down to a small testcase, but there the compiler doesn't
complain at all! It seems to me it should either just error out if an inlined
function is being redefined, or (probably much harder) check somehow that the
bodies are the same before errorring out. Simplified test case follows (no way
to create another attachment, either when entering the bug or here).

typedef unsigned char u8;

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

int f(const u8 *addr)
{
  return !is_multicast_ether_addr(addr);
}

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

int g(const u8 *addr)
{
  return is_multicast_ether_addr(addr);
}


Comment 3 Jakub Jelinek 2005-07-12 13:37:55 UTC
Tracking this upstream.


Note You need to log in before you can comment on or make changes to this bug.