Bug 43662 - [4.4/4.5/4.6 Regression] ICE in insert_save with ms_abi attribute
Summary: [4.4/4.5/4.6 Regression] ICE in insert_save with ms_abi attribute
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.5.0
: P1 normal
Target Milestone: 4.4.4
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
: 44818 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-04-06 08:34 UTC by marcus
Modified: 2010-07-06 01:49 UTC (History)
5 users (show)

See Also:
Host:
Target: x86_64-unknown-linux
Build:
Known to work: 4.5.1
Known to fail: 4.5.0
Last reconfirmed: 2010-04-06 10:03:20


Attachments
acmstream.i (128.53 KB, text/plain)
2010-04-06 08:35 UTC, marcus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description marcus 2010-04-06 08:34:37 UTC
during Wine 64bit build I get

gcc -c  -O2      acmstream.i
acmstream.c: In function ‘AVIFILE_OpenCompressor’:
acmstream.c:327:1: internal compiler error: in insert_save, at caller-save.c:1303
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugs.opensuse.org/> for instructions.

gcc version 4.5.0 20100331 (experimental) [trunk revision 157870] (SUSE Linux)
Comment 1 marcus 2010-04-06 08:35:39 UTC
Created attachment 20322 [details]
acmstream.i

gcc -c -O2 acmstream.i

started to reduce...  likely attribute(ms_abi) related I think.
Comment 2 Richard Biener 2010-04-06 10:03:20 UTC
We use a caller-save slot of VOIDmode for a DImode mem.
Comment 3 Andrew Pinski 2010-04-09 02:46:38 UTC
Short testcase:
int __attribute__((ms_abi)) ACMStream_fnRead(int*iface,int start,int samples,int buffer){}
typedef struct _IAVIStreamImpl {
  int sInfo;
  int has;
} IAVIStreamImpl;
extern int __attribute__((ms_abi)) aso(void*);
int AVIFILE_OpenCompressor(IAVIStreamImpl *This)
{
  if (This->has != 0)
  aso(&This->has);
  sre(&This->sInfo);
}
--- CUT ---
This is some how related to the ms_abi attribute.
Comment 4 H.J. Lu 2010-04-09 16:32:39 UTC
It is caused by revision 157849:

http://gcc.gnu.org/ml/gcc-cvs/2010-03/msg00686.html
Comment 5 Jie Zhang 2010-04-10 15:29:21 UTC
The patch:

http://gcc.gnu.org/ml/gcc-patches/2010-04/msg00466.html
Comment 6 Mikael Pettersson 2010-04-14 13:20:30 UTC
The patch causing this regression was backported to 4.4 in r157850, causing current 4.4 to also regress.
Comment 7 Richard Biener 2010-04-14 14:08:11 UTC
P1 for the regression on the release branch.
Comment 8 Mikael Pettersson 2010-04-14 18:23:09 UTC
(In reply to comment #5)
> The patch:
> 
> http://gcc.gnu.org/ml/gcc-patches/2010-04/msg00466.html

The test case in this patch breaks on 32-bit x86 because gcc complains that the ms_abi attribute is only available in 64-bit mode.  The following fixes it:

--- gcc/testsuite/gcc.target/i386/pr43662.c.~1~
+++ gcc/testsuite/gcc.target/i386/pr43662.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target lp64 } */
 /* { dg-options "-O2" } */
 
 int __attribute__((ms_abi)) ACMStream_fnRead(int*iface,int start,int
Comment 9 Ozkan Sezer 2010-04-14 18:59:54 UTC
(In reply to comment #8)
> +/* { dg-require-effective-target lp64 } */

Adding llp64 to that would be helpful, too.
Comment 10 Jakub Jelinek 2010-04-19 07:10:18 UTC
I don't think llp64 there would be very much helpful, then all functions are ms_abi and thus no ABI changes in between functions and no ICE.
Comment 11 Jie Zhang 2010-04-19 07:24:58 UTC
Thanks all. This is the updated patch:

http://gcc.gnu.org/ml/gcc-patches/2010-04/msg01157.html
Comment 12 Jie Zhang 2010-04-19 10:03:18 UTC
Subject: Bug 43662

Author: jiez
Date: Mon Apr 19 10:02:52 2010
New Revision: 158509

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158509
Log:
	PR target/43662
	* reginfo.c (reinit_regs): Set caller_save_initialized_p
	to false.

	testsuite/
	PR target/43662
	* gcc.target/i386/pr43662.c: New test.

Added:
    trunk/gcc/testsuite/gcc.target/i386/pr43662.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/reginfo.c
    trunk/gcc/testsuite/ChangeLog

Comment 13 Jie Zhang 2010-04-19 10:05:13 UTC
Subject: Bug 43662

Author: jiez
Date: Mon Apr 19 10:04:43 2010
New Revision: 158510

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158510
Log:
	PR target/43662
	* reginfo.c (reinit_regs): Set caller_save_initialized_p
	to false.

	testsuite/
	PR target/43662
	* gcc.target/i386/pr43662.c: New test.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/gcc.target/i386/pr43662.c
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/reginfo.c
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog

Comment 14 Jie Zhang 2010-04-19 10:06:27 UTC
Subject: Bug 43662

Author: jiez
Date: Mon Apr 19 10:06:13 2010
New Revision: 158511

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158511
Log:
	PR target/43662
	* reginfo.c (reinit_regs): Set caller_save_initialized_p
	to false.

	testsuite/
	PR target/43662
	* gcc.target/i386/pr43662.c: New test.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/gcc.target/i386/pr43662.c
Modified:
    branches/gcc-4_4-branch/gcc/ChangeLog
    branches/gcc-4_4-branch/gcc/reginfo.c
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog

Comment 15 Jie Zhang 2010-04-19 10:10:10 UTC
Should be fixed now on trunk, 4.5 and 4.4 branches.
Comment 16 Jakub Jelinek 2010-04-22 09:43:20 UTC
Fixed.
Comment 17 Andrew Pinski 2010-07-06 01:49:06 UTC
*** Bug 44818 has been marked as a duplicate of this bug. ***