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

--- Comment #18 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Jan Hubicka from comment #17)
> > The following happens:
> > 
> > get_order is called by kmalloc_large which is called in kmalloc. And kmalloc
> > calls the function for larger allocations. Problem is that we eliminate all
> > calls to get_order late
> > 
> > pipe.i.108t.thread1:;; Function get_order (get_order, funcdef_no=295,
> > decl_uid=4528, cgraph_uid=300, symbol_order=303)
> > pipe.i.108t.thread1:get_order (long unsigned int size)
> > pipe.i.108t.thread1:  _125 = get_order (_114);
> > pipe.i.108t.thread1:  _67 = get_order (_56);
> > pipe.i.109t.cdce:;; Function get_order (get_order, funcdef_no=295,
> > decl_uid=4396, cgraph_uid=300, symbol_order=303)
> > pipe.i.109t.cdce:get_order (long unsigned int size)
> > 
> > so remove_unreachable_nodes is not called any more.
> Yep, that is by design - we are already outputting functions to
> assembler file, so there is not much we can do at this moent. Option
> wold be to do threading early of course.  How often this happen in
> practice?
> 
> Also note that -Winline outputs reasons why the static inline is not

You are right, this is printed:

gcc -O2 pipe.i -c -fdump-tree-all -Winline
In file included from ./arch/x86/include/asm/page.h:77,
                 from ./arch/x86/include/asm/thread_info.h:12,
                 from ./include/linux/thread_info.h:38,
                 from ./arch/x86/include/asm/preempt.h:7,
                 from ./include/linux/preempt.h:78,
                 from ./include/linux/spinlock.h:51,
                 from ./include/linux/mmzone.h:8,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/mm.h:10,
                 from fs/pipe.c:8:
./include/linux/slab.h: In function ‘alloc_pipe_info’:
./include/asm-generic/getorder.h:29:146: warning: inlining failed in call to
‘get_order’: --param max-inline-insns-single limit reached [-Winline]
   29 | static inline __attribute_const__ int get_order(unsigned long size)
      |                                                                        
                                                                         ^      
In file included from fs/pipe.c:11:
./include/linux/slab.h:482:30: note: called from here
  482 |         unsigned int order = get_order(size);
      |                              ^~~~~~~~~~~~~~~
In file included from ./arch/x86/include/asm/page.h:77,
                 from ./arch/x86/include/asm/thread_info.h:12,
                 from ./include/linux/thread_info.h:38,
                 from ./arch/x86/include/asm/preempt.h:7,
                 from ./include/linux/preempt.h:78,
                 from ./include/linux/spinlock.h:51,
                 from ./include/linux/mmzone.h:8,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/mm.h:10,
                 from fs/pipe.c:8:
./include/linux/slab.h: In function ‘pipe_resize_ring’:
./include/asm-generic/getorder.h:29:146: warning: inlining failed in call to
‘get_order’: --param max-inline-insns-single limit reached [-Winline]
   29 | static inline __attribute_const__ int get_order(unsigned long size)
      |                                                                        
                                                                         ^      
In file included from fs/pipe.c:11:
./include/linux/slab.h:482:30: note: called from here
  482 |         unsigned int order = get_order(size);
      |                              ^~~~~~~~~~~~~~~


> inlined (which is also by design a decision of the inliner heuristics).
> I suppose here the inliner sees the function called multiple times and
> since it is quite long it decides to keep it offline.  Opitmizing all
> references late if of course unfortunate.
> 
> Honza

Reply via email to