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]

Re: Bug report and patch to suggest on triggering related to optimizing out a great deal of code


> attached is compressed mon.i.gz file
> 
> Here is the patch in action:
> 
> [david@lucy color_mon]$ cc -I/m/include -I/usr/include -O -c mon.c -o
> mon.o -
> -save-temps
> mon.c: In function `main':
> mon.c:839: warning: optimizing out a lot of code: try without -O switch
> mon.c:839: Internal compiler error in `build_insn_chain', at
> global.c:1758

Thanks again for your bug report. I have simplified your testcase a
bit (see below), but I could not figure out how to fix the bug. Please
note that it only occurs with -O; it works fine with -O2.

Regards,
Martin

main(int na, char* argv[])
{
	int wflg = 0, tflg = 0;
	int dflg = 0;
	exit(0);
	while(1)
	{
		switch(argv[1][0])
		{
			help:
				exit(0);
			case 'w':
			case 'W':
				wflg = 1;
				break;
			case 't':
			case 'T':
				tflg = 1;
				break;
			case 'd':
				dflg = 1;
				break;
		}
	}
}

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