This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RF[CT]: IMA repairs 2/n: maybe_apply_renaming_pragma rawrite


Zack Weinberg writes:

> I would appreciate comments on the patch, help with the Solaris crash,
> and testing on alpha-dec-osf4 (which is the only target that enables
> #pragma extern_prefix).  There is no user documentation in this patch;
> I will add it when I revise the patch.

I've now tried bootstrapping the patch on mainline as of 20040601, but it
fails compiling gthr-posix.c at the end of stage1:

./xgcc -B./ -B/vol/gcc/share/alpha-dec-osf4.0f/bin/ -isystem /vol/gcc/share/alpha-dec-osf4.0f/include -isystem /vol/gcc/share/alpha-dec-osf4.0f/sys-include -L/vol/gcc/obj/gcc-3.5.0-20040601/4.0f-gcc-rename/gcc/../ld -O2  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -pthread -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -I. -I. -I/vol/gnu/src/gcc/gcc-dist/gcc -I/vol/gnu/src/gcc/gcc-dist/gcc/. -I/vol/gnu/src/gcc/gcc-dist/gcc/../include -I/vol/gnu/src/gcc/gcc-dist/gcc/../libcpp/include -I/vol/gnu/src/gcc/gcc-dist/gcc/../libbanshee/libcompat -I/vol/gnu/src/gcc/gcc-dist/gcc/../libbanshee -I/vol/gnu/src/gcc/gcc-dist/gcc/../libbanshee/points-to  -c /vol/gnu/src/gcc/gcc-dist/gcc/gthr-posix.c -o libgcc/./gthr-posix.o
as0: Error: gthr-posix.c, line 1: .globl must precede the definition of the symbol __
as0: Error: gthr-posix.c, line 1: .globl must precede the definition of the symbol __
as0: Error: gthr-posix.c, line 1: .ent must precede the definition of the symbol __
as0: Error: gthr-posix.c, line 1: Conflicting definition of symbol $__..ng
as0: Error: gthr-posix.c, line 1: Conflicting definition of symbol __
[...]
make[3]: *** [libgcc/./gthr-posix.o] Error 1

The following testcase illustrates the problem:

typedef struct __pthread_once_t {
    long __state;
    long __reserved[10];
    } pthread_once_t;
typedef void __pthreadOnceFunc_t (void);
typedef __pthreadOnceFunc_t* __pthreadOnce_t;
#pragma extern_prefix "__"
extern int pthread_once (pthread_once_t*, __pthreadOnce_t);
#pragma extern_prefix ""
int
pthread_once (pthread_once_t *once __attribute__ ((__unused__)),
       void (*func) (void) __attribute__ ((__unused__)))
{
  return -1;
}

Without your patch and with cc1 -O3, I get this:

	.file	1 "ep.i"
	.verstamp 3 11
	.set noreorder
	.set volatile
	.set noat
	.arch ev4
	.text
	.align 2
	.align 2
	.align 4
	.globl __pthread_once
	.ent __pthread_once
$__pthread_once..ng:
__pthread_once:
	.frame $30,0,$26,0
	.prologue 0
	lda $0,-1($31)
	ret $31,($26),1
	.end __pthread_once

while with the patch, I get

	.file	1 "ep.i"
	.verstamp 3 11
	.set noreorder
	.set volatile
	.set noat
	.arch ev4
	.text
	.align 2
	.align 2
	.align 4
	.globl __
	.ent __
$__..ng:
__:
	.frame $30,0,$26,0
	.prologue 0
	lda $0,-1($31)
	ret $31,($26),1
	.end __

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]