Testsuite and constant-folding?

Joseph S. Myers joseph@codesourcery.com
Fri Jan 5 19:43:00 GMT 2007


On Fri, 5 Jan 2007, Brooks Moses wrote:

> (3) How do GCC testsuites other than the Fortran one handle this issue?

Using volatile variables is one way to ensure that an built-in function 
doesn't get evaluated to a constant at compile time.  See for example 
gcc.c-torture/execute/builtins/complex-1.c.  In practice non-volatile 
non-const non-static global variables will also do the job, see e.g. 
gcc.dg/builtin-bswap-4.c.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list