+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
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;
}
-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
-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.
--- /dev/null
+/* { 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" } } */