[Bug target/44532] x86-64 unnecessary parameter extension
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44532 Steven Bosscher changed: What|Removed |Added Status|NEW |RESOLVED Last reconfirmed|2010-06-14 11:30:39 |2019-3-4 CC||steven at gcc dot gnu.org Resolution|--- |WONTFIX --- Comment #4 from Steven Bosscher --- GCC trunk today:" f1(short, int): movswl %di, %eax imull %esi, %eax ret f2(unsigned short, int): movzwl %di, %eax imull %esi, %eax ret clang trunk: f1(short, int):# @f1(short, int) movl%edi, %eax imull %esi, %eax retq f2(unsigned short, int):# @f2(unsigned short, int) movl%edi, %eax imull %esi, %eax retq icc 19.0.1: f1(short, int): movswq%di, %rax #3.12 imull %esi, %eax#3.16 ret #3.16 f2(unsigned short, int): movzwl%di, %eax #7.1 imull %esi, %eax#8.16 ret Given the comments from H.J. and the icc output, let's WONTFIX this one.
[Bug target/44532] x86-64 unnecessary parameter extension
--- Comment #1 from jakub at gcc dot gnu dot org 2010-06-14 08:01 --- tempreg = convert_to_mode (data-nominal_mode, tempreg, unsignedp); if (GET_CODE (tempreg) == SUBREG GET_MODE (tempreg) == data-nominal_mode REG_P (SUBREG_REG (tempreg)) data-nominal_mode == data-passed_mode GET_MODE (SUBREG_REG (tempreg)) == GET_MODE (data-entry_parm) GET_MODE_SIZE (GET_MODE (tempreg)) GET_MODE_SIZE (GET_MODE (data-entry_parm))) { /* The argument is already sign/zero extended, so note it into the subreg. */ SUBREG_PROMOTED_VAR_P (tempreg) = 1; SUBREG_PROMOTED_UNSIGNED_SET (tempreg, unsignedp); } For x86_64 and short/char, all the conditions above are true except that nominal_mode (HImode) != passed_mode (SImode). -- jakub at gcc dot gnu dot org changed: What|Removed |Added CC||hubicka at gcc dot gnu dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44532
[Bug target/44532] x86-64 unnecessary parameter extension
--- Comment #2 from rguenth at gcc dot gnu dot org 2010-06-14 11:30 --- Confirmed. -- rguenth at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 GCC target triplet||x86-64-*-*, i?86-*-* Keywords||missed-optimization Last reconfirmed|-00-00 00:00:00 |2010-06-14 11:30:39 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44532
[Bug target/44532] x86-64 unnecessary parameter extension
--- Comment #3 from hjl dot tools at gmail dot com 2010-06-15 00:57 --- We should consider: 1. The x86-64 psABI doesn't say how char/short should be extended as function parameters. 2. Gcc may not touch upper bits, PR 42324. 3. Gcc never depends on the upper bits which are properly extended in function parameters. 4. Icc may not touch the upper bits in function parameters on stack. 5. For a function without proper prototype, caller may not properly extend function parameters. I think the current way is safer. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44532