Bug 790221 - g++ crashes compiling "asm goto" insite template function
Summary: g++ crashes compiling "asm goto" insite template function
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 16
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-13 23:23 UTC by Thiago Macieira
Modified: 2012-02-14 15:55 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-14 15:55:54 UTC
Type: ---


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 52247 0 None None None Never

Description Thiago Macieira 2012-02-13 23:23:24 UTC
Description of problem:
When trying to compile the following C++ source code, gcc crashes:

template<typename T> bool ref(T &x)
{ 
    asm goto("jz %l[no]" : : : : no); 
    return true; 
no: 
    return false; 
} 
int main(int argc, char **argv) { return ref(argc); }

Version-Release number of selected component (if applicable):
gcc-4.6.2-1.fc16.x86_64
gcc (GCC) 4.6.2 20111027 (Red Hat 4.6.2-1)

How reproducible:
Always

Steps to Reproduce:
1. Compile the above program
  
Actual results:
GCC crashes:
<stdin>: In function ‘bool ref(T&) [with T = int]’:
<stdin>:1:158: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.


Expected results:
The code is compiled.

Additional info:
GCC developers do not usually like bug reports on patched GCC versions, so I am reporting first to Fedora.

Comment 1 Jakub Jelinek 2012-02-14 15:55:54 UTC
Tracking this upstream - http://gcc.gnu.org/PR52247


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