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/66122] Bad uninlining decisions


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66122

--- Comment #6 from Denis Vlasenko <vda.linux at googlemail dot com> ---
Got a hold on a machine with gcc version 5.1.1 20150422 (Red Hat 5.1.1-1)

Pulled current Linus kernel tree and built it with this config:
http://busybox.net/~vda/kernel_config2
Note that "CONFIG_CC_OPTIMIZE_FOR_SIZE is not set", i.e. it's a -O2 build.

Selecting duplicate functions still shows a number of tiny uninlined functions:

$ nm --size-sort vmlinux | grep -iF ' t ' | uniq -c | grep -v '^ *1 ' | sort
-rn
     83 000000000000008a t rcu_read_lock_sched_held
     48 000000000000001b t sd_driver_init
     48 0000000000000012 t sd_driver_exit
     48 0000000000000008 t __initcall_sd_driver_init6
     47 0000000000000020 t usb_serial_module_init
     47 0000000000000012 t usb_serial_module_exit
     47 0000000000000008 t __initcall_usb_serial_module_init6
     45 0000000000000057 t uni2char
     45 0000000000000025 t char2uni
     43 000000000000001f t sd_probe
     40 000000000000006a t rcu_read_unlock
     29 000000000000005a t cpumask_next
     27 000000000000007a t rcu_read_lock
     27 0000000000000011 t kzalloc
     24 0000000000000022 t arch_local_save_flags
     23 0000000000000041 t cpumask_check
     19 0000000000000017 t phy_module_init
     19 0000000000000017 t phy_module_exit
     19 0000000000000008 t __initcall_phy_module_init6
     18 000000000000006c t spi_write
     18 000000000000003f t show_alarm
     18 000000000000000b t bitmap_weight
     15 0000000000000037 t show_alarms
     15 0000000000000014 t init_once
     14 0000000000000603 t init_engine
     14 0000000000000354 t pcm_trigger
     14 000000000000033b t pcm_open
     14 00000000000000f8 t stop_transport
     14 00000000000000db t pcm_close
     14 00000000000000c8 t set_meters_on
     14 00000000000000b5 t write_dsp
     14 00000000000000b5 t pcm_hw_free
     14 0000000000000091 t pcm_pointer
     14 0000000000000090 t hw_rule_playback_channels_by_format
     14 000000000000008d t send_vector
     14 000000000000004f t snd_echo_vumeters_info
     14 0000000000000042 t hw_rule_sample_rate
     14 000000000000003e t snd_echo_vumeters_switch_put
     14 0000000000000034 t audiopipe_free
     14 000000000000002b t snd_echo_channels_info_info
     14 0000000000000024 t snd_echo_remove
     14 000000000000001b t echo_driver_init
     14 0000000000000019 t pcm_analog_out_hw_params
     14 0000000000000019 t arch_local_irq_restore
     14 0000000000000014 t snd_echo_dev_free
     14 0000000000000012 t echo_driver_exit
     14 0000000000000008 t __initcall_echo_driver_init6
     13 0000000000000127 t pcm_analog_out_open
     13 0000000000000127 t pcm_analog_in_open
     13 0000000000000039 t qdisc_peek_dequeued
     13 0000000000000037 t cpumask_check
     13 0000000000000022 t arch_local_irq_restore
     13 000000000000001c t pcm_analog_in_hw_params
     13 0000000000000006 t bcma_host_soc_unregister_driver
     12 0000000000000053 t nlmsg_trim
...

Such as:
ffffffff811a42e0 <kzalloc>:
ffffffff811a42e0:       55                      push   %rbp
ffffffff811a42e1:       81 ce 00 80 00 00       or     $0x8000,%esi
ffffffff811a42e7:       48 89 e5                mov    %rsp,%rbp
ffffffff811a42ea:       e8 f1 92 1a 00          callq  <__kmalloc>
ffffffff811a42ef:       5d                      pop    %rbp
ffffffff811a42f0:       c3                      retq

ffffffff810792d0 <bitmap_weight>:
ffffffff810792d0:       55                      push   %rbp
ffffffff810792d1:       48 89 e5                mov    %rsp,%rbp
ffffffff810792d4:       e8 37 a8 b7 00          callq  <__bitmap_weight>
ffffffff810792d9:       5d                      pop    %rbp
ffffffff810792da:       c3                      retq

and even
ffffffff88566c9b <bcma_host_soc_unregister_driver>:
ffffffff88566c9b:       55                      push   %rbp
ffffffff88566c9c:       48 89 e5                mov    %rsp,%rbp
ffffffff88566c9f:       5d                      pop    %rbp
ffffffff88566ca0:       c3                      retq

This is an *empty function* from drivers/bcma/bcma_private.h:103 uninlined:
static inline void __exit bcma_host_soc_unregister_driver(void)
{
}

BTW it doesn't even have any callers in vmlinux. It should have been optimized
out.


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