mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-24 16:30:53 +08:00
builtins.c (set_builtin_user_assembler_name): Also handle ffs if int is smaller than word.
* builtins.c (set_builtin_user_assembler_name): Also handle ffs if int is smaller than word. * gcc.dg/builtin-ffs-1.c: New test. From-SVN: r156646
This commit is contained in:
parent
f25a2b52ab
commit
cbb1ab1040
@ -1,3 +1,8 @@
|
||||
2010-02-10 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* builtins.c (set_builtin_user_assembler_name): Also handle
|
||||
ffs if int is smaller than word.
|
||||
|
||||
2010-02-09 Vladimir Makarov <vmakarov@redhat.com>
|
||||
|
||||
PR middle-end/42973
|
||||
|
@ -13594,6 +13594,14 @@ set_builtin_user_assembler_name (tree decl, const char *asmspec)
|
||||
case BUILT_IN_ABORT:
|
||||
abort_libfunc = set_user_assembler_libfunc ("abort", asmspec);
|
||||
break;
|
||||
case BUILT_IN_FFS:
|
||||
if (INT_TYPE_SIZE < BITS_PER_WORD)
|
||||
{
|
||||
set_user_assembler_libfunc ("ffs", asmspec);
|
||||
set_optab_libfunc (ffs_optab, mode_for_size (INT_TYPE_SIZE,
|
||||
MODE_INT, 0), "ffs");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
2010-02-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
2010-02-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
PR fortran/42999
|
||||
* array.c (gfc_constant_ac): Do not prevent expansion of constructors
|
||||
|
@ -1,4 +1,8 @@
|
||||
2010-02-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
2010-02-10 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
* gcc.dg/builtin-ffs-1.c: New test.
|
||||
|
||||
2010-02-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
PR fortran/42999
|
||||
* gfortran.dg/array_constructor_35.f90: New test.
|
||||
|
17
gcc/testsuite/gcc.dg/builtin-ffs-1.c
Normal file
17
gcc/testsuite/gcc.dg/builtin-ffs-1.c
Normal file
@ -0,0 +1,17 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2" } */
|
||||
|
||||
extern int ffs (int) __asm ("__GI_ffs") __attribute__ ((nothrow, const));
|
||||
|
||||
int
|
||||
ffsll (long long int i)
|
||||
{
|
||||
unsigned long long int x = i & -i;
|
||||
|
||||
if (x <= 0xffffffff)
|
||||
return ffs (i);
|
||||
else
|
||||
return 32 + ffs (i >> 32);
|
||||
}
|
||||
|
||||
/* { dg-final { scan-assembler-not "\nffs\n|\nffs\[^a-zA-Z0-9_\]|\[^a-zA-Z0-9_\]ffs\n" } } */
|
Loading…
x
Reference in New Issue
Block a user