Commit 8a845901 by Richard Biener Committed by Richard Biener

re PR middle-end/56977 (gcc -Og incorrectly warns about 'constant zero length parameter')

2013-06-25  Richard Biener  <rguenther@suse.de>

	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.

From-SVN: r200391
parent 9d2cdf25
2013-06-25 Richard Biener <rguenther@suse.de>
PR middle-end/56977
* passes.c (init_optimization_passes): Move pass_fold_builtins
and pass_dce earlier with -Og.
2013-06-25 Eric Botcazou <ebotcazou@adacore.com> 2013-06-25 Eric Botcazou <ebotcazou@adacore.com>
* expr.c (expand_expr_real_1) <ARRAY_REF>: Fix formatting glitches. * expr.c (expand_expr_real_1) <ARRAY_REF>: Fix formatting glitches.
......
...@@ -1536,15 +1536,15 @@ init_optimization_passes (void) ...@@ -1536,15 +1536,15 @@ init_optimization_passes (void)
/* Perform simple scalar cleanup which is constant/copy propagation. */ /* Perform simple scalar cleanup which is constant/copy propagation. */
NEXT_PASS (pass_ccp); NEXT_PASS (pass_ccp);
NEXT_PASS (pass_object_sizes); NEXT_PASS (pass_object_sizes);
/* Fold remaining builtins. */
NEXT_PASS (pass_fold_builtins);
/* Copy propagation also copy-propagates constants, this is necessary /* 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_copy_prop);
NEXT_PASS (pass_dce);
NEXT_PASS (pass_asan); NEXT_PASS (pass_asan);
NEXT_PASS (pass_tsan); NEXT_PASS (pass_tsan);
NEXT_PASS (pass_rename_ssa_copies); 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 /* ??? We do want some kind of loop invariant motion, but we possibly
need to adjust LIM to be more friendly towards preserving accurate need to adjust LIM to be more friendly towards preserving accurate
debug information here. */ debug information here. */
......
2013-06-25 Richard Biener <rguenther@suse.de>
PR middle-end/56977
* gcc.dg/pr56977.c: New testcase.
2013-06-24 Martin Jambor <mjambor@suse.cz> 2013-06-24 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/57358 PR tree-optimization/57358
......
/* { dg-do compile } */
/* { dg-options "-Og" } */
__attribute__((__error__("error"))) void error ();
void f (int i) {
if (__builtin_constant_p (i)) {
error ();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment