public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/22017] [3.4/4.0/4.1 Regression] Error to pass struct parameter when compile with mingw's gcc.exe using "-march=i386 -mrtd" flags
       [not found] <bug-22017-10808@http.gcc.gnu.org/bugzilla/>
@ 2005-10-22 21:52 ` pinskia at gcc dot gnu dot org
  2005-10-31  3:45 ` mmitchel at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-22 21:52 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical


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


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

* [Bug target/22017] [3.4/4.0/4.1 Regression] Error to pass struct parameter when compile with mingw's gcc.exe using "-march=i386 -mrtd" flags
       [not found] <bug-22017-10808@http.gcc.gnu.org/bugzilla/>
  2005-10-22 21:52 ` [Bug target/22017] [3.4/4.0/4.1 Regression] Error to pass struct parameter when compile with mingw's gcc.exe using "-march=i386 -mrtd" flags pinskia at gcc dot gnu dot org
@ 2005-10-31  3:45 ` mmitchel at gcc dot gnu dot org
  2005-10-31  4:30 ` dannysmith at users dot sourceforge dot net
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-10-31  3:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from mmitchel at gcc dot gnu dot org  2005-10-31 03:45 -------
Leaving at P2, only because Cygwin is not a primary platform.  (Otherwise, I'd
make this P1.)


-- 


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


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

* [Bug target/22017] [3.4/4.0/4.1 Regression] Error to pass struct parameter when compile with mingw's gcc.exe using "-march=i386 -mrtd" flags
       [not found] <bug-22017-10808@http.gcc.gnu.org/bugzilla/>
  2005-10-22 21:52 ` [Bug target/22017] [3.4/4.0/4.1 Regression] Error to pass struct parameter when compile with mingw's gcc.exe using "-march=i386 -mrtd" flags pinskia at gcc dot gnu dot org
  2005-10-31  3:45 ` mmitchel at gcc dot gnu dot org
@ 2005-10-31  4:30 ` dannysmith at users dot sourceforge dot net
  2006-02-16 11:31 ` [Bug target/22017] [3.4/4.0/4.1/4.2 Regression] Error to pass struct parameter when compile with -mrtd rguenth at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: dannysmith at users dot sourceforge dot net @ 2005-10-31  4:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from dannysmith at users dot sourceforge dot net  2005-10-31 04:30 -------
This is an i386 bug, not specific to  MS windows target.  However, it is only a
problem with -mtune=i386 -mrtd. 

Danny


-- 


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


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

* [Bug target/22017] [3.4/4.0/4.1/4.2 Regression] Error to pass struct parameter when compile with -mrtd
       [not found] <bug-22017-10808@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2005-10-31  4:30 ` dannysmith at users dot sourceforge dot net
@ 2006-02-16 11:31 ` rguenth at gcc dot gnu dot org
  2006-02-16 12:29 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-02-16 11:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from rguenth at gcc dot gnu dot org  2006-02-16 11:31 -------
I can reproduce this on i586-pc-linux-gnu with -Os -mrtd.  As analyzed, the
failure occours with -mrtd if a call to memcpy is generated.  The following
testcase fails for me with -mrtd and passes without it for 3.4.5, 4.0.2, 4.1.0
and mainline using the C frontend:

extern void abort(void);

struct st_t {
    int m_i;
    char m_ch[260];
};

void foo(int *pInt, struct st_t st)
{
    if (*pInt != 123
        || st.m_i != 1
        || st.m_ch[0] != 2)
      abort();
}

int main()
{
    int i = 123;

    struct st_t st;
    st.m_i = 1;
    st.m_ch[0] = 2;

    foo(&i, st);
    return 0;
}

Still using -mrtd is not common at least for non-mingw targets.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 GCC target triplet|i386-*-mingw32              |i?86-*-*
      Known to fail|3.4.2 3.4.3 3.4.4           |3.4.2 3.4.3 3.4.4 3.4.5
                   |                            |4.0.2 4.1.0 4.2.0
            Summary|[3.4/4.0/4.1/4.2 Regression]|[3.4/4.0/4.1/4.2 Regression]
                   |Error to pass struct        |Error to pass struct
                   |parameter when compile with |parameter when compile with
                   |mingw's gcc.exe using "-    |-mrtd
                   |march=i386 -mrtd" flags     |
   Target Milestone|4.0.3                       |3.4.6


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


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

* [Bug target/22017] [3.4/4.0/4.1/4.2 Regression] Error to pass struct parameter when compile with -mrtd
       [not found] <bug-22017-10808@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2006-02-16 11:31 ` [Bug target/22017] [3.4/4.0/4.1/4.2 Regression] Error to pass struct parameter when compile with -mrtd rguenth at gcc dot gnu dot org
@ 2006-02-16 12:29 ` pinskia at gcc dot gnu dot org
  2006-02-16 13:22 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-16 12:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pinskia at gcc dot gnu dot org  2006-02-16 12:29 -------
Milestone should be 4.0.3 pre agreement with GDR and Mark.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2005-06-12 15:08:24         |2006-02-16 12:29:22
               date|                            |
   Target Milestone|3.4.6                       |4.0.3


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


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

* [Bug target/22017] [3.4/4.0/4.1/4.2 Regression] Error to pass struct parameter when compile with -mrtd
       [not found] <bug-22017-10808@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2006-02-16 12:29 ` pinskia at gcc dot gnu dot org
@ 2006-02-16 13:22 ` rguenth at gcc dot gnu dot org
  2006-02-16 13:25 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-02-16 13:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from rguenth at gcc dot gnu dot org  2006-02-16 13:22 -------
The problem is that we do not honour the override decl for memcpy simply
because
for expand_call ("foo(&i, st);") we end up in emit_block_move_via_libcall which
builds yet another "memcpy" decl via expr.c:init_block_move_fn().  Yay.


-- 


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


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

* [Bug target/22017] [3.4/4.0/4.1/4.2 Regression] Error to pass struct parameter when compile with -mrtd
       [not found] <bug-22017-10808@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2006-02-16 13:22 ` rguenth at gcc dot gnu dot org
@ 2006-02-16 13:25 ` rguenth at gcc dot gnu dot org
  2006-02-16 13:34 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-02-16 13:25 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 643 bytes --]



------- Comment #11 from rguenth at gcc dot gnu dot org  2006-02-16 13:25 -------
The problem is we cannot simply use (implicit_)built_in_decl[BUILT_IN_MEMCPY]
here
either because that one is still the internal one, and if annotating our memcpy
decl with __attribute__((__cdecl__)) we warn:

/tmp/t.c:2: warning: conflicting types for built-in function ‘memcpy’

and keep our one in (implicit_)built_in_decl[BUILT_IN_MEMCPY], still creating
the user overridden one.  But I have no idea how to get our hands on it here.

Still it looks like init_block_move_fn is completely wonky.


-- 


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


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

* [Bug target/22017] [3.4/4.0/4.1/4.2 Regression] Error to pass struct parameter when compile with -mrtd
       [not found] <bug-22017-10808@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2006-02-16 13:25 ` rguenth at gcc dot gnu dot org
@ 2006-02-16 13:34 ` rguenth at gcc dot gnu dot org
  2006-02-16 13:36 ` rguenth at gcc dot gnu dot org
  2006-02-16 15:50 ` rguenth at gcc dot gnu dot org
  9 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-02-16 13:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from rguenth at gcc dot gnu dot org  2006-02-16 13:34 -------
A similar issue is in PR11772 - we fail to account for -mrtd when expanding
calls to builtin functions or functions from libgcc.


-- 


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


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

* [Bug target/22017] [3.4/4.0/4.1/4.2 Regression] Error to pass struct parameter when compile with -mrtd
       [not found] <bug-22017-10808@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2006-02-16 13:34 ` rguenth at gcc dot gnu dot org
@ 2006-02-16 13:36 ` rguenth at gcc dot gnu dot org
  2006-02-16 15:50 ` rguenth at gcc dot gnu dot org
  9 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-02-16 13:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from rguenth at gcc dot gnu dot org  2006-02-16 13:36 -------
It all looks like a mess wrt -mrtd, I'm not going to touch this.


-- 


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


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

* [Bug target/22017] [3.4/4.0/4.1/4.2 Regression] Error to pass struct parameter when compile with -mrtd
       [not found] <bug-22017-10808@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2006-02-16 13:36 ` rguenth at gcc dot gnu dot org
@ 2006-02-16 15:50 ` rguenth at gcc dot gnu dot org
  9 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-02-16 15:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from rguenth at gcc dot gnu dot org  2006-02-16 15:50 -------
Reading the documentation for '-mrtd' I'm tempted to close this as invalid. 
The
user is changing the ABI while still linking to libraries with a different ABI.
 The fact that overriding builtins is not possible is a separate issue, but
that is already covered by 11772 which deals with the case of having a complete
-mrtd toolchain but still builtins are emitted without honouring -mrtd.

At least it's a duplicate, if valid, or invalid.

*** This bug has been marked as a duplicate of 11772 ***


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


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


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

* [Bug target/22017] [3.4/4.0/4.1 Regression] Error to pass struct parameter when compile with mingw's gcc.exe using "-march=i386 -mrtd" flags
  2005-06-11 14:43 [Bug c/22017] New: Error to pass struct parameter when compile with mingw's gcc.exe using "-march=i386 -mrtd" flags lyuzhou at 21cn dot com
                   ` (2 preceding siblings ...)
  2005-07-06 17:03 ` mmitchel at gcc dot gnu dot org
@ 2005-09-27 16:02 ` mmitchel at gcc dot gnu dot org
  3 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 16:02 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.2                       |4.0.3


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


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

* [Bug target/22017] [3.4/4.0/4.1 Regression] Error to pass struct parameter when compile with mingw's gcc.exe using "-march=i386 -mrtd" flags
  2005-06-11 14:43 [Bug c/22017] New: Error to pass struct parameter when compile with mingw's gcc.exe using "-march=i386 -mrtd" flags lyuzhou at 21cn dot com
  2005-06-12 15:08 ` [Bug target/22017] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
  2005-06-13  5:42 ` lyuzhou at 21cn dot com
@ 2005-07-06 17:03 ` mmitchel at gcc dot gnu dot org
  2005-09-27 16:02 ` mmitchel at gcc dot gnu dot org
  3 siblings, 0 replies; 14+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-07-06 17:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2005-07-06 17:03 -------
Postponed until 4.0.2.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.5                       |4.0.2


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


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

* [Bug target/22017] [3.4/4.0/4.1 Regression] Error to pass struct parameter when compile with mingw's gcc.exe using "-march=i386 -mrtd" flags
  2005-06-11 14:43 [Bug c/22017] New: Error to pass struct parameter when compile with mingw's gcc.exe using "-march=i386 -mrtd" flags lyuzhou at 21cn dot com
  2005-06-12 15:08 ` [Bug target/22017] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-06-13  5:42 ` lyuzhou at 21cn dot com
  2005-07-06 17:03 ` mmitchel at gcc dot gnu dot org
  2005-09-27 16:02 ` mmitchel at gcc dot gnu dot org
  3 siblings, 0 replies; 14+ messages in thread
From: lyuzhou at 21cn dot com @ 2005-06-13  5:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From lyuzhou at 21cn dot com  2005-06-13 05:41 -------
I just apply your patch to mingw gcc 3.4.4.
But it seems failed too.

(In reply to comment #3)
> Hi,
> This is what is says in the comments above i386/i386.c:
> ix86_return_pop_args:
>    FUNDECL is the declaration node of the function (as a tree),
>    FUNTYPE is the data type of the function (as a tree),
>    or for a library call it is an identifier node for the subroutine name.
> and indeed , the call to build_decl in init_block_move_fn in expr.c
> (where the call to "mmecpy" is generated) has an identifier node as the
> second arg.
> There appears to be a long-standing thinko in the test for library calls
> in ix86_return_pops_args.
> This patch fixes the memcpy call in the testcase on trunk. I'll do a
> bootstrap and regetest overnight. Could you test on 3.4 branch please.
> 	* config/i386/i386 (ix86_return_pops_args): Test the function
> 	type, not the decl node, when testing for library call.
> Index: i386.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
> retrieving revision 1.829
> diff -c -3 -p -r1.829 i386.c
> *************** ix86_eax_live_at_start_p (void)
> *** 1943,1949 ****
>   int
>   ix86_return_pops_args (tree fundecl, tree funtype, int size)
>   {
> !   int rtd = TARGET_RTD && (!fundecl || TREE_CODE (fundecl) != 
> IDENTIFIER_NODE);
>   
>     /* Cdecl functions override -mrtd, and never pop the stack.  */
>     if (! lookup_attribute ("cdecl", TYPE_ATTRIBUTES (funtype))) {
> --- 1943,1949 ----
>   int
>   ix86_return_pops_args (tree fundecl, tree funtype, int size)
>   {
> !   int rtd = TARGET_RTD  && (!funtype || TREE_CODE (funtype) != 
> IDENTIFIER_NODE);
>   
>     /* Cdecl functions override -mrtd, and never pop the stack.  */
>     if (! lookup_attribute ("cdecl", TYPE_ATTRIBUTES (funtype))) {



-- 


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


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

* [Bug target/22017] [3.4/4.0/4.1 Regression] Error to pass struct parameter when compile with mingw's gcc.exe using "-march=i386 -mrtd" flags
  2005-06-11 14:43 [Bug c/22017] New: Error to pass struct parameter when compile with mingw's gcc.exe using "-march=i386 -mrtd" flags lyuzhou at 21cn dot com
@ 2005-06-12 15:08 ` pinskia at gcc dot gnu dot org
  2005-06-13  5:42 ` lyuzhou at 21cn dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-12 15:08 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-06-12 15:08:24
               date|                            |
            Summary|Error to pass struct        |[3.4/4.0/4.1 Regression]
                   |parameter when compile with |Error to pass struct
                   |mingw's gcc.exe using "-    |parameter when compile with
                   |march=i386 -mrtd" flags     |mingw's gcc.exe using "-
                   |                            |march=i386 -mrtd" flags
   Target Milestone|---                         |3.4.5


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


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

end of thread, other threads:[~2006-02-16 15:50 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-22017-10808@http.gcc.gnu.org/bugzilla/>
2005-10-22 21:52 ` [Bug target/22017] [3.4/4.0/4.1 Regression] Error to pass struct parameter when compile with mingw's gcc.exe using "-march=i386 -mrtd" flags pinskia at gcc dot gnu dot org
2005-10-31  3:45 ` mmitchel at gcc dot gnu dot org
2005-10-31  4:30 ` dannysmith at users dot sourceforge dot net
2006-02-16 11:31 ` [Bug target/22017] [3.4/4.0/4.1/4.2 Regression] Error to pass struct parameter when compile with -mrtd rguenth at gcc dot gnu dot org
2006-02-16 12:29 ` pinskia at gcc dot gnu dot org
2006-02-16 13:22 ` rguenth at gcc dot gnu dot org
2006-02-16 13:25 ` rguenth at gcc dot gnu dot org
2006-02-16 13:34 ` rguenth at gcc dot gnu dot org
2006-02-16 13:36 ` rguenth at gcc dot gnu dot org
2006-02-16 15:50 ` rguenth at gcc dot gnu dot org
2005-06-11 14:43 [Bug c/22017] New: Error to pass struct parameter when compile with mingw's gcc.exe using "-march=i386 -mrtd" flags lyuzhou at 21cn dot com
2005-06-12 15:08 ` [Bug target/22017] [3.4/4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-06-13  5:42 ` lyuzhou at 21cn dot com
2005-07-06 17:03 ` mmitchel at gcc dot gnu dot org
2005-09-27 16:02 ` mmitchel 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).