This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: Fix strict-aliasing warnings from unwind-dw2-fde.c


> The only strict-alias warnings that were spit out were the following 
> across all architectures:
> 
> make[2]: Entering directory 
> `/builddir/build/BUILD/glibc-2.16.90-2af1b328/inet'
> tst-inet6_rth.c: In function 'do_test':
> tst-inet6_rth.c:76:17: warning: dereferencing type-punned pointer will 
> break strict-aliasing rules [-Wstrict-aliasing]

I just pushed a simple fix for this.

> and this one which was PPC64 specific:
> 
> gmon-start.c: In function '__gmon_start__':
> gmon-start.c:63:3: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules [-Wstrict-aliasing]
> 
> So we're actually pretty close to being strict-aliasing clean as far as 
> I can tell.

This is probably fixed by the roland/ppc64-gmon-start-warning branch (patch
below).  But I'm not in a position to test it easily.


Thanks,
Roland


	* sysdeps/powerpc/powerpc64/entry.h (TEXT_START): Define using a
	second, differently-typed declaration, rather than a cast.

--- a/sysdeps/powerpc/powerpc64/entry.h
+++ b/sysdeps/powerpc/powerpc64/entry.h
@@ -1,5 +1,5 @@
 /* Finding the entry point and start of text.  PowerPC64 version.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
 
 #ifndef __ASSEMBLY__
 extern void _start (void);
+extern unsigned long int _start_as_data[] asm ("_start");
 #endif
 
 #define ENTRY_POINT _start
@@ -30,4 +31,4 @@ extern void _start (void);
    to keep profiling records.  We can't copy the ia64 scheme as our
    entry poiny address is really the address of the function
    descriptor, not the actual function entry.  */
-#define TEXT_START (((long int *) ENTRY_POINT)[0])
+#define TEXT_START (_start_as_data[0])


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