* [Bug target/106919] [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu
2022-09-12 23:32 [Bug target/106919] New: [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu doko at gcc dot gnu.org
@ 2022-09-13 6:49 ` rguenth at gcc dot gnu.org
2022-09-13 11:27 ` marxin at gcc dot gnu.org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-09-13 6:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106919
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |13.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/106919] [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu
2022-09-12 23:32 [Bug target/106919] New: [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu doko at gcc dot gnu.org
2022-09-13 6:49 ` [Bug target/106919] " rguenth at gcc dot gnu.org
@ 2022-09-13 11:27 ` marxin at gcc dot gnu.org
2022-09-22 9:47 ` doko at gcc dot gnu.org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-09-13 11:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106919
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2022-09-13
Ever confirmed|0 |1
Status|UNCONFIRMED |WAITING
CC| |marxin at gcc dot gnu.org
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Please attach a pre-processed source code.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/106919] [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu
2022-09-12 23:32 [Bug target/106919] New: [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu doko at gcc dot gnu.org
2022-09-13 6:49 ` [Bug target/106919] " rguenth at gcc dot gnu.org
2022-09-13 11:27 ` marxin at gcc dot gnu.org
@ 2022-09-22 9:47 ` doko at gcc dot gnu.org
2022-09-22 9:48 ` doko at gcc dot gnu.org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: doko at gcc dot gnu.org @ 2022-09-22 9:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106919
Matthias Klose <doko at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
--- Comment #2 from Matthias Klose <doko at gcc dot gnu.org> ---
$ cat libgcov-merge.i
int __gcov_merge_topn_n_counters;
long __gcov_merge_topn___trans_tmp_1;
void __gcov_merge_topn() {
for (unsigned i = 0; i < __gcov_merge_topn_n_counters / 3; i++) {
for (unsigned j ; __gcov_merge_topn___trans_tmp_1; )
;
}
}
doko@zelenka:~/gcc-snapshot-20220920$ cat libgcov-merge.i
int __gcov_merge_topn_n_counters;
long __gcov_merge_topn___trans_tmp_1;
void __gcov_merge_topn() {
for (unsigned i = 0; i < __gcov_merge_topn_n_counters / 3; i++)
for (; __gcov_merge_topn___trans_tmp_1;)
;
}
$ /home/doko/gcc-snapshot-20220920/build/gcc/xgcc
-B/home/doko/gcc-snapshot-20220920/build/gcc/ -c -march=z196 -m64 -mzarch -g
-O2 libgcov-merge.i libgcov-merge.i
during RTL pass: ce2
libgcov-merge.i: In function '__gcov_merge_topn':
libgcov-merge.i:7:1: internal compiler error: RTL check: expected code 'set' or
'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672
7 | }
| ^
0x22c196b rtl_check_failed_code2(rtx_def const*, rtx_code, rtx_code, char
const*, int, char const*)
../../src/gcc/rtl.cc:926
0x2af1f69 s390_rtx_costs
../../src/gcc/config/s390/s390.cc:3672
0x22e9ab9 rtx_cost(rtx_def*, machine_mode, rtx_code, int, bool)
../../src/gcc/rtlanal.cc:4601
0x22c3877 set_rtx_cost
../../src/gcc/rtl.h:2925
0x22f3eb5 seq_cost(rtx_insn const*, bool)
../../src/gcc/rtlanal.cc:5788
0x38ea2b5 default_noce_conversion_profitable_p(rtx_insn*, noce_if_info*)
../../src/gcc/ifcvt.cc:814
0x38f145f noce_try_cmove
../../src/gcc/ifcvt.cc:1864
0x38fc6d9 noce_process_if_block
../../src/gcc/ifcvt.cc:3964
0x38fe8b5 noce_find_if_block
../../src/gcc/ifcvt.cc:4521
0x38ff33b find_if_header
../../src/gcc/ifcvt.cc:4726
0x3903475 if_convert
../../src/gcc/ifcvt.cc:5873
0x390394d execute
../../src/gcc/ifcvt.cc:6026
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/106919] [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu
2022-09-12 23:32 [Bug target/106919] New: [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu doko at gcc dot gnu.org
` (2 preceding siblings ...)
2022-09-22 9:47 ` doko at gcc dot gnu.org
@ 2022-09-22 9:48 ` doko at gcc dot gnu.org
2022-09-22 9:50 ` doko at gcc dot gnu.org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: doko at gcc dot gnu.org @ 2022-09-22 9:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106919
--- Comment #3 from Matthias Klose <doko at gcc dot gnu.org> ---
rechecked with 20220920
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/106919] [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu
2022-09-12 23:32 [Bug target/106919] New: [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu doko at gcc dot gnu.org
` (3 preceding siblings ...)
2022-09-22 9:48 ` doko at gcc dot gnu.org
@ 2022-09-22 9:50 ` doko at gcc dot gnu.org
2022-09-22 19:35 ` marxin at gcc dot gnu.org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: doko at gcc dot gnu.org @ 2022-09-22 9:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106919
--- Comment #4 from Matthias Klose <doko at gcc dot gnu.org> ---
Created attachment 53611
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53611&action=edit
preprocessed source
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/106919] [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu
2022-09-12 23:32 [Bug target/106919] New: [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu doko at gcc dot gnu.org
` (4 preceding siblings ...)
2022-09-22 9:50 ` doko at gcc dot gnu.org
@ 2022-09-22 19:35 ` marxin at gcc dot gnu.org
2022-09-22 20:07 ` [Bug target/106919] [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu since r13-2251-g1930c5d05ceff2 marxin at gcc dot gnu.org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-09-22 19:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106919
--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, bisecting right now.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/106919] [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu since r13-2251-g1930c5d05ceff2
2022-09-12 23:32 [Bug target/106919] New: [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu doko at gcc dot gnu.org
` (5 preceding siblings ...)
2022-09-22 19:35 ` marxin at gcc dot gnu.org
@ 2022-09-22 20:07 ` marxin at gcc dot gnu.org
2022-09-22 20:12 ` marxin at gcc dot gnu.org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-09-22 20:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106919
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[13 Regression] RTL check: |[13 Regression] RTL check:
|expected code 'set' or |expected code 'set' or
|'clobber', have |'clobber', have
|'if_then_else' in |'if_then_else' in
|s390_rtx_costs, at |s390_rtx_costs, at
|config/s390/s390.cc:3672on |config/s390/s390.cc:3672on
|s390x-linux-gnu |s390x-linux-gnu since
| |r13-2251-g1930c5d05ceff2
CC| |rdapp at gcc dot gnu.org
--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r13-2251-g1930c5d05ceff2.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/106919] [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu since r13-2251-g1930c5d05ceff2
2022-09-12 23:32 [Bug target/106919] New: [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu doko at gcc dot gnu.org
` (6 preceding siblings ...)
2022-09-22 20:07 ` [Bug target/106919] [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu since r13-2251-g1930c5d05ceff2 marxin at gcc dot gnu.org
@ 2022-09-22 20:12 ` marxin at gcc dot gnu.org
2022-09-23 8:44 ` rdapp at gcc dot gnu.org
2022-09-26 10:09 ` marxin at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-09-22 20:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106919
--- Comment #7 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed with:
diff --git a/gcc/config/s390/s390.cc b/gcc/config/s390/s390.cc
index 076c97a8b22..869847ab3d7 100644
--- a/gcc/config/s390/s390.cc
+++ b/gcc/config/s390/s390.cc
@@ -3669,7 +3669,7 @@ s390_rtx_costs (rtx x, machine_mode mode, int outer_code,
slightly more expensive than a normal load. */
*total = COSTS_N_INSNS (1) + 2;
- rtx dst = SET_DEST (src);
+ rtx dst = dest;
rtx then = XEXP (src, 1);
rtx els = XEXP (src, 2);
But I think the declaration of 'dest' should be removed:
diff --git a/gcc/config/s390/s390.cc b/gcc/config/s390/s390.cc
index 076c97a8b22..fa571c0190a 100644
--- a/gcc/config/s390/s390.cc
+++ b/gcc/config/s390/s390.cc
@@ -3648,7 +3648,7 @@ s390_rtx_costs (rtx x, machine_mode mode, int outer_code,
*total = 0;
return true;
case SET: {
- rtx dest = SET_DEST (x);
+ rtx dst = SET_DEST (x);
rtx src = SET_SRC (x);
switch (GET_CODE (src))
@@ -3669,7 +3669,6 @@ s390_rtx_costs (rtx x, machine_mode mode, int outer_code,
slightly more expensive than a normal load. */
*total = COSTS_N_INSNS (1) + 2;
- rtx dst = SET_DEST (src);
rtx then = XEXP (src, 1);
rtx els = XEXP (src, 2);
@@ -3696,25 +3695,25 @@ s390_rtx_costs (rtx x, machine_mode mode, int
outer_code,
break;
}
- switch (GET_CODE (dest))
+ switch (GET_CODE (dst))
{
case SUBREG:
- if (!REG_P (SUBREG_REG (dest)))
+ if (!REG_P (SUBREG_REG (dst)))
*total += rtx_cost (SUBREG_REG (src), VOIDmode, SET, 0, speed);
/* fallthrough */
case REG:
/* If this is a VR -> VR copy, count the number of
registers. */
- if (VECTOR_MODE_P (GET_MODE (dest)) && REG_P (src))
+ if (VECTOR_MODE_P (GET_MODE (dst)) && REG_P (src))
{
- int nregs = s390_hard_regno_nregs (VR0_REGNUM, GET_MODE
(dest));
+ int nregs = s390_hard_regno_nregs (VR0_REGNUM, GET_MODE (dst));
*total = COSTS_N_INSNS (nregs);
}
/* Same for GPRs. */
else if (REG_P (src))
{
int nregs
- = s390_hard_regno_nregs (GPR0_REGNUM, GET_MODE (dest));
+ = s390_hard_regno_nregs (GPR0_REGNUM, GET_MODE (dst));
*total = COSTS_N_INSNS (nregs);
}
else
@@ -3722,7 +3721,7 @@ s390_rtx_costs (rtx x, machine_mode mode, int outer_code,
*total += rtx_cost (src, mode, SET, 1, speed);
return true;
case MEM: {
- rtx address = XEXP (dest, 0);
+ rtx address = XEXP (dst, 0);
rtx tmp;
long tmp2;
if (s390_loadrelative_operand_p (address, &tmp, &tmp2))
@Robin: What do you think?
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/106919] [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu since r13-2251-g1930c5d05ceff2
2022-09-12 23:32 [Bug target/106919] New: [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu doko at gcc dot gnu.org
` (7 preceding siblings ...)
2022-09-22 20:12 ` marxin at gcc dot gnu.org
@ 2022-09-23 8:44 ` rdapp at gcc dot gnu.org
2022-09-26 10:09 ` marxin at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: rdapp at gcc dot gnu.org @ 2022-09-23 8:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106919
--- Comment #8 from rdapp at gcc dot gnu.org ---
Yes, one of dst and dest is superflous. Looks good like that. I bootstrapped
the same patch locally already, no regressions.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/106919] [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu since r13-2251-g1930c5d05ceff2
2022-09-12 23:32 [Bug target/106919] New: [13 Regression] RTL check: expected code 'set' or 'clobber', have 'if_then_else' in s390_rtx_costs, at config/s390/s390.cc:3672on s390x-linux-gnu doko at gcc dot gnu.org
` (8 preceding siblings ...)
2022-09-23 8:44 ` rdapp at gcc dot gnu.org
@ 2022-09-26 10:09 ` marxin at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-09-26 10:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106919
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #9 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed with r13-2867-g2387cfc7f6e206:
s390: fix wrong refactoring
Since r13-2251-g1930c5d05ceff2, the refactoring is not 1:1 and we end
up with a wrong rtx type.
gcc/ChangeLog:
* config/s390/s390.cc (s390_rtx_costs): Remove dest variable
and use only dst.
^ permalink raw reply [flat|nested] 11+ messages in thread