diff options
author | Richard Guenther <rguenther@suse.de> | 2008-02-20 17:25:52 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2008-02-20 17:25:52 +0000 |
commit | 4cd8e76f1d5a3023e1faed30cef00270103c330d (patch) | |
tree | 8859bcc1e459f16a199213b97b933e7436f588cf | |
parent | a99c05392be32119390de08703da62079ee5eac2 (diff) | |
download | gcc-4cd8e76f1d5a3023e1faed30cef00270103c330d.zip gcc-4cd8e76f1d5a3023e1faed30cef00270103c330d.tar.gz gcc-4cd8e76f1d5a3023e1faed30cef00270103c330d.tar.bz2 |
re PR middle-end/35265 (__builtin_popcount expansion bug)
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.
From-SVN: r132485
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/builtins.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/builtins-66.c | 11 |
4 files changed, 25 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5fa81dc..495a476 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 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. + +2008-02-20 Richard Guenther <rguenther@suse.de> + * fold-const.c (split_tree): Associate floatig-point expressions if flag_associative_math is set. diff --git a/gcc/builtins.c b/gcc/builtins.c index 1c14050..5e6ebf5 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -5192,6 +5192,7 @@ expand_builtin_fabs (tree exp, rtx target, rtx subtarget) return NULL_RTX; arg = CALL_EXPR_ARG (exp, 0); + CALL_EXPR_ARG (exp, 0) = arg = builtin_save_expr (arg); mode = TYPE_MODE (TREE_TYPE (arg)); op0 = expand_expr (arg, subtarget, VOIDmode, EXPAND_NORMAL); return expand_abs (mode, op0, target, 0, safe_from_p (target, arg, 1)); @@ -10749,6 +10750,8 @@ validate_arg (const_tree arg, enum tree_code code) 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)); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8b9fb37..04c799f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2008-02-20 Richard Guenther <rguenther@suse.de> + PR middle-end/35265 + * gcc.dg/builtins-66.c: New testcase. + +2008-02-20 Richard Guenther <rguenther@suse.de> + * gcc.dg/fold-reassoc-1.c: New testcase. * gcc.dg/tree-ssa/recip-3.c: Adjust to not compute d/d. diff --git a/gcc/testsuite/gcc.dg/builtins-66.c b/gcc/testsuite/gcc.dg/builtins-66.c new file mode 100644 index 0000000..87bea3f --- /dev/null +++ b/gcc/testsuite/gcc.dg/builtins-66.c @@ -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" } } */ |