public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/113357] New: [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c
@ 2024-01-12 17:01 mikpelinux at gmail dot com
  2024-01-12 17:11 ` [Bug target/113357] " pinskia at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: mikpelinux at gmail dot com @ 2024-01-12 17:01 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113357
           Summary: [14 regression] m68k-linux bootstrap failure in stage2
                    due to segfault compiling unwind-dw2.c
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mikpelinux at gmail dot com
  Target Milestone: ---

gcc-14 native(*) bootstrap on m68k-linux-gnu fails during stage2 as follows:

ranlib  libgcov.a
/mnt/scratch/objdir14/./gcc/xgcc -B/mnt/scratch/objdir14/./gcc/
-B/mnt/scratch/install14/m68k-unknown-linux-gnu/bin/
-B/mnt/scratch/install14/m68k-unknown-linux-gnu/lib/ -isystem
/mnt/scratch/install14/m68k-unknown-linux-gnu/include -isystem
/mnt/scratch/install14/m68k-unknown-linux-gnu/sys-include   -fno-checking -g
-O2 -O2  -g -O2 -DIN_GCC   -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual
-Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem
./include   -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector  
-fPIC -I. -I. -I../.././gcc -I/mnt/scratch/gcc-14-20240107/libgcc
-I/mnt/scratch/gcc-14-20240107/libgcc/.
-I/mnt/scratch/gcc-14-20240107/libgcc/../gcc
-I/mnt/scratch/gcc-14-20240107/libgcc/../include  -DHAVE_CC_TLS   -o
unwind-dw2.o -MT unwind-dw2.o -MD -MP -MF unwind-dw2.dep -fexceptions -c
/mnt/scratch/gcc-14-20240107/libgcc/unwind-dw2.c -fvisibility=hidden
-DHIDE_EXPORTS
during GIMPLE pass: switchlower
/mnt/scratch/gcc-14-20240107/libgcc/unwind-dw2.c: In function
'execute_stack_op':
/mnt/scratch/gcc-14-20240107/libgcc/unwind-dw2.c:524:1: internal compiler
error: Segmentation fault
  524 | execute_stack_op (const unsigned char *op_ptr, const unsigned char
*op_end,
      | ^~~~~~~~~~~~~~~~
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://gcc.gnu.org/bugs/> for instructions.
make[3]: *** [/mnt/scratch/gcc-14-20240107/libgcc/shared-object.mk:14:
unwind-dw2.o] Error 1
make[3]: Leaving directory
'/mnt/scratch/objdir14/m68k-unknown-linux-gnu/libgcc'
make[2]: *** [Makefile:17845: all-stage2-target-libgcc] Error 2
make[2]: Leaving directory '/mnt/scratch/objdir14'
make[1]: *** [Makefile:21317: stage2-bubble] Error 2
make[1]: Leaving directory '/mnt/scratch/objdir14'
make: *** [Makefile:21513: bootstrap] Error 2

This has been going on since 20231022, 20231015 was good. gcc-13 is also good.

Starting a git bisect now, but it'll take at least several weeks to get a
result.

(*) M1 mini running Aranym running m68k-linux-gnu full-system emulation.

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

* [Bug target/113357] [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c
  2024-01-12 17:01 [Bug bootstrap/113357] New: [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c mikpelinux at gmail dot com
@ 2024-01-12 17:11 ` pinskia at gcc dot gnu.org
  2024-01-12 17:23 ` mikpelinux at gmail dot com
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-01-12 17:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
               Host|                            |m68k-linux-gnu
          Component|bootstrap                   |target
   Target Milestone|---                         |14.0
             Target|                            |m68k-linux-gnu
              Build|                            |m68k-linux-gnu
           Keywords|                            |build, ice-on-valid-code,
                   |                            |wrong-code

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Can you provide the exact configure options so someone might be able to
reproduce it too?

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

* [Bug target/113357] [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c
  2024-01-12 17:01 [Bug bootstrap/113357] New: [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c mikpelinux at gmail dot com
  2024-01-12 17:11 ` [Bug target/113357] " pinskia at gcc dot gnu.org
@ 2024-01-12 17:23 ` mikpelinux at gmail dot com
  2024-01-27 17:27 ` mikpelinux at gmail dot com
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: mikpelinux at gmail dot com @ 2024-01-12 17:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Mikael Pettersson <mikpelinux at gmail dot com> ---
/mnt/scratch/gcc-14-20240107/configure --prefix=/mnt/scratch/install14
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-linker-build-id --with-linker-hash-style=gnu --disable-sjlj-exceptions
--disable-plugin --disable-lto --disable-multilib --disable-libgomp
--enable-initfini-array --enable-languages=c,c++

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

* [Bug target/113357] [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c
  2024-01-12 17:01 [Bug bootstrap/113357] New: [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c mikpelinux at gmail dot com
  2024-01-12 17:11 ` [Bug target/113357] " pinskia at gcc dot gnu.org
  2024-01-12 17:23 ` mikpelinux at gmail dot com
@ 2024-01-27 17:27 ` mikpelinux at gmail dot com
  2024-01-31 14:11 ` mikpelinux at gmail dot com
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: mikpelinux at gmail dot com @ 2024-01-27 17:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Mikael Pettersson <mikpelinux at gmail dot com> ---
git bisect identified the following as the start of this error:

# new: [04c9cf5c786b94fbe3f6f21f06cae73a7575ff7a] Implement new RTL
optimizations pass: fold-mem-offsets

Note the error still reproduced as of 2024-01-07 so wasn't fixed by PR111601.

(Technically my bisect has one more commit to test, the one immediately before
the above, but that one only updates gcc/d/ so cannot have any impact to my
bootstraps.)

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

* [Bug target/113357] [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c
  2024-01-12 17:01 [Bug bootstrap/113357] New: [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c mikpelinux at gmail dot com
                   ` (2 preceding siblings ...)
  2024-01-27 17:27 ` mikpelinux at gmail dot com
@ 2024-01-31 14:11 ` mikpelinux at gmail dot com
  2024-03-22 13:55 ` [Bug target/113357] [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c since r14-4664-g04c9cf5c786b94 law at gcc dot gnu.org
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: mikpelinux at gmail dot com @ 2024-01-31 14:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Mikael Pettersson <mikpelinux at gmail dot com> ---
Confirmed:

04c9cf5c786b94fbe3f6f21f06cae73a7575ff7a is the first new commit
commit 04c9cf5c786b94fbe3f6f21f06cae73a7575ff7a
Author: Manolis Tsamis <manolis.tsamis@vrull.eu>
Date:   Mon Oct 16 13:08:12 2023 -0600

    Implement new RTL optimizations pass: fold-mem-offsets

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

* [Bug target/113357] [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c since r14-4664-g04c9cf5c786b94
  2024-01-12 17:01 [Bug bootstrap/113357] New: [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c mikpelinux at gmail dot com
                   ` (3 preceding siblings ...)
  2024-01-31 14:11 ` mikpelinux at gmail dot com
@ 2024-03-22 13:55 ` law at gcc dot gnu.org
  2024-05-07  7:43 ` [Bug target/113357] [14/15 " rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: law at gcc dot gnu.org @ 2024-03-22 13:55 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4

--- Comment #5 from Jeffrey A. Law <law at gcc dot gnu.org> ---
So given my bootstraps (qemu) are working the most likely scenarios are either
a difference in the emulators or a difference in the configure setup.

The first thing I would suggest would be to put the stage2 compiler under a
debugger and find out why it faulted.  That might help with understanding the
problem.  ie, are we segfaulting because we dereferenced a NULL pointer, or
perhaps faulting because we did an unaligned access, or whatever.

The next thing I would suggest would be extracting the .i file and confirming
you  can feed that to the stage2 cc1 and see the fault.  Assuming you can, then
you ought to be able to do an object bisection.  ie, replace .o files for the
failing stage with those from a previous stage, relink, retest.  It'll take a
while.  But  this usually results in finding a single trigger file.  Once
that's narrowed down we can figure out the next steps.

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

* [Bug target/113357] [14/15 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c since r14-4664-g04c9cf5c786b94
  2024-01-12 17:01 [Bug bootstrap/113357] New: [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c mikpelinux at gmail dot com
                   ` (4 preceding siblings ...)
  2024-03-22 13:55 ` [Bug target/113357] [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c since r14-4664-g04c9cf5c786b94 law at gcc dot gnu.org
@ 2024-05-07  7:43 ` rguenth at gcc dot gnu.org
  2024-06-02 12:44 ` admin@tho-otto.de
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-07  7:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|14.0                        |14.2

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 14.1 is being released, retargeting bugs to GCC 14.2.

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

* [Bug target/113357] [14/15 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c since r14-4664-g04c9cf5c786b94
  2024-01-12 17:01 [Bug bootstrap/113357] New: [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c mikpelinux at gmail dot com
                   ` (5 preceding siblings ...)
  2024-05-07  7:43 ` [Bug target/113357] [14/15 " rguenth at gcc dot gnu.org
@ 2024-06-02 12:44 ` admin@tho-otto.de
  2024-06-03 12:45 ` manolis.tsamis at vrull dot eu
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: admin@tho-otto.de @ 2024-06-02 12:44 UTC (permalink / raw)
  To: gcc-bugs

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

Thorsten Otto <admin@tho-otto.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |admin@tho-otto.de

--- Comment #7 from Thorsten Otto <admin@tho-otto.de> ---
I ran into a similar problem. The symptom was that code in
tree-switch-conversion was miscompiled:

    if (k == count)
        {
          gcc_checking_assert (count < m_max_case_bit_tests);
          test[k].mask = wi::zero (prec);
          test[k].target_bb = n->m_case_bb;
          test[k].label = n->m_case_label_expr;
          test[k].bits = 0;
          test[k].prob = profile_probability::never ();
          count++;
        }

--- good.s      2024-06-02 13:20:13.453987931 +0200
+++ bad.s       2024-06-02 13:50:03.452881214 +0200
@@ -26976,11 +26976,10 @@
        move.l %d1,-330(%a0)    | prephitmp_336, MEM <struct case_bit_test[3]>
[(struct wide_int_storage *)&test][count_1036].mask.D.16112.len
 | gcc/tree-switch-conversion.cc:1639:          test[k].target_bb =
n->m_case_bb;
        move.l 4(%a3),%d1       | MEM <vector(1) unsigned int> [(void *)n_1051
+ 4B], vect__12.3140
-       lea (-322,%fp),%a4      |,,
-       lea (%a4,%d0.l),%a1     |, vectp.3143
+       lea (%fp,%d0.l),%a1     | tmp12, tmp638, vectp.3143
 | gcc/tree-switch-conversion.cc:1639:          test[k].target_bb =
n->m_case_bb;
        move.l 8(%a3),(%a1)     | MEM <vector(1) unsigned int> [(void *)n_1051
+ 8B], MEM <vector(1) unsigned int> [(void *)vectp.3143_425]
-       move.l %d1,4(%a1)       | vect__12.3140, MEM <vector(1) unsigned int>
[(void *)vectp.3143_425 + 4B]
+       move.l %d1,-318(%a1)    | vect__12.3140, MEM <vector(1) unsigned int>
[(void *)vectp.3143_425 + 4B]
 | gcc/tree-switch-conversion.cc:1641:          test[k].bits = 0;
        clr.l -314(%a0) | test[count_1036].bits
 | gcc/tree-switch-conversion.cc:1642:          test[k].prob =
profile_probability::never ();


Apparently the offset to the local test array was optimized away for the first
store, causing the outer loop to not find the previous m_case_bb pointer, and
then either crash or fail with an assertion because the array overflowed.

Seems like this is not the first regression caused by this "optimization".
Maybe it should be disabled for targets other than riscv, atleast until more
tests have been written.

A crash with such a buggy compiler can be produced with eg.

int date_is_valid(int mon)
{
    switch (mon) {
        case 1:
        case 3:
        case 5:
        case 7:
        case 8:
        case 10:
        case 12:
            break;
        default:
            return 0x2400;
    }

    return 0;
}

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

* [Bug target/113357] [14/15 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c since r14-4664-g04c9cf5c786b94
  2024-01-12 17:01 [Bug bootstrap/113357] New: [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c mikpelinux at gmail dot com
                   ` (6 preceding siblings ...)
  2024-06-02 12:44 ` admin@tho-otto.de
@ 2024-06-03 12:45 ` manolis.tsamis at vrull dot eu
  2024-06-03 15:22 ` mikpelinux at gmail dot com
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: manolis.tsamis at vrull dot eu @ 2024-06-03 12:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Manolis Tsamis <manolis.tsamis at vrull dot eu> ---
Created attachment 58335
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58335&action=edit
Do not modify live_out registers

After looking again at the dumps from PR112415, which I believe is closely
related to the issue here, I saw that while f-m-o was checking the uses of the
folded registers, it was still modifying registers that were at the BB's
live_out set.

I have attached a patch that I'm testing for addressing this. Could you please
check if this fixes this issue?

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

* [Bug target/113357] [14/15 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c since r14-4664-g04c9cf5c786b94
  2024-01-12 17:01 [Bug bootstrap/113357] New: [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c mikpelinux at gmail dot com
                   ` (7 preceding siblings ...)
  2024-06-03 12:45 ` manolis.tsamis at vrull dot eu
@ 2024-06-03 15:22 ` mikpelinux at gmail dot com
  2024-06-04 10:02 ` admin@tho-otto.de
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: mikpelinux at gmail dot com @ 2024-06-03 15:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Mikael Pettersson <mikpelinux at gmail dot com> ---
(In reply to Manolis Tsamis from comment #8)
> Created attachment 58335 [details]
> Do not modify live_out registers
> 
> After looking again at the dumps from PR112415, which I believe is closely
> related to the issue here, I saw that while f-m-o was checking the uses of
> the folded registers, it was still modifying registers that were at the BB's
> live_out set.
> 
> I have attached a patch that I'm testing for addressing this. Could you
> please check if this fixes this issue?

I'm starting a bootstrap on m68k-linux-gnu with this now, should know by Friday
if it resolves the issue or not. (It's running in full-system emulation mode on
Aranym, so it's slow.)

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

* [Bug target/113357] [14/15 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c since r14-4664-g04c9cf5c786b94
  2024-01-12 17:01 [Bug bootstrap/113357] New: [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c mikpelinux at gmail dot com
                   ` (8 preceding siblings ...)
  2024-06-03 15:22 ` mikpelinux at gmail dot com
@ 2024-06-04 10:02 ` admin@tho-otto.de
  2024-06-04 12:35 ` law at gcc dot gnu.org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: admin@tho-otto.de @ 2024-06-04 10:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Thorsten Otto <admin@tho-otto.de> ---
In my case it didn't fix the issue. I still get

internal compiler error: in emit, at tree-switch-conversion.cc:1637 

when i configure it atleast with --enable-checking=misc

So i can just repeat myself: if even after 3-4 attempts of fixing this it still
does not work, please revert that fold-mem-offset patch(es), or atleast disable
them. Its not worth of doing unsafe optimizations whose only purpose is to save
a single instruction for a particular machine, but cause trouble for others.

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

* [Bug target/113357] [14/15 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c since r14-4664-g04c9cf5c786b94
  2024-01-12 17:01 [Bug bootstrap/113357] New: [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c mikpelinux at gmail dot com
                   ` (9 preceding siblings ...)
  2024-06-04 10:02 ` admin@tho-otto.de
@ 2024-06-04 12:35 ` law at gcc dot gnu.org
  2024-06-04 13:29 ` admin@tho-otto.de
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: law at gcc dot gnu.org @ 2024-06-04 12:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Jeffrey A. Law <law at gcc dot gnu.org> ---
That's not the way we do things.  And my bootstraps on m68k are working fine. 
Last one was 6 days ago.

This needs to be debugged by someone with the time/interest on the m68k.

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

* [Bug target/113357] [14/15 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c since r14-4664-g04c9cf5c786b94
  2024-01-12 17:01 [Bug bootstrap/113357] New: [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c mikpelinux at gmail dot com
                   ` (10 preceding siblings ...)
  2024-06-04 12:35 ` law at gcc dot gnu.org
@ 2024-06-04 13:29 ` admin@tho-otto.de
  2024-06-05 12:16 ` mikpelinux at gmail dot com
  2024-06-07 20:28 ` mikpelinux at gmail dot com
  13 siblings, 0 replies; 15+ messages in thread
From: admin@tho-otto.de @ 2024-06-04 13:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Thorsten Otto <admin@tho-otto.de> ---
Can you try to compile the date_is_valid() snippet in comment#7?

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

* [Bug target/113357] [14/15 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c since r14-4664-g04c9cf5c786b94
  2024-01-12 17:01 [Bug bootstrap/113357] New: [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c mikpelinux at gmail dot com
                   ` (11 preceding siblings ...)
  2024-06-04 13:29 ` admin@tho-otto.de
@ 2024-06-05 12:16 ` mikpelinux at gmail dot com
  2024-06-07 20:28 ` mikpelinux at gmail dot com
  13 siblings, 0 replies; 15+ messages in thread
From: mikpelinux at gmail dot com @ 2024-06-05 12:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Mikael Pettersson <mikpelinux at gmail dot com> ---
(In reply to Mikael Pettersson from comment #9)
> (In reply to Manolis Tsamis from comment #8)
> > Created attachment 58335 [details]
> > Do not modify live_out registers
> > 
> > After looking again at the dumps from PR112415, which I believe is closely
> > related to the issue here, I saw that while f-m-o was checking the uses of
> > the folded registers, it was still modifying registers that were at the BB's
> > live_out set.
> > 
> > I have attached a patch that I'm testing for addressing this. Could you
> > please check if this fixes this issue?
> 
> I'm starting a bootstrap on m68k-linux-gnu with this now, should know by
> Friday if it resolves the issue or not. (It's running in full-system
> emulation mode on Aranym, so it's slow.)

Failed with a compile-warning-turned-error, haven't had time to investigate.

In file included from /mnt/scratch/gcc-15-20240602/gcc/system.h:726,
                 from /mnt/scratch/gcc-15-20240602/gcc/gimple-range-edge.cc:24:
In member function 'wide_int_storage& wide_int_storage::operator=(const T&)
[with T = wi::hwi_with_prec]',
    inlined from 'generic_wide_int<storage>&
generic_wide_int<T>::operator=(const T&) [with T = wi::hwi_with_prec; storage =
wide_int_storage]' at /mnt/scratch/gcc-15-20240602/gcc/wide-int.h:1002:23,
    inlined from 'void irange_bitmask::set_unknown(unsigned int)' at
/mnt/scratch/gcc-15-20240602/gcc/value-range.h:165:27,
    inlined from 'virtual void irange::set_varying(tree)' at
/mnt/scratch/gcc-15-20240602/gcc/value-range.h:1140:25,
    inlined from 'int_range<N, RESIZABLE>::int_range(tree) [with unsigned int N
= 3; bool RESIZABLE = true]' at
/mnt/scratch/gcc-15-20240602/gcc/value-range.h:1102:15,
    inlined from 'void gimple_outgoing_range::calc_switch_ranges(gswitch*)' at
/mnt/scratch/gcc-15-20240602/gcc/gimple-range-edge.cc:140:36:
/mnt/scratch/gcc-15-20240602/gcc/wide-int.h:1241:23: error:
'default_range.int_range<3,
true>::<unnamed>.irange::m_bitmask.irange_bitmask::m_value.generic_wide_int<wide_int_storage>::<unnamed>.wide_int_storage::u.wide_int_storage::<unnamed
union>::valp' may be used uninitialized [-Werror=maybe-uninitialized]
 1241 |         XDELETEVEC (u.valp);
/mnt/scratch/gcc-15-20240602/gcc/../include/libiberty.h:370:48: note: in
definition of macro 'XDELETEVEC'
  370 | #define XDELETEVEC(P)           free ((void*) (P))
      |                                                ^
/mnt/scratch/gcc-15-20240602/gcc/gimple-range-edge.cc: In member function 'void
gimple_outgoing_range::calc_switch_ranges(gswitch*)':
/mnt/scratch/gcc-15-20240602/gcc/gimple-range-edge.cc:140:17: note:
'default_range' declared here
  140 |   int_range_max default_range (type);
      |                 ^~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[3]: *** [Makefile:1197: gimple-range-edge.o] Error 1

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

* [Bug target/113357] [14/15 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c since r14-4664-g04c9cf5c786b94
  2024-01-12 17:01 [Bug bootstrap/113357] New: [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c mikpelinux at gmail dot com
                   ` (12 preceding siblings ...)
  2024-06-05 12:16 ` mikpelinux at gmail dot com
@ 2024-06-07 20:28 ` mikpelinux at gmail dot com
  13 siblings, 0 replies; 15+ messages in thread
From: mikpelinux at gmail dot com @ 2024-06-07 20:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Mikael Pettersson <mikpelinux at gmail dot com> ---
Since gcc-15 wouldn't build due to an unrelated issue, I applied the fmo patch
to gcc-14.1 (which also has this bug) and bootstrapped that. Alas it didn't
make any difference, same error in stage2 as in the initial report.

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

end of thread, other threads:[~2024-06-07 20:28 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-12 17:01 [Bug bootstrap/113357] New: [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c mikpelinux at gmail dot com
2024-01-12 17:11 ` [Bug target/113357] " pinskia at gcc dot gnu.org
2024-01-12 17:23 ` mikpelinux at gmail dot com
2024-01-27 17:27 ` mikpelinux at gmail dot com
2024-01-31 14:11 ` mikpelinux at gmail dot com
2024-03-22 13:55 ` [Bug target/113357] [14 regression] m68k-linux bootstrap failure in stage2 due to segfault compiling unwind-dw2.c since r14-4664-g04c9cf5c786b94 law at gcc dot gnu.org
2024-05-07  7:43 ` [Bug target/113357] [14/15 " rguenth at gcc dot gnu.org
2024-06-02 12:44 ` admin@tho-otto.de
2024-06-03 12:45 ` manolis.tsamis at vrull dot eu
2024-06-03 15:22 ` mikpelinux at gmail dot com
2024-06-04 10:02 ` admin@tho-otto.de
2024-06-04 12:35 ` law at gcc dot gnu.org
2024-06-04 13:29 ` admin@tho-otto.de
2024-06-05 12:16 ` mikpelinux at gmail dot com
2024-06-07 20:28 ` mikpelinux at gmail dot com

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).