/[grub]/grub2/aclocal.m4
ViewVC logotype

Diff of /grub2/aclocal.m4

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by okuji, Sat Jul 9 09:34:39 2005 UTC revision 1.5 by okuji, Sat Aug 13 18:44:14 2005 UTC
# Line 300  AC_DEFUN(grub_I386_CHECK_REGPARM_BUG, Line 300  AC_DEFUN(grub_I386_CHECK_REGPARM_BUG,
300  AC_MSG_CHECKING([if GCC has the regparm=3 bug])  AC_MSG_CHECKING([if GCC has the regparm=3 bug])
301  AC_CACHE_VAL(grub_cv_i386_check_nested_functions,  AC_CACHE_VAL(grub_cv_i386_check_nested_functions,
302  [AC_RUN_IFELSE([AC_LANG_SOURCE(  [AC_RUN_IFELSE([AC_LANG_SOURCE(
303  [[int *p;  [[
304    static int
305    test (int *n)
306    {
307      return *n == -1;
308    }
309    
310  int  static int
311  main ()  testfunc (int __attribute__ ((__regparm__ (3))) (*hook) (int a, int b, int *c))
312  {  {
313    int test;    int a = 0;
314      int b = 0;
315      int c = -1;
316      return hook (a, b, &c);
317    }
318    
319    int __attribute__ ((__regparm__ (3))) nestedfunc (int a, int b, int c)  int
320    main (void)
321    {
322      int __attribute__ ((__regparm__ (3))) nestedfunc (int a, int b, int *c)
323      {      {
324        return (&test == p);        return a == b && test (c);
325      }      }
326        return testfunc (nestedfunc) ? 0 : 1;
   p = &test;  
   return ! nestedfunc (0, 0, 0);  
327  }  }
328  ]])],  ]])],
329          [grub_cv_i386_check_nested_functions=yes],          [grub_cv_i386_check_nested_functions=no],
330          [grub_cv_i386_check_nested_functions=no])])          [grub_cv_i386_check_nested_functions=yes])])
331    
332  AC_MSG_RESULT([$grub_cv_i386_check_nested_functions])  AC_MSG_RESULT([$grub_cv_i386_check_nested_functions])
333    
# Line 326  if test "x$grub_cv_i386_check_nested_fun Line 336  if test "x$grub_cv_i386_check_nested_fun
336          [__attribute__ ((__regparm__ (2)))],          [__attribute__ ((__regparm__ (2)))],
337          [Catch gcc bug])          [Catch gcc bug])
338  else  else
339    AC_DEFINE([NESTED_FUNC_ATTR], [], [Catch gcc bug])  dnl Unfortunately, the above test does not detect a bug in gcc-4.0.
340    dnl So use regparm 2 until a better test is found.
341      AC_DEFINE([NESTED_FUNC_ATTR],
342            [__attribute__ ((__regparm__ (2)))],
343            [Catch gcc bug])
344  fi  fi
345  ])  ])

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26