This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [new-regalloc] Problem on x86 with initialization of ra_reg_info




On Fri, 2 Feb 2001, Geert Bosch wrote:

> On Fri, 2 Feb 2001 13:37:43 -0500 (EST), Daniel Berlin wrote:
> ``Yes it does. There is no point in considering non hard, non fixed
> registers, that are never set, anywhere.''
>
> But the issue is that ra_reg_info[xxx] is 0 for registers that
> are not candidates. Clearly the code below then dereferences a
> nullpointer if reg_num is the number of a register which is not
> a candidate. On the x86 this happens when compiling libgcc2.a (reg_num == 6).
>
> So which of these statements is true:
>   - ra_reg_info[regnum] should not be a null pointer
>   - we should not execute this code when regnum is not a candidate

This one.

>   - the test should check that ra_reg_info[regnum] is not null
>


> Clearly it is not valid to dereference a null pointer...

Right.
I'd like to find the cause, rather than the symptom.
If  we check ra_reg_info[x] for null, we'll never find the real problems,
since we should never have it be null when we actually need the register.
(IE it'll just hide bugs).
 Let me see see if i can  reproduce this problem on my x86.

--Dan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]