Bug 37184 - [4.3 Regression] ice in ix86_match_ccmode
Summary: [4.3 Regression] ice in ix86_match_ccmode
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.3.3
Assignee: Uroš Bizjak
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: patch
Depends on:
Blocks:
 
Reported: 2008-08-21 02:31 UTC by John Regehr
Modified: 2008-08-28 13:47 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2008-08-21 09:53:12


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Regehr 2008-08-21 02:31:21 UTC
Seen using r139367 on Ubuntu Hardy on ia32.

regehr@john-home:~/volatile/tmp9$ current-gcc -O1 small.c
small.c: In function ‘func_29’:
small.c:21: internal compiler error: in ix86_match_ccmode, at config/i386/i386.c:12801
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

regehr@john-home:~/volatile/tmp9$ current-gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --program-prefix=current- --enable-languages=c,c++ --prefix=/home/regehr : (reconfigured) ../configure --program-prefix=current- --enable-languages=c,c++ --prefix=/home/regehr : (reconfigured) ../configure --program-prefix=current- --enable-languages=c,c++ --prefix=/home/regehr
Thread model: posix
gcc version 4.4.0 20080821 (experimental) (GCC) 

regehr@john-home:~/volatile/tmp9$ cat small.c

typedef int int32_t;
typedef unsigned int uint32_t;
__extension__ typedef unsigned long long int uint64_t;
static inline unsigned int
rshift_u_s (unsigned int left, int right)
{
  return left >> right;
}

uint32_t g_15;
int32_t
func_29 (int32_t p_30)
{
  uint32_t l_31;
  uint64_t l_35 = 0x7736EAE11771B705LL;
  uint32_t l_36 = 0xEDB553A8L;
  l_31 = g_15;
  if ((l_31 <
       (rshift_u_s ((g_15 - (g_15 >= l_35)), (l_36 <= 1)))) + mod_rhs (1))
    return 1;
}
Comment 1 Uroš Bizjak 2008-08-21 09:53:12 UTC
Does following patch fix your original problem?

Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c  (revision 139372)
+++ config/i386/i386.c  (working copy)
@@ -12794,6 +12794,10 @@
       if (req_mode == CCZmode)
        return 0;
       /* FALLTHRU */
+    case CCAmode:
+    case CCCmode:
+    case CCOmode:
+    case CCSmode:
     case CCZmode:
       break;
 
Comment 2 John Regehr 2008-08-22 03:57:12 UTC
(In reply to comment #1)
> Does following patch fix your original problem?

Yes looks good.  Thanks!
Comment 3 uros 2008-08-22 14:00:20 UTC
Subject: Bug 37184

Author: uros
Date: Fri Aug 22 13:58:52 2008
New Revision: 139471

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=139471
Log:
        PR target/37184
        * config/i386/i386.c (ix86_match_ccmode): Handle CCAmode,
        CCCmode, CCOmode and CCSmode destination modes.

        PR target/37191
        * config/i386/mmx.md (*vec_extractv2sf_0): Avoid combining registers
        from different units in a single alternative.
        (*vec_extractv2sf_1): Ditto.
        (*vec_extractv2si_0): Ditto.
        (*vec_extractv2si_1): Ditto.
        * config/i386/sse.md (sse2_storehpd): Ditto.
        (sse2_storelpd): Ditto.
        (sse2_loadhpd): Ditto.
        (sse2_loadlpd): Ditto.

        PR target/37197
        * config/i386/i386.md (clzsi2_abm): Fix operand 1 constraints.
        (popcountsi2): Ditto.
        (clzdi2_abm): Ditto.
        (popcountdi2): Ditto.
        (clzhi2_abm): Ditto.
        (popcounthi2): Ditto.

testsuite/ChangeLog:

        PR target/37184
        * gcc.target/i386/pr37184.c: New test.

        PR target/37191
        * gcc.target/i386/pr37191.c: New test.

        PR target/37197
        * gcc.target/i386/pr37197.c: New test.

Added:
    trunk/gcc/testsuite/gcc.target/i386/pr37184.c
    trunk/gcc/testsuite/gcc.target/i386/pr37191.c
    trunk/gcc/testsuite/gcc.target/i386/pr37197.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c
    trunk/gcc/config/i386/i386.md
    trunk/gcc/config/i386/mmx.md
    trunk/gcc/config/i386/sse.md
    trunk/gcc/testsuite/ChangeLog

Comment 4 Uroš Bizjak 2008-08-22 14:03:25 UTC
Fixed for 4.4.
Comment 5 uros 2008-08-28 13:32:42 UTC
Subject: Bug 37184

Author: uros
Date: Thu Aug 28 13:31:33 2008
New Revision: 139707

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=139707
Log:
	PR target/37184
	* config/i386/i386.c (ix86_match_ccmode): Handle CCAmode,
	CCCmode, CCOmode and CCSmode destination modes.

	PR target/37191
	* config/i386/mmx.md (*vec_extractv2sf_0): Avoid combining registers
	from different units in a single alternative.
	(*vec_extractv2sf_1): Ditto.
	(*vec_extractv2si_0): Ditto.
	(*vec_extractv2si_1): Ditto.
	* config/i386/sse.md (sse2_storehpd): Ditto.
	(sse2_storelpd): Ditto.
	(sse2_loadhpd): Ditto.
	(sse2_loadlpd): Ditto.

	PR target/37197
	* config/i386/i386.md (clzsi2_abm): Fix operand 1 constraints.
	(popcountsi2): Ditto.
	(clzdi2_abm): Ditto.
	(popcountdi2): Ditto.
	(clzhi2_abm): Ditto.
	(popcounthi2): Ditto.

testsuite/ChangeLog:

	PR target/37184
	* gcc.target/i386/pr37184.c: New test.

	PR target/37191
	* gcc.target/i386/pr37191.c: New test.

	PR target/37197
	* gcc.target/i386/pr37197.c: New test.


Added:
    branches/gcc-4_3-branch/gcc/testsuite/gcc.target/i386/pr37184.c
      - copied unchanged from r139471, trunk/gcc/testsuite/gcc.target/i386/pr37184.c
    branches/gcc-4_3-branch/gcc/testsuite/gcc.target/i386/pr37191.c
      - copied unchanged from r139471, trunk/gcc/testsuite/gcc.target/i386/pr37191.c
    branches/gcc-4_3-branch/gcc/testsuite/gcc.target/i386/pr37197.c
      - copied unchanged from r139471, trunk/gcc/testsuite/gcc.target/i386/pr37197.c
Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/config/i386/i386.c
    branches/gcc-4_3-branch/gcc/config/i386/i386.md
    branches/gcc-4_3-branch/gcc/config/i386/mmx.md
    branches/gcc-4_3-branch/gcc/config/i386/sse.md
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog

Comment 6 Uroš Bizjak 2008-08-28 13:47:08 UTC
Fixed.