* [Bug lto/114505] static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support
2024-03-28 0:06 [Bug lto/114505] New: static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support eschwartz93 at gmail dot com
@ 2024-03-28 0:16 ` xry111 at gcc dot gnu.org
2024-03-28 0:21 ` pinskia at gcc dot gnu.org
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: xry111 at gcc dot gnu.org @ 2024-03-28 0:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114505
Xi Ruoyao <xry111 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2024-03-28
CC| |xry111 at gcc dot gnu.org
Ever confirmed|0 |1
Keywords| |lto
--- Comment #1 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Confirmed as I've seen it before. At least we should turn it into a "normal"
error message instead of ICE.
But note that even "downgrading the compression algorithm" is supported, it
won't really help rolling-release distros. When GCC itself is upgraded with a
LTO API version change, all previous LTO static archives will be unusable
anyway. Generally the distros should not ship LTO static archives at all.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug lto/114505] static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support
2024-03-28 0:06 [Bug lto/114505] New: static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support eschwartz93 at gmail dot com
2024-03-28 0:16 ` [Bug lto/114505] " xry111 at gcc dot gnu.org
@ 2024-03-28 0:21 ` pinskia at gcc dot gnu.org
2024-03-28 0:23 ` pinskia at gcc dot gnu.org
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-28 0:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114505
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|1 |0
Status|NEW |UNCONFIRMED
Last reconfirmed|2024-03-28 00:00:00 |
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
On the output side:
#ifdef HAVE_ZSTD_H
lto_compression compression = ZSTD;
#else
lto_compression compression = ZLIB;
#endif
bool slim_object = flag_generate_lto && !flag_fat_lto_objects;
lto_section s
= { LTO_major_version, LTO_minor_version, slim_object, 0, 0 };
s.set_compression (compression);
(flags of lto_section is just set to compression)
On the input side:
Wait this should not happen.
lto_end_uncompression (stream,
file_data->lto_section_header.get_compression ());
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug lto/114505] static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support
2024-03-28 0:06 [Bug lto/114505] New: static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support eschwartz93 at gmail dot com
2024-03-28 0:16 ` [Bug lto/114505] " xry111 at gcc dot gnu.org
2024-03-28 0:21 ` pinskia at gcc dot gnu.org
@ 2024-03-28 0:23 ` pinskia at gcc dot gnu.org
2024-03-28 0:24 ` pinskia at gcc dot gnu.org
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-28 0:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114505
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
Last reconfirmed| |2024-03-28
Ever confirmed|0 |1
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
THis should not case should not being ICE and should be handled correctly. I am
thinking something else is wrong.
Now the opposite direction is definitely should be a fatal_error instead of an
internal_error.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug lto/114505] static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support
2024-03-28 0:06 [Bug lto/114505] New: static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support eschwartz93 at gmail dot com
` (2 preceding siblings ...)
2024-03-28 0:23 ` pinskia at gcc dot gnu.org
@ 2024-03-28 0:24 ` pinskia at gcc dot gnu.org
2024-03-28 0:25 ` xry111 at gcc dot gnu.org
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-28 0:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114505
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
For the opposite direction, this is the fix:
```
diff --git a/gcc/lto-compress.cc b/gcc/lto-compress.cc
index c167ac967aa..1475674e7ac 100644
--- a/gcc/lto-compress.cc
+++ b/gcc/lto-compress.cc
@@ -408,7 +408,7 @@ lto_end_uncompression (struct lto_compression_stream
*stream,
}
#endif
if (compression == ZSTD)
- internal_error ("compiler does not support ZSTD LTO compression");
+ fatal_error ("compiler does not support ZSTD LTO compression");
lto_uncompression_zlib (stream);
}
```
But this direction should work.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug lto/114505] static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support
2024-03-28 0:06 [Bug lto/114505] New: static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support eschwartz93 at gmail dot com
` (3 preceding siblings ...)
2024-03-28 0:24 ` pinskia at gcc dot gnu.org
@ 2024-03-28 0:25 ` xry111 at gcc dot gnu.org
2024-03-28 0:26 ` sjames at gcc dot gnu.org
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: xry111 at gcc dot gnu.org @ 2024-03-28 0:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114505
Xi Ruoyao <xry111 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |needs-reduction
--- Comment #5 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
> THis should not case should not being ICE and should be handled correctly. I
> am thinking something else is wrong.
>
> Now the opposite direction is definitely should be a fatal_error instead of
> an internal_error.
I'm pretty sure I've seen the ICE before (when I forgot to strip the LTO
sections from a fat LTO archive built by a "GCC w/o zstd" to produce a non-LTO
archive).
Just need to find a test case...
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug lto/114505] static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support
2024-03-28 0:06 [Bug lto/114505] New: static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support eschwartz93 at gmail dot com
` (4 preceding siblings ...)
2024-03-28 0:25 ` xry111 at gcc dot gnu.org
@ 2024-03-28 0:26 ` sjames at gcc dot gnu.org
2024-03-28 0:29 ` pinskia at gcc dot gnu.org
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-03-28 0:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114505
--- Comment #6 from Sam James <sjames at gcc dot gnu.org> ---
I'm confident I've seen this happen before but I haven't got a quick testcase
(it should be easy to make one, but I don't have a gcc w/ zstd right this
second.)
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug lto/114505] static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support
2024-03-28 0:06 [Bug lto/114505] New: static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support eschwartz93 at gmail dot com
` (5 preceding siblings ...)
2024-03-28 0:26 ` sjames at gcc dot gnu.org
@ 2024-03-28 0:29 ` pinskia at gcc dot gnu.org
2024-03-28 0:32 ` pinskia at gcc dot gnu.org
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-28 0:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114505
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Something else must be going wrong here. Maybe a mistmatched version of ZSTD
which are incompatible somehow. Maybe ZSTD being miscompiled in one case.
The original ICE listed in this bug report should not happen unless there is
something wrong with ZSTD.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug lto/114505] static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support
2024-03-28 0:06 [Bug lto/114505] New: static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support eschwartz93 at gmail dot com
` (6 preceding siblings ...)
2024-03-28 0:29 ` pinskia at gcc dot gnu.org
@ 2024-03-28 0:32 ` pinskia at gcc dot gnu.org
2024-03-28 0:32 ` pinskia at gcc dot gnu.org
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-28 0:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114505
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
OE (Yocto) ran into this:
https://www.mail-archive.com/openembedded-core@lists.openembedded.org/msg158289.html
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug lto/114505] static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support
2024-03-28 0:06 [Bug lto/114505] New: static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support eschwartz93 at gmail dot com
` (7 preceding siblings ...)
2024-03-28 0:32 ` pinskia at gcc dot gnu.org
@ 2024-03-28 0:32 ` pinskia at gcc dot gnu.org
2024-03-28 0:34 ` pinskia at gcc dot gnu.org
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-28 0:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114505
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://github.com/openwrt/
| |openwrt/issues/10832
--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
openwrt ran into this too.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug lto/114505] static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support
2024-03-28 0:06 [Bug lto/114505] New: static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support eschwartz93 at gmail dot com
` (8 preceding siblings ...)
2024-03-28 0:32 ` pinskia at gcc dot gnu.org
@ 2024-03-28 0:34 ` pinskia at gcc dot gnu.org
2024-03-28 0:35 ` pinskia at gcc dot gnu.org
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-28 0:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114505
--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
https://www.reddit.com/r/Gentoo/comments/twtxhc/problems_compiling_gjs_1712_on_amd64/
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug lto/114505] static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support
2024-03-28 0:06 [Bug lto/114505] New: static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support eschwartz93 at gmail dot com
` (9 preceding siblings ...)
2024-03-28 0:34 ` pinskia at gcc dot gnu.org
@ 2024-03-28 0:35 ` pinskia at gcc dot gnu.org
2024-03-28 0:40 ` eschwartz93 at gmail dot com
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-28 0:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114505
--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
https://wiki.gentoo.org/wiki/QEMU#lto1:_internal_compiler_error:_original_not_compressed_with_zstd
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug lto/114505] static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support
2024-03-28 0:06 [Bug lto/114505] New: static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support eschwartz93 at gmail dot com
` (10 preceding siblings ...)
2024-03-28 0:35 ` pinskia at gcc dot gnu.org
@ 2024-03-28 0:40 ` eschwartz93 at gmail dot com
2024-03-28 0:45 ` pinskia at gcc dot gnu.org
2024-03-28 8:28 ` rguenth at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: eschwartz93 at gmail dot com @ 2024-03-28 0:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114505
--- Comment #12 from Eli Schwartz <eschwartz93 at gmail dot com> ---
(In reply to Xi Ruoyao from comment #1)
> Confirmed as I've seen it before. At least we should turn it into a
> "normal" error message instead of ICE.
>
> But note that even "downgrading the compression algorithm" is supported, it
> won't really help rolling-release distros. When GCC itself is upgraded with
> a LTO API version change, all previous LTO static archives will be unusable
> anyway. Generally the distros should not ship LTO static archives at all.
Agreed, figuring out how to solve that is an open ticket too:
https://bugs.gentoo.org/926120
Still would like to solve the zstd case :D especially since I am sure given the
flexibility of a from-source distro there will be users who insist they'd
rather rebuild the entire OS on a GCC upgrade, so reducing the compression
algorithm edge case will come in use.
(In reply to Andrew Pinski from comment #2)
> On the input side:
> Wait this should not happen.
>
> lto_end_uncompression (stream,
> file_data->lto_section_header.get_compression
> ());
I cannot swear this was the case but the error very specifically occurred as
part of a Gentoo profile change that caused zstd to be enabled.
The version of zstd should be the same, at least...
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug lto/114505] static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support
2024-03-28 0:06 [Bug lto/114505] New: static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support eschwartz93 at gmail dot com
` (11 preceding siblings ...)
2024-03-28 0:40 ` eschwartz93 at gmail dot com
@ 2024-03-28 0:45 ` pinskia at gcc dot gnu.org
2024-03-28 8:28 ` rguenth at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-28 0:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114505
--- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I understand that this might be the reason why others have enabled zstd always
but reading the code this case should be supported.
That is LTO generated from a GCC without ZSTD support should be supported with
one compiled with it.
Plus:
/* Compression algorithm used for compression of LTO bytecode. */
enum lto_compression
{
ZLIB,
ZSTD
};
ZSTD is 1 so it has to be something corrupting the field ...
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug lto/114505] static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support
2024-03-28 0:06 [Bug lto/114505] New: static archives built with gcc --without-zstd cause ICE when read by gcc with zstd support eschwartz93 at gmail dot com
` (12 preceding siblings ...)
2024-03-28 0:45 ` pinskia at gcc dot gnu.org
@ 2024-03-28 8:28 ` rguenth at gcc dot gnu.org
13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-03-28 8:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114505
--- Comment #14 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #4)
> For the opposite direction, this is the fix:
> ```
> diff --git a/gcc/lto-compress.cc b/gcc/lto-compress.cc
> index c167ac967aa..1475674e7ac 100644
> --- a/gcc/lto-compress.cc
> +++ b/gcc/lto-compress.cc
> @@ -408,7 +408,7 @@ lto_end_uncompression (struct lto_compression_stream
> *stream,
> }
> #endif
> if (compression == ZSTD)
> - internal_error ("compiler does not support ZSTD LTO compression");
> + fatal_error ("compiler does not support ZSTD LTO compression");
>
> lto_uncompression_zlib (stream);
> }
> ```
>
> But this direction should work.
This looks obvious to push, btw. And yes, this was supposed to be "supported"
^ permalink raw reply [flat|nested] 15+ messages in thread