This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/28120] The option -f[no-]inline-functions is invalid with -O2
- From: "tanaka at personal-media dot co dot jp" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jun 2006 09:52:37 -0000
- Subject: [Bug c/28120] The option -f[no-]inline-functions is invalid with -O2
- References: <bug-28120-1611@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from tanaka at personal-media dot co dot jp 2006-06-23 09:52 -------
Please answer my question again.
It can not be distinguished between a function, which specified
__inline__ and an another function, which is not specified __inline__,
after gcc-3.4.
This is sample.
/************ test.c ****************/
static __inline__ int inl_small( int a)
{
return 2*a;
}
static int small(int a)
{
return 2*a;
}
int main()
{
int i;
i = inl_small(2);
i = small(i);
}
############ mk.rc ####################
#!/bin/sh
set -v
BD3_4_5='/work/te/tool/Linux-i686'
GCC3_4_5="$BD3_4_5/bin/gcc"
BD3_3_2='/work/te/tool/Linux-i686-3.3.2'
GCC3_3_2="$BD3_3_2/bin/gcc"
ODP="$BD3_3_2/bin/objdump -C -S --disassemble-zeroes"
$GCC3_4_5 -O2 -c test.c -o 3_4_5_test_.o
$GCC3_4_5 -O2 -finline-functions -c test.c -o 3_4_5_test_inf.o
$GCC3_4_5 -O2 -fno-inline-functions -c test.c -o 3_4_5_test_noinf.o
$GCC3_4_5 -O2 -fno-inline -c test.c -o 3_4_5_test_noin.o
$GCC3_3_2 -O2 -c test.c -o 3_3_2_test_.o
$GCC3_3_2 -O2 -finline-functions -c test.c -o 3_3_2_test_inf.o
$GCC3_3_2 -O2 -fno-inline-functions -c test.c -o 3_3_2_test_noinf.o
$GCC3_3_2 -O2 -fno-inline -c test.c -o 3_3_2_test_noin.o
$ODP 3_4_5_test_.o > 3_4_5_test_.o.odp
$ODP 3_4_5_test_inf.o > 3_4_5_test_inf.o.odp
$ODP 3_4_5_test_noinf.o > 3_4_5_test_noinf.o.odp
$ODP 3_4_5_test_noin.o > 3_4_5_test_noin.o.odp
$ODP 3_3_2_test_.o > 3_3_2_test_.o.odp
$ODP 3_3_2_test_inf.o > 3_3_2_test_inf.o.odp
$ODP 3_3_2_test_noinf.o > 3_3_2_test_noinf.o.odp
$ODP 3_3_2_test_noin.o > 3_3_2_test_noin.o.odp
######################################
Result is
----------------------------------------------------
gcc-3.3.2 -O2
inl_small() small()
inlined. not inlined.
-finline-functions inlined. inlined.
-fno-inline-functions inlined. not inlined.
-fno-inline not inlined. not inlined.
----------------------------------------------------
gcc-3.4.5 -O2
inl_small small
inlined. inlined.
-finline-functions inlined. inlined.
-fno-inline-functions inlined. inlined.
-fno-inline not inlined. not inlined.
----------------------------------------------------
It could be controlled to make a function inlined or not inlined,
according to specified __inline__ or not specified __inline__
before gcc-3.4.
But it can't after gcc-3.4.
I hope to confirm a conclusion.
That is to say, simple function is always integrated into their
callers when it compiled with a option -O2, after gcc-3.4 isn't it?
Best regards.
--
tanaka at personal-media dot co dot jp changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28120