[Bug target/114942] [14/15 Regression] ICE on valid code at -O1 with "-fno-tree-sra -fno-guess-branch-probability": in extract_constrain_insn, at recog.cc:2713

2024-05-10 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114942

--- Comment #6 from GCC Commits  ---
The master branch has been updated by Vladimir Makarov :

https://gcc.gnu.org/g:9585317f0715699197b1313bbf939c6ea3c1ace6

commit r15-364-g9585317f0715699197b1313bbf939c6ea3c1ace6
Author: Vladimir N. Makarov 
Date:   Fri May 10 09:15:50 2024 -0400

[PR114942][LRA]: Don't reuse input reload reg of inout early clobber
operand

  The insn in question has the same reg in inout operand and input
operand.  The inout operand is early clobber.  LRA reused input reload
reg of the inout operand for the input operand which is wrong.  It
were a good decision if the inout operand was not early clobber one.
The patch rejects the reuse for the PR test case.

gcc/ChangeLog:

PR target/114942
* lra-constraints.cc (struct input_reload): Add new member
early_clobber_p.
(get_reload_reg): Add new arg early_clobber_p, don't reuse input
reload with true early_clobber_p member value, use the arg for new
element of curr_insn_input_reloads.
(match_reload): Assign false to early_clobber_p member.
(process_addr_reg, simplify_operand_subreg, curr_insn_transform):
Adjust get_reload_reg calls.

gcc/testsuite/ChangeLog:

PR target/114942
* gcc.target/i386/pr114942.c: New.

[Bug target/114942] [14/15 Regression] ICE on valid code at -O1 with "-fno-tree-sra -fno-guess-branch-probability": in extract_constrain_insn, at recog.cc:2713

2024-05-08 Thread vmakarov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114942

--- Comment #5 from Vladimir Makarov  ---
I've started to work on this PR.  I hope a patch will be ready on this or the
next week.

[Bug target/114942] [14/15 Regression] ICE on valid code at -O1 with "-fno-tree-sra -fno-guess-branch-probability": in extract_constrain_insn, at recog.cc:2713

2024-05-07 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114942

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|14.0|14.2

--- Comment #4 from Richard Biener  ---
GCC 14.1 is being released, retargeting bugs to GCC 14.2.

[Bug target/114942] [14/15 Regression] ICE on valid code at -O1 with "-fno-tree-sra -fno-guess-branch-probability": in extract_constrain_insn, at recog.cc:2713

2024-05-05 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114942

Uroš Bizjak  changed:

   What|Removed |Added

   Keywords||ra

--- Comment #3 from Uroš Bizjak  ---
Reload starts with:

(insn 39 38 48 6 (parallel [
(set (strict_low_part (subreg:QI (reg/v:HI 108 [ f ]) 0))
(ior:QI (subreg:QI (zero_extract:HI (reg/v:HI 108 [ f ])
(const_int 8 [0x8])
(const_int 8 [0x8])) 0)
(reg:QI 121 [ _7 ])))
(clobber (reg:CC 17 flags))
]) "pr114942.c":19:7 626 {*iorqi_exthi_1_slp}
 (expr_list:REG_DEAD (reg:QI 121 [ _7 ])
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil

  Choosing alt 1 in insn 39:  (0)   (1) !qm  (2) Q {*iorqi_exthi_1_slp}

and then allocates:

(insn 39 56 57 6 (parallel [
(set (strict_low_part (reg:QI 2 cx [orig:108 f ] [108]))
(ior:QI (subreg:QI (zero_extract:HI (reg/v:HI 2 cx [orig:108 f
] [108])
(const_int 8 [0x8])
(const_int 8 [0x8])) 0)
(reg:QI 0 ax [orig:121 _7 ] [121])))
(clobber (reg:CC 17 flags))
]) "pr114942.c":19:7 626 {*iorqi_exthi_1_slp}

not taking into account the earlyclobber of operand 0.

[Bug target/114942] [14/15 Regression] ICE on valid code at -O1 with "-fno-tree-sra -fno-guess-branch-probability": in extract_constrain_insn, at recog.cc:2713

2024-05-04 Thread ubizjak at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114942

--- Comment #2 from Uroš Bizjak  ---
This is the insn in question:

;; Alternative 1 is needed to work around LRA limitation, see PR82524.
 (define_insn_and_split "*qi_ext_1_slp"
   [(set (strict_low_part (match_operand:QI 0 "register_operand" "+Q,"))
 (any_logic:QI
   (subreg:QI
 (match_operator:SWI248 3 "extract_operator"
   [(match_operand 2 "int248_register_operand" "Q,Q")
(const_int 8)
(const_int 8)]) 0)
   (match_operand:QI 1 "nonimmediate_operand" "0,!qm")))
(clobber (reg:CC FLAGS_REG))]

When targeting alternative 1, reload should use some other register for operand
2.

[Bug target/114942] [14/15 Regression] ICE on valid code at -O1 with "-fno-tree-sra -fno-guess-branch-probability": in extract_constrain_insn, at recog.cc:2713

2024-05-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114942

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2024-05-03
   Target Milestone|--- |14.0
Summary|ICE on valid code at -O1|[14/15 Regression] ICE on
   |with "-fno-tree-sra |valid code at -O1 with
   |-fno-guess-branch-probabili |"-fno-tree-sra
   |ty": in |-fno-guess-branch-probabili
   |extract_constrain_insn, at  |ty": in
   |recog.cc:2713   |extract_constrain_insn, at
   ||recog.cc:2713
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
Version|unknown |15.0

--- Comment #1 from Andrew Pinski  ---
Confirmed. Looks like it was introduced with r14-5456-gb42a09b258c3ed .