[Bug rtl-optimization/43473] hword size destination variable induces suboptimal code generation compared to full word size var

2024-03-14 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43473

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||missed-optimization

--- Comment #3 from Andrew Pinski  ---
The difference is.
for ma:
```
(insn 11 10 13 2 (set (reg:SI 122)
(ior:SI (subreg:SI (reg:HI 119 [ a ]) 0)
(const_int -16384 [0xc000]))) "/app/example.cpp":9:11
110 {*iorsi3_insn}
 (expr_list:REG_DEAD (reg:HI 119 [ a ])
(nil)))
```

vs for mb:
```
(insn 9 8 10 2 (set (reg:SI 121 [ _3 ])
(ior:SI (reg:SI 120 [ b ])
(const_int 49152 [0xc000]))) "/app/example.cpp":16:22 110
{*iorsi3_insn}
 (expr_list:REG_DEAD (reg:SI 120 [ b ])
(nil)))
```

[Bug rtl-optimization/43473] hword size destination variable induces suboptimal code generation compared to full word size var

2019-03-05 Thread steven at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43473

Steven Bosscher  changed:

   What|Removed |Added

 Status|WAITING |NEW
   Last reconfirmed||2019-3-5
  Known to fail||8.2.0

[Bug rtl-optimization/43473] hword size destination variable induces suboptimal code generation compared to full word size var

2010-03-23 Thread rearnsha at gcc dot gnu dot org


--- Comment #1 from rearnsha at gcc dot gnu dot org  2010-03-23 13:21 
---
You haven't explained what you think is wrong, and you haven't even said what
options you used to generated the code.

If the optimizer is not on the generated code *will* be very poor.  That's why
we have an optimizer.


-- 

rearnsha at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43473



[Bug rtl-optimization/43473] hword size destination variable induces suboptimal code generation compared to full word size var

2010-03-23 Thread mirq-gccboogs at rere dot qmqm dot pl


--- Comment #2 from mirq-gccboogs at rere dot qmqm dot pl  2010-03-23 14:37 
---
Sorry, I try to split encountered problems into simple testcases and after a
few I forgot to add the common things to bugreports.

The difference between ma() and mb() in the example is a global's size:

ma():
- unsigned short global, generates two insns for the operation:

ldrhr2, [r3, #0]
mvn r2, r2, asl #18
mvn r2, r2, lsr #18
strhr2, [r3, #0]@ movhi

mb():

- unsigned int global, generates one insn for the same operation:

ldr r2, [r3, #0]
orr r2, r2, #49152
str r2, [r3, #0]

'u' and 'd' are compile time constants.

compiled with:

arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -O3 -S a.c

$ LANG=C arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=/usr/src/gcc-armtest/bin/arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/usr/src/gcc-armtest/libexec/gcc/arm-none-eabi/4.5.0/lto-wrapper
Target: arm-none-eabi
Configured with: ../gcc-combined/configure --with-newlib
--prefix=/usr/src/gcc-armtest --target arm-none-eabi --enable-languages=c
--disable-libssp
Thread model: single
gcc version 4.5.0 20100319 (experimental) (GCC) 

$ LANG=C svn info
Path: .
URL: svn://gcc.gnu.org/svn/gcc/trunk
Repository Root: svn://gcc.gnu.org/svn/gcc
Repository UUID: 138bc75d-0d04-0410-961f-82ee72b054a4
Revision: 157582
Node Kind: directory
Schedule: normal
Last Changed Author: bernds
Last Changed Rev: 157582
Last Changed Date: 2010-03-19 19:41:22 +0100 (Fri, 19 Mar 2010)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43473