This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Errors building libgcc for powerpc64le-linux-gnu
On Sun, Dec 15, 2019 at 09:43:20AM -0800, Ian Lance Taylor wrote:
> On Sat, Dec 14, 2019 at 11:25 PM Segher Boessenkool
> <segher@kernel.crashing.org> wrote:
> >
> > On Sat, Dec 14, 2019 at 10:51:50AM -0800, Ian Lance Taylor via gcc wrote:
> > > I'm seeing compiler crashes building libgcc for powerpc64le-linux-gnu,
> > > cross-compiling from x86_64-pc-linux-gnu. I'm at SVN revision 279830.
> > > I'm seeing the following. Is anybody else seeing this crash? Thanks.
> >
> > No, and that makes me wonder what is going on. The error is simple enough
> > of course, as you note in a later message; but why do we not see it on
> > every other build?
>
> I think it's because clang treats a left shift by a negative number as
> undefined behavior but GCC does not. So GCC is consistently producing
> some number, and clang is producing different numbers.
Hrm. Why did that not show up with ubsan then though? (Or maybe it did,
and I just never heard).
> I should note that I don't really understand what purpose that
> constant is serving anyhow.
- "operands[2] = GEN_INT (1 << (75 - REGNO (operands[0])));")
+ "operands[2] = GEN_INT (1 << (7 - (REGNO (operands[0]) - CR0_REGNO)));")
The constant is the bitmask of which CR fields to save/restore (always
one here, but the insn allows any combination).
Committing that patch later today. Thanks for the report!
Segher