On Fri, Feb 09, 2018 at 07:01:25PM -0200, Alexandre Oliva wrote:
> So, as discussed on IRC, I'm trying to use a target hook to allow
> targets to indicate that their length attrs have been assessed for this
> purpose, and a param to make that overridable, but I'm having trouble
> initializing the param from the target hook.  How does one do that?

Better in the default version of the target hook check the param
whether it should return true or false, and for analyzed targets
just use an always true (or false, depending on what the hook is)
as the hook.

> By disabling it altogether, we won't get the assembler checks or
> incorrect view numbers in debug info, but we will get plenty of all-zero
> locview lists.  Oh well...  I guess at this point that's better than
> wrong debug info or assembler failures.

For the debugging of the target issues, you can also use a hack:
in final.c for instructions that have minimum length longer than zero
emit a label right before emitting the insn and after it:
        .if (.Lhacke1 - .Lhackb1) == 0
        .error "zero length"
(or perhaps just:
        .if (. - .Lhack1) == 0
        .error "zero length"
), then make check various targets with that.


Reply via email to