[Bug c/55999] New: gcc 4.7.2 -O2 -floop-parallelize-all generates incorrect code

nfxjfg at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Jan 16 00:27:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55999

             Bug #: 55999
           Summary: gcc 4.7.2 -O2  -floop-parallelize-all generates
                    incorrect code
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: nfxjfg@gmail.com


struct s {
    int8_t num, c;
    int8_t xs[4], ys[4];
};

void stuff(struct s *desc)
{
    int n;
    for (n = 0; n < desc->num; n++) {
        desc->xs[n] = (n == 1 || n == 2) ? desc->c : 0;
        desc->ys[n] = (n == 1 || n == 2) ? desc->c : 0;
    }
}

desc->xs[0] is not 0 after calling this function, although it should be.

The attached log was generated with gcc -v -save-temps  gcc_issue.c
gcc_issue_main.c -Wall -Wextra -O2  -floop-parallelize-all  > log.txt 2>&1

The assert in gcc_issue_main.c should not be triggered (and is not triggered
when removing -O2 or -floop-parallelize-all).



More information about the Gcc-bugs mailing list