Re: Curious compiler optimization

2021-11-22 Thread Mario Bezzi
Exactly, and I think the same should apply to a "BALR 14,15". mario On 11/22/21 6:46 PM, Charles Mills wrote: Compiler has no way of knowing whether cFunction() has side effects. For example, it might do a printf() that you would "miss" if the call were optimized out. Charles -Original

Re: Curious compiler optimization

2021-11-22 Thread Charles Mills
Compiler has no way of knowing whether cFunction() has side effects. For example, it might do a printf() that you would "miss" if the call were optimized out. Charles -Original Message- From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On Behalf Of Mario Bezz

Re: Curious compiler optimization

2021-11-22 Thread Mario Bezzi
Apparently not.. int cGlue(void *functParms) {  int cFuction(void *);  int functRC = cFunction(functParms);  return 0; } SOURCE,XREF,SSCOMM,LIST,LANGLVL(EXTENDED),LONGNAME,ASM,RENT,OPT(3) 000D8    End of Prolog 02 | * 00

Re: Curious compiler optimization

2021-11-22 Thread Peter Relson
I disagree Mario. Your set of assembled instructions definitely produced some result, but you ended the C program with " return 0; " The __ASM indicated that the only outputs are an internal variable (functRC) and registers (that won't be preserved to the caller). I don't remember if there is