[Bug target/113221] [14 Regression][aarch64]ICE in extract_insn, at recog.cc:2812 since r14-6605-gc0911c6b357ba9

2024-01-18 Thread acoplan at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113221

Alex Coplan  changed:

   What|Removed |Added

 CC||zsojka at seznam dot cz

--- Comment #9 from Alex Coplan  ---
*** Bug 113184 has been marked as a duplicate of this bug. ***

[Bug target/113221] [14 Regression][aarch64]ICE in extract_insn, at recog.cc:2812 since r14-6605-gc0911c6b357ba9

2024-01-17 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113221

Andrew Pinski  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from Andrew Pinski  ---
Fixed.

[Bug target/113221] [14 Regression][aarch64]ICE in extract_insn, at recog.cc:2812 since r14-6605-gc0911c6b357ba9

2024-01-17 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113221

--- Comment #7 from GCC Commits  ---
The trunk branch has been updated by Andrew Pinski :

https://gcc.gnu.org/g:7a8124e341aebcc544b4720e920b625f4ffe4e8a

commit r14-8194-g7a8124e341aebcc544b4720e920b625f4ffe4e8a
Author: Andrew Pinski 
Date:   Tue Jan 16 15:37:49 2024 -0800

aarch64: Fix aarch64_ldp_reg_operand predicate not to allow all subreg
[PR113221]

So the problem here is that aarch64_ldp_reg_operand will all subreg even
subreg of lo_sum.
When LRA tries to fix that up, all things break. So the fix is to change
the check to only
allow reg and subreg of regs.

Note the tendancy here is to use register_operand but that checks the mode
of the register
but we need to allow a mismatch modes for this predicate for now.

Built and tested for aarch64-linux-gnu with no regressions
(Also tested with the LD/ST pair pass back on).

PR target/113221

gcc/ChangeLog:

* config/aarch64/predicates.md (aarch64_ldp_reg_operand): For
subreg,
only allow REG operands instead of allowing all.

gcc/testsuite/ChangeLog:

* gcc.c-torture/compile/pr113221-1.c: New test.

Signed-off-by: Andrew Pinski 

[Bug target/113221] [14 Regression][aarch64]ICE in extract_insn, at recog.cc:2812 since r14-6605-gc0911c6b357ba9

2024-01-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113221

Andrew Pinski  changed:

   What|Removed |Added

URL||https://gcc.gnu.org/piperma
   ||il/gcc-patches/2024-January
   ||/643190.html

--- Comment #6 from Andrew Pinski  ---
Patch submitted:
https://gcc.gnu.org/pipermail/gcc-patches/2024-January/643190.html

[Bug target/113221] [14 Regression][aarch64]ICE in extract_insn, at recog.cc:2812 since r14-6605-gc0911c6b357ba9

2024-01-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113221

--- Comment #5 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #4)
> Actually `(match_operand 0 "register_operand")` should be used instead of
> the current `(match_code "reg,subreg")`.

Except that does not work since register_operand checks the mode ...
and then we fail to match:
```
(insn 46 45 47 2 (parallel [
(set (reg:V4SI 148)
(unspec:V4SI [
(mem/c:V2x16QI (reg:DI 147) [0 +0 S32 A128])
] UNSPEC_LDP_FST))
(set (reg:V4SI 149)
(unspec:V4SI [
(mem/c:V2x16QI (reg:DI 147) [0 +0 S32 A128])
] UNSPEC_LDP_SND))
]) "../../../libgcc/libgcov-interface.c":211:2 -1
 (nil))
```
Because we only define the load_pair_16 for TImode and TImode != V4SImode here
...

So Back to changing it to only test for reg and subreg of a reg then.

[Bug target/113221] [14 Regression][aarch64]ICE in extract_insn, at recog.cc:2812 since r14-6605-gc0911c6b357ba9

2024-01-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113221

--- Comment #4 from Andrew Pinski  ---
Actually `(match_operand 0 "register_operand")` should be used instead of the
current `(match_code "reg,subreg")`.

[Bug target/113221] [14 Regression][aarch64]ICE in extract_insn, at recog.cc:2812 since r14-6605-gc0911c6b357ba9

2024-01-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113221

Andrew Pinski  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |pinskia at gcc dot 
gnu.org
 Status|NEW |ASSIGNED

--- Comment #3 from Andrew Pinski  ---
So I think aarch64_ldp_reg_operand allows too much, it allows `(subreg:SI
(lo_sum:DI` when it should have just allowed `(subreg:SI (reg:`.

I am going to see if that fixes the issue.

[Bug target/113221] [14 Regression][aarch64]ICE in extract_insn, at recog.cc:2812 since r14-6605-gc0911c6b357ba9

2024-01-08 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113221

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org
   Priority|P3  |P1

[Bug target/113221] [14 Regression][aarch64]ICE in extract_insn, at recog.cc:2812 since r14-6605-gc0911c6b357ba9

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

--- Comment #2 from Andrew Pinski  ---
IRA decided to combine:
```
(insn 9 8 19 3 (set (reg/f:DI 104)
(lo_sum:DI (reg/f:DI 105)
(symbol_ref:DI ("bar") [flags 0x41]  ))) "t.c":5:10 discrim 1 -1
 (expr_list:REG_DEAD (reg/f:DI 105)
(expr_list:REG_EQUAL (symbol_ref:DI ("bar") [flags 0x41] 
)
(nil
...
(insn 21 20 11 3 (set (reg/f:DI 110)
(lo_sum:DI (reg/f:DI 109)
(symbol_ref:DI ("bar") [flags 0x41]  ))) "t.c":5:10 discrim 1 -1
 (expr_list:REG_DEAD (reg/f:DI 109)
(expr_list:REG_EQUAL (symbol_ref:DI ("bar") [flags 0x41] 
)
(nil
(insn 11 21 27 3 (parallel [
(set (reg:DI 106)
(plus:DI (reg:DI 106)
(const_int 4 [0x4])))
(set (mem:SI (reg:DI 106) [0  S4 A8])
(subreg:SI (reg/f:DI 104) 0))
(set (mem:SI (plus:DI (reg:DI 106)
(const_int 4 [0x4])) [0  S4 A8])
(subreg:SI (reg/f:DI 110) 0))
]) "t.c":5:10 discrim 1 102 {*storewb_post_pair_4}
 (nil))

```



to:
```
(insn 11 20 27 3 (parallel [
(set (reg:DI 106)
(plus:DI (reg:DI 106)
(const_int 4 [0x4])))
(set (mem:SI (reg:DI 106) [0  S4 A8])
(subreg:SI (lo_sum:DI (reg/f:DI 105)
(symbol_ref:DI ("bar") [flags 0x41]  )) 0))
(set (mem:SI (plus:DI (reg:DI 106)
(const_int 4 [0x4])) [0  S4 A8])
(subreg:SI (lo_sum:DI (reg/f:DI 109)
(symbol_ref:DI ("bar") [flags 0x41]  )) 0))
]) "t.c":5:10 discrim 1 102 {*storewb_post_pair_4}
 (expr_list:REG_DEAD (reg/f:DI 109)
(expr_list:REG_DEAD (reg/f:DI 105)
(nil

```

But I have no idea why though ...

[Bug target/113221] [14 Regression][aarch64]ICE in extract_insn, at recog.cc:2812 since r14-6605-gc0911c6b357ba9

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

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2024-01-03
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

[Bug target/113221] [14 Regression][aarch64]ICE in extract_insn, at recog.cc:2812 since r14-6605-gc0911c6b357ba9

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

--- Comment #1 from Andrew Pinski  ---
Confirmed, but the IR from the ldp_fusion pass looks ok:
```
(insn 30 29 15 3 (set (reg/f:DI 110)
(lo_sum:DI (reg/f:DI 109)
(symbol_ref:DI ("_Z3barv") [flags 0x41]  ))) "/app/example.cpp":5:10 discrim 1 -1
 (expr_list:REG_DEAD (reg/f:DI 109)
(expr_list:REG_EQUAL (symbol_ref:DI ("_Z3barv") [flags 0x41] 
)
(nil
(insn 15 30 32 3 (parallel [
(set (reg:DI 106)
(plus:DI (reg:DI 106)
(const_int 4 [0x4])))
(set (mem:SI (reg:DI 106) [0  S4 A8])
(subreg:SI (reg/f:DI 104) 0))
(set (mem:SI (plus:DI (reg:DI 106)
(const_int 4 [0x4])) [0  S4 A8])
(subreg:SI (reg/f:DI 110) 0))
]) "/app/example.cpp":5:10 discrim 1 102 {*storewb_post_pair_4}
 (nil))
```

[Bug target/113221] [14 Regression][aarch64]ICE in extract_insn, at recog.cc:2812 since r14-6605-gc0911c6b357ba9

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

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |14.0
 CC||pinskia at gcc dot gnu.org