Bug 83481

Summary: Internal compiler error produced by asm statement
Product: [Retired] Red Hat Linux Reporter: Jeff Rubin <jbr>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED WONTFIX QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-02-17 14:35:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.