Your message dated Sat, 27 May 2006 02:05:36 +0200
with message-id <[EMAIL PROTECTED]>
and subject line g++-3.4 -O1: wrong code generation
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--- Begin Message ---
Package: g++-3.4
Version: 3.4.5-1
Severity: normal
Hello Debian GCC maintainers,
g++-3.4 incorrectly compiles the attached file at -O1 and up by causing
an infinite loop.
%g++-3.4 bug.c -o bug -Wall -O1
%./bug
oo-loop
gcc-3.4,g++-4.0 and gcc-4.0 all work correctly.
Cheers,
Bill.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void
mpqs_add_relation(long *ei, char *rel)
{
char *s;
s = strchr(rel, ':') - 1;
*s = '\0';
s = strtok(s + 3, " \n");
while (s != NULL)
{
long e = atol(s);
if (!e) break;
s = strtok(NULL, " \n");
ei[atol(s)] += e;
s = strtok(NULL, " \n");
}
return;
}
int
main(void)
{
long N=163;
char *res="84481755 : 1 1 4 2 1 3 1 5 1 6 1 13 1 14 1 16 1 18 1 21 1 99 1 113 1 122 0\n";
long *e=(long*)calloc(sizeof(long),N);
mpqs_add_relation(e,strdup(res));
return 0;
}
--- End Message ---
--- Begin Message ---
Version: 4.0.0
fixed in gcc-4.0, wontfix in 3.4.
--- End Message ---