[Bug middle-end/113354] Regression/14: unable to find a register to spill on mips

2024-01-12 Thread vmakarov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113354

Vladimir Makarov  changed:

   What|Removed |Added

 CC||vmakarov at gcc dot gnu.org

--- Comment #2 from Vladimir Makarov  ---
Thank you for reporting this.  The issue is not in the patch itself.  The patch
simply triggered a hidden bug.

The insn in the question looks like

1657: {r3001:SI=r291:SI*r294:SI+r3002:SI;clobber r2788:SI;clobber r2390:SI;}

On the 1st subpass we choose alternative with the following constraints

(0) l  (1) d  (2) d  (3) l  (4) X  (5) X {*mul_acc_si}

On the second subpass we choose alternative

(0) l  (1) d  (2) d  (3) l  (4) X  (5) X {*mul_acc_si}

p2788 happened to get MD0 and it prevents p3001 to get MD0 too.   p2788 can be
in any location for this alternative but LRA assignment subpass does not take
this into account.

I'll try to fix this hidden bug on the beginning of the next week.

[Bug middle-end/113354] Regression/14: unable to find a register to spill on mips

2024-01-12 Thread syq at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113354

--- Comment #1 from YunQiang Su  ---
In file included from
../../../../../libstdc++-v3/src/c++17/floating_from_chars.cc:86:
../../../../../libstdc++-v3/src/c++17/fast_float/fast_float.h: In function
‘std::from_chars_result {anonymous}::fast_float::from_chars_advanced(const c
har*, const char*, T&, parse_options) [with T = double]’:   
../../../../../libstdc++-v3/src/c++17/fast_float/fast_float.h:3039:1: error:
unable to find a register to spill
 3039 | }   
  | ^   
../../../../../libstdc++-v3/src/c++17/fast_float/fast_float.h:3039:1: error:
this is the insn: 
(insn 3578 7721 7722 263 (parallel [
(set (reg:SI 3353)  
(plus:SI (mult:SI (reg:SI 3185 [orig:2219 _914+4 ] [2219])  
(reg:SI 2175 [ _280+4 ]))   
(reg:SI 3354)))
   
   (clobber (reg:SI 3186 [3073]))  
 
(clobber (reg:SI 3074))
   ])
"../../../../../libstdc++-v3/src/c++17/fast_float/fast_float.h":248:26 42
{*mul_acc_si} 
(expr_list:REG_UNUSED (reg:SI 3074)
 
(expr_list:REG_UNUSED (reg:SI 3186 [3073]) 
  
(expr_list:REG_DEAD (reg:SI 3354)  
  
(expr_list:REG_DEAD (reg:SI 3185 [orig:2219 _914+4 ] [2219])   
  
(nil)) 
   during RTL pass: reload 
   
 
../../../../../libstdc++-v3/src/c++17/fast_float/fast_float.h:3039:1: internal
compiler error: in lra_split_hard_reg_for, at lra-assigns.cc:1862  
0x7cf140 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
  ../../gcc/rtl-error.cc:108   
 0x10184c5
lra_split_hard_reg_for()   

../../gcc/lra-assigns.cc:1862  
   0x1012405
lra(_IO_FILE*, int) 
../../gcc/lra.cc:2518  
0xfc76df do_reload  
../../gcc/ira.cc:5973  
0xfc76df execute   
../../gcc/ira.cc:6161