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: Correct c-torture stkalign test


On 02/07/2016 10:55 PM, Alan Modra wrote:
This test was added by git commit 7c5f55675 (svn 231569)

Here's the log message from that commit:
     avoid alignment of static variables affecting stack's

     Function (or more narrow) scope static variables (as well as others not
     placed on the stack) should also not have any effect on the stack
     alignment. I noticed the issue first with Linux'es dynamic_pr_debug()
     construct using an 8-byte aligned sub-file-scope local variable.

However, the test assumes that a local var will normally not be 64-bit
aligned, causing it to fail on many targets.  So the test needs to
pass if the local var *is* normally 64-bit aligned.  Done as follows.
test2() is a duplicate of test() without the alignment on the static
vars.  Fails on x86_64 -m64 and -m32 if 7c5f55675 is reverted and
passes now for powerpc64-linux.  I expect sparc will pass too, so have
reverted Eric's change.

OK to apply?

	PR testsuite/68886
	* gcc.c-torture/execute/stkalign.c: Revise test.
OK.
jeff


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