Bug 83481 - Internal compiler error produced by asm statement
Summary: Internal compiler error produced by asm statement
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 8.0
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-02-04 20:02 UTC by Jeff Rubin
Modified: 2007-04-18 16:50 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-02-17 14:35:23 UTC
Embargoed:


Attachments (Terms of Use)

Description Jeff Rubin 2003-02-04 20:02:12 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461)

Description of problem:
Consider the following (admittedly bogus) program:

int main(void) {
	typedef struct {
		int i1,i2,i3,i4;
	} foo_t;
	foo_t f;
	asm ("addl %0,$eax" : "=r" (f) : );
}

Compiling with gcc 3.2 (gcc -S foo.c -o foo.s) produces
foo.c: In function `main':
 foo.c:7: Internal compiler error in instantiate_virtual_regs_1, at 
function.c:3972

Same thing if I delete ",i4", but not if I also delete ",i3" or
",i2, i3" from the struct definition.  I know this is asm and so
is not covered by any standard, but I think this behavior isn't
quite right.  I'm not even convinced that it is correct for it to
work with just "i1" as the only member, although this occurs in
glibc, so things would break if it were made illegal.  Is it possible
to describe just what lvalues should be legal here (for f) and
what the semantics are if f is not an integral type?

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.See description
2.
3.
    

Additional info:

Comment 1 Jakub Jelinek 2003-02-17 14:35:23 UTC
Please file this to http://gcc.gnu.org/gnats.html.
__asm with bogus arguments is IMHO low priority.


Note You need to log in before you can comment on or make changes to this bug.