This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/57362] [4.8/4.9 Regression] unsupported __attribute__((target())) values appear to cause loop and/or pathological behavior
- From: "tmsriram at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 22 May 2013 23:46:00 +0000
- Subject: [Bug c++/57362] [4.8/4.9 Regression] unsupported __attribute__((target())) values appear to cause loop and/or pathological behavior
- Auto-submitted: auto-generated
- References: <bug-57362-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57362
--- Comment #3 from Sriraman Tallam <tmsriram at google dot com> ---
Patch proposed to fix this problem,
This happens when a subset of versions are invalid because of unrecognized
target string name or if a dispatcher for that is not available. When
constructing the versions array to dispatch, the index used here is wrong.
PR 57362
* config/i386/i386.c (dispatch_function_versions): Use actual_versions
to index into function_version_info.
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c (revision 199219)
+++ config/i386/i386.c (working copy)
@@ -29061,10 +29061,10 @@ dispatch_function_versions (tree dispatch_decl,
if (predicate_chain == NULL_TREE)
continue;
+ function_version_info [actual_versions].version_decl = version_decl;
+ function_version_info [actual_versions].predicate_chain =
predicate_chain;
+ function_version_info [actual_versions].dispatch_priority = priority;
actual_versions++;
- function_version_info [ix - 1].version_decl = version_decl;
- function_version_info [ix - 1].predicate_chain = predicate_chain;
- function_version_info [ix - 1].dispatch_priority = priority;
}
/* Sort the versions according to descending order of dispatch priority.
The