[Bug target/27234] no way to stop gcc from mucking with the incoming argument stack on ia32

2008-04-29 Thread hubicka at gcc dot gnu dot org


--- Comment #20 from hubicka at gcc dot gnu dot org  2008-04-29 15:40 
---
Created an attachment (id=15546)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15546&action=view)
New patch

Hi,
this patch implements idea of having temporary read-only register with
REG_EQUIV note that will get propagated to place of the read-write parameter
register.
However I am still midly confused, when reload is actually using the operand
slot in read-write way?  I don't seem to be able to construct a testcase.
If reload is not doing that, perhaps just dropping the function.c part of patch
is easiest way around.

Honza


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27234



[Bug target/27234] no way to stop gcc from mucking with the incoming argument stack on ia32

2008-04-24 Thread hubicka at gcc dot gnu dot org


--- Comment #19 from hubicka at gcc dot gnu dot org  2008-04-24 16:05 
---
I am going to make patch that will with preserve-stack attribute in addition to
inhibitting libcall also put REG_EQUIV notes on a copy instead of argument
register itself that should be sufficient to prevent reload from re-using the
slot.

I think we need to add a temporary register with REG_EQUIV note that will be
copypropagated if argument is read only (or to read only parts) so
rematerialization works.

Honza


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27234



[Bug target/27234] no way to stop gcc from mucking with the incoming argument stack on ia32

2008-04-11 Thread jakub at gcc dot gnu dot org


--- Comment #18 from jakub at gcc dot gnu dot org  2008-04-11 10:25 ---
Seems I forgot to provide the testcase I was talking about.  Here it is:

__attribute__((preserve_stack)) void f1 (int a, int b, int c, int d, int e)
{
  int i;
  for (i = 0; i < 50; i++)
{
  // Simulate high register pressure, I'm lazy
  asm volatile ("" : : "r" (e) : "%eax", "%ebx", "%ecx", "%edx", "%esi");
  e++;
  asm volatile ("" : : "r" (d) : "%eax", "%ebx", "%ecx", "%edx", "%esi");
}
}

__attribute__((preserve_stack)) void f2 (int a, int b, int c, int d, int e)
{
  int i;
  for (i = 0; i < 50; i++)
{
  asm volatile ("" : : "m" (e) : "%eax", "%ebx", "%ecx", "%edx", "%esi",
"%edi");
  e++;
}
}

extern int fn (int, int);

__attribute__((preserve_stack)) int f3 (int a, int b)
{
  return fn (b, a);
}

__attribute__((preserve_stack)) int f4 (int a, int b)
{
  return fn (a, b);
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27234



[Bug target/27234] no way to stop gcc from mucking with the incoming argument stack on ia32

2008-04-10 Thread jakub at gcc dot gnu dot org


--- Comment #17 from jakub at gcc dot gnu dot org  2008-04-10 18:13 ---
x86_64 actually isn't a problem, as it passes integral arguments in registers
(and kernel only uses at most 6 syscall arguments).  Structures aren't passed
by value.


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

Summary|no way to stop gcc from |no way to stop gcc from
   |mucking with the incoming   |mucking with the incoming
   |argument stack on   |argument stack on ia32
   |ia32/x86_64 |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27234



[Bug target/27234] no way to stop gcc from mucking with the incoming argument stack on ia32/x86_64

2008-04-10 Thread jakub at gcc dot gnu dot org


--- Comment #16 from jakub at gcc dot gnu dot org  2008-04-10 18:09 ---
>From the kernel people it would be interesting to hear on which targets they
actually need it (e.g. if it is i?86 only, it would be better implemented as
i?86 specific syscall_linkage attribute).


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27234