This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Ping : [PATCH] [gcc, combine] PR46164: Don't combine the insns if a volatile register is contained.
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Terry Guo <flameroc at gmail dot com>
- Cc: richard dot sandiford at arm dot com, rdsandiford at googlemail dot com, GCC Patches <gcc-patches at gcc dot gnu dot org>, Hale Wang <hale dot wang at arm dot com>
- Date: Sun, 15 Feb 2015 05:35:05 -0600
- Subject: Re: Ping : [PATCH] [gcc, combine] PR46164: Don't combine the insns if a volatile register is contained.
- Authentication-results: sourceware.org; auth=none
- References: <002701d04409$a20efcb0$e62cf610$ at arm dot com> <87pp9fcehe dot fsf at e105548-lin dot cambridge dot arm dot com> <20150212221552 dot GA25883 at gate dot crashing dot org> <87zj8imb7x dot fsf at googlemail dot com> <CAGbRaL6872aHRCwrc28nF5RG-zSAGqza0CjurD+XjT2XVsZMBA at mail dot gmail dot com>
Hi Terry,
I still think this is stage1 material.
> + /* Don't combine if dest contains a user specified register and i3 contains
> + ASM_OPERANDS, because the user specified register (same with dest) in i3
> + would be replaced by the src of insn which might be different with
> + the user's expectation. */
"Do not eliminate a register asm in an asm input" or similar? Text
explaining why REG_USERVAR_P && HARD_REGISTER_P works here would be
good to have, too.
> + if (REG_P (dest) && REG_USERVAR_P (dest) && HARD_REGISTER_P (dest)
> + && (GET_CODE (PATTERN (i3)) == SET
> + && GET_CODE (SET_SRC (PATTERN (i3))) == ASM_OPERANDS))
> + return 0;
That works only for asms with exactly one output. You want
extract_asm_operands.
Segher