Bug 135715 - Miscompilation (dropped read from memory)
Summary: Miscompilation (dropped read from memory)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc
Version: 3.0
Hardware: s390
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 135625
TreeView+ depends on / blocked
 
Reported: 2004-10-14 16:54 UTC by Miloslav Trmač
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-11-02 21:41:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
apputil.i.bz2 (40.56 KB, application/octet-stream)
2004-10-14 16:56 UTC, Miloslav Trmač
no flags Details
The command line and output of gcc -v ... used to produce apputil.i (2.06 KB, text/plain)
2004-10-14 16:57 UTC, Miloslav Trmač
no flags Details
s390 reload dup fix (2.32 KB, patch)
2004-10-25 11:24 UTC, Jakub Jelinek
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2004:584 0 normal SHIPPED_LIVE Updated gcc packages 2004-12-21 05:00:00 UTC

Description Miloslav Trmač 2004-10-14 16:54:23 UTC
Description of problem:
One of the first things lu_homedir_populate () in the attached
source does is aborting
        if (error == NULL || *error != NULL).

AFAICS in the assembler output, it is compiled as
        if (error == NULL || error != NULL)

This is one of my first encounters with S/3[79]0 assembly,
so I apologize if I have understood it wrong.

Version-Release number of selected component (if applicable):
gcc-3.2.3-46

Seems to work fine with gcc-3.4.2-5.

Comment 1 Miloslav Trmač 2004-10-14 16:56:05 UTC
Created attachment 105206 [details]
apputil.i.bz2

Comment 2 Miloslav Trmač 2004-10-14 16:57:25 UTC
Created attachment 105208 [details]
The command line and output of gcc -v ... used to produce apputil.i

Comment 3 Jakub Jelinek 2004-10-19 08:31:25 UTC
The instruction disappears during reload.
How urgent is this (i.e. can it wait until FC3/RHEL4b2 are done)?

Comment 5 Jakub Jelinek 2004-10-25 08:34:51 UTC
Simplified testcase:

extern void abort (void);

void
foo (int a, int b, int c, int d, int e, void **f)
{
  char g[4096];
  if (f == 0 || *f != 0)
    abort ();
}

int
main (void)
{
  void *x = 0;
  foo (0, 1, 2, 3, 4, &x);
  return 0;
}

Comment 6 Jakub Jelinek 2004-10-25 09:16:29 UTC
Reload changes:
(insn:QI 21 54 22 (parallel[
            (set (reg:CCZ 33 %cc)
                (compare:CCZ (mem/f:SI (reg/f:SI 32 %ap) [4 f+0 S4 A32])
                    (const_int 0 [0x0])))
            (set (reg/v/f:SI 45)
                (mem/f:SI (reg/f:SI 32 %ap) [4 f+0 S4 A32]))
        ] ) 13 {*icm15} (nil)
    (nil))
to
(insn:QI 21 62 22 (parallel[
            (set (reg:CCZ 33 %cc)
                (compare:CCZ (mem/f:SI (reg:SI 2 %r2) [4 f+0 S4 A32])
                    (const_int 0 [0x0])))
            (set (reg/v/f:SI 1 %r1 [45])
                (reg:SI 2 %r2))
        ] ) 13 {*icm15} (nil)
    (nil))

which is wrong (note that originally the first operand of COMPARE
and second operand of SET were the same, but after the reload they
are different.

Comment 7 Jakub Jelinek 2004-10-25 11:24:07 UTC
Created attachment 105717 [details]
s390 reload dup fix

This patch seems to work for me, though haven't bootstrapped it yet to see
whether there are any follow-ups needed.
Though, the area of the code is unchanged till current HEAD.

Comment 8 Jakub Jelinek 2004-10-26 17:37:06 UTC
Should be fixed in gcc-3.2.3-47.

Comment 9 Miloslav Trmač 2004-11-02 21:41:56 UTC
Fix confirmed, thanks!

Comment 10 John Flanagan 2004-12-21 21:02:06 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2004-584.html



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