Bug 34132 - [4.3 Regression] ICE: internal consistency failure (invalid rtl sharing found in the insn)
Summary: [4.3 Regression] ICE: internal consistency failure (invalid rtl sharing found...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Jakub Jelinek
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2007-11-17 11:58 UTC by Martin Michlmayr
Modified: 2007-11-18 19:23 UTC (History)
4 users (show)

See Also:
Host:
Target: alpha-linux-gnu
Build:
Known to work: 4.2.2
Known to fail:
Last reconfirmed: 2007-11-18 10:37:04


Attachments
preprocessed source (19.68 KB, application/octet-stream)
2007-11-17 11:59 UTC, Martin Michlmayr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Michlmayr 2007-11-17 11:58:19 UTC
With current trunk on Alpha:

(sid)353:tbm@vorpal: ~] /usr/lib/gcc-snapshot/bin/gcc -c -O1 smapi-api_sdm.c
(sid)354:tbm@vorpal: ~] /usr/lib/gcc-snapshot/bin/gcc -c -O2 smapi-api_sdm.c
smapi-api_sdm.c: In function 'SdmOpenMsg':
smapi-api_sdm.c:15: error: invalid rtl sharing found in the insn
(insn 53 49 24 4 smapi-api_sdm.c:11 (set (reg:DI 77)
        (high:DI (symbol_ref:DI ("sd_msg") [flags 0x6] <var_decl 0x200002b85a0 sd_msg>))) 252 {*movdi_er_nofix} (expr_list:REG_EQUAL (high:DI (symbol_ref:DI ("sd_msg") [flags 0x6] <var_decl 0x200002b85a0 sd_msg>))
        (nil)))
smapi-api_sdm.c:15: error: shared rtx
(high:DI (symbol_ref:DI ("sd_msg") [flags 0x6] <var_decl 0x200002b85a0 sd_msg>))
smapi-api_sdm.c:15: internal compiler error: internal consistency failure
Please submit a full bug report,
with preprocessed source if appropriate.
Comment 1 Martin Michlmayr 2007-11-17 11:59:15 UTC
Created attachment 14571 [details]
preprocessed source
Comment 2 Martin Michlmayr 2007-11-17 11:59:49 UTC
/* Testcase by Martin Michlmayr <tbm@cyrius.com> */

static char *sd_msg = "%s%u.msg";
void SdmOpenMsg (short mode, char *msgname, int filemode)
{
  if (mode == 0)
  {
    xprintf (msgname, (char *) sd_msg);
    filemode = 1;
  }
  else if (mode == 1)
    filemode = 00;
  xprintf (msgname, (char *) sd_msg);
  xprintf (filemode, "%d");
}
Comment 3 Jakub Jelinek 2007-11-18 10:37:04 UTC
Testing a fix.
Comment 4 Jakub Jelinek 2007-11-18 19:22:44 UTC
Subject: Bug 34132

Author: jakub
Date: Sun Nov 18 19:22:35 2007
New Revision: 130275

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130275
Log:
	PR rtl-optimization/34132
	* gcse.c (try_replace_reg): Avoid rtx sharing between REG_EQUAL note
	and insn.

	* gcc.c-torture/compile/20071118-1.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/20071118-1.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gcse.c
    trunk/gcc/testsuite/ChangeLog

Comment 5 Jakub Jelinek 2007-11-18 19:23:24 UTC
Fixed.