Building Fatfs makes avr-gcc crash

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

My post belongs to "no forum"  , but is still reachable.

Don't know why it lost the compiler forum tag.

 

Building main.c in fatfs avr-complex:

main.c:699:1: internal compiler error: in push_reload, at reload.c:1360

 

https://www.avrfreaks.net/forum/f...

 

 

 

Could a kind mod :-)

Move this thead to the Compiler forum

I wonder how i got it posted without a forum at all.

 

/Bingo

 

Last Edited: Fri. Sep 19, 2014 - 05:09 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just put a #if 0 around the body of everything within main() and then it compiled. So I guess one could use a binary split technique there to find out what it is in main() that the compiler does not like.

 

EDIT: it's something under the top level case 'f':

 

EDIT2: OK it's something in this case:

			case 'l' :	/* fl [<path>] - Directory listing */
				while (*ptr == ' ') ptr++;
				res = f_opendir(&Dir, ptr);
				if (res) { put_rc(res); break; }
				p1 = s1 = s2 = 0;
				for(;;) {
					res = f_readdir(&Dir, &Finfo);
					if ((res != FR_OK) || !Finfo.fname[0]) break;
					if (Finfo.fattrib & AM_DIR) {
						s2++;
					} else {
						s1++; p1 += Finfo.fsize;
					}
					xprintf(PSTR("%c%c%c%c%c %u/%02u/%02u %02u:%02u %9lu  %s"), 
								(Finfo.fattrib & AM_DIR) ? 'D' : '-',
								(Finfo.fattrib & AM_RDO) ? 'R' : '-',
								(Finfo.fattrib & AM_HID) ? 'H' : '-',
								(Finfo.fattrib & AM_SYS) ? 'S' : '-',
								(Finfo.fattrib & AM_ARC) ? 'A' : '-',
								(Finfo.fdate >> 9) + 1980, (Finfo.fdate >> 5) & 15, Finfo.fdate & 31,
								(Finfo.ftime >> 11), (Finfo.ftime >> 5) & 63,
								Finfo.fsize, &(Finfo.fname[0]));
#if _USE_LFN
					for (p2 = strlen(Finfo.fname); p2 < 14; p2++)
						xputc(' ');
					xprintf(PSTR("%s\n"), Lfname);
#else
					xputc('\n');
#endif
				}
				if (res == FR_OK) {
					xprintf(PSTR("%4u File(s),%10lu bytes total\n%4u Dir(s)"), s1, p1, s2);
					if (f_getfree(ptr, (DWORD*)&p1, &fs) == FR_OK)
						xprintf(PSTR(", %10luK bytes free\n"), p1 * fs->csize / 2);
				}
				if (res) put_rc(res);
				break;

EDIT3: As you may have guessed it's that rather complex looking xprintf() in the middle of that.

Last Edited: Fri. Sep 19, 2014 - 11:18 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanx Cliff & Joey

 

Now i know it's not only my TC's that crashes.

 

I'll just drop the ugly xprintf , and get on.

 

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well i had to try if the bug still exists with 4.9.2 , and it does

 

1-avr_complex $ make

-------- begin --------
avr-gcc (GCC) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiling: main.c
avr-gcc -c -mmcu=atmega64 -I. -gdwarf-2 -DF_CPU=14760300UL -DMEDIA=\"MMC\"  -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -save-temps -Wall -Wstrict-prototypes  -Wa,-adhlns=main.lst  -std=gnu99 -MD -MP -MF .dep/main.o.d main.c -o main.o
main.c: In function 'main':
main.c:699:1: internal compiler error: in push_reload, at reload.c:1360
 }
 ^
0x7ad348 push_reload(rtx_def*, rtx_def*, rtx_def**, rtx_def**, reg_class, machine_mode, machine_mode, int, int, int, reload_type)
    ../../../source/gcc-4.9.2/gcc/reload.c:1359
0x7acc3e push_reload(rtx_def*, rtx_def*, rtx_def**, rtx_def**, reg_class, machine_mode, machine_mode, int, int, int, reload_type)
    ../../../source/gcc-4.9.2/gcc/reload.c:1164
0x7b32a6 find_reloads(rtx_def*, int, int, int, short*)
    ../../../source/gcc-4.9.2/gcc/reload.c:4102
0x7c0c7e calculate_needs_all_insns
    ../../../source/gcc-4.9.2/gcc/reload1.c:1503
0x7c0c7e reload(rtx_def*, int)
    ../../../source/gcc-4.9.2/gcc/reload1.c:943
0x6e8890 do_reload
    ../../../source/gcc-4.9.2/gcc/ira.c:5469
0x6e8890 rest_of_handle_reload
    ../../../source/gcc-4.9.2/gcc/ira.c:5598
0x6e8890 execute
    ../../../source/gcc-4.9.2/gcc/ira.c:5627
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [main.o] Error 1

 

 

/Bingo