This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: Testsuite and constant-folding?


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


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