This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Ping^3 : [PATCH] [gcc, combine] PR46164: Don't combine the insns if a volatile register is contained.


On Wed, Apr 22, 2015 at 9:44 AM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> 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.
>
>
> Segher

Thanks for reviewing. Patch is updated per you suggestion. The
ChangeLog is also updated as below:

gcc/ChangeLog:
2015-04-22 Hale Wang <hale.wang@arm.com>
                    Terry Guo  <terry.guo@arm.com>

       PR rtl-optimization/64818
       * combine.c (can_combine_p): Don't combine user-specified register if
       it is in an asm input.

gcc/testsuite/ChangeLog:
2015-04-22 Hale Wang <hale.wang@arm.com>
                    Terry Guo  <terry.guo@arm.com>

       PR rtl-optimization/64818
       * gcc.target/arm/pr64818.c: New.

Attachment: pr64818-combine-user-specified-register-v6.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]