avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [bug #19050] gcrt1.S should call main rather than jumping


From: Anatoly Sokolov
Subject: [avr-libc-dev] [bug #19050] gcrt1.S should call main rather than jumping to it
Date: Tue, 13 Feb 2007 22:28:19 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113

Follow-up Comment #2, bug #19050 (project avr-libc):

In oficial GCC 4.x main() do not converted to a normal function. 'atmega256'
patch does it. 

For fast correction of a bug it is necessary to restore special handling of
main() funcion in 'patch-zz-atmega256x' patch.

These changes should be reverted: 

-  if (main_p)
-    {
-      fprintf (file, ("\t" 
-                     AS1 (ldi,r28) ",lo8(%s - " HOST_WIDE_INT_PRINT_DEC ")" 
CR_TAB
-                     AS1 (ldi,r29) ",hi8(%s - " HOST_WIDE_INT_PRINT_DEC ")" 
CR_TAB
-                     AS2 (out,__SP_H__,r29)     CR_TAB
-                     AS2 (out,__SP_L__,r28) "\n"),
-              avr_init_stack, size, avr_init_stack, size);
-      
-      prologue_size += 4;
-    }
-  else if (minimize && (frame_pointer_needed || live_seq > 6)) 
+  if (minimize && (frame_pointer_needed || live_seq > 6)) 

and:

-  if (main_p)
-    {
-      /* Return value from main() is already in the correct registers
-        (r25:r24) as the exit() argument.  */
-      if (AVR_MEGA)
-       {
-         fputs ("\t" AS1 (jmp,exit) "\n", file);
-         epilogue_size += 2;
-       }
-      else
-       {
-         fputs ("\t" AS1 (rjmp,exit) "\n", file);
-         ++epilogue_size;
-       }
-    }
-  else if (minimize && (frame_pointer_needed || live_seq > 4))
+  if (minimize && (frame_pointer_needed || live_seq > 4))

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?19050>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]