Bug 154116 - gcc -Os generates bad assembler code
gcc -Os generates bad assembler code
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
Blocks: 164805
  Show dependency treegraph
Reported: 2005-04-07 12:03 EDT by D. Hugh Redelmeier
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version: 3.4.4-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-09-05 04:44:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
C code to demonstrate bug (815 bytes, text/plain)
2005-04-07 12:05 EDT, D. Hugh Redelmeier
no flags Details

  None (edit)
Description D. Hugh Redelmeier 2005-04-07 12:03:15 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050323 Firefox/1.0.2 Fedora/1.0.2-1.3.1

Description of problem:
For the included example, gcc generates assembler code that makes the assembler complain.  The assembler code uses an immediate value in a movb that does not fit in a byte.  The original C code does not do this.

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

How reproducible:

Steps to Reproduce:
1. fetch attached file "gcc-inline-bad-byte.c"
2. gcc -Os -c gcc-inline-bad-byte.c

Actual Results:  /tmp/ccDdmcnm.s: Assembler messages:
/tmp/ccDdmcnm.s:9: Warning: 277 shortened to 21

Expected Results:  no error messages

Additional info:

This example is boiled down from driver code being developed by the ivtv project.
Without inlining, there is no bad assembler code (I presume that the resulting code is correct, but I have not looked).
Comment 1 D. Hugh Redelmeier 2005-04-07 12:05:11 EDT
Created attachment 112816 [details]
C code to demonstrate bug
Comment 2 Jakub Jelinek 2005-05-27 11:24:20 EDT
Should be fixed in gcc-3.4.4-1.

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