]> gcc.gnu.org Git - gcc.git/commitdiff
Fix PR tree-optimization/40219
authorMichael Meissner <meissner@linux.vnet.ibm.com>
Fri, 22 May 2009 21:51:12 +0000 (21:51 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Fri, 22 May 2009 21:51:12 +0000 (21:51 +0000)
From-SVN: r147807

gcc/ChangeLog
gcc/tree.c

index 32c00a6102d943abe15a9b0a91122a0b08195a41..68cbe584ade3717b4061664198b7a92e07c21682 100644 (file)
@@ -1,3 +1,10 @@
+2009-05-21  Michael Meissner  <meissner@linux.vnet.ibm.com>
+
+       PR tree-optimization/40219
+       * tree.c (iterative_hash_expr): Make sure the builtin function is
+       a normal builtin function and not a front end or back end builtin
+       before indexing into the built_in_decls array.
+
 2009-05-22  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/38964
index 2231b4489506817a04b497e7877cb0e1f4c77970..f0e861cb5cd8f4e1be54e61e3ef461e0372aa07c 100644 (file)
@@ -5422,11 +5422,13 @@ iterative_hash_expr (const_tree t, hashval_t val)
        return val;
       }
     case FUNCTION_DECL:
-      /* When referring to a built-in FUNCTION_DECL, use the
-        __builtin__ form.  Otherwise nodes that compare equal
-        according to operand_equal_p might get different
-        hash codes.  */
-      if (DECL_BUILT_IN (t) && built_in_decls[DECL_FUNCTION_CODE (t)])
+      /* When referring to a built-in FUNCTION_DECL, use the __builtin__ form.
+        Otherwise nodes that compare equal according to operand_equal_p might
+        get different hash codes.  However, don't do this for machine specific
+        or front end builtins, since the function code is overloaded in those
+        cases.  */
+      if (DECL_BUILT_IN_CLASS (t) == BUILT_IN_NORMAL
+         && built_in_decls[DECL_FUNCTION_CODE (t)])
        {
          t = built_in_decls[DECL_FUNCTION_CODE (t)];
          code = TREE_CODE (t);
This page took 0.111618 seconds and 5 git commands to generate.