Bug 31792 - gcc-2.96-69 generates code rejected by assembler
gcc-2.96-69 generates code rejected by assembler
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-03-14 13:50 EST by Alan Peckham
Modified: 2007-04-18 12:32 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-03-14 13:50:16 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Alan Peckham 2001-03-14 13:50:13 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (Win98; U)


Optimized expression produces bad assembler code

Reproducible: Always
Steps to Reproduce:
1. source file follows
2.
3.
	

Actual Results:  $ cc -O /tmp/test.c
/tmp/cc6qpTmE.s: Assembler messages:
/tmp/cc6qpTmE.s:32: Error: `%al' not allowed with `cmpw'


Expected Results:  no errors...

typedef struct {
    int a[100];
    unsigned char b;
} a_t;

void load_a (a_t *a_p) {
    int i; for (i=0;i<100;i++) a_p->a[i]=i; a_p->b = 101;
}

void test_a (a_t *a_p, unsigned b) {
    if (((char) ((a_p->b) - (b))) < 0) a_p->b = b;
}

main () {
    a_t a;
    load_a(&a); test_a(&a,30);
}
Comment 1 Bill Nottingham 2001-03-14 14:33:29 EST
Works fine for me with 2.96-78 and the current binutils.

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