* [Bug rtl-optimization/97092] [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c
2020-09-17 16:51 [Bug rtl-optimization/97092] New: [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c acoplan at gcc dot gnu.org
@ 2020-09-18 6:10 ` rguenth at gcc dot gnu.org
2020-12-08 16:12 ` akrl at gcc dot gnu.org
` (11 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-09-18 6:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |10.3
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug rtl-optimization/97092] [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c
2020-09-17 16:51 [Bug rtl-optimization/97092] New: [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c acoplan at gcc dot gnu.org
2020-09-18 6:10 ` [Bug rtl-optimization/97092] " rguenth at gcc dot gnu.org
@ 2020-12-08 16:12 ` akrl at gcc dot gnu.org
2020-12-08 16:25 ` Andrea Corallo
2020-12-08 16:26 ` andrea.corallo at arm dot com
` (10 subsequent siblings)
12 siblings, 1 reply; 19+ messages in thread
From: akrl at gcc dot gnu.org @ 2020-12-08 16:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
--- Comment #1 from akrl at gcc dot gnu.org ---
Hi all,
I can't reproduce this on current master (76a1719f0ff), I guess has been
fixed in the meanwhile?
Andrea
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug rtl-optimization/97092] [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c
2020-09-17 16:51 [Bug rtl-optimization/97092] New: [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c acoplan at gcc dot gnu.org
2020-09-18 6:10 ` [Bug rtl-optimization/97092] " rguenth at gcc dot gnu.org
2020-12-08 16:12 ` akrl at gcc dot gnu.org
@ 2020-12-08 16:26 ` andrea.corallo at arm dot com
2020-12-09 9:57 ` Andrea Corallo
2020-12-09 9:58 ` andrea.corallo at arm dot com
` (9 subsequent siblings)
12 siblings, 1 reply; 19+ messages in thread
From: andrea.corallo at arm dot com @ 2020-12-08 16:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
--- Comment #2 from Andrea Corallo <andrea.corallo at arm dot com> ---
"akrl at gcc dot gnu.org via Gcc-bugs" <gcc-bugs@gcc.gnu.org> writes:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
>
> --- Comment #1 from akrl at gcc dot gnu.org ---
> Hi all,
>
> I can't reproduce this on current master (76a1719f0ff), I guess has been
> fixed in the meanwhile?
As not said I swapped two reproducers. I *can* reproduce the issue on
current master.
Andrea
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Bug rtl-optimization/97092] [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c
2020-12-08 16:26 ` andrea.corallo at arm dot com
@ 2020-12-09 9:57 ` Andrea Corallo
0 siblings, 0 replies; 19+ messages in thread
From: Andrea Corallo @ 2020-12-09 9:57 UTC (permalink / raw)
To: andrea.corallo at arm dot com via Gcc-bugs
Cc: andrea.corallo at arm dot com, nd, Richard.Sandiford
[-- Attachment #1: Type: text/plain, Size: 559 bytes --]
What is going on is that in 'update_costs_from_allocno' we try to
identify the smallest mode using narrower_subreg_mode to then update the
costs.
The two modes involved here are E_DImode and E_VNx2QImode, cause these
are not ordered we ICE in 'paradoxical_subreg_p'.
Now I don't know if the strategy we want is:
- In 'update_costs_from_allocno' when modes are not ordered instead of
calling 'narrower_subreg_mode' just keep the current one.
- Always select the cheapest mode in terms of cost.
The attached I'm testing implements the second.
Andrea
[-- Attachment #2: PR97092.patch --]
[-- Type: text/plain, Size: 2347 bytes --]
>From 03da7bb5c7ad8ab6c25631de5ee1f7b70ea46229 Mon Sep 17 00:00:00 2001
From: Andrea Corallo <andrea.corallo@arm.com>
Date: Tue, 8 Dec 2020 23:17:26 +0100
Subject: [PATCH] Fix ICE in ira-color
2020-12-08 Andrea Corallo <andrea.corallo@arm.com>
* ira-color.c (update_costs_from_allocno): Pick the cheapest mode
instead of the smaller one.
---
gcc/ira-color.c | 34 ++++++++++++++++++++++------------
1 file changed, 22 insertions(+), 12 deletions(-)
diff --git a/gcc/ira-color.c b/gcc/ira-color.c
index d3f8e23faff..13a3548018a 100644
--- a/gcc/ira-color.c
+++ b/gcc/ira-color.c
@@ -1400,19 +1400,29 @@ update_costs_from_allocno (ira_allocno_t allocno, int hard_regno,
|| ALLOCNO_ASSIGNED_P (another_allocno))
continue;
- /* If we have different modes use the smallest one. It is
- a sub-register move. It is hard to predict what LRA
- will reload (the pseudo or its sub-register) but LRA
- will try to minimize the data movement. Also for some
- register classes bigger modes might be invalid,
- e.g. DImode for AREG on x86. For such cases the
- register move cost will be maximal. */
- mode = narrower_subreg_mode (mode, ALLOCNO_MODE (cp->second));
+ /* If we have different modes use the cheapest one. It is a
+ sub-register move. It is hard to predict what LRA will
+ reload (the pseudo or its sub-register) but LRA will try
+ to minimize the data movement. Also for some register
+ classes bigger modes might be invalid, e.g. DImode for
+ AREG on x86. For such cases the register move cost will
+ be maximal. */
+ machine_mode mode2 = ALLOCNO_MODE (cp->second);
ira_init_register_move_cost_if_necessary (mode);
-
- cost = (cp->second == allocno
- ? ira_register_move_cost[mode][rclass][aclass]
- : ira_register_move_cost[mode][aclass][rclass]);
+ ira_init_register_move_cost_if_necessary (mode2);
+ int cost1, cost2;
+ if (cp->second == allocno)
+ {
+ cost1 = ira_register_move_cost[mode][rclass][aclass];
+ cost2 = ira_register_move_cost[mode2][rclass][aclass];
+ }
+ else
+ {
+ cost1 = ira_register_move_cost[mode][aclass][rclass];
+ cost2 = ira_register_move_cost[mode2][aclass][rclass];
+ }
+ cost = MIN (cost1, cost2);
+
if (decr_p)
cost = -cost;
--
2.20.1
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug rtl-optimization/97092] [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c
2020-09-17 16:51 [Bug rtl-optimization/97092] New: [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c acoplan at gcc dot gnu.org
` (2 preceding siblings ...)
2020-12-08 16:26 ` andrea.corallo at arm dot com
@ 2020-12-09 9:58 ` andrea.corallo at arm dot com
2020-12-09 14:23 ` rsandifo at gcc dot gnu.org
` (8 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: andrea.corallo at arm dot com @ 2020-12-09 9:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
--- Comment #3 from Andrea Corallo <andrea.corallo at arm dot com> ---
What is going on is that in 'update_costs_from_allocno' we try to
identify the smallest mode using narrower_subreg_mode to then update the
costs.
The two modes involved here are E_DImode and E_VNx2QImode, cause these
are not ordered we ICE in 'paradoxical_subreg_p'.
Now I don't know if the strategy we want is:
- In 'update_costs_from_allocno' when modes are not ordered instead of
calling 'narrower_subreg_mode' just keep the current one.
- Always select the cheapest mode in terms of cost.
The attached I'm testing implements the second.
Andrea
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug rtl-optimization/97092] [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c
2020-09-17 16:51 [Bug rtl-optimization/97092] New: [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c acoplan at gcc dot gnu.org
` (3 preceding siblings ...)
2020-12-09 9:58 ` andrea.corallo at arm dot com
@ 2020-12-09 14:23 ` rsandifo at gcc dot gnu.org
2020-12-09 16:38 ` Andrea Corallo
2020-12-09 16:39 ` andrea.corallo at arm dot com
` (7 subsequent siblings)
12 siblings, 1 reply; 19+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2020-12-09 14:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
--- Comment #4 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
(In reply to Andrea Corallo from comment #3)
> Created attachment 49710 [details]
> PR97092.patch
>
> What is going on is that in 'update_costs_from_allocno' we try to
> identify the smallest mode using narrower_subreg_mode to then update the
> costs.
>
> The two modes involved here are E_DImode and E_VNx2QImode, cause these
> are not ordered we ICE in 'paradoxical_subreg_p'.
>
> Now I don't know if the strategy we want is:
>
> - In 'update_costs_from_allocno' when modes are not ordered instead of
> calling 'narrower_subreg_mode' just keep the current one.
>
> - Always select the cheapest mode in terms of cost.
>
> The attached I'm testing implements the second.
I think instead we should consider recomputing “mode” in each
iteration of the loop, rather than carry over the result of
previous iterations. I.e. use:
mode = narrower_subreg_mode (ALLOCNO_MODE (cp->first),
ALLOCNO_MODE (cp->second));
instead of:
mode = narrower_subreg_mode (mode, ALLOCNO_MODE (cp->second));
Before g:e2323a2b77c91d1ba8194b01e6deaa2e00f15990 “mode”
was a loop invariant, so it made sense to set it outside
the loop. I think the intention of that patch was to use
the smaller of the two modes involved in the copy, and carrying
the result over to future copies might have been unintentional.
The difficulty with carrying the mode over to later copies
is that the costs then become dependent on the order of
the copies, whereas I'm not sure the order of the copies
is significant.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Bug rtl-optimization/97092] [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c
2020-12-09 14:23 ` rsandifo at gcc dot gnu.org
@ 2020-12-09 16:38 ` Andrea Corallo
0 siblings, 0 replies; 19+ messages in thread
From: Andrea Corallo @ 2020-12-09 16:38 UTC (permalink / raw)
To: rsandifo at gcc dot gnu.org via Gcc-bugs; +Cc: rsandifo at gcc dot gnu.org
"rsandifo at gcc dot gnu.org via Gcc-bugs" <gcc-bugs@gcc.gnu.org>
writes:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
>
> --- Comment #4 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
> (In reply to Andrea Corallo from comment #3)
>> Created attachment 49710 [details]
>> PR97092.patch
>>
>> What is going on is that in 'update_costs_from_allocno' we try to
>> identify the smallest mode using narrower_subreg_mode to then update the
>> costs.
>>
>> The two modes involved here are E_DImode and E_VNx2QImode, cause these
>> are not ordered we ICE in 'paradoxical_subreg_p'.
>>
>> Now I don't know if the strategy we want is:
>>
>> - In 'update_costs_from_allocno' when modes are not ordered instead of
>> calling 'narrower_subreg_mode' just keep the current one.
>>
>> - Always select the cheapest mode in terms of cost.
>>
>> The attached I'm testing implements the second.
Hi Richard,
thanks for commenting.
> I think instead we should consider recomputing “mode” in each
> iteration of the loop, rather than carry over the result of
> previous iterations. I.e. use:
>
> mode = narrower_subreg_mode (ALLOCNO_MODE (cp->first),
> ALLOCNO_MODE (cp->second));
Are we garanteed to have ALLOCNO_MODE (cp->first) and ALLOCNO_MODE
(cp->second) always satisfying 'ordered_p'? In case not I think we
can't use 'narrower_subreg_mode'.
I thought we select the smallest because is the cheapest, so not to use
'narrower_subreg_mode' I compared directly the costs.
> instead of:
>
> mode = narrower_subreg_mode (mode, ALLOCNO_MODE (cp->second));
>
> Before g:e2323a2b77c91d1ba8194b01e6deaa2e00f15990 “mode”
> was a loop invariant, so it made sense to set it outside
> the loop. I think the intention of that patch was to use
> the smaller of the two modes involved in the copy, and carrying
> the result over to future copies might have been unintentional.
>
> The difficulty with carrying the mode over to later copies
> is that the costs then become dependent on the order of
> the copies, whereas I'm not sure the order of the copies
> is significant.
I see
Thanks!
Andrea
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug rtl-optimization/97092] [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c
2020-09-17 16:51 [Bug rtl-optimization/97092] New: [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c acoplan at gcc dot gnu.org
` (4 preceding siblings ...)
2020-12-09 14:23 ` rsandifo at gcc dot gnu.org
@ 2020-12-09 16:39 ` andrea.corallo at arm dot com
2020-12-09 16:51 ` rsandifo at gcc dot gnu.org
` (6 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: andrea.corallo at arm dot com @ 2020-12-09 16:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
--- Comment #5 from Andrea Corallo <andrea.corallo at arm dot com> ---
"rsandifo at gcc dot gnu.org via Gcc-bugs" <gcc-bugs@gcc.gnu.org>
writes:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
>
> --- Comment #4 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
> (In reply to Andrea Corallo from comment #3)
>> Created attachment 49710 [details]
>> PR97092.patch
>>
>> What is going on is that in 'update_costs_from_allocno' we try to
>> identify the smallest mode using narrower_subreg_mode to then update the
>> costs.
>>
>> The two modes involved here are E_DImode and E_VNx2QImode, cause these
>> are not ordered we ICE in 'paradoxical_subreg_p'.
>>
>> Now I don't know if the strategy we want is:
>>
>> - In 'update_costs_from_allocno' when modes are not ordered instead of
>> calling 'narrower_subreg_mode' just keep the current one.
>>
>> - Always select the cheapest mode in terms of cost.
>>
>> The attached I'm testing implements the second.
Hi Richard,
thanks for commenting.
> I think instead we should consider recomputing “mode” in each
> iteration of the loop, rather than carry over the result of
> previous iterations. I.e. use:
>
> mode = narrower_subreg_mode (ALLOCNO_MODE (cp->first),
> ALLOCNO_MODE (cp->second));
Are we garanteed to have ALLOCNO_MODE (cp->first) and ALLOCNO_MODE
(cp->second) always satisfying 'ordered_p'? In case not I think we
can't use 'narrower_subreg_mode'.
I thought we select the smallest because is the cheapest, so not to use
'narrower_subreg_mode' I compared directly the costs.
> instead of:
>
> mode = narrower_subreg_mode (mode, ALLOCNO_MODE (cp->second));
>
> Before g:e2323a2b77c91d1ba8194b01e6deaa2e00f15990 “mode”
> was a loop invariant, so it made sense to set it outside
> the loop. I think the intention of that patch was to use
> the smaller of the two modes involved in the copy, and carrying
> the result over to future copies might have been unintentional.
>
> The difficulty with carrying the mode over to later copies
> is that the costs then become dependent on the order of
> the copies, whereas I'm not sure the order of the copies
> is significant.
I see
Thanks!
Andrea
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug rtl-optimization/97092] [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c
2020-09-17 16:51 [Bug rtl-optimization/97092] New: [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c acoplan at gcc dot gnu.org
` (5 preceding siblings ...)
2020-12-09 16:39 ` andrea.corallo at arm dot com
@ 2020-12-09 16:51 ` rsandifo at gcc dot gnu.org
2020-12-09 17:06 ` Andrea Corallo
2020-12-09 17:07 ` andrea.corallo at arm dot com
` (5 subsequent siblings)
12 siblings, 1 reply; 19+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2020-12-09 16:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
--- Comment #6 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
(In reply to Andrea Corallo from comment #5)
> "rsandifo at gcc dot gnu.org via Gcc-bugs" <gcc-bugs@gcc.gnu.org>
> writes:
>
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
> >
> > --- Comment #4 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
> > (In reply to Andrea Corallo from comment #3)
> >> Created attachment 49710 [details]
> >> PR97092.patch
> >>
> >> What is going on is that in 'update_costs_from_allocno' we try to
> >> identify the smallest mode using narrower_subreg_mode to then update the
> >> costs.
> >>
> >> The two modes involved here are E_DImode and E_VNx2QImode, cause these
> >> are not ordered we ICE in 'paradoxical_subreg_p'.
> >>
> >> Now I don't know if the strategy we want is:
> >>
> >> - In 'update_costs_from_allocno' when modes are not ordered instead of
> >> calling 'narrower_subreg_mode' just keep the current one.
> >>
> >> - Always select the cheapest mode in terms of cost.
> >>
> >> The attached I'm testing implements the second.
>
> Hi Richard,
>
> thanks for commenting.
>
> > I think instead we should consider recomputing “mode” in each
> > iteration of the loop, rather than carry over the result of
> > previous iterations. I.e. use:
> >
> > mode = narrower_subreg_mode (ALLOCNO_MODE (cp->first),
> > ALLOCNO_MODE (cp->second));
>
> Are we garanteed to have ALLOCNO_MODE (cp->first) and ALLOCNO_MODE
> (cp->second) always satisfying 'ordered_p'?
Yeah, I think so. If the modes aren't ordered then we shouldn't
create a copy between them.
> I thought we select the smallest because is the cheapest, so not to use
'narrower_subreg_mode' I compared directly the costs.
I think the difficulty is that for the x86 situation described in
the comment, the cost for the wider mode might not be meaningful.
It might be dangerous to rely on it having a larger value than
the narrower (meaningful) mode.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Bug rtl-optimization/97092] [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c
2020-12-09 16:51 ` rsandifo at gcc dot gnu.org
@ 2020-12-09 17:06 ` Andrea Corallo
0 siblings, 0 replies; 19+ messages in thread
From: Andrea Corallo @ 2020-12-09 17:06 UTC (permalink / raw)
To: rsandifo at gcc dot gnu.org via Gcc-bugs; +Cc: rsandifo at gcc dot gnu.org
"rsandifo at gcc dot gnu.org via Gcc-bugs" <gcc-bugs@gcc.gnu.org>
writes:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
>
> --- Comment #6 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
> (In reply to Andrea Corallo from comment #5)
>> "rsandifo at gcc dot gnu.org via Gcc-bugs" <gcc-bugs@gcc.gnu.org>
>> writes:
>>
>> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
>> >
>> > --- Comment #4 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
>> > (In reply to Andrea Corallo from comment #3)
>> >> Created attachment 49710 [details]
>> >> PR97092.patch
>> >>
>> >> What is going on is that in 'update_costs_from_allocno' we try to
>> >> identify the smallest mode using narrower_subreg_mode to then update the
>> >> costs.
>> >>
>> >> The two modes involved here are E_DImode and E_VNx2QImode, cause these
>> >> are not ordered we ICE in 'paradoxical_subreg_p'.
>> >>
>> >> Now I don't know if the strategy we want is:
>> >>
>> >> - In 'update_costs_from_allocno' when modes are not ordered instead of
>> >> calling 'narrower_subreg_mode' just keep the current one.
>> >>
>> >> - Always select the cheapest mode in terms of cost.
>> >>
>> >> The attached I'm testing implements the second.
>>
>> Hi Richard,
>>
>> thanks for commenting.
>>
>> > I think instead we should consider recomputing “mode” in each
>> > iteration of the loop, rather than carry over the result of
>> > previous iterations. I.e. use:
>> >
>> > mode = narrower_subreg_mode (ALLOCNO_MODE (cp->first),
>> > ALLOCNO_MODE (cp->second));
>>
>> Are we garanteed to have ALLOCNO_MODE (cp->first) and ALLOCNO_MODE
>> (cp->second) always satisfying 'ordered_p'?
> Yeah, I think so. If the modes aren't ordered then we shouldn't
> create a copy between them.
Great, I'm going to test the suggested then.
Thanks
Andrea
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug rtl-optimization/97092] [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c
2020-09-17 16:51 [Bug rtl-optimization/97092] New: [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c acoplan at gcc dot gnu.org
` (6 preceding siblings ...)
2020-12-09 16:51 ` rsandifo at gcc dot gnu.org
@ 2020-12-09 17:07 ` andrea.corallo at arm dot com
2020-12-11 9:37 ` cvs-commit at gcc dot gnu.org
` (4 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: andrea.corallo at arm dot com @ 2020-12-09 17:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
--- Comment #7 from Andrea Corallo <andrea.corallo at arm dot com> ---
"rsandifo at gcc dot gnu.org via Gcc-bugs" <gcc-bugs@gcc.gnu.org>
writes:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
>
> --- Comment #6 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
> (In reply to Andrea Corallo from comment #5)
>> "rsandifo at gcc dot gnu.org via Gcc-bugs" <gcc-bugs@gcc.gnu.org>
>> writes:
>>
>> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
>> >
>> > --- Comment #4 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
>> > (In reply to Andrea Corallo from comment #3)
>> >> Created attachment 49710 [details]
>> >> PR97092.patch
>> >>
>> >> What is going on is that in 'update_costs_from_allocno' we try to
>> >> identify the smallest mode using narrower_subreg_mode to then update the
>> >> costs.
>> >>
>> >> The two modes involved here are E_DImode and E_VNx2QImode, cause these
>> >> are not ordered we ICE in 'paradoxical_subreg_p'.
>> >>
>> >> Now I don't know if the strategy we want is:
>> >>
>> >> - In 'update_costs_from_allocno' when modes are not ordered instead of
>> >> calling 'narrower_subreg_mode' just keep the current one.
>> >>
>> >> - Always select the cheapest mode in terms of cost.
>> >>
>> >> The attached I'm testing implements the second.
>>
>> Hi Richard,
>>
>> thanks for commenting.
>>
>> > I think instead we should consider recomputing “mode” in each
>> > iteration of the loop, rather than carry over the result of
>> > previous iterations. I.e. use:
>> >
>> > mode = narrower_subreg_mode (ALLOCNO_MODE (cp->first),
>> > ALLOCNO_MODE (cp->second));
>>
>> Are we garanteed to have ALLOCNO_MODE (cp->first) and ALLOCNO_MODE
>> (cp->second) always satisfying 'ordered_p'?
> Yeah, I think so. If the modes aren't ordered then we shouldn't
> create a copy between them.
Great, I'm going to test the suggested then.
Thanks
Andrea
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug rtl-optimization/97092] [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c
2020-09-17 16:51 [Bug rtl-optimization/97092] New: [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c acoplan at gcc dot gnu.org
` (7 preceding siblings ...)
2020-12-09 17:07 ` andrea.corallo at arm dot com
@ 2020-12-11 9:37 ` cvs-commit at gcc dot gnu.org
2020-12-11 16:29 ` acoplan at gcc dot gnu.org
` (3 subsequent siblings)
12 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-11 9:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andrea Corallo <akrl@gcc.gnu.org>:
https://gcc.gnu.org/g:499651e43854ea65303eb55324263c25256c9735
commit r11-5926-g499651e43854ea65303eb55324263c25256c9735
Author: Andrea Corallo <andrea.corallo@arm.com>
Date: Wed Dec 9 17:59:12 2020 +0100
ira.c: Fix ICE in ira-color [PR97092]
gcc/ChangeLog
2020-12-10 Andrea Corallo <andrea.corallo@arm.com>
PR rtl-optimization/97092
* ira-color.c (update_costs_from_allocno): Do not carry over mode
between subsequent iterations.
gcc/testsuite/ChangeLog
2020-12-10 Andrea Corallo <andrea.corallo@arm.com>
* gcc.target/aarch64/sve/pr97092.c: New test.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug rtl-optimization/97092] [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c
2020-09-17 16:51 [Bug rtl-optimization/97092] New: [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c acoplan at gcc dot gnu.org
` (8 preceding siblings ...)
2020-12-11 9:37 ` cvs-commit at gcc dot gnu.org
@ 2020-12-11 16:29 ` acoplan at gcc dot gnu.org
2020-12-11 16:56 ` Andrea Corallo
2020-12-11 16:56 ` andrea.corallo at arm dot com
` (2 subsequent siblings)
12 siblings, 1 reply; 19+ messages in thread
From: acoplan at gcc dot gnu.org @ 2020-12-11 16:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
--- Comment #9 from Alex Coplan <acoplan at gcc dot gnu.org> ---
Thanks for fixing this Andrea! FWIW I can reproduce the ICE with the same
testcase and options on the head of the GCC 10 branch (contrary to my first
message).
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [Bug rtl-optimization/97092] [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c
2020-12-11 16:29 ` acoplan at gcc dot gnu.org
@ 2020-12-11 16:56 ` Andrea Corallo
0 siblings, 0 replies; 19+ messages in thread
From: Andrea Corallo @ 2020-12-11 16:56 UTC (permalink / raw)
To: acoplan at gcc dot gnu.org via Gcc-bugs; +Cc: acoplan at gcc dot gnu.org
"acoplan at gcc dot gnu.org via Gcc-bugs" <gcc-bugs@gcc.gnu.org> writes:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
>
> --- Comment #9 from Alex Coplan <acoplan at gcc dot gnu.org> ---
> Thanks for fixing this Andrea! FWIW I can reproduce the ICE with the same
> testcase and options on the head of the GCC 10 branch (contrary to my first
> message).
Hi Alex,
I'll test the patch also on gcc-10 then so we can have it there too (it
should apply).
Thanks for checking!
Andrea
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug rtl-optimization/97092] [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c
2020-09-17 16:51 [Bug rtl-optimization/97092] New: [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c acoplan at gcc dot gnu.org
` (9 preceding siblings ...)
2020-12-11 16:29 ` acoplan at gcc dot gnu.org
@ 2020-12-11 16:56 ` andrea.corallo at arm dot com
2020-12-15 10:03 ` cvs-commit at gcc dot gnu.org
2021-01-12 10:04 ` acoplan at gcc dot gnu.org
12 siblings, 0 replies; 19+ messages in thread
From: andrea.corallo at arm dot com @ 2020-12-11 16:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
--- Comment #10 from Andrea Corallo <andrea.corallo at arm dot com> ---
"acoplan at gcc dot gnu.org via Gcc-bugs" <gcc-bugs@gcc.gnu.org> writes:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
>
> --- Comment #9 from Alex Coplan <acoplan at gcc dot gnu.org> ---
> Thanks for fixing this Andrea! FWIW I can reproduce the ICE with the same
> testcase and options on the head of the GCC 10 branch (contrary to my first
> message).
Hi Alex,
I'll test the patch also on gcc-10 then so we can have it there too (it
should apply).
Thanks for checking!
Andrea
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug rtl-optimization/97092] [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c
2020-09-17 16:51 [Bug rtl-optimization/97092] New: [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c acoplan at gcc dot gnu.org
` (10 preceding siblings ...)
2020-12-11 16:56 ` andrea.corallo at arm dot com
@ 2020-12-15 10:03 ` cvs-commit at gcc dot gnu.org
2021-01-12 10:04 ` acoplan at gcc dot gnu.org
12 siblings, 0 replies; 19+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-12-15 10:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Andrea Corallo
<akrl@gcc.gnu.org>:
https://gcc.gnu.org/g:41a2a54476cba88376c4b30ca8b94b4a088a66ce
commit r10-9153-g41a2a54476cba88376c4b30ca8b94b4a088a66ce
Author: Andrea Corallo <andrea.corallo@arm.com>
Date: Wed Dec 9 17:59:12 2020 +0100
ira.c: Fix ICE in ira-color [PR97092]
2020-12-10 Andrea Corallo <andrea.corallo@arm.com>
gcc/ChangeLog
2020-12-10 Andrea Corallo <andrea.corallo@arm.com>
PR rtl-optimization/97092
* ira-color.c (update_costs_from_allocno): Do not carry over mode
between subsequent iterations.
gcc/testsuite/ChangeLog
2020-12-10 Andrea Corallo <andrea.corallo@arm.com>
* gcc.target/aarch64/sve/pr97092.c: New test.
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Bug rtl-optimization/97092] [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c
2020-09-17 16:51 [Bug rtl-optimization/97092] New: [10/11 Regression] aarch64, SVE: ICE in ira-color.c since r10-4752-g2d56600c acoplan at gcc dot gnu.org
` (11 preceding siblings ...)
2020-12-15 10:03 ` cvs-commit at gcc dot gnu.org
@ 2021-01-12 10:04 ` acoplan at gcc dot gnu.org
12 siblings, 0 replies; 19+ messages in thread
From: acoplan at gcc dot gnu.org @ 2021-01-12 10:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97092
Alex Coplan <acoplan at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|UNCONFIRMED |RESOLVED
--- Comment #12 from Alex Coplan <acoplan at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 19+ messages in thread