Bug 43799 - [4.6 Regression] -fschedule-insns breaks vararg functions in recent builds
Summary: [4.6 Regression] -fschedule-insns breaks vararg functions in recent builds
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.0
Assignee: Not yet assigned to anyone
URL: http://gcc.gnu.org/ml/gcc-patches/201...
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2010-04-19 14:01 UTC by Zdenek Sojka
Modified: 2010-05-04 18:52 UTC (History)
3 users (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-04-19 14:11:59


Attachments
reduced testcase (from gcc.c-torture/execute/stdarg-2.c) (144 bytes, text/plain)
2010-04-19 14:10 UTC, Zdenek Sojka
Details
reduced testcase (from gcc.c-torture/execute/stdarg-4.c) (159 bytes, text/plain)
2010-04-19 14:14 UTC, Zdenek Sojka
Details
list of testsuite failures (gcc, g++, fortran) (490 bytes, text/plain)
2010-04-19 14:23 UTC, Zdenek Sojka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2010-04-19 14:01:33 UTC
Command line:
gcc -fschedule-insns testcase-1.c && ./a.out
gcc -O[123s] -fschedule-insns testcase-2.c && ./a.out

Tested revisions:
r158486 - fail
r158225 - OK
4.5 r158486 - OK

Compiler output:
$ /mnt/svn/gcc-trunk/binary-158486-lto-fortran/bin/gcc -O3 -fschedule-insns testcase.c && ./a.out
Aborted
Comment 1 H.J. Lu 2010-04-19 14:06:18 UTC
Testcase?
Comment 2 Zdenek Sojka 2010-04-19 14:10:45 UTC
Created attachment 20416 [details]
reduced testcase (from gcc.c-torture/execute/stdarg-2.c)

Command line:
$ gcc -fschedule-insns pr43799.c && ./a.out
Aborted
Comment 3 Zdenek Sojka 2010-04-19 14:14:35 UTC
Created attachment 20417 [details]
reduced testcase (from gcc.c-torture/execute/stdarg-4.c)

Command line:
$ gcc -O3 -fschedule-insns pr43799-2.c && ./a.out
Aborted
Fails at all -O[123s] levels.

At least with -O3 -fschedule-insns, this check:
	cmp	edi, 5	# i,
is missing in the generated code
Comment 4 Zdenek Sojka 2010-04-19 14:23:15 UTC
Created attachment 20418 [details]
list of testsuite failures (gcc, g++, fortran)

$ make check RUNTESTFLAGS="--target_board=unix/-fschedule-insns"
$ grep '^FAIL:' gcc/testsuite/*/*.log | grep ' exec'

It's possible not all these failures are related to this PR.

4.5 r158486 passes the run without any execution failure.
Comment 5 H.J. Lu 2010-04-19 18:03:13 UTC
It is caused by revision 158483:

http://gcc.gnu.org/ml/gcc-cvs/2010-04/msg00589.html
Comment 6 H.J. Lu 2010-05-04 18:20:47 UTC
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2010-05/msg00247.html
Comment 7 hjl@gcc.gnu.org 2010-05-04 18:51:53 UTC
Subject: Bug 43799

Author: hjl
Date: Tue May  4 18:51:29 2010
New Revision: 159040

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=159040
Log:
Add clobber CC register to sse_prologue_save patterns.

gcc/

2010-05-04  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/43799
	* config/i386/i386.md (sse_prologue_save): Add clobber CC
	register.
	(*sse_prologue_save_insn1): Likewise.
	(SSE prologue save splitter): Likewise.

gcc/testsuite/

2010-05-04  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/43799
	* gcc.target/i386/pr43799.c: New.

Added:
    trunk/gcc/testsuite/gcc.target/i386/pr43799.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.md
    trunk/gcc/testsuite/ChangeLog

Comment 8 H.J. Lu 2010-05-04 18:52:40 UTC
Fixed.