Bug 30696 - [4.3 regression] Linker failure with OpenMP and inline function
Summary: [4.3 regression] Linker failure with OpenMP and inline function
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: link-failure, openmp
Depends on:
Blocks:
 
Reported: 2007-02-03 21:36 UTC by Volker Reichelt
Modified: 2007-02-08 23:35 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-02-03 23:32:58


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2007-02-03 21:36:26 UTC
The following program causes a linker failure on mainline when compiled
with "gcc -fopenmp -O -std=c99":

====================================
inline void foo() {}

int main()
{
    foo();

#pragma omp parallel for
    for ( int i=0; i<1; ++i )
        foo();

    return 0;
}
====================================

/tmp/ccoKlB2q.o(.text+0x47): In function `main.omp_fn.0':
: undefined reference to `foo'
collect2: ld returned 1 exit status

The 4.2 branch is not affected.
Comment 1 Volker Reichelt 2007-02-03 21:39:04 UTC
Even shorter testcase:

====================================
inline void foo() {}

int main()
{
#pragma omp parallel
    foo();
    foo();

    return 0;
}
====================================
Comment 2 Richard Biener 2007-02-03 23:32:58 UTC
Confirmed.
Comment 3 Jan Hubicka 2007-02-04 23:41:10 UTC
Subject: Bug 30696

Author: hubicka
Date: Sun Feb  4 23:40:58 2007
New Revision: 121582

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121582
Log:
	PR middle-end/30696
	* ipa-inline.c (cgraph_clone_inlined_nodes): When there are unanalyzed
	nodes in cgraph, don't remove offline copy of the function.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa-inline.c

Comment 4 Jakub Jelinek 2007-02-08 23:35:36 UTC
Fixed on the trunk, thanks.