[Bug target/49446] New: avr-g++ does not optimize when using bitshift in inlined function
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49446 Summary: avr-g++ does not optimize when using bitshift in inlined function Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassig...@gcc.gnu.org ReportedBy: g...@emailgo.de Hi, so you wanted an *.i* file, I don't think this will be helpful. Anyway I appended it. I have a structure like this: function call <- inline function <- inline function. If the first Inline function (Button::Poll that is) passes a const number as parameter pin_number to the second function (Port::get_pin) that is, then the Poll::get_pin function returns *port_address & (1< search starts here: /usr/local/avr/lib/gcc/avr/4.6.0/include /usr/local/avr/lib/gcc/avr/4.6.0/include-fixed /usr/local/avr/lib/gcc/avr/4.6.0/../../../../avr/include End of search list. COLLECT_GCC_OPTIONS='-S' '-mmcu=atmega8' '-Os' '-save-temps' '-v' /usr/local/avr/libexec/gcc/avr/4.6.0/cc1plus -fpreprocessed test.ii -quiet -dumpbase test.cc -mmcu=atmega8 -auxbase test -Os -version -o test.s -fno-rtti -fno-enforce-eh-specs -fno-exceptions GNU C++ (GCC) version 4.6.0 (avr) compiled by GNU C version 4.6.1 20110526 (prerelease), GMP version 5.0.1, MPFR version 3.0.1-p3, MPC version 0.9 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU C++ (GCC) version 4.6.0 (avr) compiled by GNU C version 4.6.1 20110526 (prerelease), GMP version 5.0.1, MPFR version 3.0.1-p3, MPC version 0.9 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: bed1f0f30349434b4d9bd9c4315cba61 COMPILER_PATH=/usr/local/avr/libexec/gcc/avr/4.6.0/:/usr/local/avr/libexec/gcc/avr/4.6.0/:/usr/local/avr/libexec/gcc/avr/:/usr/local/avr/lib/gcc/avr/4.6.0/:/usr/local/avr/lib/gcc/avr/ LIBRARY_PATH=/usr/local/avr/lib/gcc/avr/4.6.0/avr4/:/usr/local/avr/lib/gcc/avr/4.6.0/../../../../avr/lib/avr4/:/usr/local/avr/lib/gcc/avr/4.6.0/:/usr/local/avr/lib/gcc/avr/4.6.0/../../../../avr/lib/ COLLECT_GCC_OPTIONS='-S' '-mmcu=atmega8' '-Os' '-save-temps' '-v' Have fun!
[Bug target/33049] [avr] bit extraction non optimal, inversing logic solves problem
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33049 HotHead changed: What|Removed |Added CC||gcc at emailgo dot de --- Comment #15 from HotHead 2011-06-17 21:38:20 UTC --- *** Bug 49446 has been marked as a duplicate of this bug. ***
[Bug target/49446] avr-g++ does not optimize when using bitshift in inlined function
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49446 HotHead changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||DUPLICATE --- Comment #1 from HotHead 2011-06-17 21:38:20 UTC --- duplicate of 33049 *** This bug has been marked as a duplicate of bug 33049 ***
[Bug target/49446] avr-g++ does not optimize when using bitshift in inlined function
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49446 HotHead changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED Version|4.6.0 |4.7.0 Resolution|DUPLICATE | --- Comment #3 from HotHead 2011-06-18 20:17:19 UTC --- Seems that it is no duplicate. additional files test.ii (intermediate) http://pastebin.com/ZPV521si test.s (output) http://pastebin.com/DDFW0FCU compiler-output (verbose) http://pastebin.com/XHNPB6WX
[Bug target/49446] avr-g++ does not optimize when using bitshift in inlined function
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49446 --- Comment #5 from HotHead 2011-06-18 20:19:07 UTC --- Created attachment 24557 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24557 intermediate file
[Bug target/49446] avr-g++ does not optimize when using bitshift in inlined function
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49446 --- Comment #4 from HotHead 2011-06-18 20:18:48 UTC --- Created attachment 24556 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24556 output assembly, notice the unnecessary bitshifts
[Bug target/49446] avr-g++ does not optimize when using bitshift in inlined function
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49446 --- Comment #6 from HotHead 2011-06-18 20:19:56 UTC --- compiler output with gcc-4.7.0 : http://pastebin.com/XHNPB6WX