Bug 7916 - [3.2/3.3/3.4 regression] ICE in instantiate_virtual_register_1
Summary: [3.2/3.3/3.4 regression] ICE in instantiate_virtual_register_1
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: inline-asm (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2002-09-13 22:16 UTC by hope2see
Modified: 2012-01-20 05:21 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
mon_enter_exit.ii (98.37 KB, text/x-c++)
2003-05-21 15:16 UTC, hope2see
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hope2see 2002-09-13 22:16:01 UTC
$ g++ -c -w -g -O0 -D_DEBUG -DORP_STATS  -DORP_POSIX -D_REENTRANT -D__SMP__  -D
LAZY_LOCK  -DLINUX_TLS_OPT  -DGC_REWORK  mon_enter_exit.ii -o CYGWIN_NT-5.1/dbg
/mon_enter_exit.o
mon_enter_exit.cpp: In function `uint8 LockedCompareExchangeUint8(uint8*,
   unsigned char, unsigned char)':
mon_enter_exit.cpp:439: Internal compiler error in instantiate_virtual_regs_1,
   at function.c:3972
Please submit a full bug report,
with preprocessed source if appropriate.

Release:
unknown

Environment:
CYGWIN_NT-5.1 / WindowsXP

How-To-Repeat:
Just execute the command below.

$ g++ -c -w -g -O0 -D_DEBUG -DORP_STATS  -DORP_POSIX -D_REENTRANT -D__SMP__  -D
LAZY_LOCK  -DLINUX_TLS_OPT  -DGC_REWORK  mon_enter_exit.ii -o CYGWIN_NT-5.1/dbg
/mon_enter_exit.o
Comment 1 Wolfgang Bangerth 2002-11-22 11:05:25 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed, also on linux x86. Reduced testcase is
    -------------------------
    void foo(char *dst, char xchg, char cmp)
    {
      __asm__("lock" "\tcmpxchgb %1, (%2)\t\n"
              :"=al"(cmp)
              :"dl"(xchg), "r"(dst), "al"(cmp));
    }
    --------------------------
    Messages are
    tmp/g> /home/bangerth/bin/gcc-3.3y-pre/bin/g++ -c y.cc
    y.cc: In function `void foo(char*, char, char)':
    y.cc:8: internal compiler error: in instantiate_virtual_regs_1, at function.c:
       3936
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
    
    
    This happens with both 3.2.1 as well as 3.3, but not with
    2.95, so is a regression.
Comment 2 janis187 2002-12-20 14:43:46 UTC
From: Janis Johnson <janis187@us.ibm.com>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org,
   nobody@gcc.gnu.org, hope2see@chol.com, jh@suse.cz
Cc:  
Subject: Re: c++/7916: [3.2/3.3 regression] ICE in instantiate_virtual_register_1
Date: Fri, 20 Dec 2002 14:43:46 -0800

 The regression reported in PR c++/7916 showed up starting
 with this patch:
 
 Wed Mar 14 22:26:10 CET 2001  Jan Hubicka  <jh@suse.cz>
 
         * i386.c (ix86_cmodel_string, ix86_cmodel): Define.
         (override_options): Parse cmodel string.
         (x86_64_sign_extended_value, x86_64_zero_extended_value): New.
         * i386.h (TARGET_OPTIONS): Add "cmodel".
         (EXTRA_CONSTRAINT): Recognize 'e' and 'Z'.
         (enum cmodel): New.
         (ix86_cmodel_string, ix86_cmodel): Declare.
 
         Spot by Matt Kraai:
         * i386.h (GENERAL_REG_P): Add missing REG_P.
 
 Here's a small test case that causes the compiler to ICE
 when compiled on i686-linux.  The PR is against C++, but my
 testing used cc1 rather than cc1plus.
 
 -------------------
 void foo(char *dst, char xchg, char cmp)
 {
   __asm__("lock" "\tcmpxchgb %1, (%2)\t\n"
           :"=al"(cmp)
           :"dl"(xchg), "r"(dst), "al"(cmp));
 }
 -------------------
 
 Output from the mainline compiler:
 
 7916.c: In function `foo':
 7916.c:6: internal compiler error: in instantiate_virtual_regs_1,
           at function.c:3898
 Please submit a full bug report,
 with preprocessed source if appropriate.
 See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7916
 
 
 

Comment 3 Wolfgang Bangerth 2002-12-20 20:43:24 UTC
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c++/7916
Date: Fri, 20 Dec 2002 20:43:24 -0600 (CST)

 ---------- Forwarded message ----------
 Date: Sat, 21 Dec 2002 01:19:12 +0100
 From: Jan Hubicka <jh@suse.cz>
 To: Janis Johnson <janis187@us.ibm.com>
 Cc: gcc@gcc.gnu.org, jh@suse.cz, bangerth@ticam.utexas.edu
 Subject: Re: patch that caused regression PR c++/7916
 
 > The regression reported in PR c++/7916 showed up starting with this
 > patch:
 > 
 > Wed Mar 14 22:26:10 CET 2001  Jan Hubicka  <jh@suse.cz>
 > 
 > 	* i386.c (ix86_cmodel_string, ix86_cmodel): Define.
 > 	(override_options): Parse cmodel string.
 > 	(x86_64_sign_extended_value, x86_64_zero_extended_value): New.
 > 	* i386.h (TARGET_OPTIONS): Add "cmodel".
 > 	(EXTRA_CONSTRAINT): Recognize 'e' and 'Z'.
 > 	(enum cmodel): New.
 > 	(ix86_cmodel_string, ix86_cmodel): Declare.
 > 
 > 	Spot by Matt Kraai:
 > 	* i386.h (GENERAL_REG_P): Add missing REG_P.
 > 
 > Here's a small test case that causes the compiler to ICE when compiled
 > on i686-linux.  The PR is against C++, but my testing used cc1 rather
 > than cc1plus.
 > 
 > -------------------
 > void foo(char *dst, char xchg, char cmp)
 > {
 >   __asm__("lock" "\tcmpxchgb %1, (%2)\t\n"
 >           :"=al"(cmp)
 >           :"dl"(xchg), "r"(dst), "al"(cmp));
 > }
 > -------------------
 > 
 > Output from the mainline compiler:
 > 
 > 7916.c: In function `foo':
 > 7916.c:6: internal compiler error: in instantiate_virtual_regs_1,
 >           at function.c:3898
 > Please submit a full bug report,
 > with preprocessed source if appropriate.
 > See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
 > 
 > I've added this information to the PR.
 > 
 > Jan, if the testcase itself isn't valid then please add that
 > information to the PR.
 The testcase is nonsenical ("=al" was probably meant to be "=a")
 but I will try to track down the reason for dying in
 instantiate_virtual_regs_1.  Thanks!
 
 Honza
 > 
 > Janis
 

Comment 4 s.bosscher 2003-03-24 12:24:58 UTC
From: Steven Bosscher <s.bosscher@student.tudelft.nl>
To: gcc-gnats@gcc.gnu.org, hope2see@chol.com, gcc-bugs@gcc.gnu.org,
	nobody@gcc.gnu.org, gcc-prs@gcc.gnu.org, jh@suse.cz
Cc:  
Subject: Re: inline-asm/7916: [3.2/3.3/3.4 regression] ICE in instantiate_virtual_register_1
Date: Mon, 24 Mar 2003 12:24:58 +0100

 The GCC 3.3 ChangeLog suggest that this PR is fixed:
 
 Fri Mar 21 23:14:11 CET 2003  Jan Hubicka  <jh@suse.cz>
 
         PR inline-asm/7916
 
         * function.c (instantiate_virtual_regs_lossage): New function.
         (instantiate_virtual_regs_1): Use it.
         (instantiate_virtual_regs): Do not continue in substition when 
 insn has
         been deleted.
 
 Honza, if the PR is fixed, can you close the PR?
 
 Greetz
 Steven
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7916
 
Comment 5 Jan Hubicka 2003-03-24 19:08:33 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed on 3.3/mainline
Comment 6 Foster Clap 2012-01-20 05:21:03 UTC
My college mate Travin, who met with an accident and due to some complications the doc’s had to head for an amputation. He was awarded compensation for his partial disability. He required lump sum cash to pay college fees. We decided we not let his year be wasted and took him to Genex Capital – a buyer of structured settlement.   They asked us to relax and go back home. Before the session started they had permission from the court allowing Travin to go ahead and sell annuity payments. We will graduate together next year.
(http://www.genexcapital.com)