Bug 36109

Summary: GET_MODE_SIZE is inefficient for constants
Product: gcc Reporter: Jorn Wolfgang Rennecke <amylaar>
Component: middle-endAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: enhancement CC: gcc-bugs
Priority: P3 Keywords: patch
Version: 4.2.1   
Target Milestone: 5.0   
URL: http://gcc.gnu.org/ml/gcc-patches/2014-01/msg00140.html
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2014-01-04 00:00:00

Description Jorn Wolfgang Rennecke 2008-05-02 13:10:20 UTC
GET_MODE_SIZE always does an array lookup.  This is inefficient for mode
constants; in this case, it would be better to compare for equality for each mode and then decide on the actual size.  When workingh with mode macros, this
would allow conditionals to be folded to 0 or 1, and thus save both compiler code
size and compilation time.
Comment 1 Andrew Pinski 2014-01-04 02:21:35 UTC
Confirmed.
Comment 2 Andrew Pinski 2024-02-16 06:14:53 UTC
Fixed by r5-128-g92f0f3ec9210d5 .