On 3/14/2021 9:16 PM, HAO CHEN GUI via Gcc-patches wrote:
Hi,
This patch fixes an ICE found by enabling const_anchor for rs6000.
The BLKmode constant rtx is sent to try_const_anchors which causes
assertion failure in try_const_anchors.
The attachment are the patch diff and change log file.
Bootstrapped and tested on powerpc64le with no regressions. Is
this okay for trunk? Any recommendations? Thanks a lot.
ChangeLog-2
* cse.c (cse_insn): Add a BLKmode check for const_anchor.
Just so I'm sure I understand what's going on here. This is something
you need for patch 1/2 which enables anchors on the PPC port. It's
related to PR33699, which is a regression. Patch #1 has been rejected
for stage4 and has bigger questions/issues/objections that need to be
addressed, right?
With that in mind, I think this should defer until patch #1 in this
series is basically acceptable to PPC maintainers.
I would ask that you refer to PR33699 in the patch so that we can more
easily see the linkage to the BZ.
Thanks,
Jeff
It sounds like
patch-2.diff
diff --git a/gcc/cse.c b/gcc/cse.c
index 37c6959abea..223fe8c714d 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -5026,7 +5026,8 @@ cse_insn (rtx_insn *insn)
if (targetm.const_anchor
&& !src_related
&& src_const
- && GET_CODE (src_const) == CONST_INT)
+ && GET_CODE (src_const) == CONST_INT
+ && mode != BLKmode)
{
src_related = try_const_anchors (src_const, mode);
src_related_is_const_anchor = src_related != NULL_RTX;