Bug 20583 - [4.0 regression] ICE in output_operand: invalid expression as operand
Summary: [4.0 regression] ICE in output_operand: invalid expression as operand
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 4.0.0
: P5 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
: 28092 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-03-22 01:19 UTC by Andreas Schwab
Modified: 2007-01-18 03:40 UTC (History)
5 users (show)

See Also:
Host:
Target: m68k-*-linux
Build:
Known to work: 4.1.0 4.1.1 4.1.2 4.2.0
Known to fail: 4.0.2
Last reconfirmed: 2006-02-20 18:41:09


Attachments
Testcase (623 bytes, text/plain)
2005-03-22 01:20 UTC, Andreas Schwab
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Schwab 2005-03-22 01:19:29 UTC
This might be related to PR20447 or PR18592. 
 
$ m68k-linux-gcc -O -S iso-2022-cn-ext.i 
iso-2022-cn-ext.i: In function ‘gconv’: 
iso-2022-cn-ext.i:85: internal compiler error: output_operand: invalid 
expression as operand 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Andreas Schwab 2005-03-22 01:20:13 UTC
Created attachment 8430 [details]
Testcase
Comment 2 dank 2005-03-23 17:06:52 UTC
That's the same one I mentioned in
http://gcc.gnu.org/ml/gcc/2005-03/msg00991.html
I was going to report it, but you beat me to it,
and you did a better job of minimizing the test
case thank I did. Thanks!

What does it take to confirm the bug?
Comment 3 dank 2005-04-14 05:28:30 UTC
Still seeing this on 4.0.0-rc1.
Comment 4 Serge Belyshev 2005-04-15 23:04:50 UTC
Confirmed.
Comment 5 dank 2005-07-06 05:11:24 UTC
Still seeing this on gcc-4.0.1-20050702.
Comment 6 Mark Mitchell 2005-08-22 02:52:23 UTC
m68k is not a primary or secondary platform; removing target milestone.
Comment 7 Kazu Hirata 2005-11-06 02:10:05 UTC
Reduced down to:

void bar (unsigned int);

void
foo (void)
{
  char buf[1] = { 3 };
  const char *p = buf;
  const char **q = &p;
  unsigned int ch;
  switch (**q)
    {
    case 1:  ch = 5; break;
    case 2:  ch = 4; break;
    case 3:  ch = 3; break;
    case 4:  ch = 2; break;
    case 5:  ch = 1; break;
    default: ch = 0; break;
    }
  bar (ch);
}

This is one of those rare cases where CSE1 folds a switch statement.
Comment 8 Kazu Hirata 2005-11-21 04:41:43 UTC
Subject: Bug 20583

Author: kazu
Date: Mon Nov 21 04:41:38 2005
New Revision: 107278

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107278
Log:
gcc/
	PR middle-end/20583
	* cse.c (cse_insn): Reject invalid forms of CONST earlier.

gcc/testsuite/
	PR middle-end/20583
	* gcc.c-torture/compile/pr20583.c: New.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr20583.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cse.c
    trunk/gcc/testsuite/ChangeLog

Comment 9 Kazu Hirata 2005-11-21 06:52:04 UTC
Subject: Bug 20583

Author: kazu
Date: Mon Nov 21 06:52:01 2005
New Revision: 107281

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107281
Log:
gcc/
	PR middle-end/20583
	* cse.c (cse_insn): Reject invalid forms of CONST earlier.

gcc/testsuite/
	PR middle-end/20583
	* gcc.c-torture/compile/pr20583.c: New.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/gcc.c-torture/pr20583.c
Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/cse.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog

Comment 10 Andrew Pinski 2005-11-21 16:50:01 UTC
Fixed in 4.1.0 and above for now.
Comment 11 Kazu Hirata 2006-05-21 09:51:54 UTC
Unassignining myself.
Comment 12 Andrew Pinski 2006-06-20 05:21:38 UTC
*** Bug 28092 has been marked as a duplicate of this bug. ***
Comment 13 Gabriel Dos Reis 2007-01-18 03:40:38 UTC
Fixed in 4.1.0.