Profiling suddenly broken for powerpc-aix4.1 (gcc-2.96 19990612)

David Edelsohn dje@watson.ibm.com
Mon Jun 14 14:42:00 GMT 1999


	The problem is not a missing asm_fprintf, but that asm_fprintf
does not perform assembler dialect selection on arguments as I had
assumed.  I needed to expand the code so that RS6000_CALL_GLUE was the
format string itself.

	One might consider it a mistake to use the assembler dialect to
choose the call glue instruction because it really should be a selection
based upon architecture (POWER versus PowerPC).  The difference is
optimization, not correctness.  The dialects match the architectures and
this method is consistent with AIX XLC behavior.  If one manually mixes
architectures and assembler dialects, one is departing from a normal
environment anyway.

	It still is nicer to use the simplified "nop" mnemonic instead of
"ori 0,0,0", so the dialect still would come into play if architecture
were the actual choice.

David

Index: rs6000.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.73
diff -c -p -r1.73 rs6000.c
*** rs6000.c	1999/06/09 16:01:47	1.73
--- rs6000.c	1999/06/14 21:25:49
*************** output_prolog (file, size)
*** 4077,4083 ****
  #else
  #ifdef RS6000_CALL_GLUE
        if (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT)
! 	fprintf (file, "\t%s\n", RS6000_CALL_GLUE);
  #endif
  #endif
  
--- 4077,4087 ----
  #else
  #ifdef RS6000_CALL_GLUE
        if (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_NT)
! 	{
! 	  putc('\t', file);
! 	  asm_fprintf (file, RS6000_CALL_GLUE);
! 	  putc('\n', file);
! 	}
  #endif
  #endif
  
*************** output_function_profiler (file, labelno)
*** 5093,5100 ****
        asm_fprintf (file, TARGET_32BIT ? "\t{l|lwz} %s," : "\tld %s,",
  		   reg_names[3]);
        assemble_name (file, buf);
!       asm_fprintf (file, "(%s)\n\tbl %s\n\t%s\n",
! 		   reg_names[2], RS6000_MCOUNT, RS6000_CALL_GLUE);
  
    /* Restore parameter registers and static chain.  */
  
--- 5097,5105 ----
        asm_fprintf (file, TARGET_32BIT ? "\t{l|lwz} %s," : "\tld %s,",
  		   reg_names[3]);
        assemble_name (file, buf);
!       asm_fprintf (file, "(%s)\n\tbl %s\n\t", reg_names[2], RS6000_MCOUNT);
!       asm_fprintf (file, RS6000_CALL_GLUE);
!       putc('\n', file);
  
    /* Restore parameter registers and static chain.  */
  


More information about the Gcc-patches mailing list