This is the mail archive of the
mailing list for the GCC project.
Re: [new-regalloc] Problem on x86 with initialization of ra_reg_info
- To: Geert Bosch <bosch at gnat dot com>
- Subject: Re: [new-regalloc] Problem on x86 with initialization of ra_reg_info
- From: Daniel Berlin <dberlin at redhat dot com>
- Date: Fri, 2 Feb 2001 14:25:21 -0500 (EST)
- cc: Daniel Berlin <dberlin at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Richard Henderson <rth at redhat dot com>
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
> - the test should check that ra_reg_info[regnum] is not null
> Clearly it is not valid to dereference a null pointer...
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.