public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/5484: Maybe an array size problem
@ 2002-01-24 18:46 gabrielmat
0 siblings, 0 replies; 2+ messages in thread
From: gabrielmat @ 2002-01-24 18:46 UTC (permalink / raw)
To: gcc-gnats
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1556 bytes --]
>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
>Closed-Date:
>Last-Modified:
>Originator: gabrielmat@hotmail.com
>Release: gcc 3.0.2
>Organization:
>Environment:
i586 pc, using gcc within DJGPP (for msdos)
>Description:
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.
>How-To-Repeat:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#define NUM_MAX UINT_MAX
#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 )
break;
else if( i == (n_primos - 1) ) {
primos[n_primos] = num;
n_primos++;
fprintf(output, " %i", num);
break;
}
}
}
fprintf(output, "\nN§ primos encontrados: %i", n_primos+1);
exit(0);
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: c/5484: Maybe an array size problem
@ 2002-04-02 19:44 rth
0 siblings, 0 replies; 2+ messages in thread
From: rth @ 2002-04-02 19:44 UTC (permalink / raw)
To: gabrielmat, gcc-bugs, gcc-prs, nobody
Synopsis: Maybe an array size problem
State-Changed-From-To: open->closed
State-Changed-By: rth
State-Changed-When: Tue Apr 2 19:44:19 2002
State-Changed-Why:
http://gcc.gnu.org/ml/gcc-patches/2002-04/msg00075.html
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5484
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-04-03 3:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-24 18:46 c/5484: Maybe an array size problem gabrielmat
2002-04-02 19:44 rth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).