https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57503
Georg-Johann Lay <gjl at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2013-10-07 00:00:00 |2018-1-15 Known to fail| |5.5.0, 6.4.1, 7.2.1 --- Comment #15 from Georg-Johann Lay <gjl at gcc dot gnu.org> --- Confirmed with v5.5, v6.4, v7.2 and current trunk: With the test case fom comment #8 and $ avr-gcc -S -Os pr57503.c -mmcu=atmega8 -fdump-rtl-expand && cat pr57503.c pr57503.c.234r.expand long func1 (unsigned char a, unsigned char b, int c) { unsigned ab = a * b; return (long) ab * c; } ;; Function func1 (func1, funcdef_no=0, decl_uid=1511, cgraph_uid=0, symbol_order=0) ;; Generating RTL for gimple basic block 2 ... (note 5 4 8 2 NOTE_INSN_FUNCTION_BEG) (insn 8 5 9 2 (set (reg:HI 48) (mult:HI (zero_extend:HI (reg/v:QI 44 [ a ])) (zero_extend:HI (reg/v:QI 45 [ b ])))) "pr57503.c":4 -1 (nil)) (insn 9 8 10 2 (parallel [ (set (reg:SI 47) (mult:SI (sign_extend:SI (reg:HI 48)) (sign_extend:SI (reg/v:HI 46 [ c ])))) (clobber (reg:HI 26 r26)) (clobber (reg:DI 18 r18)) ]) "pr57503.c":5 -1 (nil)) Hence in the 1st MULT the operands are correctly zero-extended, but in the 2nd one there is still the wrong sign_extend:SI (reg:HI 48).