gnu/126488: Compiling with gcc -pg produces immediately crashing executables

Ronald F.Guilmette rfg at
Wed Aug 13 01:30:03 UTC 2008

>Number:         126488
>Category:       gnu
>Synopsis:       Compiling with gcc -pg produces immediately crashing executables
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 13 01:30:02 UTC 2008
>Originator:     Ronald F. Guilmette
>Release:        FreeBSD 7.0-RELEASE i386
Infinite Monkeys & Co. LLC
System: FreeBSD 7.0-RELEASE
Athlon64 processor (It's an AMD LE-1640B to be precise... single core but 64.)

	Compiling & linking just about any program with "gcc -pg" produces
	either an executable that crashes instantly, just inside of main()
	or else an executable where the argc and argv values are hopelessly
	hosed (which can be almost as bad).

	Save the following trivial source file as "test.c" and then compile
	and execute it thusly:

		gcc -pg -o test test.c

	#include <stdlib.h>
	main (register int const argc, register char **const argv)
	  if (!argv) {
	    abort ();
	    return 1;
	  } else
	    return 0;

	...then stand back and watch as the program core dumps.

	Beats me.  I haven't been working on the compiler in some time now.
	I'll help to sort this out, but only if you can't find anybody else
	who's been grunging around in the GCC code more recently than me.

More information about the freebsd-bugs mailing list