[Patches] [ python-Patches-725024 ] adjust optimisation to deal with bus errors on FreeBSD

SourceForge.net noreply@sourceforge.net
Mon, 21 Apr 2003 08:10:57 -0700


Patches item #725024, was opened at 2003-04-22 01:10
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=725024&group_id=5470

Category: Build
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Andrew I MacIntyre (aimacintyre)
Assigned to: Nobody/Anonymous (nobody)
Summary: adjust optimisation to deal with bus errors on FreeBSD

Initial Comment:
Since checkin of patch #720991 on April 14, I've not
been able to run test_sre (or test_re) on a 2.3-CVS
built on FreeBSD 4.7 (gcc 2.95.4, using autoconf
default -O3) without getting a bus error.  Using less
aggressive optimisation works around the issue.

I can reproduce the problem with gcc 2.95.3 on FreeBSD
4.4, gcc 3.2.2 on FreeBSD 4.7 built from the FreeBSD
ports system, and gcc 3.2.1 for OS/2+EMX.

I'm not in a position to do a full investigation of the
issue, so I've prepared the attached patch to
configure.in which lowers the optimisation for gcc on
FreeBSD.

For gcc 2.95.x, dropping the optimisation to -O2 is
sufficient to get a Python interpreter which doesn't
fail test_sre with a bus error.  This compiler is the
default compiler for FreeBSD 4.x.  This change is
reduces performance on a VIA C3 800MHz system by about 3-4%
(both pystone and pybench)

For gcc 3.2.x, the optimisation has to be dropped to
-Os for test_sre to pass without a bus error.  This
compiler is the default compiler for FreeBSD 5.0.  On a
VIA C3 800MHz system running FreeBSD 4.7, this change
reduces performance by 6-7.5% (6% pybench, 7.5% pystone).

The EMX port does not use autoconf.

Caveats:
- I don't yet have a FreeBSD 5.0 system, but have based
this patch on the assumption that the 5.0 system
compiler will be configured with the same specs as the
FreeBSD ports configuration, and therefore have the
same behaviour.
- a less intrusive workaround would be to only lower
optimisation for the affected file (Modules/_sre.c),
however that seems impossible with autoconf.
- there appear to be no reports of similar issues for
gcc on Linux, so I've assumed that the problem is
specific to how FreeBSD configures the compilers and/or
binutils.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=725024&group_id=5470