This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/30841] New: Missed optimizations for sbi/cbi instructions
- From: "aesok at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Feb 2007 13:03:48 -0000
- Subject: [Bug rtl-optimization/30841] New: Missed optimizations for sbi/cbi instructions
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
demo.c:
#define PORTD (*(volatile unsigned char *)(50))
int
main (void)
{
PORTD |= 1;
return 0;
}
Revision r118474:
.LM2:
; (insn 14 12 18 main.c:6 (set (mem/v:QI (const_int 50 [0x32]) [0 S1 A8])
; (ior:QI (mem/v:QI (const_int 50 [0x32]) [0 S1 A8])
; (const_int 1 [0x1]))) 114 {*sbi} (nil)
; (nil))
sbi 50-0x20,0 ; 14 *sbi [length = 1]
Revision r118475:
.LM2:
; (insn 10 9 11 main.c:6 (set (reg/f:HI 30 r30 [44])
; (const_int 50 [0x32])) 12 {*movhi} (nil)
; (expr_list:REG_EQUIV (const_int 50 [0x32])
; (nil)))
ldi r30,lo8(50) ; 10 *movhi/4 [length = 2]
ldi r31,hi8(50)
; (insn 11 10 12 main.c:6 (set (reg:QI 24 r24 [orig:42 D.1514 ] [42])
; (mem/v:QI (reg/f:HI 30 r30 [44]) [0 S1 A8])) 9 {*movqi}
(insn_list:REG_DEP_TRUE 10 (nil))
; (nil))
ld r24,Z ; 11 *movqi/4 [length = 1]
; (insn 12 11 14 main.c:6 (set (reg:QI 24 r24 [orig:42 D.1514 ] [42])
; (ior:QI (reg:QI 24 r24 [orig:42 D.1514 ] [42])
; (const_int 1 [0x1]))) 47 {iorqi3} (insn_list:REG_DEP_TRUE 11
(nil))
; (nil))
ori r24,lo8(1) ; 12 iorqi3/2 [length = 1]
; (insn 14 12 18 main.c:6 (set (mem/v:QI (reg/f:HI 30 r30 [44]) [0 S1 A8])
; (reg:QI 24 r24 [orig:42 D.1514 ] [42])) 9 {*movqi}
(insn_list:REG_DEP_TRUE 12 (nil))
; (expr_list:REG_DEAD (reg:QI 24 r24 [orig:42 D.1514 ] [42])
; (expr_list:REG_DEAD (reg/f:HI 30 r30 [44])
; (nil))))
st Z,r24 ; 14 *movqi/3 [length = 1]
Revision 118475
2006-11-03 Paolo Bonzini <bonzini@gnu.org>
Steven Bosscher <stevenb.gcc@gmail.com>
* fwprop.c: New file.
* Makefile.in: Add fwprop.o.
* tree-pass.h (pass_rtl_fwprop, pass_rtl_fwprop_with_addr): New.
* passes.c (init_optimization_passes): Schedule forward propagation.
* rtlanal.c (loc_mentioned_in_p): Support NULL value of the second
parameter.
* timevar.def (TV_FWPROP): New.
* common.opt (-fforward-propagate): New.
* opts.c (decode_options): Enable forward propagation at -O2.
* gcse.c (one_cprop_pass): Do not run local cprop unless touching
jumps.
* cse.c (fold_rtx_subreg, fold_rtx_mem, fold_rtx_mem_1, find_best_addr,
canon_for_address, table_size): Remove.
(new_basic_block, insert, remove_from_table): Remove references to
table_size.
(fold_rtx): Process SUBREGs and MEMs with equiv_constant, make
simplification loop more straightforward by not calling fold_rtx
recursively.
(equiv_constant): Move here a small part of fold_rtx_subreg,
do not call fold_rtx. Call avoid_constant_pool_reference
to process MEMs.
* recog.c (canonicalize_change_group): New.
* recog.h (canonicalize_change_group): New.
* doc/invoke.texi (Optimization Options): Document fwprop.
* doc/passes.texi (RTL passes): Document fwprop.
Anatoly.
--
Summary: Missed optimizations for sbi/cbi instructions
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: rtl-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: aesok at gcc dot gnu dot org
GCC target triplet: avr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30841