Re: route(8) core dump, possible gcc(1) related

From: Sean Chittenden <sean_at_chittenden.org>
Date: Sun, 16 Dec 2007 22:23:12 -0800
>> 1033           q = strchr(s,'/');
>> 1034           if (q && which == RTA_DST) {
>> 1035                   *q = '\0';
>> 1036                   if ((val = inet_network(s)) != INADDR_NONE) {
>> 1037                           inet_makenetandmask(
>> 1038                                   val, &su->sin, strtoul(q+1,
>> 0, 0)); 1039                           return (0);
>> 1040                   }
>> 1041                   *q = '/';
>> 1042           }
>>
>> Any comments?
>>
> Preliminary results show that inet_network from libc is somehow
> thrashing $ebx even if it is not supposed to. -O0 disables value
> caching in register and always allocates stack slot for the 'q'
> pointer, so the problem is not visible.


Does setting q to volatile suffice as a workaround for the problem?  I  
was talking to someone last week that said they have taken to using  
volatile as a work around for GCC aligning instructions inside of  
conditionals improperly.  -sc

--
Sean Chittenden
sean_at_chittenden.org
http://sean.chittenden.org/
Received on Mon Dec 17 2007 - 05:49:27 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:24 UTC