Opened 11 years ago

Last modified 7 years ago

#11226 closed defect

Sympow spkg fails with gcc 4.6.0 — at Version 11

Reported by: Jeroen Demeyer Owned by: Mariah Lennox
Priority: blocker Milestone: sage-4.7
Component: packages: standard Keywords: sympow spkg
Cc: Merged in:
Authors: Mariah Lenox Reviewers:
Report Upstream: Reported upstream. Developers deny it's a bug. Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by Mariah Lennox)

On Linux Itanium (ia64) systems, sympow builds with gcc 4.6.0 but fails doctests. Example from cleo (RHEL 5.3 ia64 Itanium 2):

sage -t -long  -force_lib devel/sage/sage/lfunctions/sympow.py
**********************************************************************
File "/home/buildbot/build/sage/cleo-1/cleo_full/build/sage-4.7.alpha5/devel/sage-main/sage/lfunctions/sympow.py", line 213:
    sage: sympow.modular_degree(EllipticCurve('11a'))
Exception raised:
    Traceback (most recent call last):
      File "/home/buildbot/build/sage/cleo-1/cleo_full/build/sage-4.7.alpha5/local/bin/ncadoctest.py", line 1231, in run_one_test
        self.run_one_example(test, example, filename, compileflags)
      File "/home/buildbot/build/sage/cleo-1/cleo_full/build/sage-4.7.alpha5/local/bin/sagedoctest.py", line 38, in run_one_example
        OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
      File "/home/buildbot/build/sage/cleo-1/cleo_full/build/sage-4.7.alpha5/local/bin/ncadoctest.py", line 1172, in run_one_example
        compileflags, 1) in test.globs
      File "<doctest __main__.example_6[2]>", line 1, in <module>
        sympow.modular_degree(EllipticCurve('11a'))###line 213:
    sage: sympow.modular_degree(EllipticCurve('11a'))
      File "/home/buildbot/build/sage/cleo-1/cleo_full/build/sage-4.7.alpha5/local/lib/python/site-packages/sage/lfunctions/sympow.py", line 229, in modular_degree
        raise RuntimeError, "failed to compute modular degree"
    RuntimeError: failed to compute modular degree
**********************************************************************

[...]

The following tests failed:

	sage -t -long  -force_lib devel/sage/sage/modular/hecke/submodule.py # 1 doctests failed
	sage -t -long  -force_lib devel/sage/sage/modular/abvar/abvar.py # 1 doctests failed
	sage -t -long  -force_lib devel/sage/sage/lfunctions/sympow.py # 13 doctests failed
	sage -t -long  -force_lib devel/sage/sage/schemes/elliptic_curves/ell_rational_field.py # 17 doctests failed
----------------------------------------------------------------------

Starting up the sympow executable simply gives

sympow 1.018 RELEASE  (c) Mark Watkins -**ERROR** QD_check failed at x[0]

A revised package, which works around the gcc-4.6.0 bug by compiling QD.c with -O1 is http://boxen.math.washington.edu/home/mariah/spkg/sympow-1.018.1.p9.spkg

For other issues related to gcc 4.6.0 see #11216

Change History (11)

comment:1 Changed 11 years ago by Jeroen Demeyer

Description: modified (diff)

comment:2 Changed 11 years ago by Jeroen Demeyer

On first sight, it looks like compiling with -O1 solves the problem.

comment:3 Changed 11 years ago by David Kirkby

Description: modified (diff)

comment:4 Changed 11 years ago by François Bissey

Can't say I am surprised. Any clues from the build log?

comment:5 in reply to:  4 Changed 11 years ago by David Kirkby

Replying to fbissey:

Can't say I am surprised.

Me neither!

Dave

comment:6 Changed 11 years ago by David Kirkby

Has the '-fno-ivopts' option, (which has fixed several gcc-4.6.0 specific issues), been tried?

comment:7 in reply to:  6 Changed 11 years ago by Mariah Lennox

Replying to drkirkby:

Has the '-fno-ivopts' option, (which has fixed several gcc-4.6.0 specific issues), been tried?

Yes. I tried compiling with -O3 -fno-ivopts, but sadly the reported problem still exists.

comment:8 Changed 11 years ago by Mariah Lennox

If src/QD.c is compiled with -O1 (and the rest with -O3) then sage -t -long -force_lib devel/sage/sage/lfunctions/sympow.py no longer fails.

I am working on isolating the code in QD.c that demonstrates the gcc-4.6.0 optimization bug.

comment:9 in reply to:  8 Changed 11 years ago by David Kirkby

Replying to mariah:

If src/QD.c is compiled with -O1 (and the rest with -O3) then sage -t -long -force_lib devel/sage/sage/lfunctions/sympow.py no longer fails.

I am working on isolating the code in QD.c that demonstrates the gcc-4.6.0 optimization bug.

You are a brave lady Mariah - any code in SYMPOW is difficult to understand. Bill Hart described it as "virtually obfuscated". Unfortunately, since it not actually standard C (the Sun compiler wont compile it), it can't be entered into The International Obfuscated C Code Contest

http://www.ioccc.org/

I particualry like SYMPOW's Configure script

http://boxen.math.washington.edu/home/kirkby/bad-code/sympow-1.018.1.p7/src/Configure

which starts off

#!/bin/sh

then later has a test to see if sh exists on the system!

SH=`whichexe sh` && echo "#define SH \"$SH\"" >> $CONFIG
if [ -z "$SH" ]; then
  echo "**ERROR**: Could not find sh"; exit 1;
else
  echo "SH = $SH"
fi

Good luck Mariah - I don't envy you.

Dave

comment:10 Changed 11 years ago by Mariah Lennox

Owner: changed from tbd to Mariah Lennox

comment:11 Changed 11 years ago by Mariah Lennox

Authors: Mariah Lenox
Description: modified (diff)
Report Upstream: N/AReported upstream. Little or no feedback.
Status: newneeds_review

gcc-4.6.0 optimization regression of src/QD.c reported to gcc bugzilla http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48823

Note: See TracTickets for help on using tickets.