public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/104121] New: [12 Regression] v850: Infinite loop in find_reload_regno_insns()
@ 2022-01-19 15:56 sebastian.huber@embedded-brains.de
  2022-01-19 15:57 ` [Bug target/104121] " marxin at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: sebastian.huber@embedded-brains.de @ 2022-01-19 15:56 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104121
           Summary: [12 Regression] v850: Infinite loop in
                    find_reload_regno_insns()
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sebastian.huber@embedded-brains.de
  Target Milestone: ---

Building the current master branch for the v850-rtems target results in an
infinite loop in find_reload_regno_insns() while building libgcc:

/tmp/sh/b-gcc-v850-rtems6/v850-rtems6/v850e2v3/libgcc >
/tmp/sh/b-gcc-v850-rtems6/./gcc/xgcc -B/tmp/sh/b-gcc-v850-rtems6/./gcc/
-nostdinc -B/tmp/sh/b-gcc-v850-rtems6/v850-rtems6/newlib/ -isystem
/tmp/sh/b-gcc-v850-rtems6/v850-rtems6/newlib/targ-include -isystem
/home/EB/sebastian_h/src/gcc/newlib/libc/include
-B/tmp/sh/i-v850-rtems6/v850-rtems6/bin/
-B/tmp/sh/i-v850-rtems6/v850-rtems6/lib/ -isystem
/tmp/sh/i-v850-rtems6/v850-rtems6/include -isystem
/tmp/sh/i-v850-rtems6/v850-rtems6/sys-include    -g -O2 -mv850e2v3 -O2
-I/home/EB/sebastian_h/src/gcc/libgcc/../newlib/libc/sys/rtems/include -g -O2
-DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition 
-isystem ./include -mno-app-regs -msmall-sld -Wa,-mwarn-signed-overflow
-Wa,-mwarn-unsigned-overflow  -g -DIN_LIBGCC2 -fbuilding-libgcc
-fno-stack-protector -Dinhibit_libc  -I. -I. -I../../.././gcc
-I/home/EB/sebastian_h/src/gcc/libgcc -I/home/EB/sebastian_h/src/gcc/libgcc/.
-I/home/EB/sebastian_h/src/gcc/libgcc/../gcc
-I/home/EB/sebastian_h/src/gcc/libgcc/../include  -DHAVE_CC_TLS -DUSE_EMUTLS 
-o _muldc3.o -MT _muldc3.o -MD -MP -MF _muldc3.dep -DL_muldc3 -c
/home/EB/sebastian_h/src/gcc/libgcc/libgcc2.c -fvisibility=hidden
-DHIDE_EXPORTS -wrapper gdb,--args
GNU gdb (GDB; openSUSE Leap 15.2) 11.1
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-suse-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://bugs.opensuse.org/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /tmp/sh/b-gcc-v850-rtems6/./gcc/cc1...
(gdb) r
Starting program: /tmp/sh/b-gcc-v850-rtems6/gcc/cc1 -quiet -nostdinc -I
/home/EB/sebastian_h/src/gcc/libgcc/../newlib/libc/sys/rtems/include -I . -I .
-I ../../.././gcc -I /home/EB/sebastian_h/src/gcc/libgcc -I
/home/EB/sebastian_h/src/gcc/libgcc/. -I
/home/EB/sebastian_h/src/gcc/libgcc/../gcc -I
/home/EB/sebastian_h/src/gcc/libgcc/../include -imultilib v850e2v3 -iprefix
/tmp/sh/b-gcc-v850-rtems6/gcc/../lib64/gcc/v850-rtems6/12.0.1/ -isystem
/tmp/sh/b-gcc-v850-rtems6/./gcc/include -isystem
/tmp/sh/b-gcc-v850-rtems6/./gcc/include-fixed -MD _muldc3.d -MF _muldc3.dep -MP
-MT _muldc3.o -D__v850e2v3__ -D IN_GCC -D CROSS_DIRECTORY_STRUCTURE -D
IN_LIBGCC2 -D inhibit_libc -D HAVE_CC_TLS -D USE_EMUTLS -D L_muldc3 -D
HIDE_EXPORTS -isystem /tmp/sh/b-gcc-v850-rtems6/v850-rtems6/newlib/targ-include
-isystem /home/EB/sebastian_h/src/gcc/newlib/libc/include -isystem
/tmp/sh/i-v850-rtems6/v850-rtems6/include -isystem
/tmp/sh/i-v850-rtems6/v850-rtems6/sys-include -isystem ./include
/home/EB/sebastian_h/src/gcc/libgcc/libgcc2.c -quiet -dumpbase _muldc3.c
-dumpbase-ext .c -mv850e2v3 -mno-app-regs -msmall-sld -g -g -g -O2 -O2 -O2
-Wextra -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition -fbuilding-libgcc
-fno-stack-protector -fvisibility=hidden -o /tmp/ccXJQ7zz.s
Missing separate debuginfos, use: zypper install
glibc-debuginfo-2.26-lp152.26.12.1.x86_64
^C
Program received signal SIGINT, Interrupt.
0x0000000000982526 in find_reload_regno_insns (finish=<synthetic pointer>:
<optimized out>, start=<synthetic pointer>: <optimized out>, regno=410) at
/home/EB/sebastian_h/src/gcc/gcc/lra-assigns.cc:1740
1740              if (next_insn != NULL && second_insn == NULL)
(gdb) n
1727               n != 1 && (prev_insn != NULL || next_insn != NULL); )
(gdb) 
1729              if (prev_insn != NULL && first_insn == NULL)
(gdb) 
1740              if (next_insn != NULL && second_insn == NULL)
(gdb) 
1727               n != 1 && (prev_insn != NULL || next_insn != NULL); )
(gdb) 
1729              if (prev_insn != NULL && first_insn == NULL)
(gdb) 
1740              if (next_insn != NULL && second_insn == NULL)
(gdb) 
1727               n != 1 && (prev_insn != NULL || next_insn != NULL); )
(gdb) 
1729              if (prev_insn != NULL && first_insn == NULL)
(gdb) 
1740              if (next_insn != NULL && second_insn == NULL)
(gdb) 
1727               n != 1 && (prev_insn != NULL || next_insn != NULL); )
(gdb) 
1729              if (prev_insn != NULL && first_insn == NULL)
(gdb) bt
#0  find_reload_regno_insns (finish=<synthetic pointer>: <optimized out>,
start=<synthetic pointer>: <optimized out>, regno=410) at
/home/EB/sebastian_h/src/gcc/gcc/lra-assigns.cc:1729
#1  lra_split_hard_reg_for () at
/home/EB/sebastian_h/src/gcc/gcc/lra-assigns.cc:1794
#2  0x000000000097cbac in lra (f=<optimized out>) at
/home/EB/sebastian_h/src/gcc/gcc/lra.cc:2412
#3  0x000000000092d422 in do_reload () at
/home/EB/sebastian_h/src/gcc/gcc/ira.cc:5934
#4  (anonymous namespace)::pass_reload::execute (this=<optimized out>) at
/home/EB/sebastian_h/src/gcc/gcc/ira.cc:6120
#5  0x0000000000a564d9 in execute_one_pass (pass=pass@entry=0x1ef3d40) at
/home/EB/sebastian_h/src/gcc/gcc/passes.cc:2637
#6  0x0000000000a56df1 in execute_pass_list_1 (pass=0x1ef3d40) at
/home/EB/sebastian_h/src/gcc/gcc/passes.cc:2737
#7  0x0000000000a56e03 in execute_pass_list_1 (pass=0x1ef2ba0) at
/home/EB/sebastian_h/src/gcc/gcc/passes.cc:2738
#8  0x0000000000a56e45 in execute_pass_list (fn=<optimized out>,
pass=<optimized out>) at /home/EB/sebastian_h/src/gcc/gcc/passes.cc:2748
#9  0x0000000000658fd9 in cgraph_node::expand (this=0x7ffff75d2330) at
/home/EB/sebastian_h/src/gcc/gcc/cgraphunit.cc:1834
#10 0x000000000065a887 in expand_all_functions () at
/home/EB/sebastian_h/src/gcc/gcc/cgraphunit.cc:1998
#11 symbol_table::compile (this=this@entry=0x7ffff74ea000) at
/home/EB/sebastian_h/src/gcc/gcc/cgraphunit.cc:2348
#12 0x000000000065df70 in symbol_table::compile (this=0x7ffff74ea000) at
/home/EB/sebastian_h/src/gcc/gcc/cgraphunit.cc:2532
#13 symbol_table::finalize_compilation_unit (this=0x7ffff74ea000) at
/home/EB/sebastian_h/src/gcc/gcc/cgraphunit.cc:2529
#14 0x0000000000b4edde in compile_file () at
/home/EB/sebastian_h/src/gcc/gcc/toplev.cc:479
#15 0x000000000045e2ce in do_compile (no_backend=false) at
/home/EB/sebastian_h/src/gcc/gcc/toplev.cc:2158
#16 toplev::main (this=this@entry=0x7fffffffd11e, argc=<optimized out>,
argc@entry=89, argv=<optimized out>, argv@entry=0x7fffffffd218) at
/home/EB/sebastian_h/src/gcc/gcc/toplev.cc:2310
#17 0x00000000004606bb in main (argc=89, argv=0x7fffffffd218) at
/home/EB/sebastian_h/src/gcc/gcc/main.cc:39

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

* [Bug target/104121] [12 Regression] v850: Infinite loop in find_reload_regno_insns()
  2022-01-19 15:56 [Bug target/104121] New: [12 Regression] v850: Infinite loop in find_reload_regno_insns() sebastian.huber@embedded-brains.de
@ 2022-01-19 15:57 ` marxin at gcc dot gnu.org
  2022-01-19 15:59 ` sebastian.huber@embedded-brains.de
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-01-19 15:57 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Can you please attach pre-processed source file (-E) ?

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

* [Bug target/104121] [12 Regression] v850: Infinite loop in find_reload_regno_insns()
  2022-01-19 15:56 [Bug target/104121] New: [12 Regression] v850: Infinite loop in find_reload_regno_insns() sebastian.huber@embedded-brains.de
  2022-01-19 15:57 ` [Bug target/104121] " marxin at gcc dot gnu.org
@ 2022-01-19 15:59 ` sebastian.huber@embedded-brains.de
  2022-01-19 16:33 ` marxin at gcc dot gnu.org
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: sebastian.huber@embedded-brains.de @ 2022-01-19 15:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Sebastian Huber <sebastian.huber@embedded-brains.de> ---
Created attachment 52235
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52235&action=edit
Pre-processed source file

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

* [Bug target/104121] [12 Regression] v850: Infinite loop in find_reload_regno_insns()
  2022-01-19 15:56 [Bug target/104121] New: [12 Regression] v850: Infinite loop in find_reload_regno_insns() sebastian.huber@embedded-brains.de
  2022-01-19 15:57 ` [Bug target/104121] " marxin at gcc dot gnu.org
  2022-01-19 15:59 ` sebastian.huber@embedded-brains.de
@ 2022-01-19 16:33 ` marxin at gcc dot gnu.org
  2022-01-19 16:39 ` [Bug target/104121] [12 Regression] v850: Infinite loop in find_reload_regno_insns() since r12-5852-g50e8b0c9bca6cdc57804f860ec5311b641753fbb marxin at gcc dot gnu.org
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-01-19 16:33 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-01-19
             Status|UNCONFIRMED                 |NEW

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Thanks, reduced test-case:

$ cat /tmp/loop.i
int __muldc3_a;
int __muldc3_b;
int __muldc3_c;
double __muldc3_d;

_Complex double
xxx() {
  double y;
  if (__builtin_isnan && __builtin_isnan(y)) {
    y = 0 * (__muldc3_a * __muldc3_d + __muldc3_b * __muldc3_c);
  }
}

Loops only with -mv850e2v3 option, I'm bisecting that right now.

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

* [Bug target/104121] [12 Regression] v850: Infinite loop in find_reload_regno_insns() since r12-5852-g50e8b0c9bca6cdc57804f860ec5311b641753fbb
  2022-01-19 15:56 [Bug target/104121] New: [12 Regression] v850: Infinite loop in find_reload_regno_insns() sebastian.huber@embedded-brains.de
                   ` (2 preceding siblings ...)
  2022-01-19 16:33 ` marxin at gcc dot gnu.org
@ 2022-01-19 16:39 ` marxin at gcc dot gnu.org
  2022-01-19 18:00 ` pinskia at gcc dot gnu.org
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-01-19 16:39 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[12 Regression] v850:       |[12 Regression] v850:
                   |Infinite loop in            |Infinite loop in
                   |find_reload_regno_insns()   |find_reload_regno_insns()
                   |                            |since
                   |                            |r12-5852-g50e8b0c9bca6cdc57
                   |                            |804f860ec5311b641753fbb
                 CC|                            |aoliva at gcc dot gnu.org

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r12-5852-g50e8b0c9bca6cdc57804f860ec5311b641753fbb.

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

* [Bug target/104121] [12 Regression] v850: Infinite loop in find_reload_regno_insns() since r12-5852-g50e8b0c9bca6cdc57804f860ec5311b641753fbb
  2022-01-19 15:56 [Bug target/104121] New: [12 Regression] v850: Infinite loop in find_reload_regno_insns() sebastian.huber@embedded-brains.de
                   ` (3 preceding siblings ...)
  2022-01-19 16:39 ` [Bug target/104121] [12 Regression] v850: Infinite loop in find_reload_regno_insns() since r12-5852-g50e8b0c9bca6cdc57804f860ec5311b641753fbb marxin at gcc dot gnu.org
@ 2022-01-19 18:00 ` pinskia at gcc dot gnu.org
  2022-02-17 19:40 ` aoliva at gcc dot gnu.org
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-19 18:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0
           Keywords|                            |compile-time-hog

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

* [Bug target/104121] [12 Regression] v850: Infinite loop in find_reload_regno_insns() since r12-5852-g50e8b0c9bca6cdc57804f860ec5311b641753fbb
  2022-01-19 15:56 [Bug target/104121] New: [12 Regression] v850: Infinite loop in find_reload_regno_insns() sebastian.huber@embedded-brains.de
                   ` (4 preceding siblings ...)
  2022-01-19 18:00 ` pinskia at gcc dot gnu.org
@ 2022-02-17 19:40 ` aoliva at gcc dot gnu.org
  2022-02-17 21:42 ` aoliva at gcc dot gnu.org
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: aoliva at gcc dot gnu.org @ 2022-02-17 19:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Do you still get this?  I can't trigger the problem with the reduced testcase
with -O2 -g -mv850e2v3, on a cross to v850-rtems hosted on x86_64-linux-gnu.

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

* [Bug target/104121] [12 Regression] v850: Infinite loop in find_reload_regno_insns() since r12-5852-g50e8b0c9bca6cdc57804f860ec5311b641753fbb
  2022-01-19 15:56 [Bug target/104121] New: [12 Regression] v850: Infinite loop in find_reload_regno_insns() sebastian.huber@embedded-brains.de
                   ` (5 preceding siblings ...)
  2022-02-17 19:40 ` aoliva at gcc dot gnu.org
@ 2022-02-17 21:42 ` aoliva at gcc dot gnu.org
  2022-02-17 21:43 ` aoliva at gcc dot gnu.org
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: aoliva at gcc dot gnu.org @ 2022-02-17 21:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
No luck, even with commit 

./xgcc -B./ -O2 -g pr104121.c -mv850e2v3 -mno-app-regs -msmall-sld 
-fbuilding-libgcc -fno-stack-protector

do I actually need binutils to enable something essential in GCC to trigger the
bug?

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

* [Bug target/104121] [12 Regression] v850: Infinite loop in find_reload_regno_insns() since r12-5852-g50e8b0c9bca6cdc57804f860ec5311b641753fbb
  2022-01-19 15:56 [Bug target/104121] New: [12 Regression] v850: Infinite loop in find_reload_regno_insns() sebastian.huber@embedded-brains.de
                   ` (6 preceding siblings ...)
  2022-02-17 21:42 ` aoliva at gcc dot gnu.org
@ 2022-02-17 21:43 ` aoliva at gcc dot gnu.org
  2022-02-18  9:38 ` sebastian.huber@embedded-brains.de
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: aoliva at gcc dot gnu.org @ 2022-02-17 21:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
I mean, even with commit 50e8b0c9bca6cdc57804f860ec5311b641753fbb

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

* [Bug target/104121] [12 Regression] v850: Infinite loop in find_reload_regno_insns() since r12-5852-g50e8b0c9bca6cdc57804f860ec5311b641753fbb
  2022-01-19 15:56 [Bug target/104121] New: [12 Regression] v850: Infinite loop in find_reload_regno_insns() sebastian.huber@embedded-brains.de
                   ` (7 preceding siblings ...)
  2022-02-17 21:43 ` aoliva at gcc dot gnu.org
@ 2022-02-18  9:38 ` sebastian.huber@embedded-brains.de
  2022-02-18 15:12 ` aoliva at gcc dot gnu.org
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: sebastian.huber@embedded-brains.de @ 2022-02-18  9:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Sebastian Huber <sebastian.huber@embedded-brains.de> ---
I can't reproduce the issue with the reduced test case, however, compiling the
preprocessed file still results in an infinite loop.

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

* [Bug target/104121] [12 Regression] v850: Infinite loop in find_reload_regno_insns() since r12-5852-g50e8b0c9bca6cdc57804f860ec5311b641753fbb
  2022-01-19 15:56 [Bug target/104121] New: [12 Regression] v850: Infinite loop in find_reload_regno_insns() sebastian.huber@embedded-brains.de
                   ` (8 preceding siblings ...)
  2022-02-18  9:38 ` sebastian.huber@embedded-brains.de
@ 2022-02-18 15:12 ` aoliva at gcc dot gnu.org
  2022-02-18 15:20 ` aoliva at gcc dot gnu.org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: aoliva at gcc dot gnu.org @ 2022-02-18 15:12 UTC (permalink / raw)
  To: gcc-bugs

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

Alexandre Oliva <aoliva at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |aoliva at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #9 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Thanks, I've succeeded in duplicating the problem with the preprocessed
testcase, both with the earlier tree and with a more recent one.  Now I can
look into it.

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

* [Bug target/104121] [12 Regression] v850: Infinite loop in find_reload_regno_insns() since r12-5852-g50e8b0c9bca6cdc57804f860ec5311b641753fbb
  2022-01-19 15:56 [Bug target/104121] New: [12 Regression] v850: Infinite loop in find_reload_regno_insns() sebastian.huber@embedded-brains.de
                   ` (9 preceding siblings ...)
  2022-02-18 15:12 ` aoliva at gcc dot gnu.org
@ 2022-02-18 15:20 ` aoliva at gcc dot gnu.org
  2022-02-18 20:16 ` aoliva at gcc dot gnu.org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: aoliva at gcc dot gnu.org @ 2022-02-18 15:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
and then, as I reduced it myself down to the following and compared with the
minimized test, I've finally turned on both of my neurons ;-) and it finally
hit me: "only with -mv850e2v3" didn't mean "not with other multilibs", but
rather "without any optimization".  of course, none of the minimized test would
survive with optimization.  doh!

this one triggers with -O2 -g -mv850e2v3:

typedef float DFtype __attribute__ ((mode (DF)));
typedef _Complex float DCtype __attribute__ ((mode (DC)));
DCtype
__muldc3 (DFtype a, DFtype b, DFtype c, DFtype d)
{
   DFtype x = __builtin_huge_val () * (a * c - b * d);
   DFtype y = __builtin_huge_val () * (a * d + b * c);

   DCtype res;
  __real__ res = x;
  __imag__ res = y;
  return res;
}

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

* [Bug target/104121] [12 Regression] v850: Infinite loop in find_reload_regno_insns() since r12-5852-g50e8b0c9bca6cdc57804f860ec5311b641753fbb
  2022-01-19 15:56 [Bug target/104121] New: [12 Regression] v850: Infinite loop in find_reload_regno_insns() sebastian.huber@embedded-brains.de
                   ` (10 preceding siblings ...)
  2022-02-18 15:20 ` aoliva at gcc dot gnu.org
@ 2022-02-18 20:16 ` aoliva at gcc dot gnu.org
  2022-02-25  1:20 ` cvs-commit at gcc dot gnu.org
  2022-02-25  1:44 ` aoliva at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: aoliva at gcc dot gnu.org @ 2022-02-18 20:16 UTC (permalink / raw)
  To: gcc-bugs

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

Alexandre Oliva <aoliva at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=103302

--- Comment #11 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Ok, now I think the patch for bug 103302, that brought us this regression, is
wrong.  Unlike the old reload, lra computes live ranges for reload pseudos, and
without the clobbers, they end up much longer, possibly overlapping, to the
point that assignments become impossible.

But this is unrelated with the loop.  find_reload_regno_insns assumes
single-insn input and output reloads, and it won't find sequences like those
emitted by emit_move_multi_word (or emit_move_complex_parts, for that matter). 
That was fine when we had sequences that amounted to a clobber plus a pair of
moves, because those plus start_insn added up to more than 3, the cut-off for
find_reload_regno_insns before entering the endless loop.

But an expander for a reload insn that issued two insns could, AFAICT, trigger
the problem in which we find a first_insn and then loop forever looking for the
second_insn after next_insn became NULL and prev_insn isn't looked at any more,
or vice-versa for an output reload.  Alas, neither of the fixes for that solve
the problem:

- getting the loop to terminate and return false when we won't find all of the
reload insns with the current logic gets us an infinite loop one level up, as
we attempt to spill the reg and assign it again indefinitely.

- getting the loop to recognize the entire contiguous sequences, which is what
we should probably do, enables progress, but then, we issue more reloads, and
because of the extended live ranges, we also fail to assign them, and so on,
until we hit the lra max iteration count.

Restoring the clobber renders these changes unnecessary, and I guess that's
what we should do.  It will however bring back the obscure reloading problem we
had on risc-v, that likely affects v850 as well, in which a shared register
assignment crossing such a clobber could end up killing the source assigned to
the same hardware register before copying it to the reload destination.  That
is far less common, but far more painful when it silently hits.

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

* [Bug target/104121] [12 Regression] v850: Infinite loop in find_reload_regno_insns() since r12-5852-g50e8b0c9bca6cdc57804f860ec5311b641753fbb
  2022-01-19 15:56 [Bug target/104121] New: [12 Regression] v850: Infinite loop in find_reload_regno_insns() sebastian.huber@embedded-brains.de
                   ` (11 preceding siblings ...)
  2022-02-18 20:16 ` aoliva at gcc dot gnu.org
@ 2022-02-25  1:20 ` cvs-commit at gcc dot gnu.org
  2022-02-25  1:44 ` aoliva at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-25  1:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Alexandre Oliva <aoliva@gcc.gnu.org>:

https://gcc.gnu.org/g:a9e2ebe839d56416ceaff1a40df54de4890539be

commit r12-7384-ga9e2ebe839d56416ceaff1a40df54de4890539be
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Thu Feb 24 22:03:40 2022 -0300

    Revert commit r12-5852-g50e8b0c9bca6cdc57804f860ec5311b641753fbb

    The patch for PR103302 caused PR104121, and extended the live ranges
    of LRA reloads.


    for gcc/ChangeLog

            PR target/104121
            PR target/103302
            * expr.cc (emit_move_multi_word): Restore clobbers during LRA.

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

* [Bug target/104121] [12 Regression] v850: Infinite loop in find_reload_regno_insns() since r12-5852-g50e8b0c9bca6cdc57804f860ec5311b641753fbb
  2022-01-19 15:56 [Bug target/104121] New: [12 Regression] v850: Infinite loop in find_reload_regno_insns() sebastian.huber@embedded-brains.de
                   ` (12 preceding siblings ...)
  2022-02-25  1:20 ` cvs-commit at gcc dot gnu.org
@ 2022-02-25  1:44 ` aoliva at gcc dot gnu.org
  13 siblings, 0 replies; 15+ messages in thread
From: aoliva at gcc dot gnu.org @ 2022-02-25  1:44 UTC (permalink / raw)
  To: gcc-bugs

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

Alexandre Oliva <aoliva at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #13 from Alexandre Oliva <aoliva at gcc dot gnu.org> ---
Fixed

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

end of thread, other threads:[~2022-02-25  1:44 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-19 15:56 [Bug target/104121] New: [12 Regression] v850: Infinite loop in find_reload_regno_insns() sebastian.huber@embedded-brains.de
2022-01-19 15:57 ` [Bug target/104121] " marxin at gcc dot gnu.org
2022-01-19 15:59 ` sebastian.huber@embedded-brains.de
2022-01-19 16:33 ` marxin at gcc dot gnu.org
2022-01-19 16:39 ` [Bug target/104121] [12 Regression] v850: Infinite loop in find_reload_regno_insns() since r12-5852-g50e8b0c9bca6cdc57804f860ec5311b641753fbb marxin at gcc dot gnu.org
2022-01-19 18:00 ` pinskia at gcc dot gnu.org
2022-02-17 19:40 ` aoliva at gcc dot gnu.org
2022-02-17 21:42 ` aoliva at gcc dot gnu.org
2022-02-17 21:43 ` aoliva at gcc dot gnu.org
2022-02-18  9:38 ` sebastian.huber@embedded-brains.de
2022-02-18 15:12 ` aoliva at gcc dot gnu.org
2022-02-18 15:20 ` aoliva at gcc dot gnu.org
2022-02-18 20:16 ` aoliva at gcc dot gnu.org
2022-02-25  1:20 ` cvs-commit at gcc dot gnu.org
2022-02-25  1:44 ` aoliva 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).