Bug 135715 - Miscompilation (dropped read from memory)
Miscompilation (dropped read from memory)
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc (Show other bugs)
3.0
s390 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks: 135625
  Show dependency treegraph
 
Reported: 2004-10-14 12:54 EDT by Miloslav Trmač
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-11-02 16:41:56 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
apputil.i.bz2 (40.56 KB, application/octet-stream)
2004-10-14 12:56 EDT, 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 12:57 EDT, Miloslav Trmač
no flags Details
s390 reload dup fix (2.32 KB, patch)
2004-10-25 07:24 EDT, Jakub Jelinek
no flags Details | Diff

  None (edit)
Description Miloslav Trmač 2004-10-14 12:54:23 EDT
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 12:56:05 EDT
Created attachment 105206 [details]
apputil.i.bz2
Comment 2 Miloslav Trmač 2004-10-14 12:57:25 EDT
Created attachment 105208 [details]
The command line and output of gcc -v ... used to produce apputil.i
Comment 3 Jakub Jelinek 2004-10-19 04:31:25 EDT
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 04:34:51 EDT
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 05:16:29 EDT
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 07:24:07 EDT
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 13:37:06 EDT
Should be fixed in gcc-3.2.3-47.
Comment 9 Miloslav Trmač 2004-11-02 16:41:56 EST
Fix confirmed, thanks!
Comment 10 John Flanagan 2004-12-21 16:02:06 EST
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.