Bug 121081 (gcc-core-dump-1) - inline function with "asm" statements cause gcc to abend
Summary: inline function with "asm" statements cause gcc to abend
Status: CLOSED NOTABUG
Alias: gcc-core-dump-1
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc   
(Show other bugs)
Version: 3.0
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-04-16 21:53 UTC by Lee Morrow
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-04-22 15:50:10 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 Lee Morrow 2004-04-16 21:53:24 UTC
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 07:39:27 UTC
You need to provide a preprocessed testcase.
Thanks.

Comment 2 Lee Morrow 2004-04-22 15:50:10 UTC
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.