public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/103361] New: ICE in adjust_unroll_factor, at gimple-loop-jam.c:407
@ 2021-11-22 17:02 vsevolod.livinskij at frtk dot ru
2021-11-22 17:10 ` [Bug tree-optimization/103361] [12 Regression] ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 since r12-3677-gf92901a508305f29 marxin at gcc dot gnu.org
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: vsevolod.livinskij at frtk dot ru @ 2021-11-22 17:02 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103361
Bug ID: 103361
Summary: ICE in adjust_unroll_factor, at gimple-loop-jam.c:407
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: vsevolod.livinskij at frtk dot ru
Target Milestone: ---
Link to the Compiler Explorer: https://godbolt.org/z/jbKEn7Tdq
Reproducer:
char a, b;
extern unsigned short c[];
extern bool d[];
const unsigned short &e(const unsigned short &f, const unsigned short &g) {
if (g < f)
return g;
return f;
}
void k() {
for (int h = 0; b; h += 3)
for (unsigned long i = 0; i < 11104842004558084287ULL;
i += -11104842004558084300ULL)
for (bool j(e(6, e(6, c[h + i]))); j < (bool)a; j = 7)
d[7] = 0;
}
Error:
>$ g++ -O3 -c func.cpp
during GIMPLE pass: unrolljam
func.cpp: In function 'void k()':
func.cpp:9:6: internal compiler error: in adjust_unroll_factor, at
gimple-loop-jam.c:407
9 | void k() {
| ^
0x93ebce adjust_unroll_factor
/testing/gcc/gcc_src_master/gcc/gimple-loop-jam.c:407
0x93ebce tree_loop_unroll_and_jam
/testing/gcc/gcc_src_master/gcc/gimple-loop-jam.c:551
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
gcc version 12.0.0 20211121 (8fef6f720a5a0a056abfa986ba870bb406ab4716) (GCC)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/103361] [12 Regression] ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 since r12-3677-gf92901a508305f29
2021-11-22 17:02 [Bug tree-optimization/103361] New: ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 vsevolod.livinskij at frtk dot ru
@ 2021-11-22 17:10 ` marxin at gcc dot gnu.org
2021-11-23 7:31 ` rguenth at gcc dot gnu.org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-22 17:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103361
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Target Milestone|--- |12.0
Summary|[12 Regression] ICE in |[12 Regression] ICE in
|adjust_unroll_factor, at |adjust_unroll_factor, at
|gimple-loop-jam.c:407 |gimple-loop-jam.c:407 since
| |r12-3677-gf92901a508305f29
Known to fail| |12.0
CC| |marxin at gcc dot gnu.org,
| |rguenth at gcc dot gnu.org
Last reconfirmed| |2021-11-22
Status|UNCONFIRMED |NEW
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Thanks for the report, started with r12-3677-gf92901a508305f29
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/103361] [12 Regression] ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 since r12-3677-gf92901a508305f29
2021-11-22 17:02 [Bug tree-optimization/103361] New: ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 vsevolod.livinskij at frtk dot ru
2021-11-22 17:10 ` [Bug tree-optimization/103361] [12 Regression] ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 since r12-3677-gf92901a508305f29 marxin at gcc dot gnu.org
@ 2021-11-23 7:31 ` rguenth at gcc dot gnu.org
2021-11-23 9:11 ` rguenth at gcc dot gnu.org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-11-23 7:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103361
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
I will have a look.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/103361] [12 Regression] ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 since r12-3677-gf92901a508305f29
2021-11-22 17:02 [Bug tree-optimization/103361] New: ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 vsevolod.livinskij at frtk dot ru
2021-11-22 17:10 ` [Bug tree-optimization/103361] [12 Regression] ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 since r12-3677-gf92901a508305f29 marxin at gcc dot gnu.org
2021-11-23 7:31 ` rguenth at gcc dot gnu.org
@ 2021-11-23 9:11 ` rguenth at gcc dot gnu.org
2021-11-23 9:15 ` [Bug tree-optimization/103361] [9/10/11/12 " rguenth at gcc dot gnu.org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-11-23 9:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103361
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
OK, so I think this is an overflow somewhere in data dependence compute ...
Creating dr for MEM <short unsigned int[<unknown>]> [(const short unsigned int
&)&c][_2]
analyze_innermost: success.
base_address: &c
offset from base address: (ssizetype) ((sizetype) h_10 * 2)
constant offset from base address: 0
step: -3762939935406616984(OVF)
base alignment: 2
base misalignment: 0
offset alignment: 2
step alignment: 8
base_object: MEM <short unsigned int[<unknown>]> [(const short unsigned
int &)&c]
Access function 0: {{0, +, 3}_1, +, 7341902069151467316}_2
...
(Data Dep:
#(Data Ref:
# bb: 4
# stmt: _25 = MEM <short unsigned int[<unknown>]> [(const short unsigned int
&)&c][_2];
# ref: MEM <short unsigned int[<unknown>]> [(const short unsigned int
&)&c][_2];
# base_object: MEM <short unsigned int[<unknown>]> [(const short unsigned int
&)&c];
# Access function 0: {{0, +, 3}_1, +, 7341902069151467316}_2
#)
#(Data Ref:
# bb: 5
# stmt: pretmp_28 = MEM[(const short unsigned int &)_3];
# ref: MEM[(const short unsigned int &)_3];
# base_object: MEM[(const short unsigned int &)&c];
# Access function 0: {{0B, +, 6}_1, +, 14683804138302934632}_2
#)
access_fn_A: {{0B, +, 6}_1, +, 14683804138302934632}_2
access_fn_B: {{0B, +, 6}_1, +, 14683804138302934632}_2
(subscript
iterations_that_access_an_element_twice_in_A: [0]
last_conflict: scev_not_known
iterations_that_access_an_element_twice_in_B: [0]
last_conflict: scev_not_known
(Subscript distance: 0 ))
loop nest: (1 2 )
distance_vector: 0 0
distance_vector: -1736083252 3
direction_vector: = =
direction_vector: - +
)
the accesses are equal so the distance vector should be 0 0 which it is
for the inner loop but not for the outer it seems(!?). We run into
if (same_access_functions (ddr))
{
/* Save the 0 vector. */
dist_v = lambda_vector_new (DDR_NB_LOOPS (ddr));
save_dist_v (ddr, dist_v);
if (invariant_access_functions (ddr, loop_nest->num))
add_distance_for_zero_overlaps (ddr);
if (DDR_NB_LOOPS (ddr) > 1)
add_other_self_distances (ddr);
return true;
where invariant_access_functions is false and we eventually run into
add_multivariate_self_dist.
Ah, so the issue is lambda vector dumping is broken (truncates to int) and
unroll-and-jam also fails to use lambda_int ...
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/103361] [9/10/11/12 Regression] ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 since r12-3677-gf92901a508305f29
2021-11-22 17:02 [Bug tree-optimization/103361] New: ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 vsevolod.livinskij at frtk dot ru
` (2 preceding siblings ...)
2021-11-23 9:11 ` rguenth at gcc dot gnu.org
@ 2021-11-23 9:15 ` rguenth at gcc dot gnu.org
2021-11-23 10:04 ` cvs-commit at gcc dot gnu.org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-11-23 9:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103361
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|12.0 |9.5
Summary|[12 Regression] ICE in |[9/10/11/12 Regression] ICE
|adjust_unroll_factor, at |in adjust_unroll_factor, at
|gimple-loop-jam.c:407 since |gimple-loop-jam.c:407 since
|r12-3677-gf92901a508305f29 |r12-3677-gf92901a508305f29
Priority|P3 |P2
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
The issue is latent since lambda_int became HOST_WIDE_INT which happened in GCC
9.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/103361] [9/10/11/12 Regression] ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 since r12-3677-gf92901a508305f29
2021-11-22 17:02 [Bug tree-optimization/103361] New: ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 vsevolod.livinskij at frtk dot ru
` (3 preceding siblings ...)
2021-11-23 9:15 ` [Bug tree-optimization/103361] [9/10/11/12 " rguenth at gcc dot gnu.org
@ 2021-11-23 10:04 ` cvs-commit at gcc dot gnu.org
2021-11-23 10:05 ` [Bug tree-optimization/103361] [9/10/11 " rguenth at gcc dot gnu.org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-23 10:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103361
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:6cd440670078af89d82cbb67e01a5ecec8eec238
commit r12-5468-g6cd440670078af89d82cbb67e01a5ecec8eec238
Author: Richard Biener <rguenther@suse.de>
Date: Tue Nov 23 10:11:41 2021 +0100
tree-optimization/103361 - fix unroll-and-jam direction vector handling
This properly uses lambda_int instead of truncating the direction
vector to int which leads to false unexpected negative values.
2021-11-23 Richard Biener <rguenther@suse.de>
PR tree-optimization/103361
* gimple-loop-jam.c (adjust_unroll_factor): Use lambda_int
for the dependence distance.
* tree-data-ref.c (print_lambda_vector): Properly print a
lambda_int.
* g++.dg/torture/pr103361.C: New testcase.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/103361] [9/10/11 Regression] ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 since r12-3677-gf92901a508305f29
2021-11-22 17:02 [Bug tree-optimization/103361] New: ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 vsevolod.livinskij at frtk dot ru
` (4 preceding siblings ...)
2021-11-23 10:04 ` cvs-commit at gcc dot gnu.org
@ 2021-11-23 10:05 ` rguenth at gcc dot gnu.org
2022-02-17 9:06 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-11-23 10:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103361
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[9/10/11/12 Regression] ICE |[9/10/11 Regression] ICE in
|in adjust_unroll_factor, at |adjust_unroll_factor, at
|gimple-loop-jam.c:407 since |gimple-loop-jam.c:407 since
|r12-3677-gf92901a508305f29 |r12-3677-gf92901a508305f29
Known to work| |12.0
Known to fail|12.0 |
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed on trunk sofar, queued for backporting.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/103361] [9/10/11 Regression] ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 since r12-3677-gf92901a508305f29
2021-11-22 17:02 [Bug tree-optimization/103361] New: ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 vsevolod.livinskij at frtk dot ru
` (5 preceding siblings ...)
2021-11-23 10:05 ` [Bug tree-optimization/103361] [9/10/11 " rguenth at gcc dot gnu.org
@ 2022-02-17 9:06 ` cvs-commit at gcc dot gnu.org
2022-04-21 12:52 ` [Bug tree-optimization/103361] [9/10 " cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-17 9:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103361
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:d2f4753d4ff0edf944281cc2e4d5b5b91a9f14c9
commit r11-9583-gd2f4753d4ff0edf944281cc2e4d5b5b91a9f14c9
Author: Richard Biener <rguenther@suse.de>
Date: Tue Nov 23 10:11:41 2021 +0100
tree-optimization/103361 - fix unroll-and-jam direction vector handling
This properly uses lambda_int instead of truncating the direction
vector to int which leads to false unexpected negative values.
2021-11-23 Richard Biener <rguenther@suse.de>
PR tree-optimization/103361
* gimple-loop-jam.c (adjust_unroll_factor): Use lambda_int
for the dependence distance.
* tree-data-ref.c (print_lambda_vector): Properly print a
lambda_int.
* g++.dg/torture/pr103361.C: New testcase.
(cherry picked from commit 6cd440670078af89d82cbb67e01a5ecec8eec238)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/103361] [9/10 Regression] ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 since r12-3677-gf92901a508305f29
2021-11-22 17:02 [Bug tree-optimization/103361] New: ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 vsevolod.livinskij at frtk dot ru
` (6 preceding siblings ...)
2022-02-17 9:06 ` cvs-commit at gcc dot gnu.org
@ 2022-04-21 12:52 ` cvs-commit at gcc dot gnu.org
2022-05-06 11:09 ` [Bug tree-optimization/103361] [9 " cvs-commit at gcc dot gnu.org
2022-05-06 11:09 ` rguenth at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-04-21 12:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103361
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:4ed8728e2646897c98826cf43be2e4682d04fc2c
commit r10-10548-g4ed8728e2646897c98826cf43be2e4682d04fc2c
Author: Richard Biener <rguenther@suse.de>
Date: Tue Nov 23 10:11:41 2021 +0100
tree-optimization/103361 - fix unroll-and-jam direction vector handling
This properly uses lambda_int instead of truncating the direction
vector to int which leads to false unexpected negative values.
2021-11-23 Richard Biener <rguenther@suse.de>
PR tree-optimization/103361
* gimple-loop-jam.c (adjust_unroll_factor): Use lambda_int
for the dependence distance.
* tree-data-ref.c (print_lambda_vector): Properly print a
lambda_int.
* g++.dg/torture/pr103361.C: New testcase.
(cherry picked from commit 6cd440670078af89d82cbb67e01a5ecec8eec238)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/103361] [9 Regression] ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 since r12-3677-gf92901a508305f29
2021-11-22 17:02 [Bug tree-optimization/103361] New: ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 vsevolod.livinskij at frtk dot ru
` (7 preceding siblings ...)
2022-04-21 12:52 ` [Bug tree-optimization/103361] [9/10 " cvs-commit at gcc dot gnu.org
@ 2022-05-06 11:09 ` cvs-commit at gcc dot gnu.org
2022-05-06 11:09 ` rguenth at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-06 11:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103361
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Richard Biener
<rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:d55db847de865ec3a4d7a89c30295924508e1833
commit r9-10042-gd55db847de865ec3a4d7a89c30295924508e1833
Author: Richard Biener <rguenther@suse.de>
Date: Tue Nov 23 10:11:41 2021 +0100
tree-optimization/103361 - fix unroll-and-jam direction vector handling
This properly uses lambda_int instead of truncating the direction
vector to int which leads to false unexpected negative values.
2021-11-23 Richard Biener <rguenther@suse.de>
PR tree-optimization/103361
* gimple-loop-jam.c (adjust_unroll_factor): Use lambda_int
for the dependence distance.
* tree-data-ref.c (print_lambda_vector): Properly print a
lambda_int.
* g++.dg/torture/pr103361.C: New testcase.
(cherry picked from commit 6cd440670078af89d82cbb67e01a5ecec8eec238)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug tree-optimization/103361] [9 Regression] ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 since r12-3677-gf92901a508305f29
2021-11-22 17:02 [Bug tree-optimization/103361] New: ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 vsevolod.livinskij at frtk dot ru
` (8 preceding siblings ...)
2022-05-06 11:09 ` [Bug tree-optimization/103361] [9 " cvs-commit at gcc dot gnu.org
@ 2022-05-06 11:09 ` rguenth at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-06 11:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103361
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Known to work| |9.4.1
Resolution|--- |FIXED
Known to fail| |9.4.0
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2022-05-06 11:09 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-22 17:02 [Bug tree-optimization/103361] New: ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 vsevolod.livinskij at frtk dot ru
2021-11-22 17:10 ` [Bug tree-optimization/103361] [12 Regression] ICE in adjust_unroll_factor, at gimple-loop-jam.c:407 since r12-3677-gf92901a508305f29 marxin at gcc dot gnu.org
2021-11-23 7:31 ` rguenth at gcc dot gnu.org
2021-11-23 9:11 ` rguenth at gcc dot gnu.org
2021-11-23 9:15 ` [Bug tree-optimization/103361] [9/10/11/12 " rguenth at gcc dot gnu.org
2021-11-23 10:04 ` cvs-commit at gcc dot gnu.org
2021-11-23 10:05 ` [Bug tree-optimization/103361] [9/10/11 " rguenth at gcc dot gnu.org
2022-02-17 9:06 ` cvs-commit at gcc dot gnu.org
2022-04-21 12:52 ` [Bug tree-optimization/103361] [9/10 " cvs-commit at gcc dot gnu.org
2022-05-06 11:09 ` [Bug tree-optimization/103361] [9 " cvs-commit at gcc dot gnu.org
2022-05-06 11:09 ` rguenth 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).