Probable compiler error on armhf?
Hi,
one of my packages (starlink-ast) which always compiled nicely on armhf, started to fail with gcc-4.9.1 [1]. With gcc-4.8.4, the compilation succeeded [2]. The problem also does not appear without the -O2 flag.
Unfortunately, the error message doesn't tell me anything:
gcc -DHAVE_CONFIG_H -I. -D_FORTIFY_SOURCE=2 -I/usr/include/star -DTHREAD_SAFE -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c region.c -fPIC -DPIC -o .libs/libstarlink_ast_la-region.o
/tmp/ccJsRMs3.s: Assembler messages:
/tmp/ccJsRMs3.s:21403: Warning: base register written back, and overlaps one of transfer registers
/tmp/ccJsRMs3.s:28133: Error: registers may not be the same -- `str r3,[r3],#4'
/tmp/ccJsRMs3.s:28971: Warning: base register written back, and overlaps one of transfer registers
Is this a (known) compiler bug? As a non-compiler-expert, I have no idea how to debug this.
The error is reproducible. I could produce a small, self-consisting file that shows the error when compiled with "gcc -O2 -c t.c":
How should I proceed?
Best regards
Ole
[1] https://buildd.debian.org/status/fetch.php?pkg=starlink-ast&arch=armhf&ver=8.0.2%2Bdfsg-1&stamp=1414223014
[2] https://buildd.debian.org/status/fetch.php?pkg=starlink-ast&arch=armhf&ver=8.0.0%2Bdfsg-2&stamp=1400237749
#include <stdlib.h>
void *astFree();
void *astMalloc();
extern int astOK;
int MaskF( int inside, int ndim,
const int lbnd[], const int ubnd[],
float in[], float val) {
void *used_region;
float *c, *d, *out, *tmp_out;
double *lbndgd, *ubndgd;
int *lbndg, *ubndg, idim, ipix, nax, nin, nout, npix, npixg, result = 0;
if ( !astOK ) return result;
lbndg = astMalloc( sizeof( int )*(size_t) ndim );
ubndg = astMalloc( sizeof( int )*(size_t) ndim );
lbndgd = astMalloc( sizeof( double )*(size_t) ndim );
ubndgd = astMalloc( sizeof( double )*(size_t) ndim );
if( astOK ) {
astGetRegionBounds( used_region, lbndgd, ubndgd );
npix = 1;
npixg = 1;
for ( idim = 0; idim < ndim; idim++ ) {
lbndg[ idim ] = lbnd[ idim ];
ubndg[ idim ] = ubnd[ idim ];
npix *= ( ubnd[ idim ] - lbnd[ idim ] + 1 );
if( npixg >= 0 ) npixg *= ( ubndg[ idim ] - lbndg[ idim ] + 1 );
}
if( npixg <= 0 && astOK ) {
if( ( inside != 0 ) == ( astGetNegated( used_region ) != 0 ) ) {
c = in;
for( ipix = 0; ipix < npix; ipix++ ) *(c++) = val;
result = npix;
}
} else if( npixg > 0 && astOK ) {
if( ( inside != 0 ) == ( astGetNegated( used_region ) != 0 ) ) {
tmp_out = astMalloc( sizeof( float )*(size_t) npix );
if( tmp_out ) {
c = tmp_out;
for( ipix = 0; ipix < npix; ipix++ ) *(c++) = val;
result = npix - npixg;
}
out = tmp_out;
} else {
tmp_out = NULL;
out = in;
}
if( inside ) astNegate( used_region );
result += astResampleF( used_region, ndim, lbnd, ubnd, in, NULL,
NULL, NULL, 0, 0.0, 100, val, ndim,
lbnd, ubnd, lbndg, ubndg, out, NULL );
if( inside ) astNegate( used_region );
}
}
return result;
}
Reply to: