[oss-devel] A small patch for OSS userland
Yair K
cesium2 at gmail.com
Tue Sep 18 14:36:32 EEST 2007
On Tue, 18 Sep 2007 13:09:36 +0200, Clive Wright
<clive_wright at ntlworld.com> wrote:
> Yair K wrote:
>> On Tue, 18 Sep 2007 10:48:55 +0200, François <Revol" <revol at free.fr>>
>> wrote:
>>
>>>> a) When compiling with gcc and "-O -fschedule-insns", gcc (v4.1.3
>>>> and
>>>> v4.2.1 on x86_64) will abort with a quirky "unable to find a register
>>>> to
>>>> spill in class ‘DREG’" message (optimization levels above that simply
>>>> segfault upon being run). I wonder if anyone else is getting those
>>>> too.
>>
>> I forgot to mention that this error happens at gtkvu.c line 293.
>>
>>> That's a classic recurrent gcc bug it uses too many regs for
>>> optimisation then an't find any more. The low number of x86 registers
>>> doesn't help.
>>> Try forcing -On with different n. Try with -fno-expensive-
>>> optimisations.
>>> Try forcing -fno-pic.
>>>
>>
>> I'm compiling for x86_64 which has more registers than ia32. Oddly
>> enough,
>> gcc compiles ossxmix just fine with -m32 added to these switches. In
>> any
>> event I can compile with every -f switch used at level -O3 except for
>> -fschedule-insns, and ossxmix will work. -fno-pic or
>> -fno-expensive-optimization have no effect - either -fschedule-insns is
>> used, and ossxmix will crash, or it isn't used, and ossxmix will work.
>>
> <snip>
> I do not know whether this is relevant but I have had problems with
> compiling ossxmix. It compiles cleanly on i386 using gcc version 4.1.2
> except for one warning:
> ossxmix.c:566: warning: assignment discards qualifiers from pointer
> target type
>
> but attempts to run executable result in a segmentation fault.
>
> As a workaround I have modified gtkvu.c see attached patch.
>
> I wondered if you could check whether patching gtkvu.c has any effect on
> the errors you are experiencing.
Thanks! It doesn't remove the gcc "unable to find a register" message when
"-O -fschedule-insns" is used, but it fixes another (more important) issue:
ossxmix doesn't crash anymore when higher optimization levels are used
(-O2, -O3). I thought earlier that that crash was because of the
-fschedule-insns gcc bug (since gcc man page says that optimization is
turned on in -O2, and I tried removing every "-f" optimization to see
where gcc complains), but apparently it's not. Oddly enough, I can't get
that warning at ossxmix.c:566 regardless of which "-W" setting I use (both
gcc 4.1.3 and gcc 4.2.1). Instead I get these two (with "-Wall"):
ossxmix.c:746: warning: ‘rootwid’ may be used uninitialized in this
function
ossxmix.c:746: warning: ‘gang’ may be used uninitialized in this function
--
Yours,
Yair K.
More information about the oss-devel
mailing list