This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
bug report
- From: Hayashi Eisuke <hayashi at dc dot ag dot asahi-kasei dot co dot jp>
- To: gcc-bugs at gcc dot gnu dot org
- Cc: Andrew Pinski <pinskia at physics dot uc dot edu>, Tetsuo Tokuda <tok at dc dot ag dot asahi-kasei dot co dot jp>
- Date: Thu, 08 Jun 2006 11:14:19 +0900
- Subject: bug report
DEAR Sir : GNU
I am writing to you regarding bug report
under this code
#include <stdio.h>
#include <values.h>
void subroutine(int n)
{
int buf[n];
fprintf(stderr, "%d (%d)\n", (int)sizeof(buf), (unsigned long)buf);
}
int main( int argc, char **argv)
{
int i, value[] = {0, 1, -1, INT_MAX, 1000000, 2092728, 2092729};
for (i=0; i<7; i++) {
fprintf(stderr, "%d: ", value[i]);
subroutine(value[i]);
}
exit(0);
}
① gcc version 3.2.3
0: 0 (-1073762400)
1: 4 (-1073762416)
-1: -4 (-1073762400)
2147483647: -4 (-1073762400)
1000000: 4000000 (-1077762400)
2092728: 8370912 (-1082133312)
2092729: 8370916 (-1082133328)
② gcc version 2.96
0: 0 (-1073752048)
1: 4 (-1073752064)
-1: -4 (-1073752048)
2147483647: -4 (-1073752048)
1000000: 4000000 (-1077752048)
2092728: Segmentatioin error (core dumped)
There was a difference of the above-mentioned by the difference of the
version of gcc when having thoroughly examined it. Was this a bug of
version 2.96?
Sincerely yours,
EISUKE HAYASHI