public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: target/5977: ia64 corruption in struct args passed by value
@ 2002-03-19 14:26 rth
  0 siblings, 0 replies; 4+ messages in thread
From: rth @ 2002-03-19 14:26 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, janis187, rth

Synopsis: ia64 corruption in struct args passed by value

State-Changed-From-To: analyzed->closed
State-Changed-By: rth
State-Changed-When: Tue Mar 19 14:26:18 2002
State-Changed-Why:
    2002-03-19  Richard Henderson  <rth@redhat.com>
    
            * config/ia64/ia64.c: Revert 2002-03-01 patch.
            * config/ia64/ia64.h (INIT_EXPANDERS): New.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5977


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: target/5977: ia64 corruption in struct args passed by value
@ 2002-03-17 13:36 jakub
  0 siblings, 0 replies; 4+ messages in thread
From: jakub @ 2002-03-17 13:36 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, jakub, janis187, rth

Synopsis: ia64 corruption in struct args passed by value

Responsible-Changed-From-To: jakub->rth
Responsible-Changed-By: jakub
Responsible-Changed-When: Sun Mar 17 13:36:47 2002
Responsible-Changed-Why:
    This got broken by http://gcc.gnu.org/ml/gcc-patches/2002-03/msg00056.html
    virtual_incoming_arg_rtx accesses are created by move_block_from_reg
    called from function.c (assign_parms) [FUNCTION_ARG_PARTIAL_NREGS].
    If the va-arg-5.c case cannot be solved in another way,
    setting FIRST_PARM_OFFSET to -current_function_pretend_args_size
    and ARG_POINTER_CFA_OFFSET to 0, though I'm not sure whether
    fix_lexical_addr would work properly in that case.
    
State-Changed-From-To: open->analyzed
State-Changed-By: jakub
State-Changed-When: Sun Mar 17 13:36:47 2002
State-Changed-Why:
    Slightly shorter testcase
    struct S { int i[9]; };
    
    struct S gs1, gs2;
    
    void
    init (struct S *p, int i)
    {
      int j;
      for (j = 0; j < 9; j++)
        p->i[j] = i + j;
    }
    
    void
    check (struct S *p, int i)
    {
      int j;
      for (j = 0; j < 9; j++)
        if (p->i[j] != i + j) abort ();
    }
    
    void
    bar (struct S s1, struct S s2)
    {
      check (&s1, 10);
      check (&s2, 20);
    }
    
    int
    main ()
    {
      init (&gs1, 10);
      check (&gs1, 10);
      init (&gs2, 20);
      check (&gs2, 20);
      bar (gs1, gs2);
    
      exit (0);
    }

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5977


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: target/5977: ia64 corruption in struct args passed by value
@ 2002-03-16  1:14 jakub
  0 siblings, 0 replies; 4+ messages in thread
From: jakub @ 2002-03-16  1:14 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, jakub, janis187, nobody

Synopsis: ia64 corruption in struct args passed by value

Responsible-Changed-From-To: unassigned->jakub
Responsible-Changed-By: jakub
Responsible-Changed-When: Sat Mar 16 01:14:49 2002
Responsible-Changed-Why:
    Mine.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5977


^ permalink raw reply	[flat|nested] 4+ messages in thread

* target/5977: ia64 corruption in struct args passed by value
@ 2002-03-15 15:56 janis187
  0 siblings, 0 replies; 4+ messages in thread
From: janis187 @ 2002-03-15 15:56 UTC (permalink / raw)
  To: gcc-gnats


>Number:         5977
>Category:       target
>Synopsis:       ia64 corruption in struct args passed by value
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 15 15:56:02 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Janis Johnson
>Release:        gcc version 3.1 20020315 (prerelease)
>Organization:
>Environment:
Itanium, Red Hat Linux release 7.1.94 (Roswell)
>Description:
The 3.1 prerelease compiler for ia64-unknown-linux-gnu has
problems when passing struct arguments by value from a
function to which they were also passed by value.  This
shows up with the SPEC CPU2000 benchmark program 175.vpr,
but the test case here bears no resemblance to the
original code.

This is a regression from GCC 3.0.4.
>How-To-Repeat:
Compile the test case on ia64 with default options; when run
it will abort.
>Fix:
Unknown.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="bug.c"
Content-Disposition: inline; filename="bug.c"

/* This test case fails at runtime when compiled, with any options, with
   gcc version 3.1 20020315 (prerelease) on ia64-unknown-linux-gnu.

   It passes two structs by value to a function that then passes them by
   value to another function, in which the values of the second struct
   argument are corrupted.  */

struct S {
  int i1;
  int i2;
  int i3;
  int i4;
  int i5;
  int i6;
  int i7;
  int i8;
  int i9;
};

struct S gs1, gs2;

void
init (struct S *p, int i)
{
  p->i1 = 1 + i;
  p->i2 = 2 + i;
  p->i3 = 3 + i;
  p->i4 = 4 + i;
  p->i5 = 5 + i;
  p->i6 = 6 + i;
  p->i7 = 7 + i;
  p->i8 = 8 + i;
  p->i9 = 9 + i;
}

void
check (struct S *p, int i)
{
  if (p->i1 != 1 + i) abort ();
  if (p->i2 != 2 + i) abort ();
  if (p->i3 != 3 + i) abort ();
  if (p->i4 != 4 + i) abort ();
  if (p->i5 != 5 + i) abort ();
  if (p->i6 != 6 + i) abort ();
  if (p->i7 != 7 + i) abort ();
  if (p->i8 != 8 + i) abort ();
  if (p->i9 != 9 + i) abort ();
}

void
bar (struct S s1, struct S s2)
{
  check (&s1, 10);
  check (&s2, 20);
}

void
foo (struct S s1, struct S s2)
{
  bar (s1, s2);
}

int
main ()
{
  init (&gs1, 10);
  check (&gs1, 10);
  init (&gs2, 20);
  check (&gs2, 20);
  foo (gs1, gs2);

  exit (0);
}


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-03-19 22:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-19 14:26 target/5977: ia64 corruption in struct args passed by value rth
  -- strict thread matches above, loose matches on Subject: below --
2002-03-17 13:36 jakub
2002-03-16  1:14 jakub
2002-03-15 15:56 janis187

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).