From: Bruno H. <br...@cl...> - 2017-02-27 21:36:17
|
Hi Sam, > > You wrote in > > <https://sourceforge.net/p/clisp/mailman/message/35687181/>: > > Do you have code to get this reference automatically? No, I look it up through the web interface of Sourceforge. > Without posting any (or at least not much) assembly, could you please > explain what gcc does with -fstrict-aliasing? 1) It makes assumptions. Specifically it assumes that two pointers A* and B* cannot point to the same memory address if A and B are the same type and neither A* and B* is 'char *'. 2) It makes optimizations based on these assumptions. For example, it can eliminate memory accesses A* p; B* q; x = *p; *q = y; x = *p; => A* p; B* q; x = *p; *q = y; or reorder code: A* p; B* q; x = *p; *q = y; => A* p; B* q; *q = y; x = *p; but it can do much more optimizations. > diff -r 208ade5c97ca src/makemake.in > --- a/src/makemake.in Sun Feb 26 20:07:47 2017 -0500 > +++ b/src/makemake.in Mon Feb 27 13:05:45 2017 -0500 > @@ -1335,13 +1335,12 @@ fi > # specific compiler options. I prefer to do it through compiler options. > if [ $XCC_GCC = true ] ; then > XCFLAGS=$XCFLAGS' -fno-strict-aliasing' > -else > - if [ "$HSYSOS" = aix ] ; then # for xlc > +elif [ "$HSYSOS" = aix ] ; then # for xlc > XCFLAGS=$XCFLAGS' -qalias=noansi' > - fi > - if [ -n "$XCC_SUNPRO" ] ; then # for SUNWspro cc > +elif [ -n "$XCC_SUNPRO" ] ; then # for SUNWspro cc > XCFLAGS=$XCFLAGS' -xalias_level=weak' > - fi > +elif [ "${with_debug}" != no ]; then > + echo "$0: WARNING: how to disable strict aliasing with ${XCC} on ${HSYSOS}?" >&2 > fi > > if [ "${with_dynamic_modules}" != no ]; then # not on msvc The users of the configure script are most often our users, not ourselves, therefore such a warning it not very helpful. It'd be more helpful to find out the option for other compilers. The code already handles gcc, clang, xlc, and Sun Studio cc. What other compilers may be reasonably used to compile clisp? Can you look up the corresponding option? Bruno |