Bug 121081 - (gcc-core-dump-1) inline function with "asm" statements cause gcc to abend
inline function with "asm" statements cause gcc to abend
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc (Show other bugs)
3.0
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-04-16 17:53 EDT by Lee Morrow
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-04-22 11:50:10 EDT
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 Lee Morrow 2004-04-16 17:53:24 EDT
Description of problem:

cc -O3 -fno-strict-aliasing -fpic -W -Wall -Wsign-compare -Wpointer-
arith -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -
Wshadow -Werror -c module.c -o module.o

module.c: In function `functionName':
module.c:125: Internal compiler error in output_pic_addr_const, at 
config/i386/i386.c:6140

The aforementioned error occurs when inlining a procedure with 
embedded assembly code.  It happens with a variety of assembler 
snippets very consistently.  When the function is not-inlined, the 
compilation proceeds successfully.  Even the separate module 
containing the non-inlined assembly compiles without a problem.

When the asm() code is shortened and the name space  is very clean 
(few or no header files included and therefore little or no defines, 
typedefs, etc.) the error becomes as follows:

module.c: In function `functionName':
module.c:125: invalid `asm': invalid expression as operand

And if the asm() code is shortened even more it compiles correctly.

Now this seems like a lovely solution except ... I need all of the 
assembly instructions there.

PLEASE NOTE!!! The problem does not happen with gcc 2.95.3 or gcc 
3.3.1 from SuSE.  I will retest with an older version of RedHat 7.2 
gcc.  Since the code was originally developed there, I believe it did 
not have the problem.



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

gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-20)

How reproducible:

Everytime

Steps to Reproduce:
1.Call for details.
2.
3.
  
Actual results:

module.c: In function `functionName':
module.c:125: Internal compiler error in output_pic_addr_const, at 
config/i386/i386.c:6140

and

module.c: In function `functionName':
module.c:125: invalid `asm': invalid expression as operand




Expected results:

Successful compilation of module.c

Additional info:
Comment 1 Jakub Jelinek 2004-04-19 03:39:27 EDT
You need to provide a preprocessed testcase.
Thanks.
Comment 2 Lee Morrow 2004-04-22 11:50:10 EDT
Resolved buffer overrun core dump in GCC source.  Please close the 
call.

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