This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/22017] [3.4/4.0/4.1/4.2 Regression] Error to pass struct parameter when compile with -mrtd



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]