https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99600
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|jakub at redhat dot com |uros at gcc dot gnu.org --- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Unfortunately, running ix86_avoid_lea_for_addr on the insns that aren't added yet into the insn stream and aren't updated with df isn't that easy, *lea_outperforms* wants to walk forwards and backwards from there etc. and uses df. So, one option could be disable the (define_peephole2 [(match_scratch:W 5 "r") (parallel [(set (match_operand 0 "register_operand") (ashift (match_operand 1 "register_operand") (match_operand 2 "const_int_operand"))) (clobber (reg:CC FLAGS_REG))]) (parallel [(set (match_operand 3 "register_operand") (plus (match_dup 0) (match_operand 4 "x86_64_general_operand"))) (clobber (reg:CC FLAGS_REG))])] "IN_RANGE (INTVAL (operands[2]), 1, 3) /* Validate MODE for lea. */ && ((!TARGET_PARTIAL_REG_STALL ... altogether for TARGET_AVOID_LEA_FOR_ADDR && optimize_function_for_speed_p (cfun). Another might be to somehow mark the instructions created by the (define_peephole2 [(set (match_operand:SWI48 0 "register_operand") (match_operand:SWI48 1 "address_no_seg_operand"))] "ix86_hardreg_mov_ok (operands[0], operands[1]) && peep2_regno_dead_p (0, FLAGS_REG) && ix86_avoid_lea_for_addr (peep2_next_insn (0), operands)" [(const_int 0)] peephole2 and in the other peephole2 punt if one or both of the insns are marked that way. That marking could be some hash set (but what would delete it at the end of peephole2 pass), some reg note or whatever on the insns or perhaps just remembering INSN_UID for the first and last insn in the sequence before DONE?