public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* RTL type checking and '0' format codes
@ 1999-08-16 16:17 Zack Weinberg
  1999-08-23 23:38 ` Jeffrey A Law
  1999-08-31 23:20 ` Zack Weinberg
  0 siblings, 2 replies; 6+ messages in thread
From: Zack Weinberg @ 1999-08-16 16:17 UTC (permalink / raw)
  To: gcc

I have been looking into implementing type checking for RTL, much like
the type checking for trees we already have.  The various XFOO
macros would check the slot against the format, and abort if it was
invalid.

'0' format codes cause problems.  '0' is documented to mean that the
slot is only valid in a specific pass, and should be ignored
otherwise.  They aren't initialized in gen_rtx_FOO, and they're
ignored in generic copy-or-examine-RTL code.

Most '0' slots are always addressed with a specific type, but the
information on their type isn't in the format.  LABEL_NUSES,
JUMP_LABEL, LABEL_REFS, LABEL_NEXTREF, and CONTAINING_INSN are like
this.  We would like to type check them.

In NOTEs, '0' means that the slot can contain any of five different
things depending on what sort of NOTE it is.

In ADDRESSOF, '0' is used because someone was too lazy to fix
everything to understand 't'. :)


What I'd like to do is eliminate '0' in favor of a set of codes that
carry type info and indicate that this slot is only valid sometimes.
We need analogues for 's', 'i', and 'e'.  We also need a type code for
bb info.  I'd use 'F', 'I', 'R', and 'B' respectively (F for file, R
for reference).  In addition, I want to replace NOTE with a family of
RTL types, one for each possible meaning of a negative
NOTE_LINE_NUMBER.

This is a fairly major undertaking, but doesn't require great skill,
and I've already found a few bugs while doing the feasibility study.
The benefits of type-checking RTL are obvious.

Comments?

zw

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: RTL type checking and '0' format codes
  1999-08-16 16:17 RTL type checking and '0' format codes Zack Weinberg
@ 1999-08-23 23:38 ` Jeffrey A Law
  1999-08-24  0:02   ` Zack Weinberg
  1999-08-31 23:20   ` Jeffrey A Law
  1999-08-31 23:20 ` Zack Weinberg
  1 sibling, 2 replies; 6+ messages in thread
From: Jeffrey A Law @ 1999-08-23 23:38 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: gcc

  In message < 199908162310.QAA09148@zack.bitmover.com >you write:
  > 
  > I have been looking into implementing type checking for RTL, much like
  > the type checking for trees we already have.  The various XFOO
  > macros would check the slot against the format, and abort if it was
  > invalid.
Excellent!  We actually had someone working on this earlier, but we could never
get a copyright assignment for the work, so it never got integrated.

  > '0' format codes cause problems.  '0' is documented to mean that the
  > slot is only valid in a specific pass, and should be ignored
  > otherwise.  They aren't initialized in gen_rtx_FOO, and they're
  > ignored in generic copy-or-examine-RTL code.
Right.

  > Most '0' slots are always addressed with a specific type, but the
  > information on their type isn't in the format.  LABEL_NUSES,
  > JUMP_LABEL, LABEL_REFS, LABEL_NEXTREF, and CONTAINING_INSN are like
  > this.  We would like to type check them.
I'd punt initially and get the basic checking code installed.  Then return
to this issue.

jeff


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: RTL type checking and '0' format codes
  1999-08-23 23:38 ` Jeffrey A Law
@ 1999-08-24  0:02   ` Zack Weinberg
  1999-08-31 23:20     ` Zack Weinberg
  1999-08-31 23:20   ` Jeffrey A Law
  1 sibling, 1 reply; 6+ messages in thread
From: Zack Weinberg @ 1999-08-24  0:02 UTC (permalink / raw)
  To: law; +Cc: gcc

Jeffrey A Law wrote:
>   In message < 199908162310.QAA09148@zack.bitmover.com >you write:
>   > 
>   > I have been looking into implementing type checking for RTL, much like
>   > the type checking for trees we already have.
[...]
>   > Most '0' slots are always addressed with a specific type, but the
>   > information on their type isn't in the format.  LABEL_NUSES,
>   > JUMP_LABEL, LABEL_REFS, LABEL_NEXTREF, and CONTAINING_INSN are like
>   > this.  We would like to type check them.
> I'd punt initially and get the basic checking code installed.  Then return
> to this issue.

Agree, and I'm actually testing a patch that does this even as we
speak.  It has knock-on effects all over the code and my patch backlog
is getting quite large, so I won't be able to submit it for awhile.

zw

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: RTL type checking and '0' format codes
  1999-08-23 23:38 ` Jeffrey A Law
  1999-08-24  0:02   ` Zack Weinberg
@ 1999-08-31 23:20   ` Jeffrey A Law
  1 sibling, 0 replies; 6+ messages in thread
From: Jeffrey A Law @ 1999-08-31 23:20 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: gcc

  In message < 199908162310.QAA09148@zack.bitmover.com >you write:
  > 
  > I have been looking into implementing type checking for RTL, much like
  > the type checking for trees we already have.  The various XFOO
  > macros would check the slot against the format, and abort if it was
  > invalid.
Excellent!  We actually had someone working on this earlier, but we could never
get a copyright assignment for the work, so it never got integrated.

  > '0' format codes cause problems.  '0' is documented to mean that the
  > slot is only valid in a specific pass, and should be ignored
  > otherwise.  They aren't initialized in gen_rtx_FOO, and they're
  > ignored in generic copy-or-examine-RTL code.
Right.

  > Most '0' slots are always addressed with a specific type, but the
  > information on their type isn't in the format.  LABEL_NUSES,
  > JUMP_LABEL, LABEL_REFS, LABEL_NEXTREF, and CONTAINING_INSN are like
  > this.  We would like to type check them.
I'd punt initially and get the basic checking code installed.  Then return
to this issue.

jeff


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RTL type checking and '0' format codes
  1999-08-16 16:17 RTL type checking and '0' format codes Zack Weinberg
  1999-08-23 23:38 ` Jeffrey A Law
@ 1999-08-31 23:20 ` Zack Weinberg
  1 sibling, 0 replies; 6+ messages in thread
From: Zack Weinberg @ 1999-08-31 23:20 UTC (permalink / raw)
  To: gcc

I have been looking into implementing type checking for RTL, much like
the type checking for trees we already have.  The various XFOO
macros would check the slot against the format, and abort if it was
invalid.

'0' format codes cause problems.  '0' is documented to mean that the
slot is only valid in a specific pass, and should be ignored
otherwise.  They aren't initialized in gen_rtx_FOO, and they're
ignored in generic copy-or-examine-RTL code.

Most '0' slots are always addressed with a specific type, but the
information on their type isn't in the format.  LABEL_NUSES,
JUMP_LABEL, LABEL_REFS, LABEL_NEXTREF, and CONTAINING_INSN are like
this.  We would like to type check them.

In NOTEs, '0' means that the slot can contain any of five different
things depending on what sort of NOTE it is.

In ADDRESSOF, '0' is used because someone was too lazy to fix
everything to understand 't'. :)


What I'd like to do is eliminate '0' in favor of a set of codes that
carry type info and indicate that this slot is only valid sometimes.
We need analogues for 's', 'i', and 'e'.  We also need a type code for
bb info.  I'd use 'F', 'I', 'R', and 'B' respectively (F for file, R
for reference).  In addition, I want to replace NOTE with a family of
RTL types, one for each possible meaning of a negative
NOTE_LINE_NUMBER.

This is a fairly major undertaking, but doesn't require great skill,
and I've already found a few bugs while doing the feasibility study.
The benefits of type-checking RTL are obvious.

Comments?

zw

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: RTL type checking and '0' format codes
  1999-08-24  0:02   ` Zack Weinberg
@ 1999-08-31 23:20     ` Zack Weinberg
  0 siblings, 0 replies; 6+ messages in thread
From: Zack Weinberg @ 1999-08-31 23:20 UTC (permalink / raw)
  To: law; +Cc: gcc

Jeffrey A Law wrote:
>   In message < 199908162310.QAA09148@zack.bitmover.com >you write:
>   > 
>   > I have been looking into implementing type checking for RTL, much like
>   > the type checking for trees we already have.
[...]
>   > Most '0' slots are always addressed with a specific type, but the
>   > information on their type isn't in the format.  LABEL_NUSES,
>   > JUMP_LABEL, LABEL_REFS, LABEL_NEXTREF, and CONTAINING_INSN are like
>   > this.  We would like to type check them.
> I'd punt initially and get the basic checking code installed.  Then return
> to this issue.

Agree, and I'm actually testing a patch that does this even as we
speak.  It has knock-on effects all over the code and my patch backlog
is getting quite large, so I won't be able to submit it for awhile.

zw

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1999-08-31 23:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-08-16 16:17 RTL type checking and '0' format codes Zack Weinberg
1999-08-23 23:38 ` Jeffrey A Law
1999-08-24  0:02   ` Zack Weinberg
1999-08-31 23:20     ` Zack Weinberg
1999-08-31 23:20   ` Jeffrey A Law
1999-08-31 23:20 ` Zack Weinberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).