Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 229366 - CSE regression
Summary: CSE regression
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 5
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2007-02-20 17:28 UTC by dann
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-02-21 20:50:56 UTC

Attachments (Terms of Use)
Patch that fixes the bug in 4.1 (deleted)
2007-03-08 10:05 UTC, Alexandre Oliva
no flags Details | Diff

System ID Priority Status Summary Last Updated
GNU Compiler Collection 30643 None None None Never

Description dann 2007-02-20 17:28:09 UTC
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 20:50:56 UTC
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 10:05:07 UTC
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 13:52:21 UTC
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.