From fbd28bc3b2c3394db09577ff2f5a594d50c75b2c Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 14 Mar 2013 10:13:36 +0100 Subject: re PR tree-optimization/53265 (Warn when undefined behavior implies smaller iteration count) PR tree-optimization/53265 * common.opt (Waggressive-loop-optimizations): New option. * tree-ssa-loop-niter.c: Include tree-pass.h. (do_warn_aggressive_loop_optimizations): New function. (record_estimate): Call it. Don't add !is_exit bounds to loop->bounds if number_of_latch_executions returned constant. (estimate_numbers_of_iterations_loop): Call number_of_latch_executions early. If number_of_latch_executions returned constant, set nb_iterations_upper_bound back to it. * cfgloop.h (struct loop): Add warned_aggressive_loop_optimizations field. * Makefile.in (tree-ssa-loop-niter.o): Depend on $(TREE_PASS_H). * doc/invoke.texi (-Wno-aggressive-loop-optimizations): Document. * gcc.dg/pr53265.c: New test. * gcc.dg/torture/pr49518.c: Add -Wno-aggressive-loop-optimizations to dg-options. * g++.dg/opt/longbranch2.C (EBCOTLut): Double sizes of a2 and a3 arrays. * gcc.dg/tree-ssa/cunroll-10.c (main): Rename to foo. Add argument n, use it as high bound instead of 4. * unwind-dw2.c (execute_cfa_program): Avoid -Waggressive-array-optimizations warnings for DW_CFA_GNU_window_save on targets with DWARF_FRAME_REGISTERS < 32. * testsuite/libmudflap.c/fail37-frag.c: Add optimization barrier. From-SVN: r196650 --- libgcc/ChangeLog | 7 +++++++ libgcc/unwind-dw2.c | 11 ++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'libgcc') diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index 61f5cc07..aa10774 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,10 @@ +2013-03-14 Jakub Jelinek + + PR tree-optimization/53265 + * unwind-dw2.c (execute_cfa_program): Avoid + -Waggressive-array-optimizations warnings for DW_CFA_GNU_window_save + on targets with DWARF_FRAME_REGISTERS < 32. + 2013-03-13 Oleg Endo PR target/49880 diff --git a/libgcc/unwind-dw2.c b/libgcc/unwind-dw2.c index 101a828..80de5ab 100644 --- a/libgcc/unwind-dw2.c +++ b/libgcc/unwind-dw2.c @@ -1128,11 +1128,12 @@ execute_cfa_program (const unsigned char *insn_ptr, case DW_CFA_GNU_window_save: /* ??? Hardcoded for SPARC register window configuration. */ - for (reg = 16; reg < 32; ++reg) - { - fs->regs.reg[reg].how = REG_SAVED_OFFSET; - fs->regs.reg[reg].loc.offset = (reg - 16) * sizeof (void *); - } + if (DWARF_FRAME_REGISTERS >= 32) + for (reg = 16; reg < 32; ++reg) + { + fs->regs.reg[reg].how = REG_SAVED_OFFSET; + fs->regs.reg[reg].loc.offset = (reg - 16) * sizeof (void *); + } break; case DW_CFA_GNU_args_size: -- cgit v1.1