NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-vax/57646: Import major vax toolchain fix by Kalvis Duckmanton



>Number:         57646
>Category:       port-vax
>Synopsis:       Import major vax toolchain fix by Kalvis Duckmanton
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    port-vax-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 07 11:20:00 +0000 2023
>Originator:     Rin Okuyama
>Release:        10.99.* and netbsd-10
>Organization:
Internet Initiative Japan Inc.
>Environment:
NetBSD vax.local 10.99.9 NetBSD 10.99.9 (GENERIC) #2: Mon Oct  2 23:35:08 JST 2023  rin@sakaizumii.local:/home/rin/src/sys/arch/vax/compile/GENERIC vax

NetBSD vax10.local 10.0_BETA NetBSD 10.0_BETA (GENERIC) #5: Tue Oct  3 19:38:54 JST 2023  rin@sakaizumii.local:/home/rin/src/sys/arch/vax/compile/GENERIC vax
>Description:
We have never had satisfying compilers for vax; lot of optimization hacks
are required in order to avoid miscompilation as well as ICE. Even with
these hacks, generated binaries sometimes misbehave. Unfortunately, new
vax backend introduced for us by GCC 12 does not resolve the problems.

The series of patches provided by Kalvis Duckmanton <kalvisd at gmail>
drastically change this situation:

- No ICE even if all of -O[01] hacks are removed.
- Full ATF run completes without kernel panic.
- No obviously-compiler-related problems detected by ATF:
    http://www.netbsd.org/~rin/vax/ (caution: huge files)
  Most of failures seem due to:
    (1) non-IEEE-754-compliant floating-point unit
    (2) no working TLS support
  and some are due to
    (3) MD bugs in kernel or libc
- pkgsrc/lang/perl5 builds natively.
- No regression observed by GCC test suite for x86_64.

I expect that we can eventually address ATF failures if we have a
working compiler.

Not only fixing GCC 12, Kalvis kindly ported his works to GCC 10 for
netbsd-10 branch.

Although the patches are clearly written, it still takes some time to
import them into external/gcc/dist in a sustainable form, since:

  (a) we already have lot of local changes, some of which are difficult
      to be upstreamed
  (b) some MI parts of GCC are touched by the patches (even though
      no regressions are observed at least for x86_64; see above)

Therefore, we import this work into external/gcc.old/dist at the moment,
with MI changes being enabled only for vax. This will be immediately
pulled up into netbsd-10 branch, and provided as a part of NetBSD 10.0
RC1 for tests. I believe it is useful both for users and developers.

I will commit the patch kit mostly as is; except for

  (i)  MI parts are protected by NB_FIX_VAX_BACKEND macro
  (ii) some trivial style fixes

This plan has been approved by Kalvis, mrg@, and martin@.

Also, all of -O[01] hacks are removed at the moment. GCC 12 may require
hacks for a while, but it turned out that GCC 12 should be treated
differently from older versions; a lot of new files need -O[01] flags,
while some may no longer require it. I will take a look later. Note that
these hacks are not required if Kalvis's patches for GCC 12 are applied.

doc/HACKS is also left as is, at the moment.
>How-To-Repeat:
See tons of -O[01] hacks for vax, several PRs for gcc/vax.
>Fix:
Described above.



Home | Main Index | Thread Index | Old Index