Skip to content

Commit f3bfed3

Browse files
VAX: Fix ill-formed `jbb<ccss>i<mode>' insn operands
The insn has extraneous operand #3 that is aliased in RTL to operand #0 with a constraint. The operands specify a single-bit field in memory that the machine instruction produced boths reads for the purpose of determining whether to branch or not and either clears or sets according to the machine operation selected with the `ccss' iterator. The caller of the insn is supposed to supply the same rtx for both operands. This odd arrangement happens to work with old reload, but breaks with libatomic if LRA is used instead: .../libatomic/flag.c: In function 'atomic_flag_test_and_set': .../libatomic/flag.c:36:1: error: unable to generate reloads for: 36 | } | ^ (jump_insn 7 6 19 2 (unspec_volatile [ (set (pc) (if_then_else (eq (zero_extract:SI (mem/v:QI (reg:SI 27) [-1 S1 A8]) (const_int 1 [0x1]) (const_int 0 [0])) (const_int 1 [0x1])) (label_ref:SI 25) (pc))) (set (zero_extract:SI (mem/v:QI (reg:SI 28) [-1 S1 A8]) (const_int 1 [0x1]) (const_int 0 [0])) (const_int 1 [0x1])) ] 100) ".../libatomic/flag.c":35:10 669 {jbbssiqi} (nil) -> 25) during RTL pass: reload .../libatomic/flag.c:36:1: internal compiler error: in curr_insn_transform, at lra-constraints.c:4098 0x1112c587 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) .../gcc/rtl-error.c:108 0x10ee6563 curr_insn_transform .../gcc/lra-constraints.c:4098 0x10eeaf87 lra_constraints(bool) .../gcc/lra-constraints.c:5133 0x10ec97e3 lra(_IO_FILE*) .../gcc/lra.c:2336 0x10e4633f do_reload .../gcc/ira.c:5827 0x10e46b27 execute .../gcc/ira.c:6013 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. Switch to using `match_dup' as expected then for a machine instruction that in its encoding only has one actual operand in for the single-bit field. gcc/ * config/vax/builtins.md (jbb<ccss>i<mode>): Remove operand #3. (sync_lock_test_and_set<mode>): Adjust accordingly. (sync_lock_release<mode>): Likewise.
1 parent 436e6f7 commit f3bfed3

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

gcc/config/vax/builtins.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,7 @@
174174
175175
label = gen_label_rtx ();
176176
emit_move_insn (operands[0], const1_rtx);
177-
emit_jump_insn (gen_jbbssi<mode> (operands[1], const0_rtx, label,
178-
operands[1]));
177+
emit_jump_insn (gen_jbbssi<mode> (operands[1], const0_rtx, label));
179178
emit_move_insn (operands[0], const0_rtx);
180179
emit_label (label);
181180
DONE;
@@ -193,8 +192,7 @@
193192
FAIL;
194193
195194
label = gen_label_rtx ();
196-
emit_jump_insn (gen_jbbcci<mode> (operands[0], const0_rtx, label,
197-
operands[0]));
195+
emit_jump_insn (gen_jbbcci<mode> (operands[0], const0_rtx, label));
198196
emit_label (label);
199197
DONE;
200198
}")
@@ -204,13 +202,13 @@
204202
[(set (pc)
205203
(if_then_else
206204
(eq (zero_extract:SI
207-
(match_operand:VAXint 0 "any_memory_operand" "<bb_mem>")
205+
(match_operand:VAXint 0 "any_memory_operand" "+<bb_mem>")
208206
(const_int 1)
209207
(match_operand:SI 1 "general_operand" "nrmT"))
210208
(const_int bit))
211209
(label_ref (match_operand 2 "" ""))
212210
(pc)))
213-
(set (zero_extract:SI (match_operand:VAXint 3 "any_memory_operand" "+0")
211+
(set (zero_extract:SI (match_dup 0)
214212
(const_int 1)
215213
(match_dup 1))
216214
(const_int bit))]

0 commit comments

Comments
 (0)