[Bug rtl-optimization/29798] [4.3 Regression] -O2 gives wrong results
--- Comment #17 from chaoyingfu at gcc dot gnu dot org 2006-12-01 02:00 --- Subject: Bug 29798 Author: chaoyingfu Date: Fri Dec 1 01:57:22 2006 New Revision: 119394 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119394 Log: Merged revisions 118791-118987 via svnmerge from svn+ssh://[EMAIL PROTECTED]/svn/gcc/trunk r118791 | gccadmin | 2006-11-13 16:17:39 -0800 (Mon, 13 Nov 2006) | 1 line Daily bump. r118793 | jiez | 2006-11-13 16:39:08 -0800 (Mon, 13 Nov 2006) | 4 lines * configure.in: Remove target-libgloss from noconfigdirs for bfin-*-*. * configure: Regenerated. r118794 | jiez | 2006-11-13 16:45:33 -0800 (Mon, 13 Nov 2006) | 4 lines * configure.in: Remove target-libgloss from noconfigdirs for bfin-*-*. * configure: Regenerated. r118798 | dj | 2006-11-13 18:29:46 -0800 (Mon, 13 Nov 2006) | 3 lines * config/m32c/m32c.c (m32c_prepare_shift): Use a separate temporary for intermediates. r118802 | ghazi | 2006-11-13 21:08:46 -0800 (Mon, 13 Nov 2006) | 7 lines * fold-const.c (fold_strip_sign_ops): Handle COMPOUND_EXPR and COND_EXPR. testsuite: * gcc.dg/builtins-20.c: Add more cases. r118808 | bonzini | 2006-11-14 00:46:26 -0800 (Tue, 14 Nov 2006) | 16 lines 2006-11-14 Paolo Bonzini <[EMAIL PROTECTED]> PR rtl-optimization/29798 * fwprop.c (use_killed_between): Check that DEF_INSN dominates TARGET_INSN before any other check. (fwprop_init): Always calculate dominators. (fwprop_done): Always free them. 2006-11-14 Paolo Bonzini <[EMAIL PROTECTED]> PR rtl-optimization/29798 * gcc.c-torture/execute/pr29798.c: New. r118810 | bonzini | 2006-11-14 04:14:33 -0800 (Tue, 14 Nov 2006) | 7 lines 2006-11-14 Paolo Bonzini <[EMAIL PROTECTED]> * Makefile.tpl (clean-stage*): Test separately for package/Makefile and stageN-package/Makefile. * Makefile.in: Regenerated. r118812 | burnus | 2006-11-14 07:35:36 -0800 (Tue, 14 Nov 2006) | 13 lines fortran/ 2006-11-14 Tobias Burnus <[EMAIL PROTECTED]> PR fortran/29657 * symbol.c (check_conflict): Add further conflicts. testsuite/ 2006-11-14 Tobias Burnus <[EMAIL PROTECTED]> PR fortran/29657 * gfortran.dg/conflicts.f90: Add. r118813 | erven | 2006-11-14 07:45:55 -0800 (Tue, 14 Nov 2006) | 1 line MAINTAINERS (Write After Approval): Add myself. r118814 | jsm28 | 2006-11-14 08:01:41 -0800 (Tue, 14 Nov 2006) | 3 lines * testsuite/26_numerics/complex/13450.cc: Do not test long double in IBM long double case. r118819 | mmitchel | 2006-11-14 09:15:08 -0800 (Tue, 14 Nov 2006) | 3 lines PR c++/29106 * g++.dg/init/self1.C: New test. r118820 | burnus | 2006-11-14 09:31:00 -0800 (Tue, 14 Nov 2006) | 6 lines 2006-11-14 Tobias Burnus <[EMAIL PROTECTED]> * match.c (gfc_match_namelist): Add missing space to error message. r118821 | dberlin | 2006-11-14 10:12:20 -0800 (Tue, 14 Nov 2006) | 24 lines 2006-11-14 Daniel Berlin <[EMAIL PROTECTED]> Fix PR tree-optimization/27755 * tree-ssa-pre.c: Update comments. (bb_bitmap_sets): Add pa_in and deferred member. (BB_DEFERRED): New macro. (maximal_set): New variable. (pre_stats): Add pa_insert member. (bitmap_set_and): Short circuit orig == dest. (bitmap_set_subtract_values): New function. (bitmap_set_contains_expr): Ditto. (translate_vuses_through_block): Add phiblock argument. (dependent_clean): New function. (compute_antic_aux): Update for maximal_set changes. (compute_partial_antic_aux): New function. (compute_antic): Handle partial anticipation. (do_partial_partial_insertion): New function. (insert_aux): Handle partial anticipation. (add_to_sets): Add to maximal set. (compute_avail): Ditto. (init_pre): Initialize maximal_set. (execute_pre): Do partial anticipation if -O3+. r118823 | echristo | 2006-11-14 11:42:51 -0800 (Tue, 14 Nov 2006) | 4 lines 2006-11-14 Eric Christopher <[EMAIL PROTECTED]> * configure: Regenerate with autoconf 2.59. r118825 | jsm28 | 2006-11-14 12:36:28 -0800 (Tue, 14 Nov 2006) | 5 lines * config/arm/arm.h (FUNCTION_ARG_ADVANCE): Only adjust iwmmxt_nregs if TARGET_IWMMXT_ABI. * config/arm/iwmmxt.md (movv8qi_internal, movv4hi_internal, movv2si_internal): Support moves between core registers. r118826 | ctice | 2006-11-14 12:55:56 -0800 (Tue, 14 Nov 2006) | 4 lines Add ability to generate DWARF pubtypes section if DEBUG_PUBTYPES_SECTION is defined. Also add dejagnu testcases for pubtypes. r118827 | rguenth | 2006-11-14 14:
[Bug rtl-optimization/29798] [4.3 Regression] -O2 gives wrong results
--- Comment #15 from bonzini at gnu dot org 2006-11-14 09:06 --- Subject: Bug 29798 Author: bonzini Date: Tue Nov 14 09:06:42 2006 New Revision: 118809 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118809 Log: 2006-11-14 Paolo Bonzini <[EMAIL PROTECTED]> Merge from mainline: 2006-11-14 Paolo Bonzini <[EMAIL PROTECTED]> PR rtl-optimization/29798 * fwprop.c (use_killed_between): Check that DEF_INSN dominates TARGET_INSN before any other check. Modified: branches/dataflow-branch/gcc/ChangeLog.dataflow branches/dataflow-branch/gcc/fwprop.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29798
[Bug rtl-optimization/29798] [4.3 Regression] -O2 gives wrong results
--- Comment #14 from bonzini at gnu dot org 2006-11-14 08:50 --- still have to commit the patch on dataflow branch, but mainline is ok now -- bonzini at gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29798
[Bug rtl-optimization/29798] [4.3 Regression] -O2 gives wrong results
--- Comment #13 from bonzini at gnu dot org 2006-11-14 08:46 --- Subject: Bug 29798 Author: bonzini Date: Tue Nov 14 08:46:26 2006 New Revision: 118808 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118808 Log: 2006-11-14 Paolo Bonzini <[EMAIL PROTECTED]> PR rtl-optimization/29798 * fwprop.c (use_killed_between): Check that DEF_INSN dominates TARGET_INSN before any other check. (fwprop_init): Always calculate dominators. (fwprop_done): Always free them. 2006-11-14 Paolo Bonzini <[EMAIL PROTECTED]> PR rtl-optimization/29798 * gcc.c-torture/execute/pr29798.c: New. Added: trunk/gcc/testsuite/gcc.c-torture/execute/pr29798.c Modified: trunk/gcc/ChangeLog trunk/gcc/fwprop.c trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29798
[Bug rtl-optimization/29798] [4.3 Regression] -O2 gives wrong results
--- Comment #12 from bonzini at gnu dot org 2006-11-13 11:55 --- testing a patch -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29798
[Bug rtl-optimization/29798] [4.3 Regression] -O2 gives wrong results
--- Comment #11 from bonzini at gnu dot org 2006-11-13 11:02 --- reduced testcase: #include int main () { int i; double oldrho; double beta = 0.0; double work = 1.0; for (i = 1; i <= 2; i++) { double rho = work * work; if (i != 1) beta = rho / oldrho; if (beta == 1.0) abort (); work /= 2.0; oldrho = rho; } return 0; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29798
[Bug rtl-optimization/29798] [4.3 Regression] -O2 gives wrong results
--- Comment #10 from bonzini at gnu dot org 2006-11-13 09:57 --- sorry for being so dumb. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29798
[Bug rtl-optimization/29798] [4.3 Regression] -O2 gives wrong results
--- Comment #9 from jpr at csc dot fi 2006-11-13 08:45 --- Subject: Re: [4.3 Regression] -O2 gives wrong results Hi, i get the same with -O0 & -O1, but -O2 gives the output 1: 1 nan 2: 1 5 1: 2 5 2: 2 0.56 1: 3 0.56 2: 3 0.546798 1: 4 0.546798 2: 4 0.450496 1: 5 0.450496 2: 5 0.349347 1: 6 0.349347 2: 6 0.27989 1: 7 0.27989 2: 7 0.235831 1: 8 0.235831 2: 8 0.20784 1: 9 0.20784 2: 9 0.190072 1: 10 0.190072 2: 10 0.179228 1: 11 0.179228 2: 11 0.173471 1: 12 0.173471 2: 12 0.171803 1: 13 0.171803 2: 13 0.173738 1: 14 0.173738 2: 14 0.179119 1: 15 0.179119 2: 15 0.187993 1: 16 0.187993 2: 16 0.200468 1: 17 0.200468 2: 17 0.216452 1: 18 0.216452 2: 18 0.235121 1: 19 0.235121 2: 19 0.25404 20 0.50373 4.29738 Juha > > > --- Comment #8 from bonzini at gnu dot org 2006-11-13 08:14 --- > Please enlighten me. :-( > > research:~/gcc-test-pr29798/peak-gcc-src/gcc bonzinip$ svn info > Path: . > URL: svn+ssh://[EMAIL PROTECTED]/svn/gcc/trunk/gcc > Repository Root: svn+ssh://[EMAIL PROTECTED]/svn/gcc > Repository UUID: 138bc75d-0d04-0410-961f-82ee72b054a4 > Revision: 118720 > Node Kind: directory > Schedule: normal > Last Changed Author: sayle > Last Changed Rev: 118718 > Last Changed Date: 2006-11-12 03:57:10 +0100 (Sun, 12 Nov 2006) > Properties Last Updated: 2006-08-04 18:44:20 +0200 (Fri, 04 Aug 2006) > > research:~/gcc-test-pr29798/peak-gcc-build/gcc bonzinip$ gcc test.c -o foook > -lm && ./foook > 1: 1 4.87384e-270 > 2: 1 4.87384e-270 > > 1: 2 5 > 2: 2 5 > > 2 1 4 > > research:~/gcc-test-pr29798/peak-gcc-build/gcc bonzinip$ ./xgcc -B. test.c -o > foo -lm && ./foo > 1: 1 4.87387e-270 > 2: 1 4.87387e-270 > > 1: 2 5 > 2: 2 5 > > 2 1 4 > > > -- > > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29798 > > --- You are receiving this mail because: --- > You reported the bug, or are watching the reporter. > -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29798
[Bug rtl-optimization/29798] [4.3 Regression] -O2 gives wrong results
--- Comment #8 from bonzini at gnu dot org 2006-11-13 08:14 --- Please enlighten me. :-( research:~/gcc-test-pr29798/peak-gcc-src/gcc bonzinip$ svn info Path: . URL: svn+ssh://[EMAIL PROTECTED]/svn/gcc/trunk/gcc Repository Root: svn+ssh://[EMAIL PROTECTED]/svn/gcc Repository UUID: 138bc75d-0d04-0410-961f-82ee72b054a4 Revision: 118720 Node Kind: directory Schedule: normal Last Changed Author: sayle Last Changed Rev: 118718 Last Changed Date: 2006-11-12 03:57:10 +0100 (Sun, 12 Nov 2006) Properties Last Updated: 2006-08-04 18:44:20 +0200 (Fri, 04 Aug 2006) research:~/gcc-test-pr29798/peak-gcc-build/gcc bonzinip$ gcc test.c -o foook -lm && ./foook 1: 1 4.87384e-270 2: 1 4.87384e-270 1: 2 5 2: 2 5 2 1 4 research:~/gcc-test-pr29798/peak-gcc-build/gcc bonzinip$ ./xgcc -B. test.c -o foo -lm && ./foo 1: 1 4.87387e-270 2: 1 4.87387e-270 1: 2 5 2: 2 5 2 1 4 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29798
[Bug rtl-optimization/29798] [4.3 Regression] -O2 gives wrong results
--- Comment #7 from jpr at csc dot fi 2006-11-12 13:24 --- Subject: Re: [4.3 Regression] -O2 gives wrong results In reply to comment #6) > mine, but please can you give me the correct output? i don't see the > regressions (comparing to a 4.1.2 compiler). In the original testcase xvec should contain xvec[0]=1, xvec[1]=4 after the loop and it should only take 2 iterations to get there. Juha -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29798
[Bug rtl-optimization/29798] [4.3 Regression] -O2 gives wrong results
--- Comment #6 from bonzini at gnu dot org 2006-11-12 11:00 --- mine, but please can you give me the correct output? i don't see the regressions (comparing to a 4.1.2 compiler). -- bonzini at gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |bonzini at gnu dot org |dot org | Status|NEW |ASSIGNED Last reconfirmed|2006-11-11 11:46:11 |2006-11-12 11:00:14 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29798
[Bug rtl-optimization/29798] [4.3 Regression] -O2 gives wrong results
--- Comment #5 from pinskia at gcc dot gnu dot org 2006-11-11 23:35 --- Note Richard's reduced testcase is undefined though the orginal one with the printfs removed is defined as the use is only when the variable has been initialized. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29798
[Bug rtl-optimization/29798] [4.3 Regression] -O2 gives wrong results
--- Comment #4 from jpr at csc dot fi 2006-11-11 19:16 --- Subject: Re: [4.3 Regression] -O2 gives wrong results Note however that the prints inside the main loop are not needed to trigger the problem in the oroginal test code. You may freely remove them and the problem remains. I just added the prints to further demonstrate the problem... Juha > > > --- Comment #2 from pinskia at gcc dot gnu dot org 2006-11-11 14:11 > --- > If we don't use it when the variable is uninitialized, we get the desired > result (note how I did not say the correct result as I think this code is > undefined and what we are getting is allowed by the C standard). > > > -- > > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29798 > > --- You are receiving this mail because: --- > You reported the bug, or are watching the reporter. > -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29798
[Bug rtl-optimization/29798] [4.3 Regression] -O2 gives wrong results
--- Comment #3 from pinskia at gcc dot gnu dot org 2006-11-11 14:20 --- In insn 26, replacing (reg/v:DF 61 [ oldrho ]) with (reg/v:DF 63 [ rho ]) Changed insn 26 In insn 16, replacing (reg/v:DF 61 [ oldrho ]) with (reg/v:DF 63 [ rho ]) Changed insn 16 -- pinskia at gcc dot gnu dot org changed: What|Removed |Added CC||bonzini at gnu dot org Target Milestone|--- |4.3.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29798
[Bug rtl-optimization/29798] [4.3 Regression] -O2 gives wrong results
--- Comment #2 from pinskia at gcc dot gnu dot org 2006-11-11 14:11 --- If we don't use it when the variable is uninitialized, we get the desired result (note how I did not say the correct result as I think this code is undefined and what we are getting is allowed by the C standard). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29798
[Bug rtl-optimization/29798] [4.3 Regression] -O2 gives wrong results
--- Comment #1 from rguenth at gcc dot gnu dot org 2006-11-11 11:46 --- Confirmed. Shorter testcase: #include int main() { double rho; double alpha; int iter_count; double oldrho; double work; work= 2.0e+0; for (iter_count=1; iter_count<11; ++iter_count) { fprintf(stderr, "1: %g\n", oldrho); rho = 1 + work * work; fprintf(stderr, "2: %g\n\n", oldrho); alpha = rho / (5.0e-1 * work * work); work = work - alpha * work; oldrho = rho; } return 0; } It should print the same "oldrho" value at "1:" and "2:" each iteration (but the first one, because oldrho is not initialized then, so the behavior is undefined). Appearantly this undefinedness in the first iteration makes the difference here. -- rguenth at gcc dot gnu dot org changed: What|Removed |Added CC||rguenth at gcc dot gnu dot ||org Status|UNCONFIRMED |NEW Component|tree-optimization |rtl-optimization Ever Confirmed|0 |1 Keywords||wrong-code Known to fail||4.3.0 Known to work||4.1.2 Last reconfirmed|-00-00 00:00:00 |2006-11-11 11:46:11 date|| Summary|-O2 gives wrong results |[4.3 Regression] -O2 gives ||wrong results http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29798