public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/11884] New: Bad address passed to function with > 8 arguments
@ 2003-08-11 19:27 sdowning at fame dot com
  2003-08-11 19:29 ` [Bug c/11884] " sdowning at fame dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: sdowning at fame dot com @ 2003-08-11 19:27 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: Bad address passed to function with > 8 arguments
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sdowning at fame dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: hppa64-hp-hpux11.11
  GCC host triplet: hppa64-hp-hpux11.11
GCC target triplet: hppa64-hp-hpux11.11

The problem occurs on HP-UX 11i, with the 64-bit gcc build.

The symptom occurs when optimization (-O) is turned on.  A wrong
address is being passed to the gets_prt function when arg9 is a
non-int type.  The symptom is demonstrated by the fact that the
printf's of the addresses in many_args and gets_ptr are not the same.


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

* [Bug c/11884] Bad address passed to function with > 8 arguments
  2003-08-11 19:27 [Bug c/11884] New: Bad address passed to function with > 8 arguments sdowning at fame dot com
@ 2003-08-11 19:29 ` sdowning at fame dot com
  2003-08-11 20:07 ` falk at debian dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: sdowning at fame dot com @ 2003-08-11 19:29 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From sdowning at fame dot com  2003-08-11 19:29 -------
Created an attachment (id=4593)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=4593&action=view)
Complete C module demonstrating bug


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

* [Bug c/11884] Bad address passed to function with > 8 arguments
  2003-08-11 19:27 [Bug c/11884] New: Bad address passed to function with > 8 arguments sdowning at fame dot com
  2003-08-11 19:29 ` [Bug c/11884] " sdowning at fame dot com
@ 2003-08-11 20:07 ` falk at debian dot org
  2003-08-11 21:08 ` sdowning at fame dot com
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: falk at debian dot org @ 2003-08-11 20:07 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From falk at debian dot org  2003-08-11 20:07 -------
The differing address doesn't seem like a bug per se to me; gcc might spill it,
reclaim it, and then re-spill to a different place, although that seems unlikely.
So is there any observable wrong behaviour?


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

* [Bug c/11884] Bad address passed to function with > 8 arguments
  2003-08-11 19:27 [Bug c/11884] New: Bad address passed to function with > 8 arguments sdowning at fame dot com
  2003-08-11 19:29 ` [Bug c/11884] " sdowning at fame dot com
  2003-08-11 20:07 ` falk at debian dot org
@ 2003-08-11 21:08 ` sdowning at fame dot com
  2003-08-12 11:18 ` sdowning at fame dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: sdowning at fame dot com @ 2003-08-11 21:08 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From sdowning at fame dot com  2003-08-11 21:08 -------
Subject: Re:  Bad address passed to function with > 8 arguments

"falk at debian dot org" <gcc-bugzilla@gcc.gnu.org> writes:

> ------- Additional Comments From falk at debian dot org  2003-08-11 20:07 -------
> The differing address doesn't seem like a bug per se to me; gcc
> might spill it, reclaim it, and then re-spill to a different place,
> although that seems unlikely.  So is there any observable wrong
> behaviour?

It's definitely a bug.  The address of the variable in the caller MUST
be the same in the caller and callee.  It IS the same address in the
non-optimized build.

If you dereference the address in gets_ptr, the program core dumps.


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

* [Bug c/11884] Bad address passed to function with > 8 arguments
  2003-08-11 19:27 [Bug c/11884] New: Bad address passed to function with > 8 arguments sdowning at fame dot com
                   ` (2 preceding siblings ...)
  2003-08-11 21:08 ` sdowning at fame dot com
@ 2003-08-12 11:18 ` sdowning at fame dot com
  2003-08-23  2:53 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: sdowning at fame dot com @ 2003-08-12 11:18 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From sdowning at fame dot com  2003-08-12 11:18 -------
I didn't mention that I did some dividing and conquering to see that the 
symptom does not occur if there are fewer than 8 parameters before the float 
argument.  The first 8 parameters can be types other than int (in the original 
program before I simplified, it took struct *, unsigned short, int, unsigned 
int, e.g a variety of types before the float).


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

* [Bug c/11884] Bad address passed to function with > 8 arguments
  2003-08-11 19:27 [Bug c/11884] New: Bad address passed to function with > 8 arguments sdowning at fame dot com
                   ` (3 preceding siblings ...)
  2003-08-12 11:18 ` sdowning at fame dot com
@ 2003-08-23  2:53 ` pinskia at gcc dot gnu dot org
  2003-08-24 21:57 ` [Bug optimization/11884] " dhazeghi at yahoo dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-23  2:53 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
   Target Milestone|3.4                         |---


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

* [Bug optimization/11884] Bad address passed to function with > 8 arguments
  2003-08-11 19:27 [Bug c/11884] New: Bad address passed to function with > 8 arguments sdowning at fame dot com
                   ` (4 preceding siblings ...)
  2003-08-23  2:53 ` pinskia at gcc dot gnu dot org
@ 2003-08-24 21:57 ` dhazeghi at yahoo dot com
  2003-11-07 17:12 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-08-24 21:57 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


dhazeghi at yahoo dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
          Component|c                           |optimization


------- Additional Comments From dhazeghi at yahoo dot com  2003-08-24 21:57 -------
Stuart, could you attach the bad assembly to this report? Thanks.


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

* [Bug optimization/11884] Bad address passed to function with > 8 arguments
  2003-08-11 19:27 [Bug c/11884] New: Bad address passed to function with > 8 arguments sdowning at fame dot com
                   ` (5 preceding siblings ...)
  2003-08-24 21:57 ` [Bug optimization/11884] " dhazeghi at yahoo dot com
@ 2003-11-07 17:12 ` pinskia at gcc dot gnu dot org
  2004-01-27 21:30 ` danglin at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-07 17:12 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-11-07 17:12:56
               date|                            |


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

* [Bug optimization/11884] Bad address passed to function with > 8 arguments
  2003-08-11 19:27 [Bug c/11884] New: Bad address passed to function with > 8 arguments sdowning at fame dot com
                   ` (6 preceding siblings ...)
  2003-11-07 17:12 ` pinskia at gcc dot gnu dot org
@ 2004-01-27 21:30 ` danglin at gcc dot gnu dot org
  2004-06-16  6:51 ` [Bug rtl-optimization/11884] " pinskia at gcc dot gnu dot org
  2004-09-15  3:36 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: danglin at gcc dot gnu dot org @ 2004-01-27 21:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From danglin at gcc dot gnu dot org  2004-01-27 21:30 -------
On hppa64, the argument pointer is not a fixed register and the first
call clobbers it.  I believe that a copy of the argument pointer rtx is
created by function.c, but it appears that the addressof pass is not
using the copy but arg_pointer_rtx directly for the address calculation
used in the call to gets_ptr.

It appears you can work around the problem by assigning &arg9 to a
variable before the first call.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2003-11-07 17:12:56         |2004-01-27 21:30:23
               date|                            |


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


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

* [Bug rtl-optimization/11884] Bad address passed to function with > 8 arguments
  2003-08-11 19:27 [Bug c/11884] New: Bad address passed to function with > 8 arguments sdowning at fame dot com
                   ` (7 preceding siblings ...)
  2004-01-27 21:30 ` danglin at gcc dot gnu dot org
@ 2004-06-16  6:51 ` pinskia at gcc dot gnu dot org
  2004-09-15  3:36 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-16  6:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-16 06:51 -------
*** Bug 16010 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mhx-perl at gmx dot net


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


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

* [Bug rtl-optimization/11884] Bad address passed to function with > 8 arguments
  2003-08-11 19:27 [Bug c/11884] New: Bad address passed to function with > 8 arguments sdowning at fame dot com
                   ` (8 preceding siblings ...)
  2004-06-16  6:51 ` [Bug rtl-optimization/11884] " pinskia at gcc dot gnu dot org
@ 2004-09-15  3:36 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-15  3:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-09-15 03:36 -------
Is this now fixed as addressof is now removed?

-- 


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


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

end of thread, other threads:[~2004-09-15  3:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-11 19:27 [Bug c/11884] New: Bad address passed to function with > 8 arguments sdowning at fame dot com
2003-08-11 19:29 ` [Bug c/11884] " sdowning at fame dot com
2003-08-11 20:07 ` falk at debian dot org
2003-08-11 21:08 ` sdowning at fame dot com
2003-08-12 11:18 ` sdowning at fame dot com
2003-08-23  2:53 ` pinskia at gcc dot gnu dot org
2003-08-24 21:57 ` [Bug optimization/11884] " dhazeghi at yahoo dot com
2003-11-07 17:12 ` pinskia at gcc dot gnu dot org
2004-01-27 21:30 ` danglin at gcc dot gnu dot org
2004-06-16  6:51 ` [Bug rtl-optimization/11884] " pinskia at gcc dot gnu dot org
2004-09-15  3:36 ` pinskia at gcc dot gnu dot org

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).