Bug 36109 - GET_MODE_SIZE is inefficient for constants
Summary: GET_MODE_SIZE is inefficient for constants
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.2.1
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL: http://gcc.gnu.org/ml/gcc-patches/201...
Keywords: patch
Depends on:
Reported: 2008-05-02 13:10 UTC by Jorn Wolfgang Rennecke
Modified: 2014-01-04 02:21 UTC (History)
1 user (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed: 2014-01-04 00:00:00


Note You need to log in before you can comment on or make changes to this bug.
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