public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/115679] New: inlining failed in call to 'foo': function not considered for inlining
@ 2024-06-27 10:45 Changqing.Li at windriver dot com
  2024-06-27 12:32 ` [Bug tree-optimization/115679] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Changqing.Li at windriver dot com @ 2024-06-27 10:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115679
           Summary: inlining failed in call to 'foo': function not
                    considered for inlining
           Product: gcc
           Version: 14.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Changqing.Li at windriver dot com
  Target Milestone: ---

The issue I met is similar to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54965.

Reproduce steps:
1. wget https://cairographics.org/releases/pixman-0.43.4.tar.gz
2. Untar source
3. cd pixman-0.43.4; mkdir build; 
4. add options -Og and -save-temps in meson.build
5. meson setup ./build
6. ninja -C ./build/

gcc version: both 14.0.1 and 14.1.0 can reproduce
system type: linux (eg: fedora 40)
Success option:
 ARGS = -Ipixman/libpixman-1.so.0.43.4.p -Ipixman -I../pixman
-fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch
-std=gnu99 -O2 -g -Wdeclaration-after-statement -fno-strict-aliasing
-fvisibility=hidden -Wundef -ftrapping-math -Wno-unused-local-typedefs
-DHAVE_CONFIG_H -fPIC -pthread

Fail option:
 ARGS = -Ipixman/libpixman-1.so.0.43.4.p -Ipixman -I../pixman
-fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch
-std=gnu99 -O2 -g -Wdeclaration-after-statement -fno-strict-aliasing
-fvisibility=hidden -Wundef -ftrapping-math -Og -Wno-unused-local-typedefs
-DHAVE_CONFIG_H -fPIC -pthread


Difference of success/fail option:  -Og,  once -Og is used, compile will fail.

Fail message:
../pixman/pixman-combine-float.c:370:5: error: inlining failed in call to
‘always_inline’ ‘combine_soft_light_c’: function not considered for inlining
  370 |     combine_ ## name ## _c (float sa, float s, float da, float d)      
\
      |     ^~~~~~~~
../pixman/pixman-combine-float.c:655:1: note: in expansion of macro
‘MAKE_SEPARABLE_PDF_COMBINERS’
  655 | MAKE_SEPARABLE_PDF_COMBINERS (soft_light)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

See the attached *.i*

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug tree-optimization/115679] inlining failed in call to 'foo': function not considered for inlining
  2024-06-27 10:45 [Bug tree-optimization/115679] New: inlining failed in call to 'foo': function not considered for inlining Changqing.Li at windriver dot com
@ 2024-06-27 12:32 ` rguenth at gcc dot gnu.org
  2024-06-27 13:38 ` hubicka at ucw dot cz
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-06-27 12:32 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
With -Og it's usually that the always-inline function is called indirectly -
that's an unsupported case.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug tree-optimization/115679] inlining failed in call to 'foo': function not considered for inlining
  2024-06-27 10:45 [Bug tree-optimization/115679] New: inlining failed in call to 'foo': function not considered for inlining Changqing.Li at windriver dot com
  2024-06-27 12:32 ` [Bug tree-optimization/115679] " rguenth at gcc dot gnu.org
@ 2024-06-27 13:38 ` hubicka at ucw dot cz
  2024-06-27 19:40 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: hubicka at ucw dot cz @ 2024-06-27 13:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jan Hubicka <hubicka at ucw dot cz> ---
> With -Og it's usually that the always-inline function is called indirectly -
> that's an unsupported case.
We can probably add CIF code for functions that were called indirectly
but are no more, so this is reported better.  I will cook up patch.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug tree-optimization/115679] inlining failed in call to 'foo': function not considered for inlining
  2024-06-27 10:45 [Bug tree-optimization/115679] New: inlining failed in call to 'foo': function not considered for inlining Changqing.Li at windriver dot com
  2024-06-27 12:32 ` [Bug tree-optimization/115679] " rguenth at gcc dot gnu.org
  2024-06-27 13:38 ` hubicka at ucw dot cz
@ 2024-06-27 19:40 ` pinskia at gcc dot gnu.org
  2024-07-03  0:57 ` Changqing.Li at windriver dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-27 19:40 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-06-27
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |WAITING

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Can you provide the preprocessed source?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug tree-optimization/115679] inlining failed in call to 'foo': function not considered for inlining
  2024-06-27 10:45 [Bug tree-optimization/115679] New: inlining failed in call to 'foo': function not considered for inlining Changqing.Li at windriver dot com
                   ` (2 preceding siblings ...)
  2024-06-27 19:40 ` pinskia at gcc dot gnu.org
@ 2024-07-03  0:57 ` Changqing.Li at windriver dot com
  2024-07-03  0:59 ` Changqing.Li at windriver dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Changqing.Li at windriver dot com @ 2024-07-03  0:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Li, Changqing <Changqing.Li at windriver dot com> ---
Created attachment 58570
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58570&action=edit
preprocessed source

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug tree-optimization/115679] inlining failed in call to 'foo': function not considered for inlining
  2024-06-27 10:45 [Bug tree-optimization/115679] New: inlining failed in call to 'foo': function not considered for inlining Changqing.Li at windriver dot com
                   ` (3 preceding siblings ...)
  2024-07-03  0:57 ` Changqing.Li at windriver dot com
@ 2024-07-03  0:59 ` Changqing.Li at windriver dot com
  2024-07-03  1:05 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Changqing.Li at windriver dot com @ 2024-07-03  0:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Li, Changqing <Changqing.Li at windriver dot com> ---
Hi, 

I have attached the preprocessed source.  You can also get it from here:

https://cairographics.org/releases/pixman-0.43.4.tar.gz

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug tree-optimization/115679] inlining failed in call to 'foo': function not considered for inlining
  2024-06-27 10:45 [Bug tree-optimization/115679] New: inlining failed in call to 'foo': function not considered for inlining Changqing.Li at windriver dot com
                   ` (4 preceding siblings ...)
  2024-07-03  0:59 ` Changqing.Li at windriver dot com
@ 2024-07-03  1:05 ` pinskia at gcc dot gnu.org
  2024-07-03  1:19 ` Changqing.Li at windriver dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-07-03  1:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Li, Changqing from comment #4)
> Created attachment 58570 [details]
> preprocessed source

This is not the preprocessed source.
Please read https://gcc.gnu.org/bugs/ and try again.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug tree-optimization/115679] inlining failed in call to 'foo': function not considered for inlining
  2024-06-27 10:45 [Bug tree-optimization/115679] New: inlining failed in call to 'foo': function not considered for inlining Changqing.Li at windriver dot com
                   ` (5 preceding siblings ...)
  2024-07-03  1:05 ` pinskia at gcc dot gnu.org
@ 2024-07-03  1:19 ` Changqing.Li at windriver dot com
  2024-07-03  4:52 ` pinskia at gcc dot gnu.org
  2024-07-03  4:58 ` pinskia at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: Changqing.Li at windriver dot com @ 2024-07-03  1:19 UTC (permalink / raw)
  To: gcc-bugs

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

Li, Changqing <Changqing.Li at windriver dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #58570|0                           |1
        is obsolete|                            |

--- Comment #7 from Li, Changqing <Changqing.Li at windriver dot com> ---
Created attachment 58571
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58571&action=edit
pixman-combine-float.c.i

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug tree-optimization/115679] inlining failed in call to 'foo': function not considered for inlining
  2024-06-27 10:45 [Bug tree-optimization/115679] New: inlining failed in call to 'foo': function not considered for inlining Changqing.Li at windriver dot com
                   ` (6 preceding siblings ...)
  2024-07-03  1:19 ` Changqing.Li at windriver dot com
@ 2024-07-03  4:52 ` pinskia at gcc dot gnu.org
  2024-07-03  4:58 ` pinskia at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-07-03  4:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jan Hubicka from comment #2)
> > With -Og it's usually that the always-inline function is called indirectly -
> > that's an unsupported case.
> We can probably add CIF code for functions that were called indirectly
> but are no more, so this is reported better.  I will cook up patch.

Yes it is indirect function call.
So yes this is invalid at -Og.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug tree-optimization/115679] inlining failed in call to 'foo': function not considered for inlining
  2024-06-27 10:45 [Bug tree-optimization/115679] New: inlining failed in call to 'foo': function not considered for inlining Changqing.Li at windriver dot com
                   ` (7 preceding siblings ...)
  2024-07-03  4:52 ` pinskia at gcc dot gnu.org
@ 2024-07-03  4:58 ` pinskia at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-07-03  4:58 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---


static __inline__ __attribute__ ((__always_inline__)) void
combine_inner (pixman_bool_t component,
        float *dest, const float *src, const float *mask, int n_pixels,
        combine_channel_t combine_a, combine_channel_t combine_c)
{

...
combine_c(...)

static float __inline__ __attribute__ ((__always_inline__)) pd_combine_clear
(float sa, float s, float da, float d) { const float fa = get_factor (ZERO, sa,
da); const float fb = get_factor (ZERO, sa, da); return ((1.0f < s * fa + d *
fb) ? 1.0f : s * fa + d * fb); }
...
static void combine_clear_ca_float (pixman_implementation_t *imp, pixman_op_t
op, float *dest, const float *src, const float *mask, int n_pixels) {
combine_inner (1, dest, src, mask, n_pixels, pd_combine_clear,
pd_combine_clear); }

*** This bug has been marked as a duplicate of bug 107931 ***

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-07-03  4:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-27 10:45 [Bug tree-optimization/115679] New: inlining failed in call to 'foo': function not considered for inlining Changqing.Li at windriver dot com
2024-06-27 12:32 ` [Bug tree-optimization/115679] " rguenth at gcc dot gnu.org
2024-06-27 13:38 ` hubicka at ucw dot cz
2024-06-27 19:40 ` pinskia at gcc dot gnu.org
2024-07-03  0:57 ` Changqing.Li at windriver dot com
2024-07-03  0:59 ` Changqing.Li at windriver dot com
2024-07-03  1:05 ` pinskia at gcc dot gnu.org
2024-07-03  1:19 ` Changqing.Li at windriver dot com
2024-07-03  4:52 ` pinskia at gcc dot gnu.org
2024-07-03  4:58 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).