Bug 229366 - CSE regression
CSE regression
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
i686 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2007-02-20 12:28 EST by dann
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-02-21 15:50:56 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch that fixes the bug in 4.1 (1.55 KB, patch)
2007-03-08 05:05 EST, Alexandre Oliva
no flags Details | Diff

External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 30643 None None None Never

  None (edit)
Description dann 2007-02-20 12:28:09 EST
Compiling this code with -O2 -S
struct s {  int a;  int b;};
void bar (struct s *ps,  int *p, int *__restrict__ rp, int *__restrict__ rq)
  ps->a = 0;
  ps->b = 1;
  if (ps->a != 0)    abort ();
  p[0] = 0;
  p[1] = 1;
  if (p[0] != 0)     abort ();
  rp[0] = 0;
  rq[0] = 1;
  if (rp[0] != 0)     abort();
should eliminate all the "abort" calls. 
and it does happen with: GCC: (GNU) 4.1.1 20060525 (Red Hat 4.1.1-1)

but GCC: (GNU) 4.1.1 20070105 (Red Hat 4.1.1-51) generates:

        .file   "t.c"
        .p2align 4,,15
.globl bar
        .type   bar, @function
        pushl   %ebp
        movl    %esp, %ebp
        subl    $8, %esp
        movl    8(%ebp), %eax
        movl    12(%ebp), %edx
        movl    16(%ebp), %ecx
        movl    $0, (%eax)
        movl    $1, 4(%eax)
        movl    (%eax), %eax
        testl   %eax, %eax
        jne     .L10
        movl    $0, (%edx)
        movl    $1, 4(%edx)
        movl    (%edx), %edx
        testl   %edx, %edx
        jne     .L10
        movl    20(%ebp), %eax
        movl    $0, (%ecx)
        movl    $1, (%eax)
        movl    (%ecx), %eax
        testl   %eax, %eax
        jne     .L10
        call    abort
        .size   bar, .-bar
        .ident  "GCC: (GNU) 4.1.1 20070105 (Red Hat 4.1.1-51)"

This is PR30643 for gcc mainline. It seems that it somehow got backported to
Comment 1 Jakub Jelinek 2007-02-21 15:50:56 EST
This isn't Fedora gcc specific problem, tracking it just upstream is enough,
when it is fixed there it will show up in Fedora gcc very soon.
Comment 2 Alexandre Oliva 2007-03-08 05:05:07 EST
Created attachment 149557 [details]
Patch that fixes the bug in 4.1

Trunk needs more than this, but this patch fixes the bug in 4.1.
Comment 3 Jakub Jelinek 2007-03-13 09:52:21 EDT
Should be fixed in gcc-4.1.2-4 in rawhide.

Note You need to log in before you can comment on or make changes to this bug.