[gnu.gcc.bug] "long long int" and pointers

davis@CS.UNC.EDU (Mark Davis) (09/09/89)

Pointers to variables of the type "long long int" do not work properly
for gcc 1.35 and 1.35.98 running on a Sun 3/60 with SunOS 3.5.

When using pointers to deal with long long ints, the value "0" is
returned instead of the expected value.  This behavior is different
than for int, leading me to believe this is a bug.

Here is a example program:
--------------- Cut Here ----------------------------------
main()
{
int i=3,*ip;
long long int lli=4, *llip;
ip = & i;
llip = & lli;
printf("  i=%d,   *ip=%d\nlli=%d, *llip=%d\n",
	i,*ip,lli,*llip);
}
--------------- Cut Here ----------------------------------

Here is a compile and run of the test program.
clocs% gcc -v -o test5 test5.c
gcc version 1.35
 /usr/local/contrib/lib/gcc-cpp -v -undef -D__GNUC__ -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -Dmc68010 test5.c /tmp/cca09780.cpp
GNU CPP version 1.35
 /usr/local/contrib/lib/gcc-cc1 /tmp/cca09780.cpp -quiet -dumpbase test5.c -version -o /tmp/cca09780.s
GNU C version 1.35 (68k, MIT syntax) compiled by GNU C version 1.35.
 as -mc68010 -o test5.o /tmp/cca09780.s
 ld -o test5 /lib/crt0.o test5.o /usr/local/contrib/lib/gcc-gnulib -lc
clocs% test5
  i=3,   *ip=3
lli=4, *llip=0

Notice that i == *ip (the behavior I expected), but lli != *llip.

I did not install version 1.35 of the compiler, but I have every
reason to believe that links were made by running:
	config.gcc sun2

The same bug is present in gcc 1.35.98 with
	config.gcc sun3
	Linked `config.h' to `./config/xm-m68k.h'.
	Linked `tm.h' to `./config/tm-sun3os3.h'.
	Linked `md' to `./config/m68k.md'.
	Linked `aux-output.c' to `./config/out-m68k.c'.
	Links are now set up for use with a sun3.

The symptoms do not change when the -O option is used with either
compiler.

For additional information, please e-mail or phone.

Thanks - Mark (davis@cs.unc.edu or uunet!mcnc!davis)
	 work (919)962-1739  home (919)489-0157