Bug 82446 - [11/12/13/14 Regression] Missed equalities in dr_group_sort_cmp
Summary: [11/12/13/14 Regression] Missed equalities in dr_group_sort_cmp
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 8.0
: P2 normal
Target Milestone: 11.5
Assignee: Not yet assigned to anyone
URL:
Keywords: missed-optimization
Depends on:
Blocks: 82397
  Show dependency treegraph
 
Reported: 2017-10-06 09:40 UTC by Richard Biener
Modified: 2023-08-04 08:09 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
failed patch attempt (1.78 KB, patch)
2017-10-06 09:48 UTC, Richard Biener
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2017-10-06 09:40:36 UTC
The fix for PR82397 causes a few missed equalities and thus different vectorizer group access detections because operand_equal_p was handling commutated operands
and data_ref_compare_tree does not.
Comment 1 Richard Biener 2017-10-06 09:48:29 UTC
Created attachment 42311 [details]
failed patch attempt

I tried to address this in split_constant_offset, better canonicalizing trees there.  While it handles the case in the original PR it regresses some others,
for example gcc.dg/vect/pr69783.c because it canonicalizes before folding,
possibly messing up canonicalization that happened to be ok before.

So the solution is probably to add a canonicalize_tree function that does just
this (without folding, just swapping operands in-place -- requiring tree
unsharing before if it is possibly shared).

Ideally we'd have a expr hash on each tree_exp that swap_tree_operands ()
could use so we'd properly canonicalize already during folding (conveniently
tree_exp _does_ have 4 bytes of unused padding...).  buildN could compute
this for us as well.

Anyway, a separate function looks more feasible at the moment, we can call that
from dr_innermost analysis (there's already some kind of weird canonicalization
function).
Comment 2 Jakub Jelinek 2018-05-02 10:05:59 UTC
GCC 8.1 has been released.
Comment 3 Jakub Jelinek 2018-07-26 11:19:49 UTC
GCC 8.2 has been released.
Comment 4 Jakub Jelinek 2019-02-22 15:21:43 UTC
GCC 8.3 has been released.
Comment 5 Jakub Jelinek 2020-03-04 09:42:22 UTC
GCC 8.4.0 has been released, adjusting target milestone.
Comment 6 Jakub Jelinek 2021-05-14 09:49:17 UTC
GCC 8 branch is being closed.
Comment 7 Richard Biener 2021-06-01 08:09:24 UTC
GCC 9.4 is being released, retargeting bugs to GCC 9.5.
Comment 8 Richard Biener 2022-05-27 09:37:37 UTC
GCC 9 branch is being closed
Comment 9 Jakub Jelinek 2022-06-28 10:33:44 UTC
GCC 10.4 is being released, retargeting bugs to GCC 10.5.
Comment 10 Richard Biener 2023-07-07 10:32:34 UTC
GCC 10 branch is being closed.
Comment 11 Andrew Pinski 2023-08-03 23:52:48 UTC
Is this still true?
Comment 12 Richard Biener 2023-08-04 08:09:24 UTC
I don't think anything changed here, but I don't see any actual testcase where we could verify things so let's close this bug.