This is the mail archive of the gcc-patches@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]

Re: [PATCH] Fix PR other/16820 (struct-layout-1 failures on non-I


> > So is there someway to force -fno-common to be used with this test or
> > has that already been done?  It looked to me like the compile time patch
> > 
> >   http://gcc.gnu.org/ml/gcc-patches/2004-07/msg02654.html
> > 
> > to remove the use of complex.h still hadn't been checked in and I
> > thought maybe it was because of this runtime problem.
> 
> I think it was because Jakub's patch wasn't reviewed.  The enclosed
> change shows how I added -fno-common.  The `-DDBG' was just added
> for debugging.  It should be possible to only add this option on
> hppa*-*-hpux* but I didn't fully work out how to do that.

Here is a patch to do the hppa*-*-hpux* check and add -fno-common just
for that platform.  Combined with Jakubs patch it fixed almost all the
layout failures on HP-UX platforms.  There is 1 remaining layout failure
on PA32 and 2 on PA64.  IA64 has a real problem with long-double varargs
that causes failures and I am looking into that.

Can someone approve this patch and Jakubs so we can get rid of these
spurious errors?

Steve Ellcey
sje@cup.hp.com


2004-09-29  Steve Ellcey  <sje@cup.hp.com>

	* gcc.dg/compat/struct-layout-1_generate.c (switchfiles):  Use
	-fno-common when on HPPA HP-UX platforms.


*** gcc.orig/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c	Wed Sep 29 15:24:58 2004
--- gcc/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c	Wed Sep 29 15:24:41 2004
*************** switchfiles (int fields)
*** 550,555 ****
--- 550,556 ----
      }
    fprintf (outfile, "\
  /* { dg-options \"-I%s\" } */\n\
+ /* { dg-options \"-I%s -fno-common\" { target hppa*-*-hpux* } } */\n\
  #include \"struct-layout-1.h\"\n\
  \n\
  #define TX(n, type, attrs, fields, ops) extern void test##n (void);\n\
*************** int main (void)\n\
*** 564,570 ****
    if (fails)\n\
      abort ();\n\
    exit (0);\n\
! }\n", srcdir, filecnt, filecnt);
    fclose (outfile);
    sprintf (destptr, "t%03d_x.c", filecnt);
    outfile = fopen (destbuf, "w");
--- 565,571 ----
    if (fails)\n\
      abort ();\n\
    exit (0);\n\
! }\n", srcdir, srcdir, filecnt, filecnt);
    fclose (outfile);
    sprintf (destptr, "t%03d_x.c", filecnt);
    outfile = fopen (destbuf, "w");
*************** int main (void)\n\
*** 572,581 ****
      goto fail;
    fprintf (outfile, "\
  /* { dg-options \"-w -I%s\" } */\n\
  #include \"struct-layout-1_x1.h\"\n\
  #include \"t%03d_test.h\"\n\
  #include \"struct-layout-1_x2.h\"\n\
! #include \"t%03d_test.h\"\n", srcdir, filecnt, filecnt);
    fclose (outfile);
    sprintf (destptr, "t%03d_y.c", filecnt);
    outfile = fopen (destbuf, "w");
--- 573,583 ----
      goto fail;
    fprintf (outfile, "\
  /* { dg-options \"-w -I%s\" } */\n\
+ /* { dg-options \"-w -I%s -fno-common\" { target hppa*-*-hpux* } } */\n\
  #include \"struct-layout-1_x1.h\"\n\
  #include \"t%03d_test.h\"\n\
  #include \"struct-layout-1_x2.h\"\n\
! #include \"t%03d_test.h\"\n", srcdir, srcdir, filecnt, filecnt);
    fclose (outfile);
    sprintf (destptr, "t%03d_y.c", filecnt);
    outfile = fopen (destbuf, "w");
*************** int main (void)\n\
*** 583,592 ****
      goto fail;
    fprintf (outfile, "\
  /* { dg-options \"-w -I%s\" } */\n\
  #include \"struct-layout-1_y1.h\"\n\
  #include \"t%03d_test.h\"\n\
  #include \"struct-layout-1_y2.h\"\n\
! #include \"t%03d_test.h\"\n", srcdir, filecnt, filecnt);
    fclose (outfile);
    sprintf (destptr, "t%03d_test.h", filecnt);
    outfile = fopen (destbuf, "w");
--- 585,595 ----
      goto fail;
    fprintf (outfile, "\
  /* { dg-options \"-w -I%s\" } */\n\
+ /* { dg-options \"-w -I%s -fno-common\" { target hppa*-*-hpux* } } */\n\
  #include \"struct-layout-1_y1.h\"\n\
  #include \"t%03d_test.h\"\n\
  #include \"struct-layout-1_y2.h\"\n\
! #include \"t%03d_test.h\"\n", srcdir, srcdir, filecnt, filecnt);
    fclose (outfile);
    sprintf (destptr, "t%03d_test.h", filecnt);
    outfile = fopen (destbuf, "w");


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