public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/113933] New: Switch pa to LRA
@ 2024-02-15 19:01 sjames at gcc dot gnu.org
2024-02-15 20:47 ` [Bug target/113933] " dave.anglin at bell dot net
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-02-15 19:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113933
Bug ID: 113933
Summary: Switch pa to LRA
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: sjames at gcc dot gnu.org
CC: danglin at gcc dot gnu.org, law at gcc dot gnu.org
Blocks: 113932
Target Milestone: ---
People are getting eager to require LRA. Please port the PA target to LRA (see
PR113932).
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113932
[Bug 113932] [meta-bug] Targets which should be ported to LRA
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/113933] Switch pa to LRA
2024-02-15 19:01 [Bug target/113933] New: Switch pa to LRA sjames at gcc dot gnu.org
@ 2024-02-15 20:47 ` dave.anglin at bell dot net
2024-09-19 6:07 ` segher at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: dave.anglin at bell dot net @ 2024-02-15 20:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113933
--- Comment #1 from dave.anglin at bell dot net ---
On 2024-02-15 2:01 p.m., sjames at gcc dot gnu.org wrote:
> People are getting eager to require LRA. Please port the PA target to LRA (see
> PR113932).
Having tried this once, I know it's non trivial on PA.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/113933] Switch pa to LRA
2024-02-15 19:01 [Bug target/113933] New: Switch pa to LRA sjames at gcc dot gnu.org
2024-02-15 20:47 ` [Bug target/113933] " dave.anglin at bell dot net
@ 2024-09-19 6:07 ` segher at gcc dot gnu.org
2024-09-19 6:12 ` sjames at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: segher at gcc dot gnu.org @ 2024-09-19 6:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113933
--- Comment #2 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to dave.anglin from comment #1)
> On 2024-02-15 2:01 p.m., sjames at gcc dot gnu.org wrote:
> > People are getting eager to require LRA. Please port the PA target to LRA (see
> > PR113932).
> Having tried this once, I know it's non trivial on PA.
Then please tell us what problems you are running into?
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/113933] Switch pa to LRA
2024-02-15 19:01 [Bug target/113933] New: Switch pa to LRA sjames at gcc dot gnu.org
2024-02-15 20:47 ` [Bug target/113933] " dave.anglin at bell dot net
2024-09-19 6:07 ` segher at gcc dot gnu.org
@ 2024-09-19 6:12 ` sjames at gcc dot gnu.org
2024-09-20 17:02 ` danglin at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-09-19 6:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113933
Sam James <sjames at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2024-09-19
Ever confirmed|0 |1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/113933] Switch pa to LRA
2024-02-15 19:01 [Bug target/113933] New: Switch pa to LRA sjames at gcc dot gnu.org
` (2 preceding siblings ...)
2024-09-19 6:12 ` sjames at gcc dot gnu.org
@ 2024-09-20 17:02 ` danglin at gcc dot gnu.org
2024-09-20 18:52 ` danglin at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: danglin at gcc dot gnu.org @ 2024-09-20 17:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113933
--- Comment #3 from John David Anglin <danglin at gcc dot gnu.org> ---
This code in pa_emit_move_sequence is reload specific (reg_equiv_mem):
if (scratch_reg
&& reload_in_progress
&& GET_CODE (operand0) == REG
&& REGNO (operand0) >= FIRST_PSEUDO_REGISTER)
operand0 = reg_equiv_mem (REGNO (operand0));
else if (scratch_reg
&& reload_in_progress
&& GET_CODE (operand0) == SUBREG
&& GET_CODE (SUBREG_REG (operand0)) == REG
&& REGNO (SUBREG_REG (operand0)) >= FIRST_PSEUDO_REGISTER)
{
/* We must not alter SUBREG_BYTE (operand0) since that would confuse
the code which tracks sets/uses for delete_output_reload. */
rtx temp = gen_rtx_SUBREG (GET_MODE (operand0),
reg_equiv_mem (REGNO (SUBREG_REG (operand0))),
SUBREG_BYTE (operand0));
operand0 = alter_subreg (&temp, true);
}
We need something similar for lra. Otherwise, we hit following error:
dave@mx3210:~/gnu/gcc/objdir/hppa-linux-gnu/libgcc$ sh xx.sh
GNU C17 (GCC) version 15.0.0 20240918 (experimental) [master
r15-3695-gcc62b2c3da1] (hppa-linux-gnu)
compiled by GNU C version 13.3.0, GMP version 6.3.0, MPFR version
4.2.1, MPC version 1.3.1, isl version isl-0.18-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 07d108a61db93a2471fe8e13f11689df
during RTL pass: reload
../../../gcc/libgcc/libgcc2.c: In function ‘__mulvdi3’:
../../../gcc/libgcc/libgcc2.c:376:1: internal compiler error: maximum number of
generated reload insns per insn achieved (90)
376 | }
| ^
0x335fd73 internal_error(char const*, ...)
../../gcc/gcc/diagnostic-global-context.cc:517
0x12b9e43 lra_constraints(bool)
../../gcc/gcc/lra-constraints.cc:5404
0x1291b63 lra(_IO_FILE*, int)
../../gcc/gcc/lra.cc:2445
0x11f4d43 do_reload
../../gcc/gcc/ira.cc:5976
0x11f5663 execute
../../gcc/gcc/ira.cc:6164
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/113933] Switch pa to LRA
2024-02-15 19:01 [Bug target/113933] New: Switch pa to LRA sjames at gcc dot gnu.org
` (3 preceding siblings ...)
2024-09-20 17:02 ` danglin at gcc dot gnu.org
@ 2024-09-20 18:52 ` danglin at gcc dot gnu.org
2024-09-20 18:54 ` danglin at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: danglin at gcc dot gnu.org @ 2024-09-20 18:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113933
--- Comment #4 from John David Anglin <danglin at gcc dot gnu.org> ---
Created attachment 59163
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59163&action=edit
Initial patch to enable lra
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/113933] Switch pa to LRA
2024-02-15 19:01 [Bug target/113933] New: Switch pa to LRA sjames at gcc dot gnu.org
` (4 preceding siblings ...)
2024-09-20 18:52 ` danglin at gcc dot gnu.org
@ 2024-09-20 18:54 ` danglin at gcc dot gnu.org
2024-09-20 20:19 ` danglin at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: danglin at gcc dot gnu.org @ 2024-09-20 18:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113933
--- Comment #5 from John David Anglin <danglin at gcc dot gnu.org> ---
Created attachment 59164
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59164&action=edit
Preproccessed source
We have lra crash with this source.
/home/dave/gnu/gcc/objdir/./gcc/cc1 -fpreprocessed _mulvdi3.i -quiet -dumpbase
_mulvdi3.c -dumpbase-ext .c -g -g -g -O2 -O2 -O2 -Wextra -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wformat=0 -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition -version -fno-checking -fbuilding-libgcc
-fno-stack-protector -fPIC -fvisibility=hidden -o _mulvdi3.s
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/113933] Switch pa to LRA
2024-02-15 19:01 [Bug target/113933] New: Switch pa to LRA sjames at gcc dot gnu.org
` (5 preceding siblings ...)
2024-09-20 18:54 ` danglin at gcc dot gnu.org
@ 2024-09-20 20:19 ` danglin at gcc dot gnu.org
2024-09-22 13:47 ` danglin at gcc dot gnu.org
2024-09-22 18:31 ` danglin at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: danglin at gcc dot gnu.org @ 2024-09-20 20:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113933
--- Comment #6 from John David Anglin <danglin at gcc dot gnu.org> ---
lra crashes on this insn:
(insn 524 38 523 5 (set (reg:DI 106 [ _16 ])
(reg:DI 321 [orig:106 _16 ] [106]))
"../../../gcc/libgcc/libgcc2.c":276:4 81 {*pa.md:4260}
(nil))
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/113933] Switch pa to LRA
2024-02-15 19:01 [Bug target/113933] New: Switch pa to LRA sjames at gcc dot gnu.org
` (6 preceding siblings ...)
2024-09-20 20:19 ` danglin at gcc dot gnu.org
@ 2024-09-22 13:47 ` danglin at gcc dot gnu.org
2024-09-22 18:31 ` danglin at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: danglin at gcc dot gnu.org @ 2024-09-22 13:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113933
John David Anglin <danglin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #59163|0 |1
is obsolete| |
--- Comment #7 from John David Anglin <danglin at gcc dot gnu.org> ---
Created attachment 59178
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59178&action=edit
Patch
This patch gets us to bootstrap on hppa-unknown-linux-gnu and
hppa64-hp-hpux11.11.
For the most part, I fixed the LRA crashes by adjusting pa_secondary_reload
to prevent pa_emit_move_sequence from being called in situations where it
just emitted an unmodified set. Without reg_equiv_mem, the operands were
not being adjusted and the reload failed.
I was not able to get SECONDARY_MEMORY_NEEDED to work properly on hppa64
target with lra. It never did copy via memory between general and
floating-point registers. We ended up with an unrecognized insn if I allowed
reloading
pseudos during LRA. If I didn't allow them, we got a secondary reload
overflow. So, I modified 64-bit SImode, SFmode, DImode and DFmode to do
copy using the SP-40 slot in the frame marker.
We have a bunch of regressions. For example,
FAIL: gcc.dg/enum-alias-3.c (test for excess errors)
FAIL: gcc.dg/non-local-goto-1.c execution test
FAIL: gcc.dg/non-local-goto-2.c execution test
FAIL: gcc.dg/pr49994-1.c (internal compiler error: in add_stores, at
var-tracking.cc:5966)
FAIL: gcc.dg/pr49994-1.c (test for excess errors)
Don't know if the changes to pa_secondary_reload will work with legacy reload.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/113933] Switch pa to LRA
2024-02-15 19:01 [Bug target/113933] New: Switch pa to LRA sjames at gcc dot gnu.org
` (7 preceding siblings ...)
2024-09-22 13:47 ` danglin at gcc dot gnu.org
@ 2024-09-22 18:31 ` danglin at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: danglin at gcc dot gnu.org @ 2024-09-22 18:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113933
--- Comment #8 from John David Anglin <danglin at gcc dot gnu.org> ---
Looks like there is a typo in the indirect_goto constraints and that
causes the insn which loads "lab" to be deleted.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-09-22 18:31 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-15 19:01 [Bug target/113933] New: Switch pa to LRA sjames at gcc dot gnu.org
2024-02-15 20:47 ` [Bug target/113933] " dave.anglin at bell dot net
2024-09-19 6:07 ` segher at gcc dot gnu.org
2024-09-19 6:12 ` sjames at gcc dot gnu.org
2024-09-20 17:02 ` danglin at gcc dot gnu.org
2024-09-20 18:52 ` danglin at gcc dot gnu.org
2024-09-20 18:54 ` danglin at gcc dot gnu.org
2024-09-20 20:19 ` danglin at gcc dot gnu.org
2024-09-22 13:47 ` danglin at gcc dot gnu.org
2024-09-22 18:31 ` danglin 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).