[Bug target/53735] thumb1 spill failure with -Os

2013-08-05 Thread rearnsha at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53735

Richard Earnshaw rearnsha at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #5 from Richard Earnshaw rearnsha at gcc dot gnu.org ---
Realistically, we're never going to be able to fix this.  You've tied the
compilers hands behind it's back and it's then unable to keep its balance when
you give it a push.

In Thumb1 code, when optimizing for space, you've got just r0-r6 available in
general (r7 is used for the frame pointer).  Your source code tries to use all
7 of them (a1[r0]-a4[r3], v1[r4], r5 and v3[r6]).  That just leaves r7 (the
frame pointer) for the compiler to use for everything, so it's no surprise that
things then fall apart.


[Bug target/53735] thumb1 spill failure with -Os

2012-07-26 Thread zhenqiang.chen at linaro dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53735

zhenqiang.chen at linaro dot org changed:

   What|Removed |Added

 CC||zhenqiang.chen at linaro
   ||dot org

--- Comment #4 from zhenqiang.chen at linaro dot org 2012-07-26 07:50:25 UTC ---
Root cause: r8-r11 is not available for THUMB1 with -Os.

In function arm_conditional_register_usage (arm.c), you can find the code

  if (TARGET_THUMB1  optimize_size)
{
  /* When optimizing for size on Thumb-1, it's better not
to use the HI regs, because of the overhead of
stacking them.  */
  for (regno = FIRST_HI_REGNUM;
   regno = LAST_HI_REGNUM; ++regno)
fixed_regs[regno] = call_used_regs[regno] = 1;
}

If removing the code, the result is OK (r8 is used).


[Bug target/53735] thumb1 spill failure with -Os

2012-07-24 Thread zhuolin.liu at arm dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53735

zhuolin liu zhuolin.liu at arm dot com changed:

   What|Removed |Added

 CC||zhuolin.liu at arm dot com

--- Comment #3 from zhuolin liu zhuolin.liu at arm dot com 2012-07-24 
09:04:15 UTC ---
simple code

fork() fails to assemble with -mthumb -Os, works with -O2 instead of -Os.

register int aa5 __asm__ (r4) ;
register int aa6 __asm__ (r5) ;
struct pthread
{
  int tid;
  int pid;
  int ss[128];
};
int add_lock;
int fork (void)
{
   int * meself = __builtin_thread_pointer () - 1;
if (add_lock !=(int)meself)
  {
__lll_lock_wait_private (0);
  }
  register int __a1 __asm__ (a1)=1;
  register int _v3 __asm__ (v3) = 1;
  int _v1tmp = (int) (((struct pthread *)__builtin_thread_pointer () -
1)-tid);
   register int __a2 __asm__ (a2) =1;
   register int __a3 __asm__ (a3) =1;
   register int __a4 __asm__ (a4) =1;
   register int _v1 __asm__ (v1) = _v1tmp;
   __asm__ __volatile__ ( \n : :r (_v3) , r (__a1), r (__a2), r
(__a3), r (__a4), r (_v1) :);
}


[Bug target/53735] thumb1 spill failure with -Os

2012-07-17 Thread ramana at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53735

Ramana Radhakrishnan ramana at gcc dot gnu.org changed:

   What|Removed |Added

   Keywords|assemble-failure|
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2012-07-17
 Ever Confirmed|0   |1
  Known to fail||4.8.0

--- Comment #2 from Ramana Radhakrishnan ramana at gcc dot gnu.org 2012-07-17 
09:34:05 UTC ---
It's really not an assemble failure. The problem is in the compiler and it
looks prima-facie like ICE on valid code.


[Bug target/53735] thumb1 spill failure with -Os

2012-06-20 Thread aldot at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53735

--- Comment #1 from Bernhard Reutner-Fischer aldot at gcc dot gnu.org 
2012-06-20 18:58:06 UTC ---
Created attachment 27668
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=27668
reduced source