This is the mail archive of the gcc@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: [m32c-elf] losing track of register lifetime in combine?


DJ Delorie <dj@redhat.com> writes:

> I compared the generated code with an equivalent explicit test,
> and discovered that gcc uses a separate rtx for the intermediate:
> 
> i = 0xfffff;
> if (j >= 16)
>   {
>     int i2;
>     i2 = i >> 8;
>     i = i2 >> 8;
>     j -= 16;
>   }
> 
> This seems to avoid the combiner problem, becuase you don't have the
> same register being set and being used in one insn.  Does this explain
> why combine was having a problem, or was this a legitimate thing to do
> and the combiner is still wrong?  Using a temp in the expander works
> around the problem.

Interesting.  Using a temporary is the natural way to implement this
code.  But not using a temporary should be valid.  So I think there is
a bug in combine.

But since using a temporary will give more CSE opportunities, I think
you should use a temporary.  And you shouldn't worry about fixing
combine, since all that code is going to have to change on
dataflow-branch anyhow.  (Actually it probably just works on
dataflow-branch.)

Ian


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