c/5484: Maybe an array size problem

gabrielmat@hotmail.com gabrielmat@hotmail.com
Thu Jan 24 21:06:00 GMT 2002

>Number:         5484
>Category:       c
>Synopsis:       Maybe an array size problem
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 24 18:46:01 PST 2002
>Originator:     gabrielmat@hotmail.com
>Release:        gcc 3.0.2
i586 pc, using gcc within DJGPP (for msdos)
When I try to create the primos array of that size (UINT_MAX/5), I got the error "Internal compiler error in assign_stack_temp_for_type, at function.c:657". It doesn´t
have that problem with a minor size.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#define OUTPUT_FILE "primos.txt"

int main()
   unsigned int primos[NUM_MAX/5], n_primos, num, i;
   FILE *output;
   primos[0] = 2;
   n_primos = 1;
   output = fopen(OUTPUT_FILE, "w");
   fprintf(output, "\n\nN§ primos entre 1 y %i:\n\n1", NUM_MAX);
   for(num = 3; num <= NUM_MAX; num++) {
       for(i = 0; i <= (n_primos - 1); i++) {
           if( fmod(num, primos[i]) == 0 )
           else if( i == (n_primos - 1) ) {
               primos[n_primos] = num;
               fprintf(output, " %i", num);
   fprintf(output, "\nN§ primos encontrados: %i", n_primos+1);


More information about the Gcc-bugs mailing list