https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119214

--- Comment #15 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Robert Dubner from comment #14)
> (In reply to Richard Biener from comment #13)
> > (In reply to Robert Dubner from comment #7)
> > 
> > Yes.  IMO the least invasive way is to instead use labels.
> > 
> 
> At the present time, I think I want to simply implement the if( !optimize )
> solution.

I agree this is a good solution for GCC 15.

[..]

> Incidentally:  To make all that work, I need a NOP -- an instruction that
> gets a ".loc 1 xxx" location but doesn't do anything, and I couldn't figure
> out how to create a NOP.  I am doing the equivalent of a NOP by creating an
> integer with global scope in libgcobol.so, and I generate
> 
>    gg_assign(var_decl_nop, build_int_cst_type(INT, 106));
> 
> at the points in the executable where I need a NOP.  (Yes, I am solving a
> problem with a write-only variable.  If you let me hang around, you'll
> likely see more goofy stuff like that.  It's not my fault; that stuff comes
> and finds *me*.)
> 
> Is there a proper way of generating a NOP?  It would just be neater.

There's no good way to create a NOP, but I don't understand why you'd need
that.

I'll also note that it's probably worth spending some time thinking about
a better DWARF representation than labels and the way to communicate to
gdb the desired information.  Changing to labels will be quite some work,
esp. on the gdb side I'd guess, and the solution still feels a bit of a
hack.  To me the way COBOL handles PERFORM and specifically the PERFORM
"target" feels hacky as well, of course ;)

Reply via email to