Bug 659582
Summary: | gcc: internal compiler error: in get_insn_template, at final.c:1726 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | harry muttart <harry> | ||||||
Component: | gcc | Assignee: | Jakub Jelinek <jakub> | ||||||
Status: | CLOSED ERRATA | QA Contact: | qe-baseos-tools-bugs | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | low | ||||||||
Version: | 6.0 | CC: | law, mfranc, pmuller | ||||||
Target Milestone: | rc | ||||||||
Target Release: | --- | ||||||||
Hardware: | x86_64 | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | gcc-4.4.5-5.el6 | Doc Type: | Bug Fix | ||||||
Doc Text: |
Previously, using "always_inline" on a function when compiling with "-g" without any "-O" options would cause the compiler to insert debugging annotations in unexpected locations. Consequently, the unexpected annotations caused the compiler to crash with an internal error. In these updated packages, the compiler is modified to properly handle attributes which change optimization levels, such as always_inline, properly.
|
Story Points: | --- | ||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2011-05-19 13:58:02 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
harry muttart
2010-12-03 03:24:09 UTC
This is a bad interaction between inlining, attribute optimized and the var tracking code. I have a potential patch that I'll be running through the usual battery of tests. Workaround is of course not using optimize or target attributes, they have never been reliable and at least up to 4.6, inclusive, won't be reliable. I probably won't get test results for the fix until late today or early tomorrow as one of my testboxes fried its drive and thus everything in the queue is going take a bit longer. WRT a workaround, the failing file has a single function which uses the optimize attribute, so a simple workaround would be to pull that function out into its own file, remove the optimize attribute and compile the resulting file with -O0. jeff GCC 4.4 tests look good. GCC 4.5 tests in progress. Reduced testcase (compile with -g): void report_fatal_vararg(const char* file_name, int line_no, const char* format, ...) ; typedef class oopDesc* oop; class objectRef { public: long int _objref; inline bool is_heap() const __attribute__ ((always_inline)) { long int sid = (_objref); return (sid==2); } inline oop as_oop() const __attribute__ ((always_inline)) { if( !is_heap()) { report_fatal_vararg("", 304, "" "0x%016lx", _objref ); __asm__ __volatile__("int $3"); }; return (oop)as_address(); } char * as_address() volatile const { return (char *)(_objref); } }; class ObjectSynchronizer{ public: static void lock(objectRef o) __attribute__ ((optimize("O0"))) ; }; void ObjectSynchronizer::lock( objectRef ref) { oop obj=ref.as_oop(); } Created attachment 467488 [details]
Fix bad interaction between inlining, optimize attribute and var-tracking
Jakub -- attached are backports of the two patches from the mainline and gcc-4.5 branches to fix this bug. I'm not sure of the proper procedure for getting them into our gcc-4.4 branch and getting new rpms spun.
I can take care of those issues if you walk me through the process -- it's probably good if we have another engineer familiar with the process.
Jeff
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: a bug in attribute optimize handling has been fixed. Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1 +1,9 @@ -a bug in attribute optimize handling has been fixed.+a bug in attribute optimize handling has been fixed. + +Cause: Using the "always_inline" on a function when compiling with -g and without any -O options would cause the compiler to insert debugging annotations in unexpected locations. The unexpected annotations would cause the compiler to crash with an internal error. + +Consequence: The compiler would crash. + +Fix: The compiler was modified to properly handle attributes which change optimization levels, such as always_inline, properly. + +Result: The compiler no longer crashes when presented with this situation. Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,9 +1 @@ -a bug in attribute optimize handling has been fixed. +Previously, using "always_inline" on a function when compiling with "-g" without any "-O" options would cause the compiler to insert debugging annotations in unexpected locations. Consequently, the unexpected annotations caused the compiler to crash with an internal error. In these updated packages, the compiler is modified to properly handle attributes which change optimization levels, such as always_inline, properly.- -Cause: Using the "always_inline" on a function when compiling with -g and without any -O options would cause the compiler to insert debugging annotations in unexpected locations. The unexpected annotations would cause the compiler to crash with an internal error. - -Consequence: The compiler would crash. - -Fix: The compiler was modified to properly handle attributes which change optimization levels, such as always_inline, properly. - -Result: The compiler no longer crashes when presented with this situation. An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-0663.html |