Skip to content
Snippets Groups Projects
  • H.J. Lu's avatar
    51f8ac33
    x86-64: Find a scratch register for large model profiling · 51f8ac33
    H.J. Lu authored
    2 scratch registers, %r10 and %r11, are available at function entry for
    large model profiling.  But %r10 may be used by stack realignment and we
    can't use %r10 in this case.  Add x86_64_select_profile_regnum to find
    a caller-saved register which isn't live or a callee-saved register
    which has been saved on stack in the prologue at entry for large model
    profiling and sorry if we can't find one.
    
    gcc/
    
    	PR target/113689
    	* config/i386/i386.cc (x86_64_select_profile_regnum): New.
    	(x86_function_profiler): Call x86_64_select_profile_regnum to
    	get a scratch register for large model profiling.
    
    gcc/testsuite/
    
    	PR target/113689
    	* gcc.target/i386/pr113689-1.c: New file.
    	* gcc.target/i386/pr113689-2.c: Likewise.
    	* gcc.target/i386/pr113689-3.c: Likewise.
    51f8ac33
    History
    x86-64: Find a scratch register for large model profiling
    H.J. Lu authored
    2 scratch registers, %r10 and %r11, are available at function entry for
    large model profiling.  But %r10 may be used by stack realignment and we
    can't use %r10 in this case.  Add x86_64_select_profile_regnum to find
    a caller-saved register which isn't live or a callee-saved register
    which has been saved on stack in the prologue at entry for large model
    profiling and sorry if we can't find one.
    
    gcc/
    
    	PR target/113689
    	* config/i386/i386.cc (x86_64_select_profile_regnum): New.
    	(x86_function_profiler): Call x86_64_select_profile_regnum to
    	get a scratch register for large model profiling.
    
    gcc/testsuite/
    
    	PR target/113689
    	* gcc.target/i386/pr113689-1.c: New file.
    	* gcc.target/i386/pr113689-2.c: Likewise.
    	* gcc.target/i386/pr113689-3.c: Likewise.