gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] strict aliasing


From: Camm Maguire
Subject: [Gcl-devel] strict aliasing
Date: Fri, 11 Dec 2009 16:19:39 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Greetings!

Leo Butler <address@hidden> writes:

> On Fri, 11 Dec 2009, Camm Maguire wrote:
>
> < Greetings! OK just fixd the GCL bugs, which result in some of the
> < maxima bugs, and am ready for upload.
> < 
> < There are new gcc warnings, which I always like to clear up.  Perhaps
> < you might help by figuring out the currently blessed way of writing
> < the following:
> < 
> < #define GET_FAULT_ADDR(sig,code,sv,a) \
> <     ((void *)(((struct sigcontext *)(&code))->cr2))
> < #endif
> < 
> < sgbc.c: In function 'memprotect_handler':
> < sgbc.c:1620: warning: dereferencing pointer 'code.636' does break 
> strict-aliasing rules
> < sgbc.c:1620: note: initialized from here
>
> Camm, if I understand strict-aliasing [*] then the problem is that your macro 
> is casting a 
> (void *) while on line 1620, faddr is a (char *). 
>
> If you change your macro to cast a (char *), then this should fix this 
> problem. Again,
> from the above article, (char *) may refer to an alias of any object, so this 
> should
> not introduce any additional breakages of the strict aliasing rules.
>

Alas, this does not work:

address@hidden:~/debian/gcl/gcl-2.6.8pre/o$ rm gbc.o; make gbc.o
gcc -c -Wall -DVOL=volatile -fsigned-char -pipe -O3 -fomit-frame-pointer  
-I/home/camm/debian/gcl/gcl-2.6.8pre/o -I../h -I../gcl-tk gbc.c  
In file included from gbc.c:1508:
sgbc.c: In function 'memprotect_handler':
sgbc.c:1620: warning: dereferencing pointer 'code.636' does break 
strict-aliasing rules
sgbc.c:1620: note: initialized from here
sgbc.c: In function 'memprotect_handler_test':
sgbc.c:1098: warning: dereferencing pointer 'code.547' does break 
strict-aliasing rules
sgbc.c:1098: note: initialized from here
address@hidden:~/debian/gcl/gcl-2.6.8pre/o$ cpp -I../h gbc.c |grep code
  faddr=((char *)(((struct sigcontext *)(&code))->cr2));

The problem apparently lies with the sigcontext.

> Are your fixes available from CVS, and if so, where?
>

Yes, cvs -d :pserver:address@hidden:/sources/gcl -r
Version_2_6_8pre co -d gcl-2.6.8pre gcl

BTW, I have a maxima 5.20 build which I might upload now.  GCL is
uploaded.  There are a few issues -- two test failures due to a double
conversion error in GMP.  See address@hidden archives if interested
or if have workaround suggestions.

Take care,
-- 
Camm Maguire                                        address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]