Skip to content

make check fails with -march=i686 on gcc 2.96 (PR#2296)

2 messages · heinlein@cse.ogi.edu, Peter Dalgaard

#
The top-level 'make check' fails on Red Hat Linux 7.3 (fully patched 
as of Nov. 15, 2002) when CFLAGS includes "-march=i686". In 
particular, the following targets fail:

* test-Reg
* test-Examples
* test-Ts

The workaround is not to use "-march=i686". Specific stuff below, and
I'd be happy to provide any files or fragments thereof that'd help.

The failure does not occur

a) when the configure script is allowed to generate the optimization
   flags all on its own:

b) using Red Hat 8.0 with gcc 3.2 and glibc 2.2.93 (even with 
   -march=i686 specified)

+-----------------------------------------+----------------------+
| Paul Heinlein                           | heinlein@cse.ogi.edu |
| Research Systems Engineer               |      +1 503 748-1472 |
| Dept. of Computer Science & Engineering | 20000 NW Walker Road |
| OGI School of Science & Engineering     |  Beaverton, OR 97006 |
| Oregon Health & Science University      |                  USA |
+-----------------------------------------+----------------------+


System info:

* gcc 2.96 (rpm: gcc-2.96-113)
* libc 2.2.5 (rpm: glibc-2.2.5-42)
* kernel 2.4.18 (rpm: kernel-smp-2.4.18-17.7.x)
* 2 x Pentium III (Coppermine)


[heinlein@pecos R-1.6.1]$ CFLAGS='-O2 -march=i686' ./configure \
...
R is now configured for i686-pc-linux-gnu

  Source directory:          .  
  Installation directory:    /usr

  C compiler:                gcc  -D__NO_MATH_INLINES -mieee-fp -O2 -march=i686
  C++ compiler:              g++  -mieee-fp -g -O2
  Fortran compiler:          g77  -mieee-fp -g -O2

  X11 support:               yes
  Gnome support:             yes
  Tcl/Tk support:            yes
  Readline support:          yes

  R profiling support:       yes
  R as a shared library:     no

  Recommended packages:      yes

[heinlein@pecos R-1.6.1]$ make
... everything ok ...
[heinlein@pecos R-1.6.1]$ make check
...
make[4]: Entering directory `/var/tmp/R-1.6.1/tests/Examples'
collecting examples for package 'base' ...
make[5]: Entering directory `/var/tmp/R-1.6.1/src/library'
 >>> Building/Updating help pages for package 'base'
     Formats: text example 
make[5]: Leaving directory `/var/tmp/R-1.6.1/src/library'
running code in 'base-Ex.R' ...make[4]: *** [base-Ex.Rout] Error 1
[heinlein@pecos R-1.6.1]$ cd tests
[heinlein@pecos tests]$ make test-Reg
running regression tests
make[1]: Entering directory `/var/tmp/R-1.6.1/tests'
running code in 'reg-tests-1.R' ...make[1]: *** [reg-tests-1.Rout] Error 1
make[1]: Leaving directory `/var/tmp/R-1.6.1/tests'
make: *** [test-Reg] Error 2


Other test targets succeed: test-Packages (one warning about
undocumented code object 'plot' in methods), test-Internet,
test-Lapack, test-Nafns, test-Postscript, test-Random, test-DocArgs,
test-DocStyle (with some warnings), test-FF, test-Methods.





-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
heinlein@cse.ogi.edu writes:
Sounds more like a compiler bug than an R bug. (I have yet to see the
-march setting have any noticeable effect on a program, so I wouldn't
consider it high priority...)
 
The dual PIII that I have access to is still on RH7.2 and gcc-2.96-98
but I can reproduce the crash in base-Ex.R

#0  0x4012ace9 in __printf_fp () at printf_fp.c:910
#1  0x4012657b in _IO_vfprintf (s=0xbfffb020, 
    format=0xbfffb130 "%#2.2147483647e", ap=0xbfffb110) at _itoa.h:49
#2  0x40141605 in _IO_vsprintf (string=0x8b928b0 " 192.64", 
    format=0xbfffb130 "%#2.2147483647e", args=0xbfffb108) at #iovsprintf.c:46
#3  0x4012ec69 in sprintf (s=0x8b928b0 " 192.64", 
    format=0xbfffb130 "%#2.2147483647e") at sprintf.c:38
#4  0x08101613 in Rf_EncodeReal (x=nan(0x80000000007a2), w=2, #d=2147483647, 
    e=1) at ../../../R/src/main/printutils.c:171
#5  0x08101afb in Rf_EncodeElement (x=0x8bb2940, indx=0, quote=0)
    at ../../../R/src/main/printutils.c:366
...

BTW, another gotcha: r-devel tried to pass --args to gdb, but the
RH7.2 one (5.0-rh15) does not understand that.