Bug 8803

Summary: [3.2/3.3/3.4 regression] Internal compiler error in instantiate_virtual_regs_1, at function.c:3974
Product: gcc Reporter: anonymous
Component: inline-asmAssignee: Jan Hubicka <hubicka>
Status: RESOLVED FIXED    
Severity: normal CC: ebotcazou, gcc-bugs, s.bosscher
Priority: P3 Keywords: ice-on-invalid-code
Version: 3.2.1   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:
Attachments: test.cc

Description anonymous 2002-12-03 13:36:01 UTC
I'm playing with MMX for the first time, so it's possible that
the enclosed code isn't quite legal.

Release:
gcc-3.2.1 (and gcc-3.2)

Environment:
Linux-2.4.19 on Athlon and Linux-2.5.17 on PII
glibc-2.2.4

How-To-Repeat:
g++ -o test test.cc
Comment 1 Wolfgang Bangerth 2002-12-04 13:47:53 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed. A simpler testcase is
    ------------------------------------
    void f (unsigned char * u) {
      char U1U2U3U4 [8];
      asm ("pxor %[U], %[U]\n\t"
           "punpacklbw %[u], %[U]\n\t"
           : [U] "=y" (*U1U2U3U4)
           : [u] "m" (*u));
    }
    --------------------------
    on which I get (with 3.2.2pre and 3.3pre)
    tmp/g> /home/bangerth/bin/gcc-3.0.4/bin/gcc -c test.cc
    test.cc: In function `void f(unsigned char*)':
    test.cc:5: parse error before `[' token
    tmp/g> /home/bangerth/bin/gcc-3.2/bin/gcc -c test.cc
    test.cc: In function `void f(unsigned char*)':
    test.cc:7: Internal compiler error in instantiate_virtual_regs_1, at function.c
       :3972
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
    
    
    The code did not compile with 3.0.4, since apparently
    some syntax about [U] in the asm statement is not understood.
    Nevertheless, that it now ICEs is a regression, so I mark it 
    as that.
Comment 2 s.bosscher 2003-03-24 20:37:00 UTC
From: Steven Bosscher <s.bosscher@student.tudelft.nl>
To: gcc-gnats@gcc.gnu.org, anonymous@sources.redhat.com,
	gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-prs@gcc.gnu.org
Cc:  
Subject: Re: inline-asm/8803: [3.2/3.3/3.4 regression] Internal compiler error
 in instantiate_virtual_regs_1, at function.c:3974
Date: Mon, 24 Mar 2003 20:37:00 +0100

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8803
 
 This still happens on todays 3.3 branch.
 
 # gcc-3.3 -c 8803.c
 8803.c: In function `f':
 8803.c:5: error: impossible constraint in `asm'
 
 # gcc-3.3 -c 8803.c -O
 8803.c: In function `f':
 8803.c:7: internal compiler error: in fixup_var_refs_1, at function.c:1945
 Please submit a full bug report,
 with preprocessed source if appropriate.
 See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
 
 Greetz
 Steven
 
 
Comment 3 Eric Botcazou 2003-04-08 19:13:37 UTC
Responsible-Changed-From-To: unassigned->hubicka
Responsible-Changed-Why: Submitted a fix.
Comment 4 Jan Hubicka 2003-04-10 22:25:29 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed on mainline and 3.3 branch