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]

one test case, two bugs (C++ & backend)


The appended test case shows two bugs in the x86 compiler generated
from sources as of 1999-10-06 9:00 PST.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
extern "C"
{
  struct st
  {
#ifdef SECOND
    int a;
# define REST
#else
    int a, b, c, d;
# define REST , 1, 2, 3
#endif
  };
}

class f
{
public:
  int foo (int);
};

class b
{
public:
  int bar (int);
};

int
f::foo (int a)
{
  static const st i = { 0 REST };

  if (i.a == a)
    return 0;
  return 1;
}
int
b::bar (int a)
{
  static const st i = { 0 REST };

  if (i.a == a)
    return 0;
  return 1;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When compiling using

	gcc -c foo.cc

I see

	/tmp/ccmdJBiC.s: Assembler messages:
	/tmp/ccmdJBiC.s:47: Fatal error: Symbol i already defined.

This does not happen with C++ structures.  It's caused by declaring
the `struct st' as extern "C".


This was the original bug.  While investigating this I found the
second.  When compiling

	gcc -c -DSECOND foo.cc

I see

	foo.cc: In method `int f::foo (int)':
	foo.cc:35: Insn does not satisfy its constraints:
	(insn 51 15 17 (set (reg:SI 0 eax)
	        (reg:SI 24)) 36 {*movsi_2} (nil)
	    (nil))
	foo.cc:35: Internal compiler error in `insn_default_length', at insn-attrtab.c:245


The compiler is configured for i686.  Just holler if I should add
these tests to the testsuite.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------


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