home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.arch      Apparently more than just beeps & boops      131,241 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 130,164 of 131,241   
   Anton Ertl to Niklas Holsti   
   Re: branch splitting   
   06 Nov 25 17:52:32   
   
   From: anton@mips.complang.tuwien.ac.at   
      
   Niklas Holsti  writes:   
   >On 2025-11-05 7:17, Anton Ertl wrote:   
   >> Stallman obviously knew what to say about their semantics when he   
   >> added labels-as-values to GNU C with gcc 2.0.   
   >   
   >   
   >I don't know what Stallman said, or would have said if asked, but I   
   >guess something like "the semantics is a jump to the (address of the)   
   >label to which the value refers", which is machine-level semantics and   
   >not semantics in the abstract C machine.   
      
   You can look at his specification in the documentation of, say, 7th   
   edition Unix (where Ritchie apparently took the effort to document   
   semantics), and see how he specified that.  I doubt he specified   
   "semantics in the abstract C machine", but I expect that he specified   
   semantics at the C level.   
      
   Concerning how Stallman documented it, you can look at the gcc   
   documentation from 2.0 until Stallman passed maintainership on   
   (gcc-2.7?).   
      
   If you look at the curent documentation   
   , it talks   
   about the "address of a label" and "jump to one", which you might   
   consider to be a machine-level description.  You can also describe   
   this at a C source level or "C abstract machine" level, but I don't   
   expect the description to become any clearer.   
      
   >The problem in the abstract C machine is a "goto label-value" statement   
   >where the label-value refers to a label in a different function. Does   
   >gcc prevent that at compile time? If not, I would expect the semantics   
   >to be Undefined Behavior, the usual cop-out when nothing useful can be said.   
      
   The gcc documentation says:   
      
   |You may not use this mechanism to jump to code in a different   
   |function. If you do that, totally unpredictable things happen.   
      
   - anton   
   --   
   'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'   
     Mitch Alsup,    
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca