This is the mail archive of the
mailing list for the GCC project.
Re: Ping^3 : [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: law at redhat dot com, Richard Sandiford <rdsandiford at googlemail dot com>, Richard Sandiford <Richard dot Sandiford at arm dot com>, Hale Wang <hale dot wang at arm dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 21 Apr 2015 20:44:08 -0500
- Subject: Re: Ping^3 : [PATCH] [gcc, combine] PR46164: Don't combine the insns if a volatile register is contained.
- Authentication-results: sourceware.org; auth=none
- References: <CAGbRaL5sqjgq6bBg5o2y+sErJu-J5UzJzt=ZH1LLERsu1NR28g at mail dot gmail dot com> <20150421030331 dot GA28262 at gate dot crashing dot org> <CAGbRaL5CFTYH3t3pfbnQooYJeEUgVgu0=HFs4JwLWBZBUDy1DQ at mail dot gmail dot com>
On Tue, Apr 21, 2015 at 03:13:38PM +0800, Terry Guo wrote:
> > Did you fix the comment? REG_USERVAR_P and HARD_REGISTER_P can be
> > set for more than just register asm.
> Sorry for missing the patch. I believe that I addressed your patch.
> Please review it again to make sure my understanding is correct.
> + /* Use REG_USERVAR_P and HARD_REGISTER_P to check whether DEST is a user
> + specified register, and do not eliminate such register if it is in an
> + asm input. Otherwise if allow such elimination, we may break the
> + register asm usage defined in GCC manual. */
> + if (REG_P (dest) && REG_USERVAR_P (dest) && HARD_REGISTER_P (dest)
> + && extract_asm_operands (PATTERN (i3)))
> + return 0;
The "to check whether DEST is a user-specified register" part is not
correct; this check can for example also match for function arguments
(which are hard regs) that were combined into any "normal" user var.
I don't see how we would do a better check, and disallowing combination
in this case is harmless (or even good); but the comment is misleading.