From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5EC653858D20; Fri, 31 Mar 2023 06:13:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5EC653858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680243224; bh=HBMTn4GKP4EblJhi4aYeapux7GZHzT5w+7FOemMOs+4=; h=From:To:Subject:Date:From; b=niKhuuMyh4XCE75oPfDbFgaQtWvaLMxmW384j+yLa+eVc656CMQ6QCaKyPP9iBra2 hzzzXdQYQQegia/PFJ1wDTAgAbtrLFYPD9z3iKZEB2C2WgKTjGxam61Z0acz1bmGIk 56qaw/+xNmjB7LH8XTSS/mXWLWvElCtxzbYGXv+o= From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/109351] New: RA uses lowest cost for the mode of different reg_classes w/o considering hard_regno_mode_ok. Date: Fri, 31 Mar 2023 06:13:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109351 Bug ID: 109351 Summary: RA uses lowest cost for the mode of different reg_classes w/o considering hard_regno_mode_ok. Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: crazylht at gmail dot com Target Milestone: --- 575 for (cl =3D (int) N_REG_CLASSES - 1; cl >=3D 0; cl--) 576 { 577 if (cl !=3D (int) NO_REGS) 578 for (mode =3D 0; mode < MAX_MACHINE_MODE; mode++) 579 { 580 ira_max_memory_move_cost[mode][cl][0] 581 =3D ira_memory_move_cost[mode][cl][0] 582 =3D memory_move_cost ((machine_mode) mode, 583 (reg_class_t) cl, false); 584 ira_max_memory_move_cost[mode][cl][1] 585 =3D ira_memory_move_cost[mode][cl][1] 586 =3D memory_move_cost ((machine_mode) mode, 587 (reg_class_t) cl, true); 588 /* Costs for NO_REGS are used in cost calculation on the 589 1st pass when the preferred register classes are not 590 known yet. In this case we take the best scenario. */ 591 if (ira_memory_move_cost[mode][NO_REGS][0] 592 > ira_memory_move_cost[mode][cl][0]) 593 ira_max_memory_move_cost[mode][NO_REGS][0] 594 =3D ira_memory_move_cost[mode][NO_REGS][0] 595 =3D ira_memory_move_cost[mode][cl][0]; 596 if (ira_memory_move_cost[mode][NO_REGS][1] 597 > ira_memory_move_cost[mode][cl][1]) 598 ira_max_memory_move_cost[mode][NO_REGS][1] 599 =3D ira_memory_move_cost[mode][NO_REGS][1] 600 =3D ira_memory_move_cost[mode][cl][1]; 601 } 602 } It could be a potential performance issue. It's from PR108707.=