Re: [PATCH] x86: Fix compilation bug in kprobes' twobyte_is_boostable

From: Linus Torvalds
Date: Sun Oct 23 2011 - 17:19:43 EST


On Sun, Oct 23, 2011 at 7:07 PM, Josh Stone <jistone@xxxxxxxxxx> wrote:
>
> Unfortunately, no.  Whatever const-propagation gcc is doing here
> (somewhat wrongly per PR50571) is not affected by volatile on that cast.
>  I also tried leaving it to the parameter type (no cast), no help.

Oh, ok.

> I just tried removing the const from twobyte_is_boostable[], and that
> also does the trick.  Not sure why I didn't try that first -- I guess
> because I saw all the volatiles in bitops.  Is that more palatable, or
> would you still rather try to fix it in bitops.h directly?

I guess there's no nice bitops.h fix, so maybe the minimal "remove
const" is the right thing to do.

>>  - Long long ago, we had that "big array" approach for ADDR too. So
>> we've wavered between the volatile and using a block memory op. But
>> we've used the "volatile" for a long time now for the bit change ones,
>> so I don't think we should mix concepts like your patch.
>
> Do you recall why it settled on volatile?  That seems like the less
> descriptive of the two approaches.  But "long long ago" appears to be
> beyond recorded (git) history...

Yeah, it's really long ago. Iirc the reason it got removed was that
there were gcc versions that were unhappy about it, we've had problems
in this area before..

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/