Skip to content

Commit

Permalink
PR bootstrap/70704
Browse files Browse the repository at this point in the history
	* configure.ac (--enable-stage1-checking): For --disable-checking or
	implicit --enable-checking, make sure extra flag matches in between
	stage1 and later checking.
	* configure: Regenerated.
gcc/
	* configure.ac (--enable-checking): Document extra flag, for
	non-release builds default to --enable-checking=yes,extra.
	If misc checking and extra checking, define CHECKING_P to 2 instead
	of 1.
	* common.opt (fchecking=): Add.
	* doc/invoke.texi (-fchecking=): Document.
	* doc/install.texi: Document --enable-checking changes.
	* configure: Regenerated.
	* config.in: Regenerated.
gcc/cp/
	* pt.c (build_non_dependent_expr): Use flag_checking > 1 instead of
	just flag_checking.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235430 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
jakub committed Apr 26, 2016
1 parent 37075cd commit c05979a
Show file tree
Hide file tree
Showing 12 changed files with 94 additions and 41 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2016-04-26 Jakub Jelinek <jakub@redhat.com>

PR bootstrap/70704
* configure.ac (--enable-stage1-checking): For --disable-checking or
implicit --enable-checking, make sure extra flag matches in between
stage1 and later checking.
* configure: Regenerated.

2016-04-22 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

* .gitattributes: New file.
Expand Down
15 changes: 8 additions & 7 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -14850,16 +14850,17 @@ else
# For --disable-checking or implicit --enable-checking=release, avoid
# setting --enable-checking=gc in the default stage1 checking for LTO
# bootstraps. See PR62077.
stage1_checking=--enable-checking=release,misc,gimple,rtlflag,tree,types
case $BUILD_CONFIG in
*lto*)
if test "x$enable_checking" = x && \
test -d ${srcdir}/gcc && \
test x"`cat ${srcdir}/gcc/DEV-PHASE`" = xexperimental; then
stage1_checking=--enable-checking=yes,types
fi;;
*) stage1_checking=--enable-checking=yes,types;;
stage1_checking=--enable-checking=release,misc,gimple,rtlflag,tree,types;;
*)
stage1_checking=--enable-checking=yes,types;;
esac
if test "x$enable_checking" = x && \
test -d ${srcdir}/gcc && \
test x"`cat ${srcdir}/gcc/DEV-PHASE`" = xexperimental; then
stage1_checking=yes,types,extra
fi
else
stage1_checking=--enable-checking=$enable_checking,types
fi
Expand Down
15 changes: 8 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3530,16 +3530,17 @@ AC_ARG_ENABLE(stage1-checking,
# For --disable-checking or implicit --enable-checking=release, avoid
# setting --enable-checking=gc in the default stage1 checking for LTO
# bootstraps. See PR62077.
stage1_checking=--enable-checking=release,misc,gimple,rtlflag,tree,types
case $BUILD_CONFIG in
*lto*)
if test "x$enable_checking" = x && \
test -d ${srcdir}/gcc && \
test x"`cat ${srcdir}/gcc/DEV-PHASE`" = xexperimental; then
stage1_checking=--enable-checking=yes,types
fi;;
*) stage1_checking=--enable-checking=yes,types;;
stage1_checking=--enable-checking=release,misc,gimple,rtlflag,tree,types;;
*)
stage1_checking=--enable-checking=yes,types;;
esac
if test "x$enable_checking" = x && \
test -d ${srcdir}/gcc && \
test x"`cat ${srcdir}/gcc/DEV-PHASE`" = xexperimental; then
stage1_checking=yes,types,extra
fi
else
stage1_checking=--enable-checking=$enable_checking,types
fi])
Expand Down
13 changes: 13 additions & 0 deletions gcc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
2016-04-26 Jakub Jelinek <jakub@redhat.com>

PR bootstrap/70704
* configure.ac (--enable-checking): Document extra flag, for
non-release builds default to --enable-checking=yes,extra.
If misc checking and extra checking, define CHECKING_P to 2 instead
of 1.
* common.opt (fchecking=): Add.
* doc/invoke.texi (-fchecking=): Document.
* doc/install.texi: Document --enable-checking changes.
* configure: Regenerated.
* config.in: Regenerated.

2016-04-25 Uros Bizjak <ubizjak@gmail.com>

* config/i386/i386.md (*movxi_internal_avx512f): Use insn type
Expand Down
4 changes: 4 additions & 0 deletions gcc/common.opt
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,10 @@ fchecking
Common Var(flag_checking) Init(CHECKING_P)
Perform internal consistency checkings.

fchecking=
Common Joined RejectNegative UInteger Var(flag_checking)
Perform internal consistency checkings.

fcombine-stack-adjustments
Common Report Var(flag_combine_stack_adjustments) Optimization
Looks for opportunities to reduce stack adjustments and stack references.
Expand Down
3 changes: 2 additions & 1 deletion gcc/config.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@


/* Define to 1 if you want more run-time sanity checks. This one gets a grab
bag of miscellaneous but relatively cheap checks. */
bag of miscellaneous but relatively cheap checks. Define to 2 if you want
also extra run-time checking that might affect code generation. */
#ifndef USED_FOR_TARGET
#undef CHECKING_P
#endif
Expand Down
26 changes: 16 additions & 10 deletions gcc/configure
Original file line number Diff line number Diff line change
Expand Up @@ -1596,7 +1596,7 @@ Optional Features:
enable expensive run-time checks. With LIST, enable
only specific categories of checks. Categories are:
yes,no,all,none,release. Flags are:
assert,df,fold,gc,gcac,gimple,misc,
assert,df,extra,fold,gc,gcac,gimple,misc,
rtlflag,rtl,runtime,tree,valgrind,types
--enable-coverage[=LEVEL]
enable compiler's code coverage collection. Use to
Expand Down Expand Up @@ -7075,7 +7075,7 @@ else

# Determine the default checks.
if test x$is_release = x ; then
ac_checking_flags=yes
ac_checking_flags=yes,extra
else
ac_checking_flags=release
fi
Expand All @@ -7087,32 +7087,33 @@ do
case $check in
# these set all the flags to specific states
yes) ac_assert_checking=1 ; ac_checking=1 ; ac_df_checking= ;
ac_fold_checking= ; ac_gc_checking=1 ;
ac_fold_checking= ; ac_gc_checking=1 ; ac_extra_checking= ;
ac_gc_always_collect= ; ac_gimple_checking=1 ; ac_rtl_checking= ;
ac_rtlflag_checking=1 ; ac_runtime_checking=1 ;
ac_tree_checking=1 ; ac_valgrind_checking= ;
ac_types_checking=1 ;;
no|none) ac_assert_checking= ; ac_checking= ; ac_df_checking= ;
ac_fold_checking= ; ac_gc_checking= ;
ac_fold_checking= ; ac_gc_checking= ; ac_extra_checking= ;
ac_gc_always_collect= ; ac_gimple_checking= ; ac_rtl_checking= ;
ac_rtlflag_checking= ; ac_runtime_checking= ;
ac_tree_checking= ; ac_valgrind_checking= ;
ac_types_checking= ;;
all) ac_assert_checking=1 ; ac_checking=1 ; ac_df_checking=1 ;
ac_fold_checking=1 ; ac_gc_checking=1 ;
ac_fold_checking=1 ; ac_gc_checking=1 ; ac_extra_checking=1 ;
ac_gc_always_collect=1 ; ac_gimple_checking=1 ; ac_rtl_checking=1 ;
ac_rtlflag_checking=1 ; ac_runtime_checking=1 ;
ac_tree_checking=1 ; ac_valgrind_checking= ;
ac_types_checking=1 ;;
release) ac_assert_checking=1 ; ac_checking= ; ac_df_checking= ;
ac_fold_checking= ; ac_gc_checking= ;
ac_fold_checking= ; ac_gc_checking= ; ac_extra_checking= ;
ac_gc_always_collect= ; ac_gimple_checking= ; ac_rtl_checking= ;
ac_rtlflag_checking= ; ac_runtime_checking=1 ;
ac_tree_checking= ; ac_valgrind_checking= ;
ac_types_checking= ;;
# these enable particular checks
assert) ac_assert_checking=1 ;;
df) ac_df_checking=1 ;;
df) ac_df_checking=1 ;;
extra) ac_extra_checking=1 ;;
fold) ac_fold_checking=1 ;;
gc) ac_gc_checking=1 ;;
gcac) ac_gc_always_collect=1 ;;
Expand All @@ -7131,8 +7132,13 @@ IFS="$ac_save_IFS"

nocommon_flag=""
if test x$ac_checking != x ; then
if test x$ac_extra_checking != x ; then
ac_checking=2
fi

$as_echo "#define CHECKING_P 1" >>confdefs.h
cat >>confdefs.h <<_ACEOF
#define CHECKING_P $ac_checking
_ACEOF

nocommon_flag=-fno-common
else
Expand Down Expand Up @@ -18453,7 +18459,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 18456 "configure"
#line 18462 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
Expand Down Expand Up @@ -18559,7 +18565,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 18562 "configure"
#line 18568 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
Expand Down
23 changes: 14 additions & 9 deletions gcc/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -516,12 +516,12 @@ AC_ARG_ENABLE(checking,
[enable expensive run-time checks. With LIST,
enable only specific categories of checks.
Categories are: yes,no,all,none,release.
Flags are: assert,df,fold,gc,gcac,gimple,misc,
Flags are: assert,df,extra,fold,gc,gcac,gimple,misc,
rtlflag,rtl,runtime,tree,valgrind,types])],
[ac_checking_flags="${enableval}"],[
# Determine the default checks.
if test x$is_release = x ; then
ac_checking_flags=yes
ac_checking_flags=yes,extra
else
ac_checking_flags=release
fi])
Expand All @@ -531,32 +531,33 @@ do
case $check in
# these set all the flags to specific states
yes) ac_assert_checking=1 ; ac_checking=1 ; ac_df_checking= ;
ac_fold_checking= ; ac_gc_checking=1 ;
ac_fold_checking= ; ac_gc_checking=1 ; ac_extra_checking= ;
ac_gc_always_collect= ; ac_gimple_checking=1 ; ac_rtl_checking= ;
ac_rtlflag_checking=1 ; ac_runtime_checking=1 ;
ac_tree_checking=1 ; ac_valgrind_checking= ;
ac_types_checking=1 ;;
no|none) ac_assert_checking= ; ac_checking= ; ac_df_checking= ;
ac_fold_checking= ; ac_gc_checking= ;
ac_fold_checking= ; ac_gc_checking= ; ac_extra_checking= ;
ac_gc_always_collect= ; ac_gimple_checking= ; ac_rtl_checking= ;
ac_rtlflag_checking= ; ac_runtime_checking= ;
ac_tree_checking= ; ac_valgrind_checking= ;
ac_types_checking= ;;
all) ac_assert_checking=1 ; ac_checking=1 ; ac_df_checking=1 ;
ac_fold_checking=1 ; ac_gc_checking=1 ;
ac_fold_checking=1 ; ac_gc_checking=1 ; ac_extra_checking=1 ;
ac_gc_always_collect=1 ; ac_gimple_checking=1 ; ac_rtl_checking=1 ;
ac_rtlflag_checking=1 ; ac_runtime_checking=1 ;
ac_tree_checking=1 ; ac_valgrind_checking= ;
ac_types_checking=1 ;;
release) ac_assert_checking=1 ; ac_checking= ; ac_df_checking= ;
ac_fold_checking= ; ac_gc_checking= ;
ac_fold_checking= ; ac_gc_checking= ; ac_extra_checking= ;
ac_gc_always_collect= ; ac_gimple_checking= ; ac_rtl_checking= ;
ac_rtlflag_checking= ; ac_runtime_checking=1 ;
ac_tree_checking= ; ac_valgrind_checking= ;
ac_types_checking= ;;
# these enable particular checks
assert) ac_assert_checking=1 ;;
df) ac_df_checking=1 ;;
df) ac_df_checking=1 ;;
extra) ac_extra_checking=1 ;;
fold) ac_fold_checking=1 ;;
gc) ac_gc_checking=1 ;;
gcac) ac_gc_always_collect=1 ;;
Expand All @@ -575,9 +576,13 @@ IFS="$ac_save_IFS"

nocommon_flag=""
if test x$ac_checking != x ; then
AC_DEFINE(CHECKING_P, 1,
if test x$ac_extra_checking != x ; then
ac_checking=2
fi
AC_DEFINE_UNQUOTED(CHECKING_P, $ac_checking,
[Define to 1 if you want more run-time sanity checks. This one gets a grab
bag of miscellaneous but relatively cheap checks.])
bag of miscellaneous but relatively cheap checks. Define to 2 if you want
also extra run-time checking that might affect code generation.])
nocommon_flag=-fno-common
else
AC_DEFINE(CHECKING_P, 0)
Expand Down
6 changes: 6 additions & 0 deletions gcc/cp/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2016-04-26 Jakub Jelinek <jakub@redhat.com>

PR bootstrap/70704
* pt.c (build_non_dependent_expr): Use flag_checking > 1 instead of
just flag_checking.

2016-04-25 Jason Merrill <jason@redhat.com>

* tree.c (std_attribute_table): New.
Expand Down
6 changes: 4 additions & 2 deletions gcc/cp/pt.c
Original file line number Diff line number Diff line change
Expand Up @@ -23623,8 +23623,10 @@ build_non_dependent_expr (tree expr)

/* When checking, try to get a constant value for all non-dependent
expressions in order to expose bugs in *_dependent_expression_p
and constexpr. */
if (flag_checking && cxx_dialect >= cxx11
and constexpr. This can affect code generation, see PR70704, so
only do this for -fchecking=2. */
if (flag_checking > 1
&& cxx_dialect >= cxx11
/* Don't do this during nsdmi parsing as it can lead to
unexpected recursive instantiations. */
&& !parsing_nsdmi ())
Expand Down
9 changes: 6 additions & 3 deletions gcc/doc/install.texi
Original file line number Diff line number Diff line change
Expand Up @@ -1708,7 +1708,7 @@ When you specify this option, the compiler is built to perform internal
consistency checks of the requested complexity. This does not change the
generated code, but adds error checking within the compiler. This will
slow down the compiler and may only work properly if you are building
the compiler with GCC@. This is @samp{yes} by default when building
the compiler with GCC@. This is @samp{yes,extra} by default when building
from SVN or snapshots, but @samp{release} for releases. The default
for building the stage1 compiler is @samp{yes}. More control
over the checks may be had by specifying @var{list}. The categories of
Expand All @@ -1717,8 +1717,11 @@ checks available are @samp{yes} (most common checks
all), @samp{all} (all but @samp{valgrind}), @samp{release} (cheapest
checks @samp{assert,runtime}) or @samp{none} (same as @samp{no}).
Individual checks can be enabled with these flags @samp{assert},
@samp{df}, @samp{fold}, @samp{gc}, @samp{gcac} @samp{misc}, @samp{rtl},
@samp{rtlflag}, @samp{runtime}, @samp{tree}, and @samp{valgrind}.
@samp{df}, @samp{fold}, @samp{gc}, @samp{gcac}, @samp{misc}, @samp{rtl},
@samp{rtlflag}, @samp{runtime}, @samp{tree}, @samp{extra} and @samp{valgrind}.
@samp{extra} adds for @samp{misc} checking extra checks that might affect
code generation and should therefore not differ between stage1 and later
stages.

The @samp{valgrind} check requires the external @command{valgrind}
simulator, available from @uref{http://valgrind.org/}. The
Expand Down
7 changes: 5 additions & 2 deletions gcc/doc/invoke.texi
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,8 @@ Objective-C and Objective-C++ Dialects}.
@item Developer Options
@xref{Developer Options,,GCC Developer Options}.
@gccoptlist{-d@var{letters} -dumpspecs -dumpmachine -dumpversion @gol
-fchecking -fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
-fchecking -fchecking=@var{n} -fdbg-cnt-list @gol
-fdbg-cnt=@var{counter-value-list} @gol
-fdisable-ipa-@var{pass_name} @gol
-fdisable-rtl-@var{pass_name} @gol
-fdisable-rtl-@var{pass-name}=@var{range-list} @gol
Expand Down Expand Up @@ -12368,10 +12369,12 @@ Here are some examples showing uses of these options.
@end smallexample

@item -fchecking
@itemx -fchecking=@var{n}
@opindex fchecking
@opindex fno-checking
Enable internal consistency checking. The default depends on
the compiler configuration.
the compiler configuration. @option{-fchecking=2} enables further
internal consistency checking that might affect code generation.

@item -frandom-seed=@var{string}
@opindex frandom-seed
Expand Down

0 comments on commit c05979a

Please sign in to comment.