public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/108268] New: [13 Regression] Build failure on cross from powerpc64le-linux to nvptx-none
@ 2023-01-02 20:29 jakub at gcc dot gnu.org
2023-01-02 20:29 ` [Bug middle-end/108268] " jakub at gcc dot gnu.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-02 20:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108268
Bug ID: 108268
Summary: [13 Regression] Build failure on cross from
powerpc64le-linux to nvptx-none
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
Target Milestone: ---
../configure --disable-bootstrap --disable-sjlj-exceptions
--enable-newlib-io-long-long
--with-build-time-tools=/builddir/build/BUILD/gcc-13.0.0-20230102/obji/usr/nvptx-none/bin
--
target nvptx-none --enable-as-accelerator-for=ppc64le-redhat-linux
--enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=
http://bugzilla.redhat.com/bugzilla --enable-checking=release
--with-system-zlib --with-gcc-major-version-only --without-isl
configured GCC ICEs on compilation of all C/C++ files.
The problem is that c_cpp_builtins function has &c_global_trees[0] value stored
in $r30
register, but when it calls
1525 int value = dwarf_reg_sizes_constant ();
the $r30 value is saved into stack frame and partially overwritten by buffer
overflow.
Before it is 0x0000000011939cb0 and after returning from that function
0x11930008. This is because DWARF_FRAME_RETURN_COLUMN macro defaults to
DWARF_FRAME_REGISTERS, nvptx.h doesn't override it (it is a target without
register allocation nor debug info), dwarf_reg_sizes_constant allocates
343 poly_uint16 *sizes = XALLOCAVEC (poly_uint16, DWARF_FRAME_REGISTERS);
and then generate_dwarf_reg_sizes stores:
326 if (!init_state.wrote_return_column)
327 sizes[DWARF_FRAME_RETURN_COLUMN] = GET_MODE_SIZE (Pmode);
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/108268] [13 Regression] Build failure on cross from powerpc64le-linux to nvptx-none
2023-01-02 20:29 [Bug middle-end/108268] New: [13 Regression] Build failure on cross from powerpc64le-linux to nvptx-none jakub at gcc dot gnu.org
@ 2023-01-02 20:29 ` jakub at gcc dot gnu.org
2023-01-02 20:34 ` pinskia at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-02 20:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108268
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |13.0
Priority|P3 |P1
CC| |fw at gcc dot gnu.org
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/108268] [13 Regression] Build failure on cross from powerpc64le-linux to nvptx-none
2023-01-02 20:29 [Bug middle-end/108268] New: [13 Regression] Build failure on cross from powerpc64le-linux to nvptx-none jakub at gcc dot gnu.org
2023-01-02 20:29 ` [Bug middle-end/108268] " jakub at gcc dot gnu.org
@ 2023-01-02 20:34 ` pinskia at gcc dot gnu.org
2023-01-03 11:02 ` jakub at gcc dot gnu.org
2023-01-06 11:47 ` jakub at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-02 20:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108268
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |build
Severity|normal |blocker
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/108268] [13 Regression] Build failure on cross from powerpc64le-linux to nvptx-none
2023-01-02 20:29 [Bug middle-end/108268] New: [13 Regression] Build failure on cross from powerpc64le-linux to nvptx-none jakub at gcc dot gnu.org
2023-01-02 20:29 ` [Bug middle-end/108268] " jakub at gcc dot gnu.org
2023-01-02 20:34 ` pinskia at gcc dot gnu.org
@ 2023-01-03 11:02 ` jakub at gcc dot gnu.org
2023-01-06 11:47 ` jakub at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-03 11:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108268
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Looking at GCC 12, I think no target actually stored anything into that last
element
unless it was a return or alternate return column.
It is true that expand_builtin_init_dwarf_reg_sizes had:
if (!init_state.wrote_return_column)
init_return_column_size (mode, mem, DWARF_FRAME_RETURN_COLUMN);
#ifdef DWARF_ALT_FRAME_RETURN_COLUMN
init_return_column_size (mode, mem, DWARF_ALT_FRAME_RETURN_COLUMN);
#endif
which is what the new gcc tries to preserve.
init_one_dwarf_reg_size had:
const unsigned int dnum = DWARF_FRAME_REGNUM (regno);
const unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
const unsigned int dcol = DWARF_REG_TO_UNWIND_COLUMN (rnum);
...
if (rnum >= DWARF_FRAME_REGISTERS)
return;
though, and seems DWARF_REG_TO_UNWIND_COLUMN always uses the default definition
of
just returning its argument, so I think init_one_dwarf_reg_size would never
store to
the last element. init_return_column_size can though. And
TARGET_INIT_DWARF_REG_SIZES_EXTRA is only defined on msp430 and rs6000 and
neither writes at offsets >= DWARF_FRAME_REGISTERS.
So, I think the DWARF_FRAME_REGISTERS element should be considered into whether
everything is constant/same size only if it is DWARF_FRAME_RETURN_COLUMN or
DWARF_ATL_FRAME_RETURN_COLUMN.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/108268] [13 Regression] Build failure on cross from powerpc64le-linux to nvptx-none
2023-01-02 20:29 [Bug middle-end/108268] New: [13 Regression] Build failure on cross from powerpc64le-linux to nvptx-none jakub at gcc dot gnu.org
` (2 preceding siblings ...)
2023-01-03 11:02 ` jakub at gcc dot gnu.org
@ 2023-01-06 11:47 ` jakub at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-06 11:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108268
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|UNCONFIRMED |RESOLVED
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
r13-4980-gd010efbfb89721bc9ca9e657e980ff0d8e6187af reverted the problematic
commit, so it should build now fine again.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-01-06 11:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-02 20:29 [Bug middle-end/108268] New: [13 Regression] Build failure on cross from powerpc64le-linux to nvptx-none jakub at gcc dot gnu.org
2023-01-02 20:29 ` [Bug middle-end/108268] " jakub at gcc dot gnu.org
2023-01-02 20:34 ` pinskia at gcc dot gnu.org
2023-01-03 11:02 ` jakub at gcc dot gnu.org
2023-01-06 11:47 ` jakub 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).