From: Jason M. <ja...@mi...> - 2017-02-28 01:58:54
|
So we don't reinvent the wheel, John Regehr maintains a set of testcases for how compilers optimize undefined behaviors here: https://github.com/regehr/ub-canaries In particular see: https://github.com/regehr/ub-canaries/tree/master/strict-aliasing On 00:54 Tue 28 Feb , Pascal Bourguignon wrote: > On 28 Feb 2017, at 00:48, Bruno Haible <[1]br...@cl...> wrote: > > Sam, > > On a second thought, this appears like a clear case for an autoconf > test: > check whether the default compiler does strict aliasing > optimizations > and, if it does, try to disable them, and if we cannot disable them, > fail configure. > > Yes. Excellent idea! Even with compilers that we have never heard of, > this will > do the right thing: bark at high optimization levels, and be silent > when not > optimizing. > > The thing with optimizations is that you don’t get to decide when the > compiler will apply them. > > So, the actual test program you will have to compile while configuring, > will be the actual program. Only so, you can be sure whether the > compiler did the optimization. > -- > __Pascal J. Bourguignon__ > > References > > 1. mailto:br...@cl... > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > clisp-devel mailing list > cli...@li... > https://lists.sourceforge.net/lists/listinfo/clisp-devel |