diff mbox

PR 57362

Message ID CAAs8HmyR5bLcTOaG0dJroGsKG8RuJKq0RZ4ccFYm0Sw-T99r6Q@mail.gmail.com
State New
Headers show

Commit Message

Sriraman Tallam May 22, 2013, 11:20 p.m. UTC
Hi,

   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57362

   This ICE reported here happens because the array storing the
function versions that should be processed is not indexed correctly.
This patch fixes this. This only happens when some versions cannot be
dispatched because a dispatcher for that is not available or is an
invalid target.


Is this alright?

Thanks,
Sri

        PR 57362
        * config/i386/i386.c (dispatch_function_versions):  Use
actual_versions to index into
        function_version_info.

   /* Sort the versions according to descending order of dispatch priority.  The

Comments

H.J. Lu May 23, 2013, 12:14 a.m. UTC | #1
On Wed, May 22, 2013 at 4:20 PM, Sriraman Tallam <tmsriram@google.com> wrote:
> Hi,
>
>    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57362
>
>    This ICE reported here happens because the array storing the
> function versions that should be processed is not indexed correctly.
> This patch fixes this. This only happens when some versions cannot be
> dispatched because a dispatcher for that is not available or is an
> invalid target.
>
>
> Is this alright?
>
> Thanks,
> Sri
>
>         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

You should also add the testcase in PR57362.

--
H.J.
diff mbox

Patch

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;
     }