https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94042
--- Comment #40 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Segher Boessenkool from comment #36)
> > > I did that (with /usr/bin/gcc etc. though, won't work at all otherwise),
> > > but that builds stage2 as 64-bit?
> >
> > Hm, that's possible. But the stage2 should not crash right?
>
> It doesn't work, of course (mixed 32-bit and 64-bit thing).
>
> And I need a 32-bit stage2 in any case, to have a compiler that miscompiles
> pt.c:tsubst_template_arg, to figure out why it thinks it as allowed to use
> GPR0 somewhere it obviously is live.
Ok, I've just run the build on gcc110 machine and you take a look at
/tmp/build.log. You are right that, using CC="gcc -m32" will cause that stage1
compiler is a cross from powerpc to powerpc64.
The miscompiled compiler is stage2:
$ file ./xgcc
./xgcc: ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, version 1
(SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, not
stripped
and it ICEs on a simple test-case:
$ ./xgcc -B. /tmp/reduced.ii
/tmp/reduced.ii: In substitution of ‘template<bool <anonymous>, class> struct
__enable_if [with bool <anonymous> = true; <template-parameter-1-2> = _Tp]’:
/tmp/reduced.ii:5:24: required from here
/tmp/reduced.ii:5:24: internal compiler error: Segmentation fault
5 | struct __enable_if<true, _Tp>
| ^~~~~~~~~~~~~~~~~~~~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
$ cat /tmp/reduced.ii
template<bool, typename>
struct __enable_if
{ };
template<typename _Tp>
struct __enable_if<true, _Tp>
{ typedef _Tp __type; };