Bug 91730 - [10 regression] r275518 causes 3 verification errors in the cpu 2006 test suite
Summary: [10 regression] r275518 causes 3 verification errors in the cpu 2006 test suite
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 10.0
: P3 normal
Target Milestone: 10.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: spec
  Show dependency treegraph
 
Reported: 2019-09-10 20:23 UTC by seurer
Modified: 2019-09-17 11:03 UTC (History)
1 user (show)

See Also:
Host: powerpc64le-unknown-linux-gnu
Target: powerpc64le-unknown-linux-gnu, x86_64-*-*
Build: powerpc64le-unknown-linux-gnu
Known to work: 9.2.0
Known to fail: 10.0
Last reconfirmed: 2019-09-11 00:00:00


Attachments
Dump file with problematic transformation (18.51 KB, text/plain)
2019-09-11 07:55 UTC, Martin Liška
Details
Dump file without problematic transformation (18.45 KB, text/plain)
2019-09-11 07:56 UTC, Martin Liška
Details

Note You need to log in before you can comment on or make changes to this bug.
Description seurer 2019-09-10 20:23:46 UTC
464.h264ref, 453.povray, and 482.sphinx3

Example:

Running Benchmarks
  Running 464.h264ref ref base ppc64 default
/home/seurer/gcc/cpu2006/bin/specinvoke -d /home/seurer/gcc/cpu2006/benchspec/CPU2006/464.h264ref/run/run_base_ref_ppc64.0000 -e speccmds.err -o speccmds.stdout -f speccmds.cmd -C -q
/home/seurer/gcc/cpu2006/bin/specinvoke -E -d /home/seurer/gcc/cpu2006/benchspec/CPU2006/464.h264ref/run/run_base_ref_ppc64.0000 -c 1 -e compare.err -o compare.stdout -f compare.cmd

*** Miscompare of foreman_ref_baseline_encodelog.out; for details see
    /home/seurer/gcc/cpu2006/benchspec/CPU2006/464.h264ref/run/run_base_ref_ppc64.0000/foreman_ref_baseline_encodelog.out.mis
Invalid run; unable to continue.
Comment 1 Richard Biener 2019-09-11 07:14:52 UTC
Using -Ofast I presume?  Note there's the 'match' debug-counter you can use to
bisect the offending transform (per source file of course).

Confirmed on a Haswell machine with -Ofast -march=native as well.

Not exactly wrong-code confirmed yet but we'd like to have SPEC CPU "-Ofast clean" and thus need to understand what actual transform is bad here.
Comment 2 Martin Liška 2019-09-11 07:25:36 UTC
I can confirm that and I'm going to bisect the transformation.
Comment 3 Martin Liška 2019-09-11 07:55:43 UTC
Created attachment 46868 [details]
Dump file with problematic transformation

For the 453.povray (which fails with --size=test), the problematic file is:
g++ -c -o quadrics.o -dspec_cpu -dndebug   -ofast -g -fpermissive   -dspec_cpu_lp64       quadrics.cpp -fdbg-cnt=match:4030

Where match:4030 is the first bad debug counter value.
Comment 4 Martin Liška 2019-09-11 07:56:09 UTC
Created attachment 46869 [details]
Dump file without problematic transformation
Comment 5 Martin Liška 2019-09-11 07:59:08 UTC
The transformation is from:

  _663 = T1$1_55 + _293;
  _651 = (float) _663;

where T1$1_55 and _293 are doubles. To:

  _758 = (float) T1$1_55;
  _759 = (float) _293;
  _760 = _758 + _759;
  _651 = (float) _760;
Comment 6 Richard Biener 2019-09-11 08:03:15 UTC
(In reply to Martin Liška from comment #5)
> The transformation is from:
> 
>   _663 = T1$1_55 + _293;
>   _651 = (float) _663;
> 
> where T1$1_55 and _293 are doubles. To:
> 
>   _758 = (float) T1$1_55;
>   _759 = (float) _293;
>   _760 = _758 + _759;
>   _651 = (float) _760;

OK, so thats invalid for example when T1$1_55 and _293 are FP values
that cannot be represented in 'float' but their sum can.  That's outside
of what we generally allow with -ffast-math.

It would be valid if one of T1$1_55 or _293 are already float.
Comment 7 Richard Biener 2019-09-11 08:04:51 UTC
Note in all cases of the testcases coming with the patch the sources are
eventually casted from float to double.
Comment 8 Richard Biener 2019-09-11 08:23:14 UTC
Reverted the patch.
Comment 9 Tamar Christina 2019-09-17 11:03:43 UTC
Hmm yes the transformation is too aggressive and incorrect here.

we'll fix that and resubmit a fixed patch.