This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Testsuite and constant-folding?
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Brooks Moses <brooks dot moses at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Fri, 5 Jan 2007 19:43:33 +0000 (UTC)
- Subject: Re: Testsuite and constant-folding?
- References: <459E9BC1.7040801@codesourcery.com>
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