[Bug c/38666] internal compiler error: Segmentation fault

2008-12-29 Thread sergstesh at yahoo dot com


--- Comment #1 from sergstesh at yahoo dot com  2008-12-29 21:50 ---
Created an attachment (id=17005)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17005&action=view)
'gcc_bug.i.gz' file produced by 'gcc' and 'gzip' from the input 'gcc_bug.c' one

Source with all the files included. I had to 'gzip' it because otherwise
Bugzilla doesn't accept it because of size.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38666



[Bug c/38666] internal compiler error: Segmentation fault

2008-12-29 Thread sergstesh at yahoo dot com


--- Comment #2 from sergstesh at yahoo dot com  2008-12-29 21:53 ---
The bug is data-dependent. If inside the 'for' loop I replace all the
coefficients with 1.0, the failure is graceful:

cc1: out of memory allocating 4054207356 bytes after a total of 105562112 bytes
.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38666



[Bug c/38666] internal compiler error: Segmentation fault

2008-12-29 Thread sergstesh at yahoo dot com


--- Comment #3 from sergstesh at yahoo dot com  2008-12-29 21:57 ---
No problem occurs with -O0; with -O2, -O3 'gcc' also exits gracefully:

cc1: out of memory allocating 4283978752 bytes after a total of 228749312 bytes
.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38666



[Bug c/38666] internal compiler error: Segmentation fault

2008-12-29 Thread sergstesh at yahoo dot com


--- Comment #4 from sergstesh at yahoo dot com  2008-12-29 22:45 ---
Just to make sure - my OS is 32 bits SUSE-10.3, though the CPU is 64 bits
capable.


-- 

sergstesh at yahoo dot com changed:

   What|Removed |Added

   Severity|normal  |major
  Component|middle-end  |c


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38666



[Bug c/38666] internal compiler error: Segmentation fault

2008-12-29 Thread sergstesh at yahoo dot com


--- Comment #6 from sergstesh at yahoo dot com  2008-12-30 00:00 ---
(In reply to comment #5)
> The function is simply too big and we likely use most of the memory computing
> and storing the const reals.  A case for closer investigation.
> 

(In reply to comment #5)
> The function is simply too big and we likely use most of the memory computing
> and storing the const reals.  A case for closer investigation.
> 

My primary concern is segmentation fault, not the cases when 'gcc' can't
allocate enough memory and reports the problem clearly.

It also appears gcc-3.4.6 is much less memory-hungry - I'm checking it right
now.


-- 

sergstesh at yahoo dot com changed:

   What|Removed |Added

   Severity|normal  |major
  Component|middle-end  |c


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38666



[Bug c/38666] internal compiler error: Segmentation fault

2008-12-29 Thread sergstesh at yahoo dot com


--- Comment #8 from sergstesh at yahoo dot com  2008-12-30 00:08 ---
(In reply to comment #7)
> (In reply to comment #6)
> > My primary concern is segmentation fault, not the cases when 'gcc' can't
> > allocate enough memory and reports the problem clearly.
> 
> The seg fault is most likely some recursive function gone wrong.
> 

I guess the recursive function is in 'gcc'.

Anyway, if you look at the code (probably you've already looked), you'll find
that though it's long, it's simple. I mean, there is a whole lot of similar
relatively simple expressions like this one:

accumulator[sample_number] += 5.375239973e-09 *
exp(-5.409392003e-06 * d_sample_number) * cos(1.954049995e-01 *
two_pi_times_sample_number - (1.325159989e+00));
.

So, simplistically, because the expressions are simple and the optimization
level is low, I do not see too much place for deep recursion, but I'm
unfamiliar with 'gcc' internals.


-- 

sergstesh at yahoo dot com changed:

   What|Removed |Added

   Severity|normal  |major
  Component|middle-end  |c


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38666



[Bug c/38666] internal compiler error: Segmentation fault

2008-12-30 Thread rguenth at gcc dot gnu dot org


--- Comment #9 from rguenth at gcc dot gnu dot org  2008-12-30 10:17 ---
I expect there to be a "simple" memleak regarding to floating point constant
handling.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38666