Re[2]: [Gc] Alpha issue running test_stack

Ivan Maidanski ivmai at mail.ru
Mon Oct 22 00:08:36 PDT 2012


Hi Michael,

I guess you haven't got time to inspect assembly of broken code (Alpha target).

I think it would be ok for now, just to find which use of AO_EXPECT_FALSE results in broken code and create a workaround avoiding AO_EXPECT_FALSE exactly at that place.
There are only several places to check in atomic_ops_stack.c:

1. AO_stack_push_explicit_aux_release:
  while (AO_EXPECT_FALSE(!AO_compare_and_swap_release(list, next, x_bits)));
->
  while (!AO_compare_and_swap_release(list, next, x_bits));

2. AO_stack_pop_explicit_aux_acquire:
  if (AO_EXPECT_FALSE(first != AO_load(list))) {
->
  if (first != AO_load(list)) {

3. AO_stack_pop_explicit_aux_acquire:
  if (AO_EXPECT_FALSE(!AO_compare_and_swap_release(list, first, next))) {
->
  if (!AO_compare_and_swap_release(list, first, next)) {

Could you please check this?
(It would be good to put some workaround in the upcoming libatomic_ops 7.2 and 7.3alpha4 releases.)

Thank you.

Regards,
Ivan

Wed, 26 Sep 2012 21:52:09 +1200 Michael Cree <mcree at orcon.net.nz>:
>	
>
>
	
	
>
		
		
			
>On Tue 25 September 2012 06:35:18 Ivan Maidanski wrote:
>
> Hi Michael,
>
> 
>
> Mon, 24 Sep 2012 20:43:43 +1200 Michael Cree <mcree at orcon.net.nz>:
>
> > On Sun 23 September 2012 21:44:34 Ivan Maidanski wrote:
>
> > > Hi Michael, Thorsten and Wouter,
>
> > > 
>
> > > A couple of months, You reported libatomic_ops-7.3alpaha test_stack
>
> > > failure on Alpha, PowerPC and m68k: *
>
> > > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=680100
>
> > > * http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=680066
>
> > > 
>
> > > 1. Could you please verify that the problem exists in the recent
>
> > 
>
> > > libatomic_ops-7.2:
>
> > On Alpha the test_stack failure is not present in the release-7_2 branch
>
> > but is present in master.  It therefore looks like a regression.
>
> > 
>
> 
>
> > I bisected between the head of the release-7_2 branch and master which
>
> > results in:
>
> > 
>
> > cc51941b02fddc75952831eb8e28b06d340d2bef is the first bad commit
>
> > commit cc51941b02fddc75952831eb8e28b06d340d2bef
>
> > Author: Ivan Maidanski <ivmai at mail.ru>
>
> > Date:   Mon Mar 26 08:06:19 2012 +0400
>
> > 
>
> >     Use __builtin_expect in CAS failure loop condition checks (GCC only)
>
>
> 
>
> Looks like.
>
> Will something like this (for master) fix the problem on alpha?:
>
> src/atomic_ops.h:
>
> 
>
> #if __GNUC__ >= 3 && !defined(LINT2)
>
> # define AO_EXPECT_FALSE(expr) __builtin_expect(expr, 0)
>
> 
>
> ->
>
> 
>
> #if __GNUC__ >= 3 && !defined(LINT2) && !defined(__alpha__)
>
> # define AO_EXPECT_FALSE(expr) __builtin_expect(expr, 0)
>
>
Yep, that fixes it, but as you state below that is not a real fix.
>
>
> If yes then, right, this is gcc/alpha bug. A more precise workaround
>
> (targeting particular AO_EXPECT_FALSE use) could done then.
>
>
When I get a chance I'll take a look at the code generated by gcc about one of 
>
the AO_EXPECT_FALSEs and see if I can spot any problems.
>
>
Cheers
>
Michael.
>
_______________________________________________
>
Gc mailing list
>Gc at linux.hpl.hp.com
>http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
>
			
		
		
	

	
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://napali.hpl.hp.com/pipermail/gc/attachments/20121022/4aff3727/attachment.htm


More information about the Gc mailing list