This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Is cross-section inlining valid behaviour?
- From: "Bingfeng Mei" <bmei at broadcom dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 23 Jul 2008 07:46:11 -0700
- Subject: Is cross-section inlining valid behaviour?
Hello,
I came across a problem related to cross-section inlining. For the
following example,
static void foo(void) __attribute__((section ("foo")));
static void foo(void)
{
printf("Hello\n");
}
void bar(void) __attribute__((section ("bar")));
void bar(void)
{
foo();
}
I compiled with the latest mainline gcc.
gcc tst.c -O3 -S
The foo function is inlined into bar anyway even they have different
section attribute. Is this a bug or expected behaviour?
.file "tst.c"
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "Hello"
.section bar,"ax",@progbits
.p2align 4,,15
.globl bar
.type bar, @function
bar:
.LFB3:
movl $.LC0, %edi
jmp puts
.LFE3:
Thanks.
Bingfeng Mei