This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATH] PR 5126, fix for m68k PIC optimization bug


Hi,

This fixes a PIC optimization bug on m68k as reported in PR
5126:
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?pr=5126&database=gcc&cmd=view

The test-case for this is in:
http://gcc.gnu.org/ml/gcc-bugs/1999-11n/msg00673.html

The problem is reported against gcc 2.95.3, but is
still present in gcc mainline.



2001-12-01  Craig Rodrigues  <rodrigc@gcc.gnu.org>

	PR target/5126
	* config/m68k/m68k.c: Fix for PIC code generation.




--- m68k.c      2000/07/26 00:18:31     1.1.1.1
+++ m68k.c      2001/12/15 17:19:16
@@ -462,7 +462,8 @@
                                  -cfa_store_offset + n_regs++ * 4);
        }
     }
-  if (flag_pic && current_function_uses_pic_offset_table)
+  if (flag_pic && current_function_uses_pic_offset_table &&
+      regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
     {
 #ifdef MOTOROLA
       asm_fprintf (stream, "\t%Olea (%Rpc, %U_GLOBAL_OFFSET_TABLE_@GOTPC),
%s\n",
-- 
Craig Rodrigues        
http://www.gis.net/~craigr    
rodrigc@mediaone.net          


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]