Bug 31792 - gcc-2.96-69 generates code rejected by assembler
Summary: gcc-2.96-69 generates code rejected by assembler
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
(Show other bugs)
Version: 7.0
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-03-14 18:50 UTC by Alan Peckham
Modified: 2007-04-18 16:32 UTC (History)
0 users

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


Attachments (Terms of Use)

Description Alan Peckham 2001-03-14 18:50:13 UTC
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 19:33:29 UTC
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.