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

--- Comment #2 from Jan Hubicka <hubicka at ucw dot cz> ---
> Huh, __builtin_va_arg_pack_len is only valid within varargs functions.  The
> difference seems to be that without LTO we simply emit a library call and
> not emit aa.i:open (which is invalid) but with LTO we inline the call
> and thus end up trying to expand the builtin.
> 
> So it's rather a accepts-invalid without LTO ;)
> 
> Or LTO misbehaving in not throwing away extern inline functions that are not
> used within TU boundaries...  Honza - any opinion on that?

Well, i would say that the code is invalid.
Extern functions and LTO are fishy as at least for C semantics they can
differ in implementation between units.  We never supported that correctly
though we can do so now via syntactic aliases.  Perhaps something for next
stage1 (we could also use this to behave more consistently for comdats
built with different optimization flags in different units).
I think this is more QOI issue though.

Honza

Reply via email to