This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC question.
- To: Stephen dot Jones at st dot com (Stephen Jones)
- Subject: Re: GCC question.
- From: Joern Rennecke <amylaar at redhat dot com>
- Date: Sat, 25 Aug 2001 01:16:41 +0100 (BST)
- Cc: Stephen dot Jones at st dot com, gcc at gcc dot gnu dot org, stephen dot clarke at st dot com
> The combiner doesn't spot the optimisation. The reg:DI 170 contains the 0xffff,
> which the compiler should know as it just put it there! Also, the REG_EQUAL
> note shows that the discarding of the top 48 bits could also be considered.
>
> So my question is:
> i) What is stopping the combination in the second case?
Combine can only handle up to three instructions at a time.
And it does not consider take advantage of REG_EQUAL notes.
> ii) Is there in fact some standard way of doing this masking operation which
> would not incur this problem?
No, but there are two nonstandard ways: you could use a clobber in the
insn pattern and a post-reload splitter, or a peephole2 pattern.