This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR35265


With the middle-end now treating integral types the same if they
have the same representation and properties, expansion that via
validate_args asks for INTEGER_TYPE now also needs to accept
any INTEGRAL_TYPE_P.

Bootstrap and regtest on x86_64-unknown-linux-gnu running.  I'll
commit this to trunk and the branches once that finished successfully.

Richard.

2008-02-20  Richard Guenther  <rguenther@suse.de>

	PR middle-end/35265
	* builtins.c (validate_arg): If we want an INTEGER_TYPE,
	be happy with INTEGRAL_TYPE_P.

	* gcc.dg/builtins-66.c: New testcase.

Index: builtins.c
===================================================================
*** builtins.c	(revision 132479)
--- builtins.c	(working copy)
*************** validate_arg (const_tree arg, enum tree_
*** 10749,10754 ****
--- 10750,10757 ----
      return false;
    else if (code == POINTER_TYPE)
      return POINTER_TYPE_P (TREE_TYPE (arg));
+   else if (code == INTEGER_TYPE)
+     return INTEGRAL_TYPE_P (TREE_TYPE (arg));
    return code == TREE_CODE (TREE_TYPE (arg));
  }
  
Index: testsuite/gcc.dg/builtins-66.c
===================================================================
*** testsuite/gcc.dg/builtins-66.c	(revision 0)
--- testsuite/gcc.dg/builtins-66.c	(revision 0)
***************
*** 0 ****
--- 1,11 ----
+ /* { dg-do compile } */
+ 
+ enum { E0 = 0, E1 = 1, E2 = 2 } e;
+ 
+ int
+ foo (void)
+ {
+   return __builtin_popcount ((int) e);
+ }
+ 
+ /* { dg-final { scan-assembler-not "__builtin_popcount" } } */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]