public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/10980] vararg functions are not inlined
       [not found] <bug-10980-4@http.gcc.gnu.org/bugzilla/>
@ 2011-09-23 13:47 ` vanboxem.ruben at gmail dot com
  2011-09-23 13:59 ` hubicka at ucw dot cz
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: vanboxem.ruben at gmail dot com @ 2011-09-23 13:47 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10980

Ruben Van Boxem <vanboxem.ruben at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vanboxem.ruben at gmail dot
                   |                            |com

--- Comment #7 from Ruben Van Boxem <vanboxem.ruben at gmail dot com> 2011-09-23 13:34:52 UTC ---
This problem popped up when compiling LLVM's libc++:
M:\Development\Source\libc++\src\locale.cpp:1:0: warning: -fPIC ignored for
target (all code is position independent) [enabled by default]
M:\Development\Source\libc++\include/locale: In function 'int
std::__1::__asprintf_l(char**, _locale_t, const char*, ...)':
M:\Development\Source\libc++\include/locale:372:5: sorry, unimplemented:
function 'int std::__1::__asprintf_l(char**, _locale_t, const char*, ...)' can
never be inlined because it uses variable argument lists
M:\Development\Source\libc++\include/locale: In function 'int
std::__1::__sprintf_l(char*, _locale_t, const char*, ...)':
M:\Development\Source\libc++\include/locale:344:5: sorry, unimplemented:
function 'int std::__1::__sprintf_l(char*, _locale_t, const char*, ...)' can
never be inlined because it uses variable argument lists
M:\Development\Source\libc++\include/locale: In function 'int
std::__1::__snprintf_l(char*, size_t, _locale_t, const char*, ...)':
M:\Development\Source\libc++\include/locale:358:5: sorry, unimplemented:
function 'int std::__1::__snprintf_l(char*, size_t, _locale_t, const char*,
...)' can never be inlined because it uses variable argument lists
M:\Development\Source\libc++\include/locale: In function 'int
std::__1::__sscanf_l(const char*, _locale_t, const char*, ...)':
M:\Development\Source\libc++\include/locale:386:5: sorry, unimplemented:
function 'int std::__1::__sscanf_l(const char*, _locale_t, const char*, ...)'
can never be inlined because it uses variable argument lists

The code can be found here:
http://llvm.org/svn/llvm-project/libcxx/trunk/include/locale


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

* [Bug tree-optimization/10980] vararg functions are not inlined
       [not found] <bug-10980-4@http.gcc.gnu.org/bugzilla/>
  2011-09-23 13:47 ` [Bug tree-optimization/10980] vararg functions are not inlined vanboxem.ruben at gmail dot com
@ 2011-09-23 13:59 ` hubicka at ucw dot cz
  2011-09-23 14:10 ` vanboxem.ruben at gmail dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: hubicka at ucw dot cz @ 2011-09-23 13:59 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10980

--- Comment #8 from Jan Hubicka <hubicka at ucw dot cz> 2011-09-23 13:40:55 UTC ---
> This problem popped up when compiling LLVM's libc++:
> M:\Development\Source\libc++\src\locale.cpp:1:0: warning: -fPIC ignored for
> target (all code is position independent) [enabled by default]
> M:\Development\Source\libc++\include/locale: In function 'int
> std::__1::__asprintf_l(char**, _locale_t, const char*, ...)':
> M:\Development\Source\libc++\include/locale:372:5: sorry, unimplemented:
> function 'int std::__1::__asprintf_l(char**, _locale_t, const char*, ...)' can
> never be inlined because it uses variable argument lists
> M:\Development\Source\libc++\include/locale: In function 'int
> std::__1::__sprintf_l(char*, _locale_t, const char*, ...)':

It seems wrong to add always_inline attribute on something like this.  I am not
aware
that LLVM would be inlining variadic function either
(even though it is doable in some trivial cases)

Honza


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

* [Bug tree-optimization/10980] vararg functions are not inlined
       [not found] <bug-10980-4@http.gcc.gnu.org/bugzilla/>
  2011-09-23 13:47 ` [Bug tree-optimization/10980] vararg functions are not inlined vanboxem.ruben at gmail dot com
  2011-09-23 13:59 ` hubicka at ucw dot cz
@ 2011-09-23 14:10 ` vanboxem.ruben at gmail dot com
  2011-09-23 14:21   ` Jan Hubicka
  2011-09-23 14:32 ` hubicka at ucw dot cz
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 8+ messages in thread
From: vanboxem.ruben at gmail dot com @ 2011-09-23 14:10 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10980

--- Comment #9 from Ruben Van Boxem <vanboxem.ruben at gmail dot com> 2011-09-23 13:46:27 UTC ---
Current Clang compiled everything without a hitch. It might ignore the
attribute, I haven't checked. Perhaps this error should be made a warning?


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

* Re: [Bug tree-optimization/10980] vararg functions are not inlined
  2011-09-23 14:10 ` vanboxem.ruben at gmail dot com
@ 2011-09-23 14:21   ` Jan Hubicka
  0 siblings, 0 replies; 8+ messages in thread
From: Jan Hubicka @ 2011-09-23 14:21 UTC (permalink / raw)
  To: vanboxem.ruben at gmail dot com; +Cc: gcc-bugs

I bet it just ignores the attribute that is not how the attribute is
supposed to work.

We output error in this case intentionally (and warning in at the same
spot if function is declared inline and -Winline is given).
Functions marked always_inlined really ought to be always inlined and
attribute is supposed to be useable in the cases where compilation would
fail otherwise (such as SSE buitins).

Our documentation is however not particularly clear here, perhaps it should
be updated...

Honza


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

* [Bug tree-optimization/10980] vararg functions are not inlined
       [not found] <bug-10980-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2011-09-23 14:10 ` vanboxem.ruben at gmail dot com
@ 2011-09-23 14:32 ` hubicka at ucw dot cz
  2011-10-17 18:45 ` vanboxem.ruben at gmail dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: hubicka at ucw dot cz @ 2011-09-23 14:32 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10980

--- Comment #10 from Jan Hubicka <hubicka at ucw dot cz> 2011-09-23 14:10:53 UTC ---
I bet it just ignores the attribute that is not how the attribute is
supposed to work.

We output error in this case intentionally (and warning in at the same
spot if function is declared inline and -Winline is given).
Functions marked always_inlined really ought to be always inlined and
attribute is supposed to be useable in the cases where compilation would
fail otherwise (such as SSE buitins).

Our documentation is however not particularly clear here, perhaps it should
be updated...

Honza


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

* [Bug tree-optimization/10980] vararg functions are not inlined
       [not found] <bug-10980-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2011-09-23 14:32 ` hubicka at ucw dot cz
@ 2011-10-17 18:45 ` vanboxem.ruben at gmail dot com
  2011-10-18  9:54 ` rguenth at gcc dot gnu.org
  2021-09-06  6:50 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: vanboxem.ruben at gmail dot com @ 2011-10-17 18:45 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10980

--- Comment #11 from Ruben Van Boxem <vanboxem.ruben at gmail dot com> 2011-10-17 18:44:39 UTC ---
(In reply to comment #10)
> I bet it just ignores the attribute that is not how the attribute is
> supposed to work.
> 
> We output error in this case intentionally (and warning in at the same
> spot if function is declared inline and -Winline is given).
> Functions marked always_inlined really ought to be always inlined and
> attribute is supposed to be useable in the cases where compilation would
> fail otherwise (such as SSE buitins).
> 
> Our documentation is however not particularly clear here, perhaps it should
> be updated...
> 
> Honza

Seeing that documentation is unclear (no mention of when errors or warnings are
produced), and Qt Creator devs want to know what version of GCC started
errorring on this, could you please let me know what GCC version started
producing errors? Thanks!


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

* [Bug tree-optimization/10980] vararg functions are not inlined
       [not found] <bug-10980-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2011-10-17 18:45 ` vanboxem.ruben at gmail dot com
@ 2011-10-18  9:54 ` rguenth at gcc dot gnu.org
  2021-09-06  6:50 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-18  9:54 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10980

--- Comment #12 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-10-18 09:54:03 UTC ---
(In reply to comment #11)
> (In reply to comment #10)
> > I bet it just ignores the attribute that is not how the attribute is
> > supposed to work.
> > 
> > We output error in this case intentionally (and warning in at the same
> > spot if function is declared inline and -Winline is given).
> > Functions marked always_inlined really ought to be always inlined and
> > attribute is supposed to be useable in the cases where compilation would
> > fail otherwise (such as SSE buitins).
> > 
> > Our documentation is however not particularly clear here, perhaps it should
> > be updated...
> > 
> > Honza
> 
> Seeing that documentation is unclear (no mention of when errors or warnings are
> produced), and Qt Creator devs want to know what version of GCC started
> errorring on this, could you please let me know what GCC version started
> producing errors? Thanks!

GCC always errored out on this (previously by sorry(), now with error()).

We can possibly inline varargs functions when we delay lowering the
vararg builtins to the stdarg pass (which would clean up its implementation
a lot ...).


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

* [Bug tree-optimization/10980] vararg functions are not inlined
       [not found] <bug-10980-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2011-10-18  9:54 ` rguenth at gcc dot gnu.org
@ 2021-09-06  6:50 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-06  6:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
We have __builtin_va_arg_pack and __builtin_va_arg_pack_len which I think
solves this problem really.


https://gcc.gnu.org/onlinedocs/gcc-11.2.0/gcc/Constructing-Calls.html#index-_005f_005fbuiltin_005fva_005farg_005fpack

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

end of thread, other threads:[~2021-09-06  6:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-10980-4@http.gcc.gnu.org/bugzilla/>
2011-09-23 13:47 ` [Bug tree-optimization/10980] vararg functions are not inlined vanboxem.ruben at gmail dot com
2011-09-23 13:59 ` hubicka at ucw dot cz
2011-09-23 14:10 ` vanboxem.ruben at gmail dot com
2011-09-23 14:21   ` Jan Hubicka
2011-09-23 14:32 ` hubicka at ucw dot cz
2011-10-17 18:45 ` vanboxem.ruben at gmail dot com
2011-10-18  9:54 ` rguenth at gcc dot gnu.org
2021-09-06  6:50 ` 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).