Bug#435546: gcc-4.1: Wrong loop code generation using O2

2007-08-01 Thread Javier Cabezas Rodríguez
On 8/1/07, Bastian Blank <[EMAIL PROTECTED]> wrote: > On Wed, Aug 01, 2007 at 04:16:13PM +0200, Javier Cabezas Rodríguez wrote: > > void do_pin_processes(int pids[], int n, char pin) > > { > > int i; > > for (i = 0; i < n; i++) { > > printf("%d\n", i); > > do_pin_process(pids[i], pin);

Bug#435546: gcc-4.1: Wrong loop code generation using O2

2007-08-01 Thread Bastian Blank
On Wed, Aug 01, 2007 at 04:16:13PM +0200, Javier Cabezas Rodríguez wrote: > void do_pin_processes(int pids[], int n, char pin) > { > int i; > for (i = 0; i < n; i++) { > printf("%d\n", i); > do_pin_process(pids[i], pin); > } > } > > When I compile the attached program with the follow

Bug#435546: gcc-4.1: Wrong loop code generation using O2

2007-08-01 Thread Matthias Klose
Please could you attach/reference buildable sources? that's only the case if build with -pg? > However if I export the CFLAGS variable with -O0 it works properly. please could you recheck with -O1, and then add the optimization flags which make up -O2 one by one? see the docs. -- To UNSUBSCRI

Bug#435546: gcc-4.1: Wrong loop code generation using O2

2007-08-01 Thread Javier Cabezas Rodríguez
Package: gcc-4.1 Version: 4.1.2-13 Severity: important void do_pin_processes(int pids[], int n, char pin) { int i; for (i = 0; i < n; i++) { printf("%d\n", i); do_pin_process(pids[i], pin); } } When I compile the attached program with the following flags the compiler generates a inf