From: rguenth Date: Tue, 25 Jun 2013 08:21:31 +0000 (+0000) Subject: 2013-06-25 Richard Biener X-Git-Tag: upstream/4.9.2~5437 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=37704d29aee597330cc8d2d984a514140a672b2c;p=platform%2Fupstream%2Flinaro-gcc.git 2013-06-25 Richard Biener PR middle-end/56977 * passes.c (init_optimization_passes): Move pass_fold_builtins and pass_dce earlier with -Og. * gcc.dg/pr56977.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200391 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f21e60b..f0af61e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-06-25 Richard Biener + + PR middle-end/56977 + * passes.c (init_optimization_passes): Move pass_fold_builtins + and pass_dce earlier with -Og. + 2013-06-25 Eric Botcazou * expr.c (expand_expr_real_1) : Fix formatting glitches. diff --git a/gcc/passes.c b/gcc/passes.c index c8b03ee..761f030 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -1536,15 +1536,15 @@ init_optimization_passes (void) /* Perform simple scalar cleanup which is constant/copy propagation. */ NEXT_PASS (pass_ccp); NEXT_PASS (pass_object_sizes); + /* Fold remaining builtins. */ + NEXT_PASS (pass_fold_builtins); /* Copy propagation also copy-propagates constants, this is necessary - to forward object-size results properly. */ + to forward object-size and builtin folding results properly. */ NEXT_PASS (pass_copy_prop); + NEXT_PASS (pass_dce); NEXT_PASS (pass_asan); NEXT_PASS (pass_tsan); NEXT_PASS (pass_rename_ssa_copies); - NEXT_PASS (pass_dce); - /* Fold remaining builtins. */ - NEXT_PASS (pass_fold_builtins); /* ??? We do want some kind of loop invariant motion, but we possibly need to adjust LIM to be more friendly towards preserving accurate debug information here. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9940868..8c9f01a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-06-25 Richard Biener + + PR middle-end/56977 + * gcc.dg/pr56977.c: New testcase. + 2013-06-24 Martin Jambor PR tree-optimization/57358 diff --git a/gcc/testsuite/gcc.dg/pr56977.c b/gcc/testsuite/gcc.dg/pr56977.c new file mode 100644 index 0000000..fde88af --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr56977.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-options "-Og" } */ + +__attribute__((__error__("error"))) void error (); + +void f (int i) { + if (__builtin_constant_p (i)) { + error (); + } +}