Bug 38905 - [4.3 Regression] 464.h264ref in SPEC CPU 2006 miscompiled
Summary: [4.3 Regression] 464.h264ref in SPEC CPU 2006 miscompiled
Status: RESOLVED DUPLICATE of bug 36765
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.3.3
: P3 normal
Target Milestone: 4.3.3
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on: 37868
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-18 15:33 UTC by H.J. Lu
Modified: 2009-01-18 21:22 UTC (History)
6 users (show)

See Also:
Host:
Target: x86-64-unknown-linux-gnu
Build:
Known to work: 4.3.2 4.4.0
Known to fail:
Last reconfirmed: 2009-01-18 20:56:55


Attachments
first alias patch (3.44 KB, patch)
2009-01-18 20:36 UTC, Richard Biener
Details | Diff
second alias patch (925 bytes, patch)
2009-01-18 20:36 UTC, Richard Biener
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2009-01-18 15:33:49 UTC
On Linux/x86-64, gcc 4.3.3 revision 143474 miscompiled 464.h264ref in
SPEC CPU 2006 at -O2 -ffast-math:

  Running 464.h264ref ref base o2 default
Error with '/export/gnu/import/svn/gcc-test/spec/2006/x86_64/spec/bin/specinvoke
rt/gnu/import/svn/gcc-test/spec/2006/x86_64/spec/benchspec/CPU2006/464.h264ref/r
ref_o2.0000 -c 1 -e compare.err -o compare.stdout -f compare.cmd': check file '/
mport/svn/gcc-test/spec/2006/x86_64/spec/benchspec/CPU2006/464.h264ref/run/run_b
000/.err'
*** Miscompare of foreman_ref_main_leakybucketparam.cfg, see /export/gnu/import/
/spec/2006/x86_64/spec/benchspec/CPU2006/464.h264ref/run/run_base_ref_o2.0000/fo
in_leakybucketparam.cfg.mis
*** Miscompare of foreman_ref_main_encodelog.out, see /export/gnu/import/svn/gcc
006/x86_64/spec/benchspec/CPU2006/464.h264ref/run/run_base_ref_o2.0000/foreman_r
delog.out.mis
*** Miscompare of sss_main_encodelog.out, see /export/gnu/import/svn/gcc-test/sp
64/spec/benchspec/CPU2006/464.h264ref/run/run_base_ref_o2.0000/sss_main_encodelo
*** Miscompare of foreman_ref_baseline_encodelog.out, see /export/gnu/import/svn
ec/2006/x86_64/spec/benchspec/CPU2006/464.h264ref/run/run_base_ref_o2.0000/forem
ine_encodelog.out.mis
*** Miscompare of sss_main_leakybucketparam.cfg, see /export/gnu/import/svn/gcc-
06/x86_64/spec/benchspec/CPU2006/464.h264ref/run/run_base_ref_o2.0000/sss_main_l
ram.cfg.mis
*** Miscompare of foreman_ref_baseline_leakybucketparam.cfg, see /export/gnu/imp
test/spec/2006/x86_64/spec/benchspec/CPU2006/464.h264ref/run/run_base_ref_o2.000
f_baseline_leakybucketparam.cfg.mis

We are trying to find a smaller testcase as well as which
checkin caused this.
Comment 1 H.J. Lu 2009-01-18 17:16:41 UTC
It is caused by revision 142040:

http://gcc.gnu.org/ml/gcc-cvs/2008-11/msg00541.html
Comment 2 H.J. Lu 2009-01-18 17:19:10 UTC
(In reply to comment #1)
> It is caused by revision 142040:
> 
> http://gcc.gnu.org/ml/gcc-cvs/2008-11/msg00541.html
> 

The patch is at

http://gcc.gnu.org/ml/gcc-patches/2008-11/msg01040.html
Comment 3 rguenther@suse.de 2009-01-18 17:21:01 UTC
Subject: Re:  [4.3 Regression]  464.h264ref in SPEC
 CPU 2006 miscompiled

On Sun, 18 Jan 2009, hjl dot tools at gmail dot com wrote:

> ------- Comment #2 from hjl dot tools at gmail dot com  2009-01-18 17:19 -------
> (In reply to comment #1)
> > It is caused by revision 142040:
> > 
> > http://gcc.gnu.org/ml/gcc-cvs/2008-11/msg00541.html
> > 
> 
> The patch is at
> 
> http://gcc.gnu.org/ml/gcc-patches/2008-11/msg01040.html

Can you check if it is fixed by -fno-strict-aliasing and/or
--param max-fields-for-field-sensitive=0?  I suspect we need to
backport some PTA fixes :/

Richard.
Comment 4 H.J. Lu 2009-01-18 17:39:57 UTC
(In reply to comment #3)
> Can you check if it is fixed by -fno-strict-aliasing and/or
> --param max-fields-for-field-sensitive=0?  I suspect we need to
> backport some PTA fixes :/
> 

Either -fno-strict-aliasing or --param max-fields-for-field-sensitive=0
fixed this.
Comment 5 rguenther@suse.de 2009-01-18 17:42:52 UTC
Subject: Re:  [4.3 Regression]  464.h264ref in SPEC
 CPU 2006 miscompiled

On Sun, 18 Jan 2009, hjl dot tools at gmail dot com wrote:

> ------- Comment #4 from hjl dot tools at gmail dot com  2009-01-18 17:39 -------
> (In reply to comment #3)
> > Can you check if it is fixed by -fno-strict-aliasing and/or
> > --param max-fields-for-field-sensitive=0?  I suspect we need to
> > backport some PTA fixes :/
> > 
> 
> Either -fno-strict-aliasing or --param max-fields-for-field-sensitive=0
> fixed this.

I would guess that

2008-11-25  Daniel Berlin  <dberlin@dberlin.org>
            Richard Guenther  <rguenther@suse.de>

        PR tree-optimization/37869
        * tree-ssa-structalias.c (struct constraint_graph): Remove
        pt_used and number_incoming members.
        (build_pred_graph): Do not allocate them.
        (condense_visit): Do not use them.
        (label_visit): Likewise.
        (free_var_substitution_info): Do not free them.

might fix it, but of course a testcase would be nice to have.

Thx for tracking this down btw.
Richard.
Comment 6 H.J. Lu 2009-01-18 19:09:31 UTC
(In reply to comment #5)
> 
> I would guess that
> 
> 2008-11-25  Daniel Berlin  <dberlin@dberlin.org>
>             Richard Guenther  <rguenther@suse.de>
> 
>         PR tree-optimization/37869
>         * tree-ssa-structalias.c (struct constraint_graph): Remove
>         pt_used and number_incoming members.
>         (build_pred_graph): Do not allocate them.
>         (condense_visit): Do not use them.
>         (label_visit): Likewise.
>         (free_var_substitution_info): Do not free them.
> 
> might fix it, but of course a testcase would be nice to have.
> 

Tried it on 4.3 branch. It doesn't fix the problem.

Comment 7 Richard Biener 2009-01-18 19:34:36 UTC
It works for me with -O2 -ffast-math and the openSUSE 11.1 compiler which also
has this patch applied (but is based on rev. 141291).  I'm trying with plain
4.3 branch now - any special configure options used?
Comment 8 H.J. Lu 2009-01-18 19:52:58 UTC
(In reply to comment #7)
> It works for me with -O2 -ffast-math and the openSUSE 11.1 compiler which also
> has this patch applied (but is based on rev. 141291).  I'm trying with plain
> 4.3 branch now - any special configure options used?
> 

I am using

-DSPEC_CPU -DNDEBUG    -O2 -ffast-math       -DSPEC_CPU_LP64

on Fedora 9/x86-64 with glibc 2.8-10. I used 4.3 branch at revision 143470.
Comment 9 Richard Biener 2009-01-18 20:36:08 UTC
Created attachment 17136 [details]
first alias patch

I can reproduce this with the plain branch.  Attached is the first extra alias
patch in the SUSE compiler.
Comment 10 Richard Biener 2009-01-18 20:36:37 UTC
Created attachment 17137 [details]
second alias patch

Second alias related patch in the openSUSE compiler.
Comment 11 Richard Biener 2009-01-18 20:52:51 UTC
The testcase from PR36765 fails on the 4.3 branch.  Does it fail without the
patch for PR37868?
Comment 12 Richard Biener 2009-01-18 20:56:55 UTC
I'm testing the patch for PR36765 - that was a h264ref miscompile on the trunk.
Comment 13 H.J. Lu 2009-01-18 21:05:01 UTC
Patches in comment #9 plus comment #10 fix 464.h264ref with test
input. I am running with reference input on both ia32 and x86-64.
Comment 14 H.J. Lu 2009-01-18 21:11:13 UTC
(In reply to comment #11)
> The testcase from PR36765 fails on the 4.3 branch.  Does it fail without the
> patch for PR37868?
> 

gcc.c-torture/execute/pr36765.c works with -O2 at revision 142026 and
fails at revision 142040 on 4.3 branch.
Comment 15 Richard Biener 2009-01-18 21:22:59 UTC
I have verified that the patch for PR36765 fixes h264ref on the branch.

*** This bug has been marked as a duplicate of 36765 ***