From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9839 invoked by alias); 20 Jan 2013 10:23:21 -0000 Received: (qmail 9789 invoked by uid 48); 20 Jan 2013 10:23:05 -0000 From: "tkoenig at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/56049] New: [4.8 Regression] Simplification to constants not done Date: Sun, 20 Jan 2013 10:23:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tkoenig at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg01861.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56049 Bug #: 56049 Summary: [4.8 Regression] Simplification to constants not done Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned@gcc.gnu.org ReportedBy: tkoenig@gcc.gnu.org >>From http://gcc.gnu.org/ml/fortran/2013-01/msg00158.html : program inline integer i integer a(8,8), b(8,8) a = 0 do i = 1, 10000000 call add(b, a, 1) a = b end do print *, a contains subroutine add(b, a, o) integer, intent(inout) :: b(8,8) integer, intent(in) :: a(8,8), o b = a + o end subroutine add end program inline is simplified all the way to the final constant with 4.6 and 4.7 (example for 4.6.2): ;; Function inline (MAIN__) (executed once) inline () { struct array2_integer(kind=4) parm.3; struct __st_parameter_dt dt_parm.2; integer(kind=4) a[64]; : a = {}; MEM[(integer(kind=4)[64] *)&a] = 10000000; MEM[(integer(kind=4)[64] *)&a + 4B] = 10000000; MEM[(integer(kind=4)[64] *)&a + 8B] = 10000000; MEM[(integer(kind=4)[64] *)&a + 12B] = 10000000; MEM[(integer(kind=4)[64] *)&a + 16B] = 10000000; MEM[(integer(kind=4)[64] *)&a + 20B] = 10000000; MEM[(integer(kind=4)[64] *)&a + 24B] = 10000000; MEM[(integer(kind=4)[64] *)&a + 28B] = 10000000; MEM[(integer(kind=4)[64] *)&a + 32B] = 10000000; ... and so on. Current trunk converts this to ;; Function inline (MAIN__, funcdef_no=0, decl_uid=1874, cgraph_uid=1) (executed once) inline () { vector(4) integer(kind=4) vect_var_.16; vector(4) integer(kind=4) vect_var_.15; vector(4) integer(kind=4) vect_var_.14; struct array2_integer(kind=4) parm.3; struct __st_parameter_dt dt_parm.2; integer(kind=4) b[64]; integer(kind=4) a[64]; unsigned int ivtmp_153; unsigned int ivtmp_154; : a = {}; : # ivtmp_154 = PHI <10000000(2), ivtmp_153(4)> vect_var_.14_1 = MEM[(integer(kind=4)[64] *)&a]; vect_var_.15_42 = MEM[(integer(kind=4)[64] *)&a + 16B]; vect_var_.16_43 = vect_var_.14_1 + { 1, 1, 1, 1 }; vect_var_.16_44 = vect_var_.15_42 + { 1, 1, 1, 1 }; MEM[(integer(kind=4)[64] *)&b] = vect_var_.16_43; MEM[(integer(kind=4)[64] *)&b + 16B] = vect_var_.16_44; vect_var_.14_71 = MEM[(integer(kind=4)[64] *)&a + 32B]; vect_var_.15_77 = MEM[(integer(kind=4)[64] *)&a + 48B]; vect_var_.16_78 = vect_var_.14_71 + { 1, 1, 1, 1 }; vect_var_.16_79 = vect_var_.15_77 + { 1, 1, 1, 1 };